1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory();
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define([], factory);
|
6 | else if(typeof exports === 'object')
|
7 | exports["index"] = factory();
|
8 | else
|
9 | root["index"] = factory();
|
10 | })(this, function() {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId])
|
20 | return installedModules[moduleId].exports;
|
21 |
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | exports: {},
|
25 | id: moduleId,
|
26 | loaded: false
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.loaded = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.p = "";
|
48 |
|
49 |
|
50 | return __webpack_require__(0);
|
51 | })
|
52 |
|
53 | ([
|
54 |
|
55 | (function(module, exports, __webpack_require__) {
|
56 |
|
57 | __webpack_require__(1);
|
58 | module.exports = __webpack_require__(1);
|
59 |
|
60 |
|
61 | }),
|
62 |
|
63 | (function(module, exports, __webpack_require__) {
|
64 |
|
65 | 'use strict';
|
66 |
|
67 | var _stringify = __webpack_require__(2);
|
68 |
|
69 | var _stringify2 = _interopRequireDefault(_stringify);
|
70 |
|
71 | var _extends2 = __webpack_require__(5);
|
72 |
|
73 | var _extends3 = _interopRequireDefault(_extends2);
|
74 |
|
75 | var _classCallCheck2 = __webpack_require__(42);
|
76 |
|
77 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
78 |
|
79 | var _possibleConstructorReturn2 = __webpack_require__(43);
|
80 |
|
81 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
82 |
|
83 | var _inherits2 = __webpack_require__(78);
|
84 |
|
85 | var _inherits3 = _interopRequireDefault(_inherits2);
|
86 |
|
87 | var _react = __webpack_require__(86);
|
88 |
|
89 | var _react2 = _interopRequireDefault(_react);
|
90 |
|
91 | var _reactDom = __webpack_require__(243);
|
92 |
|
93 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
94 |
|
95 | __webpack_require__(244);
|
96 |
|
97 | var _tree = __webpack_require__(249);
|
98 |
|
99 | var _tree2 = _interopRequireDefault(_tree);
|
100 |
|
101 | var _commonMount = __webpack_require__(274);
|
102 |
|
103 | var _commonMount2 = _interopRequireDefault(_commonMount);
|
104 |
|
105 | var _es6PromiseDebounce = __webpack_require__(276);
|
106 |
|
107 | var _es6PromiseDebounce2 = _interopRequireDefault(_es6PromiseDebounce);
|
108 |
|
109 | var _constant = __webpack_require__(277);
|
110 |
|
111 | var _search_Filters = __webpack_require__(279);
|
112 |
|
113 | var _search_Filters2 = _interopRequireDefault(_search_Filters);
|
114 |
|
115 | var _autoForm_Input = __webpack_require__(287);
|
116 |
|
117 | var _autoForm_Input2 = _interopRequireDefault(_autoForm_Input);
|
118 |
|
119 | var _FindAll_pop = __webpack_require__(313);
|
120 |
|
121 | var _FindAll_pop2 = _interopRequireDefault(_FindAll_pop);
|
122 |
|
123 | var _loading = __webpack_require__(258);
|
124 |
|
125 | var _loading2 = _interopRequireDefault(_loading);
|
126 |
|
127 | var _search = __webpack_require__(299);
|
128 |
|
129 | var _search2 = _interopRequireDefault(_search);
|
130 |
|
131 | var _commonLabel = __webpack_require__(295);
|
132 |
|
133 | var _commonLabel2 = _interopRequireDefault(_commonLabel);
|
134 |
|
135 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
136 |
|
137 | var offset = {};
|
138 | window.autoId;
|
139 |
|
140 | var AutoTree = function (_Component) {
|
141 | (0, _inherits3.default)(AutoTree, _Component);
|
142 |
|
143 | function AutoTree(props) {
|
144 | (0, _classCallCheck3.default)(this, AutoTree);
|
145 |
|
146 | var _this = (0, _possibleConstructorReturn3.default)(this, _Component.call(this, props));
|
147 |
|
148 | _this.returnAutoLi = function (bool) {
|
149 | var _this$state = _this.state,
|
150 | index = _this$state.index,
|
151 | isFocus = _this$state.isFocus,
|
152 | inputValue = _this$state.inputValue,
|
153 | searchValue = _this$state.searchValue,
|
154 | showTree = _this$state.showTree,
|
155 | autoTreeItems = _this$state.autoTreeItems,
|
156 | hasClick = _this$state.hasClick;
|
157 | var _this$props = _this.props,
|
158 | autoTreeData = _this$props.autoTreeData,
|
159 | componentId = _this$props.componentId,
|
160 | sync = _this$props.sync,
|
161 | sideTip = _this$props.sideTip,
|
162 | hiddenTip = _this$props.hiddenTip,
|
163 | single = _this$props.single,
|
164 | status = _this$props.status;
|
165 |
|
166 |
|
167 | var sessionData = _this.getSessionData(componentId);
|
168 | var dataResult = sync ? autoTreeItems : autoTreeData;
|
169 | if (dataResult != undefined && dataResult.length != 0) {
|
170 | _this.renderParents_Node = dataResult[0].pname == undefined ? false : true;
|
171 | }
|
172 | var itemClass = _this.renderParents_Node ? "auto-tree__item " : "auto-tree__item_notShow ";
|
173 | var ifbool = dataResult == undefined || dataResult.length == 0 && isFocus == true && sessionData != null && sessionData.length > 0;
|
174 | var autoLi = [];
|
175 | if (bool) ifbool = (dataResult == undefined || dataResult.length == 0) && !single && isFocus == true && sessionData != null && sessionData.length > 0 && hasClick == true || inputValue == '' && isFocus == true && sessionData != null && !single && sessionData.length > 0 && hasClick == false;
|
176 | if (ifbool) {
|
177 | for (var i = 0; i < sessionData.length; i++) {
|
178 | var holdon_class = i == index ? 'li-hold-on' : '';
|
179 | (0, _constant.pushLi)(autoLi, itemClass, holdon_class, i, sessionData[i].id, sessionData[i].name, sideTip, hiddenTip, -1, {}, {}, {}, _this.renderParents_Node, sessionData[i].pname, _this.props);
|
180 | }
|
181 | } else if (dataResult != undefined) {
|
182 |
|
183 | var searchInputValue = status == 'search' ? searchValue : single ? inputValue : showTree ? searchValue : inputValue;
|
184 | for (var _i = 0; _i < dataResult.length; _i++) {
|
185 | autoLi = (0, _constant.getHightLightData)(index, dataResult[_i], searchInputValue, autoLi, _i, _this.renderParents_Node, sideTip, hiddenTip, _this.props);
|
186 | }
|
187 | }
|
188 | _this.autoLi = autoLi;
|
189 | return autoLi;
|
190 | };
|
191 |
|
192 | _this.clearResultsData = function (index) {
|
193 | var _resultsData = _this.state.resultsData;
|
194 | var _hasCount = _this.state.hasCount;
|
195 | if (_hasCount == 0) return;
|
196 | if (index == undefined) {
|
197 | var _tempArr = _this._tempClosed.concat(_resultsData);
|
198 | _this._tempClosed = _tempArr;
|
199 | _resultsData.length = 0;
|
200 | _hasCount = 0;
|
201 | } else {
|
202 | _this._tempClosed.push(_resultsData[index]);
|
203 | _resultsData.splice(index, 1);
|
204 | _hasCount = _hasCount - 1;
|
205 | }
|
206 | _this.setState({ resultsData: _resultsData, hasCount: _hasCount });
|
207 | };
|
208 |
|
209 | _this.handlerOver = function (event) {
|
210 | var dom = (0, _reactDom.findDOMNode)(_this.refs.autoForm_ref.refs.mouseIconClose);
|
211 | if (dom && dom.style.display == 'block' || _this.state.isFocus || !_this.state.inputValue || _this.props.disabled) {
|
212 | return;
|
213 | } else {
|
214 | _this.setState({ isShowMouseOverIcon: true });
|
215 | }
|
216 | };
|
217 |
|
218 | _this.handlerOut = function (event) {
|
219 | var node = event.target;
|
220 | if (node && node.nodeName.toLowerCase() == 'span' || _this.props.disabled) {
|
221 | return;
|
222 | } else {
|
223 | _this.setState({ isShowMouseOverIcon: false });
|
224 | }
|
225 | };
|
226 |
|
227 | _this.findAll_submit = function () {
|
228 | var _this$props2 = _this.props,
|
229 | treeData = _this$props2.treeData,
|
230 | submitCallBack = _this$props2.submitCallBack;
|
231 |
|
232 | _this.unmountMask();
|
233 | _this.setState({ searchValue: '' });
|
234 |
|
235 | _this._tempClosed = [];
|
236 | treeData.clearTreeData && treeData.clearTreeData();
|
237 | submitCallBack && submitCallBack(_this.state.resultsData);
|
238 | };
|
239 |
|
240 | _this.findAll_cancle = function () {
|
241 | var self = _this;
|
242 | var treeData = _this.props.treeData;
|
243 | var resultsData = _this.state.resultsData;
|
244 |
|
245 | var _resultsData = [];
|
246 | var _temLength = self._tempSeleted.length;
|
247 | var _tempClosed = self._tempClosed;
|
248 | _this.unmountMask();
|
249 | _this.setState({ searchValue: '' });
|
250 |
|
251 | var _tempArr = resultsData.concat(_tempClosed);
|
252 | resultsData = _tempArr;
|
253 | var _resLength = resultsData.length;
|
254 |
|
255 | for (var i = 0; i < _resLength; i++) {
|
256 | var flag = false;
|
257 | var it = resultsData[i];
|
258 | for (var j = 0; j < _temLength; j++) {
|
259 | var item = self._tempSeleted[j];
|
260 | if (it.id == item) {
|
261 | flag = true;
|
262 | }
|
263 | }
|
264 | if (!flag) _resultsData.push(it);
|
265 | }
|
266 |
|
267 | self._tempClosed = [];
|
268 | treeData.clearTreeData && treeData.clearTreeData();
|
269 | _this.setState({ resultsData: _resultsData });
|
270 | };
|
271 |
|
272 | _this.renderMask = function () {
|
273 | var _this$state2 = _this.state,
|
274 | searchValue = _this$state2.searchValue,
|
275 | autoTreeItems = _this$state2.autoTreeItems,
|
276 | single = _this$state2.single;
|
277 | var _this$props3 = _this.props,
|
278 | treeData = _this$props3.treeData,
|
279 | autoTreeData = _this$props3.autoTreeData,
|
280 | sync = _this$props3.sync;
|
281 |
|
282 | var dataResult = sync ? autoTreeItems : autoTreeData;
|
283 | var autoLi = _this.returnAutoLi();
|
284 | var popResult_style = single ? { 'width': '100%' } : {};
|
285 | var _showTree = searchValue.length != 0 && dataResult != undefined && dataResult.length > 0;
|
286 | var popUl = _showTree ? _react2.default.createElement(
|
287 | 'ul',
|
288 | { className: 'pop-auto-result', style: popResult_style, onClick: _this.itemClick },
|
289 | autoLi
|
290 | ) : _react2.default.createElement(_tree2.default, (0, _extends3.default)({}, treeData, { onClick: _this.treeItemClick }));
|
291 | var findAll_Data = {
|
292 | self: _this,
|
293 | popUl: popUl,
|
294 | findAll_cancle: _this.findAll_cancle,
|
295 | findAll_submit: _this.findAll_submit,
|
296 | single: single
|
297 | };
|
298 | var autoTreeMask = _react2.default.createElement(
|
299 | 'div',
|
300 | null,
|
301 | _react2.default.createElement(_FindAll_pop2.default, findAll_Data),
|
302 | _react2.default.createElement('div', { className: 'AutoTree-mask ' })
|
303 | );
|
304 | _reactDom2.default.render(_react2.default.createElement(
|
305 | 'div',
|
306 | null,
|
307 | autoTreeMask
|
308 | ), document.getElementById('AutoTree_Mask'));
|
309 | };
|
310 |
|
311 | _this.addClass = function (event) {
|
312 | var isIE11 = /Trident\/7\./.test(navigator.userAgent);
|
313 | var _this$props4 = _this.props,
|
314 | focusCallBack = _this$props4.focusCallBack,
|
315 | componentId = _this$props4.componentId,
|
316 | disabled = _this$props4.disabled;
|
317 | var single = _this.state.single;
|
318 |
|
319 | _this.clickScroll = true;
|
320 | if (disabled || _this.state.isFocus == true) return;
|
321 | var self = _this;
|
322 | self.tar = single ? self.refs.autoForm_ref.refs.autoTreeInput : self.refs.autoForm_ref.refs.autoTree_commonInput;
|
323 | window.autoId = componentId;
|
324 | if (!single) self.addAndRemoveListen(true, true);
|
325 | document.addEventListener('mousedown', self.handelOnMouseDown);
|
326 | self.setState({ isActive: true, isFocus: isIE11 ? false : true, isShow: true, autoTreeItems: [], showPanel: true });
|
327 | self['domState' + componentId] = self.state.isFocus == false ? true : false;
|
328 | focusCallBack && focusCallBack(event);
|
329 | };
|
330 |
|
331 | _this.editInput_focus = function () {
|
332 | var edit_input = _this.props.single ? _this.refs.autoForm_ref.refs.autoTreeInput : _this.refs.autoForm_ref.refs.autoTree_commonInput;
|
333 | var isIE11 = /Trident\/7\./.test(navigator.userAgent);
|
334 | _this.setState({ isFocus: isIE11 ? false : true });
|
335 | _this.addClass(edit_input);
|
336 | };
|
337 |
|
338 | _this.handelOnMouseDown = function (event) {
|
339 | var _this$props5 = _this.props,
|
340 | status = _this$props5.status,
|
341 | single = _this$props5.single,
|
342 | componentId = _this$props5.componentId,
|
343 | treeData = _this$props5.treeData,
|
344 | isSearchAutoTreeEdit = _this$props5.isSearchAutoTreeEdit;
|
345 |
|
346 | var self = _this;
|
347 | var result_ul = status == 'edit' ? single ? (0, _constant.getElByClass)('autotree__tree-panel') : (0, _constant.getElByClass)('auto-result-container') : (0, _constant.getElByClass)('auto-result-container-search');
|
348 | var inputDom = _this.refs.AutoTree;
|
349 | _this.clickScroll = result_ul && result_ul.contains(event.target) || inputDom && inputDom.contains(event.target) && !inputDom.querySelector(".form-item__title").contains(event.target) ? false : true;
|
350 | if (event.target.className.indexOf("sys-icon-foldup") != -1) {
|
351 | setTimeout(function () {
|
352 | self['domState' + componentId] = true;
|
353 | }, 100);
|
354 | }
|
355 | if (status == 'edit' && single) {
|
356 | if (_this.clickScroll) {
|
357 | _this['domState' + componentId] = false;
|
358 | _this.unmountComponent(componentId);
|
359 | if (single && !isSearchAutoTreeEdit) {
|
360 | treeData.clearTreeData && treeData.clearTreeData();
|
361 | }
|
362 | document.removeEventListener('mousedown', _this.handelOnMouseDown);
|
363 | setTimeout(function () {
|
364 | self._tempCleared = false;
|
365 | self.setState({ isActive: false, isFocus: false });
|
366 | }, 300);
|
367 | }
|
368 | }
|
369 | };
|
370 |
|
371 | _this.removeClass = function (event) {
|
372 | var self = _this;
|
373 | var _this$props6 = _this.props,
|
374 | componentId = _this$props6.componentId,
|
375 | blurCallBack = _this$props6.blurCallBack;
|
376 | var _this$state3 = _this.state,
|
377 | status = _this$state3.status,
|
378 | single = _this$state3.single;
|
379 |
|
380 | setTimeout(function () {
|
381 | if (self._tempCleared) return;
|
382 | var isShow_Value = single ? false : true;
|
383 | if (!single) self['domState' + componentId] = false;
|
384 | self.setState({ isActive: false, isFocus: false, isShow: isShow_Value });
|
385 | if (single && window.autoId == componentId && self.clickScroll) {
|
386 | self.unmountComponent(componentId);
|
387 | document.removeEventListener('mousedown', self.handelOnMouseDown);
|
388 | }
|
389 | if (single && self.clickScroll) self.addAndRemoveListen(true, false);
|
390 |
|
391 | }, 300);
|
392 | if (status == 'edit' && single) _this['domState' + componentId] = false;
|
393 | blurCallBack && blurCallBack(event);
|
394 | };
|
395 |
|
396 | _this.addAndRemoveListen = function (remove, add) {
|
397 | if (remove) document.removeEventListener('click', _this.onClose);
|
398 | if (add) document.addEventListener('click', _this.onClose);
|
399 | };
|
400 |
|
401 | _this.filterData = function (filterCondition) {
|
402 | var autoTreeItems = _this.props.autoTreeData;
|
403 | var filterData = filterCondition == '' ? [] : autoTreeItems.filter(function (item) {
|
404 | return item.name.includes(filterCondition);
|
405 | });
|
406 | filterData.length > 0 ? _this.setState({ autoTreeItems: filterData }) : _this.setState({ autoTreeItems: [] });
|
407 | };
|
408 |
|
409 | _this.handleChange = function (val) {
|
410 | var _this$props7 = _this.props,
|
411 | getAutoTreeDataAPI = _this$props7.getAutoTreeDataAPI,
|
412 | sync = _this$props7.sync,
|
413 | getAutoTreeData = _this$props7.getAutoTreeData,
|
414 | componentId = _this$props7.componentId,
|
415 | findAllSearch = _this$props7.findAllSearch;
|
416 |
|
417 | var filters = _this.state.filters;
|
418 | _this.setState({ index: -1, showTreeResult: true, searchValue: val.value });
|
419 | findAllSearch && findAllSearch(val.value);
|
420 | if (val.value == '') return;
|
421 | _this['domState' + componentId] = true;
|
422 | sync ? _this.filterData(val.value) : getAutoTreeData(getAutoTreeDataAPI, val.value, filters);
|
423 | };
|
424 |
|
425 | _this.changeFilter = function (event, target, val) {
|
426 | var _this$props8 = _this.props,
|
427 | autoTreeSearchCallBack = _this$props8.autoTreeSearchCallBack,
|
428 | componentId = _this$props8.componentId,
|
429 | defaultValueObj = _this$props8.defaultValueObj;
|
430 | var _this$state4 = _this.state,
|
431 | hasClick = _this$state4.hasClick,
|
432 | single = _this$state4.single,
|
433 | resultsData = _this$state4.resultsData;
|
434 |
|
435 | var temp_val = val == '' ? val : val.text;
|
436 | _this.setState({ filters: temp_val });
|
437 |
|
438 | if (_this['val' + componentId] == null || hasClick == false) {
|
439 | _this['val' + componentId] = {
|
440 | id: defaultValueObj && defaultValueObj.id || '',
|
441 | name: defaultValueObj && defaultValueObj.name || '',
|
442 | path: defaultValueObj && defaultValueObj.path || '',
|
443 | level: defaultValueObj && defaultValueObj.level || '',
|
444 | filters: temp_val
|
445 | };
|
446 | } else if (hasClick == true) {
|
447 | _this['val' + componentId]['filters'] = temp_val;
|
448 | }
|
449 | if (!single && resultsData.length != 0) {
|
450 | for (var i = 0; i < resultsData.length; i++) {
|
451 | resultsData[i]['filters'] = temp_val;
|
452 | }
|
453 | _this.setState({ resultsData: resultsData });
|
454 | }
|
455 | autoTreeSearchCallBack && autoTreeSearchCallBack(single ? _this['val' + componentId] : resultsData, temp_val);
|
456 | };
|
457 |
|
458 | _this.findAll = function () {
|
459 | var _this$props9 = _this.props,
|
460 | clearAutoTreeData = _this$props9.clearAutoTreeData,
|
461 | showPopCallback = _this$props9.showPopCallback,
|
462 | componentId = _this$props9.componentId;
|
463 |
|
464 | clearAutoTreeData();
|
465 | (0, _constant.setMaskStyle)();
|
466 | _this['domState' + componentId] = true;
|
467 | _this.setState({ isShow: false, showTree: true });
|
468 | _this.renderMask();
|
469 | _this.unmountComponent(componentId);
|
470 | _this.addAndRemoveListen(true, false);
|
471 | showPopCallback && showPopCallback();
|
472 | };
|
473 |
|
474 | _this.setSessionData = function (self, componentId) {
|
475 | sessionStorage.setItem('search' + componentId, (0, _stringify2.default)(self['temp' + componentId]));
|
476 | _this.props.setSessionCallBack && _this.props.setSessionCallBack();
|
477 | };
|
478 |
|
479 | _this.getSessionData = function (componentId) {
|
480 | return JSON.parse(sessionStorage.getItem('search' + componentId));
|
481 | };
|
482 |
|
483 | _this.itemClick = function (event) {
|
484 | var _this$props10 = _this.props,
|
485 | componentId = _this$props10.componentId,
|
486 | autoTreeData = _this$props10.autoTreeData,
|
487 | itemCallBack = _this$props10.itemCallBack;
|
488 | var single = _this.state.single;
|
489 |
|
490 | var node = (0, _constant.setRealNode)(event);
|
491 | if (node) {
|
492 | var nodeId = node.getAttribute('data-index');
|
493 | if (!single) _this.renderDom();
|
494 | _this.commonClick_Callback(false, nodeId, componentId, autoTreeData, itemCallBack);
|
495 | }
|
496 | };
|
497 |
|
498 | _this.handleKeyDown = function (e) {
|
499 | var _this$props11 = _this.props,
|
500 | componentId = _this$props11.componentId,
|
501 | autoTreeData = _this$props11.autoTreeData,
|
502 | itemCallBack = _this$props11.itemCallBack,
|
503 | sync = _this$props11.sync;
|
504 | var _this$state5 = _this.state,
|
505 | index = _this$state5.index,
|
506 | showTree = _this$state5.showTree,
|
507 | autoTreeItems = _this$state5.autoTreeItems,
|
508 | isFocus = _this$state5.isFocus,
|
509 | hasClick = _this$state5.hasClick,
|
510 | inputValue = _this$state5.inputValue;
|
511 |
|
512 | var trueIndex = index;
|
513 | var popAutoResult = (0, _constant.getElByClass)('pop-auto-result');
|
514 | var popAutoResult_ClientHeight = void 0,
|
515 | maxLength = void 0,
|
516 | tempLength = void 0,
|
517 | autoResult = void 0;
|
518 | var ItemHeight = _this.renderParents_Node ? 54 : 30;
|
519 | if (popAutoResult != undefined) {
|
520 | popAutoResult_ClientHeight = popAutoResult.offsetHeight - 10;
|
521 | maxLength = parseInt(popAutoResult_ClientHeight / ItemHeight);
|
522 | }
|
523 | tempLength = showTree ? maxLength : _this.renderParents_Node ? 5 : 8;
|
524 | var sessionData = _this.getSessionData(componentId);
|
525 | var dataResult = sync ? autoTreeItems : autoTreeData;
|
526 | var ifBool = (dataResult == undefined || dataResult.length == 0) && isFocus == true && sessionData != null && sessionData.length > 0 && hasClick == true || inputValue == '' && isFocus == true && sessionData != null && sessionData.length > 0 && hasClick == false;
|
527 | dataResult = ifBool ? sessionData : dataResult;
|
528 | autoResult = (0, _constant.getElByClass)('auto-result');
|
529 | autoResult = showTree == true && popAutoResult != undefined ? popAutoResult : autoResult;
|
530 | switch (e.keyCode) {
|
531 | case 38:
|
532 |
|
533 | if (_this.state.index <= 0) {
|
534 | return;
|
535 | } else {
|
536 | trueIndex = --_this.state.index % _this.autoLi.length;
|
537 | }
|
538 | if (trueIndex >= tempLength - 1) {
|
539 | autoResult.scrollTop = trueIndex == tempLength - 1 ? autoResult.scrollTop - ItemHeight : (trueIndex - (tempLength - 1)) * ItemHeight;
|
540 | }
|
541 | _this.setState({ index: trueIndex });
|
542 | break;
|
543 | case 40:
|
544 |
|
545 | if (_this.state.index == dataResult.length - 1) return;
|
546 | trueIndex = index < 0 ? 0 : ++index % _this.autoLi.length;
|
547 | if (trueIndex >= tempLength) {
|
548 | autoResult.scrollTop = dataResult.length - 1 == trueIndex ? (trueIndex - (tempLength - 1)) * ItemHeight + 44 : (trueIndex - (tempLength - 1)) * ItemHeight;
|
549 | }
|
550 | _this.setState({ index: trueIndex });
|
551 | break;
|
552 | case 13:
|
553 |
|
554 | if (index == -1) return;
|
555 | var nodeId = index;
|
556 | _this.commonClick_Callback(true, nodeId, componentId, dataResult, itemCallBack);
|
557 | if (_this.refs.autoForm_ref.refs.autoTreeInput) _this.refs.autoForm_ref.refs.autoTreeInput.blur();
|
558 | break;
|
559 | default:
|
560 | break;
|
561 | }
|
562 | };
|
563 |
|
564 | _this.clearDom = function () {
|
565 | var dom_1 = (0, _constant.getElByClass)('');
|
566 | var dom_2 = (0, _constant.getElByClass)('-arrow');
|
567 | if (dom_1 && dom_2) {
|
568 | var parNode = dom_1.parentNode;
|
569 | parNode.removeChild(dom_1);
|
570 | parNode.removeChild(dom_2);
|
571 | }
|
572 | };
|
573 |
|
574 | _this.commonClick_Callback = function (type, nodeId, componentId, dataResult, func) {
|
575 | var _this$props12 = _this.props,
|
576 | isSearchAutoTreeEdit = _this$props12.isSearchAutoTreeEdit,
|
577 | single = _this$props12.single,
|
578 | status = _this$props12.status,
|
579 | showDropDown = _this$props12.showDropDown,
|
580 | removeComponent = _this$props12.removeComponent;
|
581 |
|
582 | _this['domState' + componentId] = true;
|
583 | var _resultsData = _this.state.resultsData;
|
584 | var sessionData = _this.getSessionData(componentId);
|
585 | var autoTreeList = dataResult != undefined && dataResult.length > 0 ? dataResult : sessionData;
|
586 | _this.clearDom();
|
587 | for (var i = 0; i < autoTreeList.length; i++) {
|
588 | var real_Id = type == true ? i : autoTreeList[i].id;
|
589 | if (real_Id == nodeId) _this['val' + componentId] = autoTreeList[i];
|
590 | }
|
591 | if ((!isSearchAutoTreeEdit || status == 'edit' && single) && !showDropDown) _this.unmountMask();
|
592 | _this.setClickData(_this['val' + componentId].name, (0, _extends3.default)({}, _this['val' + componentId]), sessionData);
|
593 | _this['val' + componentId]['filters'] = _this.state.filters;
|
594 |
|
595 | var temp_resultsData = _resultsData.filter(function (child) {
|
596 | return _this['val' + componentId].id == child.id;
|
597 | });
|
598 | if (temp_resultsData.length == 0) _resultsData.push(_this['val' + componentId]);
|
599 | var _inputValue = _this.props.status == 'search' || _this.state.single ? _this['val' + componentId].name : '';
|
600 | _this.setState({
|
601 | inputValue: _inputValue,
|
602 |
|
603 | isFocus: false,
|
604 | itemId: nodeId,
|
605 | hasClick: true,
|
606 | resultsData: _resultsData,
|
607 | hasCount: _resultsData.length,
|
608 | showPanel: false,
|
609 | searchChange: false
|
610 | });
|
611 | if (!showDropDown) removeComponent && removeComponent();
|
612 | if (single) _this.setState({ searchValue: _inputValue });
|
613 | if (_this.state.showTree) _this._tempSeleted.push(_this['val' + componentId].id);
|
614 | if (!_this.state.showTree && !_this.state.single || _this.state.single) func && func(_this.state.single ? _this['val' + componentId] : _resultsData);
|
615 | };
|
616 |
|
617 | _this.setClickData = function (name, value, sessionData) {
|
618 | var componentId = _this.props.componentId;
|
619 |
|
620 | var jsonFlag = false;
|
621 | if (sessionData != null) {
|
622 | for (var j = 0; j < sessionData.length; j++) {
|
623 | if (sessionData[j].name == name) jsonFlag = true;
|
624 | }
|
625 | }
|
626 | var tempSessionLength = sessionData == null ? 0 : sessionData.length;
|
627 | _this['temp' + componentId] = _this['temp' + componentId] == undefined ? [] : _this['temp' + componentId];
|
628 | if (tempSessionLength < 10 && jsonFlag == false) {
|
629 | _this['temp' + componentId].length == 0 ? _this['temp' + componentId].push(value) : _this['temp' + componentId].unshift(value);
|
630 | _this.setSessionData(_this, componentId);
|
631 | } else if (tempSessionLength >= 10 && jsonFlag == false) {
|
632 | _this['temp' + componentId].pop();
|
633 | var s = value;
|
634 | _this['temp' + componentId].unshift(s);
|
635 | _this.setSessionData(_this, componentId);
|
636 | } else {
|
637 | _this.setSessionData(_this, componentId);
|
638 | }
|
639 | };
|
640 |
|
641 | _this.clearData = function (event) {
|
642 | var clearCallback = _this.props.clearCallback;
|
643 |
|
644 | if (_this.state.isFocus) {
|
645 | _this.setState({ isFocus: true, isShow: true, inputValue: "", hasClick: false });
|
646 | } else {
|
647 | _this.setState({ inputValue: "", isShow: false, hasClick: false, isFocus: false });
|
648 | }
|
649 | _this._tempCleared = true;
|
650 | clearCallback && clearCallback();
|
651 | };
|
652 |
|
653 | _this.unmountComponent = function (componentId) {
|
654 | _this.CommonMount.unmountBox();
|
655 | _this.setState({ index: -1 });
|
656 |
|
657 | _this.addAndRemoveListen(true, false);
|
658 | _this['domState' + componentId] = false;
|
659 | _this.props.unmountCallBack && _this.props.unmountCallBack();
|
660 | };
|
661 |
|
662 | _this.unmountMask = function () {
|
663 | _this.setState({ showTree: false });
|
664 | _this.unmountComponent(_this.props.componentId);
|
665 | if (document.getElementById('AutoTree_Mask')) {
|
666 | _reactDom2.default.unmountComponentAtNode(document.getElementById('AutoTree_Mask'));
|
667 | }
|
668 | };
|
669 |
|
670 | _this.onClose = function (event) {
|
671 | var self = _this;
|
672 | setTimeout(function () {
|
673 | self._tempCleared = false;
|
674 | }, 400);
|
675 | var _this$props13 = _this.props,
|
676 | status = _this$props13.status,
|
677 | onCloseCallback = _this$props13.onCloseCallback,
|
678 | componentId = _this$props13.componentId;
|
679 |
|
680 | if (window.autoId == componentId) {
|
681 | if (event && event.target.innerHTML == '全部查找' || event.target.innerHTML == "“查找全部”" || event.target.className.includes('sys-icon-close')) return;
|
682 | var area = _this.tar;
|
683 | var result_ul = status == 'edit' ? (0, _constant.getElByClass)('auto-result-container') : (0, _constant.getElByClass)('auto-result-container-search');
|
684 | if (area == undefined && _this.state.showTree == false) {
|
685 | _this.setState({ isShow: false });
|
686 | _this.unmountComponent(componentId);
|
687 | onCloseCallback && onCloseCallback(event);
|
688 | return;
|
689 | }
|
690 | if (area != undefined && result_ul != undefined && !area.contains(event.target) && !result_ul.contains(event.target)) {
|
691 | _this.setState({ isFocus: false, isShow: false });
|
692 | _this.unmountComponent(componentId);
|
693 | onCloseCallback && onCloseCallback(event);
|
694 | if (_this.state.hasClick == false) _this.setState({ inputValue: '' });
|
695 | }
|
696 | }
|
697 | };
|
698 |
|
699 | _this.itemClose = function (event, item, index) {
|
700 | var itemCloseCallBack = _this.props.itemCloseCallBack;
|
701 |
|
702 | var _resultsData = _this.state.resultsData;
|
703 | var _hasCount = _this.state.hasCount;
|
704 | _resultsData = _resultsData.filter(function (child) {
|
705 | return item.id != child.id;
|
706 | });
|
707 | _this.setState({ resultsData: _resultsData, hasCount: _hasCount - 1 });
|
708 | itemCloseCallBack && itemCloseCallBack(_resultsData);
|
709 | };
|
710 |
|
711 | _this.treeItemClick = function (e, valObj) {
|
712 |
|
713 | var _this$props14 = _this.props,
|
714 | componentId = _this$props14.componentId,
|
715 | itemCallBack = _this$props14.itemCallBack,
|
716 | status = _this$props14.status,
|
717 | treeData = _this$props14.treeData,
|
718 | showDropDown = _this$props14.showDropDown,
|
719 | isSearchAutoTreeEdit = _this$props14.isSearchAutoTreeEdit,
|
720 | removeComponent = _this$props14.removeComponent;
|
721 |
|
722 | _this['domState' + componentId] = true;
|
723 | var single = _this.state.single;
|
724 |
|
725 | if (single && !isSearchAutoTreeEdit) {
|
726 | treeData.clearTreeData && treeData.clearTreeData();
|
727 | }
|
728 | var self = _this;
|
729 | var _resultsData = _this.state.resultsData;
|
730 | var sessionData = _this.getSessionData(componentId);
|
731 | _this.setClickData(valObj.name, (0, _extends3.default)({}, valObj), sessionData);
|
732 | if (_this['val' + componentId] != null) valObj.filters = _this['val' + componentId].filters;
|
733 | _this['val' + componentId] = valObj;
|
734 | if ((!isSearchAutoTreeEdit && single || status == 'edit' && single) && !showDropDown) _this.unmountMask();
|
735 | var temp_resultsData = _resultsData.filter(function (child) {
|
736 | return _this['val' + componentId].id == child.id;
|
737 | });
|
738 | if (temp_resultsData.length == 0) _resultsData.push(_this['val' + componentId]);
|
739 | var _inputValue = status == 'search' || single ? valObj.name : '';
|
740 | if (status == 'search') {
|
741 | _this.setState({
|
742 | nodeValue: valObj.name,
|
743 | searchValue: _inputValue,
|
744 | hasClick: true,
|
745 | resultsData: _resultsData,
|
746 | hasCount: _resultsData.length,
|
747 | showPanel: false
|
748 | }, _this.forceUpdate());
|
749 | } else {
|
750 | _this.setState({
|
751 | nodeValue: valObj.name,
|
752 | inputValue: _inputValue,
|
753 | searchValue: _inputValue,
|
754 | hasClick: true,
|
755 | resultsData: _resultsData,
|
756 | hasCount: _resultsData.length,
|
757 | showPanel: false,
|
758 | isFocus: false
|
759 | }, _this.forceUpdate());
|
760 | }
|
761 |
|
762 | if (_this.state.showTree) _this._tempSeleted.push(_this['val' + componentId].id);
|
763 | if (!showDropDown) {
|
764 | removeComponent && removeComponent();
|
765 | }
|
766 | if (single && !isSearchAutoTreeEdit || status == 'search' || isSearchAutoTreeEdit) {
|
767 | itemCallBack && itemCallBack(_this['val' + componentId]);
|
768 | }
|
769 | setTimeout(function () {
|
770 | self['domState' + self.props.componentId] = false;
|
771 | }, 500);
|
772 | };
|
773 |
|
774 | _this.handelSubmit = function () {
|
775 | var searchValue = _this.state.searchValue;
|
776 | var _this$props15 = _this.props,
|
777 | isSearchAutoTreeEdit = _this$props15.isSearchAutoTreeEdit,
|
778 | treeData = _this$props15.treeData;
|
779 |
|
780 | if (isSearchAutoTreeEdit) {
|
781 | _this.unmountMask();
|
782 | treeData.clearTreeData && treeData.clearTreeData();
|
783 | }
|
784 | var val = void 0;
|
785 | if (_this['val' + _this.props.componentId] && searchValue == _this['val' + _this.props.componentId].name) {
|
786 | val = _this['val' + _this.props.componentId];
|
787 | } else {
|
788 | val = null;
|
789 | }
|
790 | _this.props.searchSubmitCallBack && _this.props.searchSubmitCallBack(val);
|
791 | };
|
792 |
|
793 | _this.state = {
|
794 | isFocus: props && props.defaultStatus || false,
|
795 | isShowMouseOverIcon: false,
|
796 | inputValue: props && props.defaultValue || '',
|
797 | itemId: '',
|
798 | isShow: true,
|
799 | showTree: false,
|
800 | status: props && props.status || 'edit',
|
801 | showTreeResult: false,
|
802 | searchValue: "",
|
803 | autoTreeItems: [],
|
804 | filters: '',
|
805 | hidden: props && props.hidden || false,
|
806 | hasClick: props.defaultValue == '' || props.defaultValue == undefined ? false : true,
|
807 | index: -1,
|
808 | hasCount: 0,
|
809 | resultsData: [],
|
810 | isActive: false,
|
811 | single: props && props.single || props.single == undefined ? true : false,
|
812 | defaultPlaceholder: props && props.placeholder || '输入可进行搜索',
|
813 | showPanel: props.status == 'search' ? true : false,
|
814 | searchChange: false
|
815 | };
|
816 | _this._tempClosed = [];
|
817 | _this._tempSeleted = [];
|
818 | _this._tempCleared = false;
|
819 | _this.autoLi = [];
|
820 | _this.clickScroll = true;
|
821 | _this.chrome_tag = true;
|
822 | _this.renderParents_Node = false;
|
823 | _this['temp' + props.componentId] = [];
|
824 | sessionStorage.setItem('search' + props.componentId, (0, _stringify2.default)(_this['temp' + props.componentId]));
|
825 | _this['val' + props.componentId] = props && props.defaultValueObj || null;
|
826 | _this.tar = null;
|
827 | _this.createDom();
|
828 | _this['domState' + props.componentId] = false;
|
829 | _this.CommonMount = new _commonMount2.default({
|
830 | containerId: 'AutoTree_ul',
|
831 | follow: true,
|
832 | fixed: true
|
833 | });
|
834 | _this.onChange = _this.onChange.bind(_this);
|
835 | _this.searchClick = _this.searchClick.bind(_this);
|
836 | _this.onChange = (0, _es6PromiseDebounce2.default)(_this.onChange, 200);
|
837 | return _this;
|
838 | }
|
839 |
|
840 | AutoTree.prototype.createDom = function createDom() {
|
841 | if (document.getElementById('AutoTree_Mask')) return;
|
842 | var mDiv = document.createElement('div');
|
843 | mDiv.id = 'AutoTree_Mask';
|
844 | document.body.appendChild(mDiv);
|
845 | };
|
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 | AutoTree.prototype.onChange = function onChange(event) {
|
871 | var self = this;
|
872 | var _props = this.props,
|
873 | getAutoTreeDataAPI = _props.getAutoTreeDataAPI,
|
874 | sync = _props.sync,
|
875 | componentId = _props.componentId,
|
876 | getAutoTreeData = _props.getAutoTreeData,
|
877 | changeCallBack = _props.changeCallBack,
|
878 | clearCallback = _props.clearCallback,
|
879 | single = _props.single,
|
880 | status = _props.status;
|
881 |
|
882 | var inputValue = status == 'search' ? event.value : event.target.value;
|
883 | var filters = this.state.filters;
|
884 | var formRef = this.refs.autoForm_ref;
|
885 | this._tempCleared = false;
|
886 | if (status == 'search' || single) {
|
887 | this.setState({ index: -1, isShow: true, showPanel: true, searchChange: true, hasClick: false, searchValue: inputValue });
|
888 | } else {
|
889 | this.setState({ index: -1, isShow: true, hasClick: false, inputValue: inputValue });
|
890 | }
|
891 | this['domState' + componentId] = true;
|
892 | if (formRef) this.tar = this.props.single ? formRef.refs.autoTreeInput : formRef.refs.autoTree_commonInput;
|
893 | offset = {
|
894 | zIndex: '99999',
|
895 | position: 'fixed'
|
896 | };
|
897 | if (inputValue == '') clearCallback && clearCallback();
|
898 |
|
899 | sync == false ? getAutoTreeData(getAutoTreeDataAPI, inputValue, filters) : this.filterData(inputValue);
|
900 | setTimeout(function () {
|
901 | self.renderDom(false, offset);
|
902 | }, 200);
|
903 | changeCallBack && changeCallBack(event, this.state, inputValue);
|
904 | };
|
905 |
|
906 | AutoTree.prototype.onRealChange = function onRealChange(event) {
|
907 | event.persist();
|
908 | this.onChange(event);
|
909 | };
|
910 |
|
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 |
|
925 |
|
926 |
|
927 |
|
928 |
|
929 |
|
930 |
|
931 |
|
932 |
|
933 |
|
934 |
|
935 |
|
936 |
|
937 | AutoTree.prototype.componentDidUpdate = function componentDidUpdate() {
|
938 | var _state = this.state,
|
939 | status = _state.status,
|
940 | showTree = _state.showTree,
|
941 | inputValue = _state.inputValue,
|
942 | isFocus = _state.isFocus,
|
943 | autoTreeItems = _state.autoTreeItems;
|
944 | var _props2 = this.props,
|
945 | componentId = _props2.componentId,
|
946 | autoTreeData = _props2.autoTreeData,
|
947 | sync = _props2.sync,
|
948 | single = _props2.single;
|
949 |
|
950 | var popAutoResult = (0, _constant.getElByClass)('pop-auto-result');
|
951 | var searchContainer = (0, _constant.getElByClass)('searchContainer');
|
952 | var autoResultContainer = (0, _constant.getElByClass)('auto-result-container');
|
953 | var windowH = window.innerHeight;
|
954 | var windowW = window.innerWidth;
|
955 | var ItemHeight = this.renderParents_Node ? 54 : 30;
|
956 | var selected_Component = (0, _constant.getElByClass)('selected_Component');
|
957 |
|
958 | if (selected_Component) {
|
959 | selected_Component.style.width = windowW * 0.65 - 301 + 'px';
|
960 | selected_Component.style.marginLeft = '15px';
|
961 | selected_Component.style.marginTop = '15px';
|
962 | }
|
963 | if (popAutoResult != undefined) {
|
964 | var popAutoResult_ClientHeight = searchContainer.offsetHeight * 0.85 - 10;
|
965 | var maxLength = parseInt(popAutoResult_ClientHeight / ItemHeight);
|
966 | var finalHeight = maxLength * ItemHeight;
|
967 | popAutoResult.style.maxHeight = finalHeight + 'px';
|
968 | }
|
969 | if (status == 'search') {
|
970 | var reConNode = (0, _constant.getElByClass)('autoTree_Search');
|
971 | var resultNode = (0, _constant.getElByClass)('auto-result-container-search');
|
972 | var searchInput = (0, _constant.getElByClass)('autoTree-search-input');
|
973 | if (searchInput && !this.chrome_tag) searchInput.style.lineHeight = 23 + 'px';
|
974 | if (reConNode != undefined && resultNode != undefined && !showTree) {
|
975 | reConNode.style.boxShadow = '0px 3px 10px rgba(0, 0, 0, 0.15)';
|
976 | }
|
977 | }
|
978 | var dataResult = sync ? autoTreeItems : autoTreeData;
|
979 | if (status == 'status' && inputValue.length > 0 && dataResult.length == 0 && isFocus == true) {
|
980 | autoResultContainer.style.height = '360px';
|
981 | }
|
982 |
|
983 | if (showTree && searchContainer != undefined) {
|
984 | var temp_Height = status == 'edit' ? 50 : 0;
|
985 | searchContainer.style.left = (windowW - searchContainer.offsetWidth) * 0.5 + 'px';
|
986 | searchContainer.style.top = (windowH - searchContainer.offsetHeight - temp_Height) * 0.5 + 'px';
|
987 | }
|
988 | if (status == 'edit' && !single) {
|
989 | if (inputValue.length == 0 && isFocus == true) this['domState' + componentId] = true;
|
990 | if (showTree == true) this['domState' + componentId] = true;
|
991 | }
|
992 |
|
993 | var self = this;
|
994 | if (this['domState' + componentId]) {
|
995 | self.renderDom(false, offset);
|
996 | }
|
997 | if (showTree) this.renderMask();
|
998 | };
|
999 |
|
1000 | AutoTree.prototype.componentDidMount = function componentDidMount() {
|
1001 | var status = this.state.status;
|
1002 |
|
1003 | if (status == 'search') {
|
1004 | var reConNode = this.refs.AutoTree;
|
1005 | if (reConNode != undefined) {
|
1006 | reConNode.style.boxShadow = '0px 3px 10px rgba(0, 0, 0, 0.15)';
|
1007 | }
|
1008 | this.setState({ isFocus: true });
|
1009 | }
|
1010 | this.chrome_tag = parseInt((0, _constant.getSysVersion)().chrome) >= 50 ? true : false;
|
1011 |
|
1012 | if (this.props.defaultStatus) this.refs.autoForm_ref.refs.autoTreeInput.focus();
|
1013 | (0, _constant.setMaskStyle)();
|
1014 | };
|
1015 |
|
1016 |
|
1017 |
|
1018 | AutoTree.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
1019 | var nextAutoData = nextProps.autoTreeData;
|
1020 | var nextTreeData = nextProps.treeData.treeData;
|
1021 | var _props3 = this.props,
|
1022 | autoTreeData = _props3.autoTreeData,
|
1023 | treeData = _props3.treeData;
|
1024 |
|
1025 |
|
1026 | if (nextProps.defaultValue != this.props.defaultValue && nextProps.defaultValue != this.state.inputValue) {
|
1027 | this.setState({ defaultValue: nextProps.defaultValue, inputValue: nextProps.defaultValue });
|
1028 | if (nextProps.defaultValue.length == 0 && this['val' + this.props.componentId]) {
|
1029 | this['val' + this.props.componentId].filters = '';
|
1030 | }
|
1031 | }
|
1032 |
|
1033 | if (nextAutoData != undefined && autoTreeData != undefined && nextAutoData.length != autoTreeData.length) {
|
1034 | this.setState({ showPanel: true });
|
1035 | }
|
1036 |
|
1037 | if (nextTreeData != undefined && treeData.treeData != undefined && nextTreeData.length != treeData.treeData.length) {
|
1038 | this.setState({ showPanel: true });
|
1039 | }
|
1040 | };
|
1041 |
|
1042 |
|
1043 |
|
1044 | AutoTree.prototype.renderDom = function renderDom(temp) {
|
1045 | var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1046 |
|
1047 | var self = this;
|
1048 | var _props4 = this.props,
|
1049 | status = _props4.status,
|
1050 | single = _props4.single,
|
1051 | isSearchAutoTreeEdit = _props4.isSearchAutoTreeEdit,
|
1052 | showDropDown = _props4.showDropDown,
|
1053 | DropDownData = _props4.DropDownData;
|
1054 | var _state2 = this.state,
|
1055 | isShow = _state2.isShow,
|
1056 | inputValue = _state2.inputValue,
|
1057 | searchChange = _state2.searchChange,
|
1058 | showPanel = _state2.showPanel;
|
1059 |
|
1060 | if (status != 'search') {
|
1061 | if (single) {
|
1062 | var ul_Content = void 0;
|
1063 | var autoLi = this.returnAutoLi(true);
|
1064 | var autoLiChild = autoLi.length > 0 ? autoLi : '';
|
1065 | if (isShow) ul_Content = autoLi.length == 0 && inputValue.length > 0 ? _react2.default.createElement('div', { className: 'findNothing empty-con' }) : autoLiChild;
|
1066 | var searchCom = _react2.default.createElement(_search_Filters2.default, { DropDownData: DropDownData, isSearchAutoTreeEdit: isSearchAutoTreeEdit, changeFilter: this.changeFilter, showDropDown: showDropDown, handelSubmit: this.handelSubmit, isPanelShow: isShow });
|
1067 | (0, _constant.renderTree)(self, temp, offset, self.treeItemClick, ul_Content, self.itemClick, searchChange, searchCom, showPanel);
|
1068 | } else {
|
1069 | (0, _constant.renderAutoUl)(self, temp, offset);
|
1070 | }
|
1071 | }
|
1072 | };
|
1073 |
|
1074 | AutoTree.prototype.searchClick = function searchClick(event) {
|
1075 | var showPanel = this.state.showPanel;
|
1076 |
|
1077 | if (!showPanel) {
|
1078 | this.setState({ showPanel: true });
|
1079 | }
|
1080 | };
|
1081 |
|
1082 | AutoTree.prototype.render = function render() {
|
1083 | var _state3 = this.state,
|
1084 | isFocus = _state3.isFocus,
|
1085 | inputValue = _state3.inputValue,
|
1086 | isShow = _state3.isShow,
|
1087 | searchValue = _state3.searchValue,
|
1088 | status = _state3.status,
|
1089 | single = _state3.single,
|
1090 | resultsData = _state3.resultsData,
|
1091 | isShowMouseOverIcon = _state3.isShowMouseOverIcon,
|
1092 | defaultPlaceholder = _state3.defaultPlaceholder,
|
1093 | showPanel = _state3.showPanel,
|
1094 | searchChange = _state3.searchChange;
|
1095 | var _props5 = this.props,
|
1096 | showDropDown = _props5.showDropDown,
|
1097 | errorMsg = _props5.errorMsg,
|
1098 | showText = _props5.showText,
|
1099 | errorStatus = _props5.errorStatus,
|
1100 | placeholder = _props5.placeholder,
|
1101 | autoTreeData = _props5.autoTreeData,
|
1102 | isSearchAutoTreeEdit = _props5.isSearchAutoTreeEdit,
|
1103 | readOnly = _props5.readOnly,
|
1104 | treeData = _props5.treeData,
|
1105 | componentId = _props5.componentId,
|
1106 | DropDownData = _props5.DropDownData,
|
1107 | disabled = _props5.disabled,
|
1108 | defaultValue = _props5.defaultValue;
|
1109 |
|
1110 |
|
1111 | var ul_Content = void 0;
|
1112 | var autoLi = this.returnAutoLi(true);
|
1113 | var autoLiChild = autoLi.length > 0 ? autoLi : '';
|
1114 | var _defaultValue = resultsData.length == 0 ? defaultValue || '' : '';
|
1115 | var cInputData = (0, _constant.getCommonInputData)(this.state.isActive, placeholder, _defaultValue, disabled, errorStatus, errorMsg, this.state.resultsData, this.itemClose, this.onChange, this.addClass, this.removeClass);
|
1116 | var autoTreeSum = autoTreeData ? autoTreeData : [];
|
1117 | var assignTreeData = (0, _extends3.default)({}, treeData, { style: { "height": "325px" } });
|
1118 |
|
1119 | if (isShow) ul_Content = autoLi.length == 0 && inputValue.length > 0 ? _react2.default.createElement('div', { className: 'findNothing empty-con' }) : autoLiChild;
|
1120 |
|
1121 | return _react2.default.createElement(
|
1122 | 'div',
|
1123 | null,
|
1124 | _react2.default.createElement(
|
1125 | 'div',
|
1126 | { ref: 'AutoTree', onKeyDown: this.handleKeyDown, className: 'field auto-tree' + (status == 'search' ? ' autoTree_Search' : '') },
|
1127 | status == 'edit' ? _react2.default.createElement(
|
1128 | 'div',
|
1129 | { className: status == 'edit' ? 'innerAutoTree' : '' },
|
1130 | _react2.default.createElement(
|
1131 | 'div',
|
1132 | { className: 'form-item ' + (errorStatus && single ? 'base-input-error-label' : '') },
|
1133 | status == 'edit' ? _react2.default.createElement(_commonLabel2.default, this.props) : '',
|
1134 | _react2.default.createElement(_autoForm_Input2.default, { status: status,
|
1135 | isShowMouseOverIcon: isShowMouseOverIcon,
|
1136 | isFocus: isFocus,
|
1137 | disabled: disabled,
|
1138 | single: single,
|
1139 | showDropDown: showDropDown,
|
1140 | placeholder: defaultPlaceholder,
|
1141 | inputValue: inputValue,
|
1142 | defaultValue: defaultValue,
|
1143 | errorMsg: errorMsg,
|
1144 | showText: showText,
|
1145 | autoId: window.autoId,
|
1146 | componentId: componentId,
|
1147 | DropDownData: DropDownData,
|
1148 | errorStatus: errorStatus,
|
1149 | commmonInput_Data: cInputData,
|
1150 | handlerOver: this.handlerOver,
|
1151 | readOnly: readOnly,
|
1152 | handlerOut: this.handlerOut,
|
1153 | clearData: this.clearData,
|
1154 | addClass: this.addClass,
|
1155 | editInput_focus: this.editInput_focus,
|
1156 | removeClass: this.removeClass,
|
1157 | onChange: this.onRealChange.bind(this),
|
1158 | findAll: this.findAll,
|
1159 | changeFilter: this.changeFilter,
|
1160 | isSearchAutoTreeEdit: isSearchAutoTreeEdit,
|
1161 | ref: 'autoForm_ref'
|
1162 | })
|
1163 | )
|
1164 | ) : _react2.default.createElement(
|
1165 | 'div',
|
1166 | { className: 'auto-tree__search-panel' },
|
1167 | _react2.default.createElement(_search2.default, (0, _extends3.default)({}, (0, _constant.getSearchData)(searchValue, showPanel ? true : false, true), { onChange: this.onChange, onClick: this.searchClick })),
|
1168 | this.props.isFetching ? _react2.default.createElement(
|
1169 | 'div',
|
1170 | { style: { "maxHeight": '310px', 'overflowY': 'scroll', backgroundColor: "#FFF", height: '310px' } },
|
1171 | _react2.default.createElement(_loading2.default, { type: 'small' })
|
1172 | ) : searchChange ? searchValue.length > 0 && autoTreeSum.length > 0 ? _react2.default.createElement(
|
1173 | 'div',
|
1174 | { className: 'auto-result-container-search', style: { display: showPanel ? 'block' : 'none' } },
|
1175 | _react2.default.createElement(
|
1176 | 'ul',
|
1177 | { className: 'auto-result', onClick: this.itemClick },
|
1178 | ul_Content
|
1179 | )
|
1180 | ) : searchValue.length > 0 && autoTreeSum.length == 0 ? _react2.default.createElement('div', { className: 'empty-con error_page' }) : showPanel ? _react2.default.createElement(_tree2.default, (0, _extends3.default)({}, assignTreeData, { onClick: this.treeItemClick })) : '' : showPanel ? _react2.default.createElement(_tree2.default, (0, _extends3.default)({}, assignTreeData, { onClick: this.treeItemClick })) : '',
|
1181 | _react2.default.createElement(_search_Filters2.default, { DropDownData: DropDownData, isSearchAutoTreeEdit: isSearchAutoTreeEdit, changeFilter: this.changeFilter, showDropDown: showDropDown, handelSubmit: this.handelSubmit })
|
1182 | )
|
1183 | )
|
1184 | );
|
1185 | };
|
1186 |
|
1187 | return AutoTree;
|
1188 | }(_react.Component);
|
1189 |
|
1190 | module.exports = AutoTree;
|
1191 |
|
1192 | }),
|
1193 |
|
1194 | (function(module, exports, __webpack_require__) {
|
1195 |
|
1196 | module.exports = { "default": __webpack_require__(3), __esModule: true };
|
1197 |
|
1198 | }),
|
1199 |
|
1200 | (function(module, exports, __webpack_require__) {
|
1201 |
|
1202 | var core = __webpack_require__(4);
|
1203 | var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
|
1204 | module.exports = function stringify(it) {
|
1205 | return $JSON.stringify.apply($JSON, arguments);
|
1206 | };
|
1207 |
|
1208 |
|
1209 | }),
|
1210 |
|
1211 | (function(module, exports) {
|
1212 |
|
1213 | var core = module.exports = { version: '2.5.3' };
|
1214 | if (typeof __e == 'number') __e = core;
|
1215 |
|
1216 |
|
1217 | }),
|
1218 |
|
1219 | (function(module, exports, __webpack_require__) {
|
1220 |
|
1221 | "use strict";
|
1222 |
|
1223 | exports.__esModule = true;
|
1224 |
|
1225 | var _assign = __webpack_require__(6);
|
1226 |
|
1227 | var _assign2 = _interopRequireDefault(_assign);
|
1228 |
|
1229 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1230 |
|
1231 | exports.default = _assign2.default || function (target) {
|
1232 | for (var i = 1; i < arguments.length; i++) {
|
1233 | var source = arguments[i];
|
1234 |
|
1235 | for (var key in source) {
|
1236 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
1237 | target[key] = source[key];
|
1238 | }
|
1239 | }
|
1240 | }
|
1241 |
|
1242 | return target;
|
1243 | };
|
1244 |
|
1245 | }),
|
1246 |
|
1247 | (function(module, exports, __webpack_require__) {
|
1248 |
|
1249 | module.exports = { "default": __webpack_require__(7), __esModule: true };
|
1250 |
|
1251 | }),
|
1252 |
|
1253 | (function(module, exports, __webpack_require__) {
|
1254 |
|
1255 | __webpack_require__(8);
|
1256 | module.exports = __webpack_require__(4).Object.assign;
|
1257 |
|
1258 |
|
1259 | }),
|
1260 |
|
1261 | (function(module, exports, __webpack_require__) {
|
1262 |
|
1263 |
|
1264 | var $export = __webpack_require__(9);
|
1265 |
|
1266 | $export($export.S + $export.F, 'Object', { assign: __webpack_require__(23) });
|
1267 |
|
1268 |
|
1269 | }),
|
1270 |
|
1271 | (function(module, exports, __webpack_require__) {
|
1272 |
|
1273 | var global = __webpack_require__(10);
|
1274 | var core = __webpack_require__(4);
|
1275 | var ctx = __webpack_require__(11);
|
1276 | var hide = __webpack_require__(13);
|
1277 | var PROTOTYPE = 'prototype';
|
1278 |
|
1279 | var $export = function (type, name, source) {
|
1280 | var IS_FORCED = type & $export.F;
|
1281 | var IS_GLOBAL = type & $export.G;
|
1282 | var IS_STATIC = type & $export.S;
|
1283 | var IS_PROTO = type & $export.P;
|
1284 | var IS_BIND = type & $export.B;
|
1285 | var IS_WRAP = type & $export.W;
|
1286 | var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
|
1287 | var expProto = exports[PROTOTYPE];
|
1288 | var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
|
1289 | var key, own, out;
|
1290 | if (IS_GLOBAL) source = name;
|
1291 | for (key in source) {
|
1292 |
|
1293 | own = !IS_FORCED && target && target[key] !== undefined;
|
1294 | if (own && key in exports) continue;
|
1295 |
|
1296 | out = own ? target[key] : source[key];
|
1297 |
|
1298 | exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
|
1299 |
|
1300 | : IS_BIND && own ? ctx(out, global)
|
1301 |
|
1302 | : IS_WRAP && target[key] == out ? (function (C) {
|
1303 | var F = function (a, b, c) {
|
1304 | if (this instanceof C) {
|
1305 | switch (arguments.length) {
|
1306 | case 0: return new C();
|
1307 | case 1: return new C(a);
|
1308 | case 2: return new C(a, b);
|
1309 | } return new C(a, b, c);
|
1310 | } return C.apply(this, arguments);
|
1311 | };
|
1312 | F[PROTOTYPE] = C[PROTOTYPE];
|
1313 | return F;
|
1314 |
|
1315 | })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
|
1316 |
|
1317 | if (IS_PROTO) {
|
1318 | (exports.virtual || (exports.virtual = {}))[key] = out;
|
1319 |
|
1320 | if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
|
1321 | }
|
1322 | }
|
1323 | };
|
1324 |
|
1325 | $export.F = 1;
|
1326 | $export.G = 2;
|
1327 | $export.S = 4;
|
1328 | $export.P = 8;
|
1329 | $export.B = 16;
|
1330 | $export.W = 32;
|
1331 | $export.U = 64;
|
1332 | $export.R = 128;
|
1333 | module.exports = $export;
|
1334 |
|
1335 |
|
1336 | }),
|
1337 |
|
1338 | (function(module, exports) {
|
1339 |
|
1340 |
|
1341 | var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
1342 | ? window : typeof self != 'undefined' && self.Math == Math ? self
|
1343 |
|
1344 | : Function('return this')();
|
1345 | if (typeof __g == 'number') __g = global;
|
1346 |
|
1347 |
|
1348 | }),
|
1349 |
|
1350 | (function(module, exports, __webpack_require__) {
|
1351 |
|
1352 |
|
1353 | var aFunction = __webpack_require__(12);
|
1354 | module.exports = function (fn, that, length) {
|
1355 | aFunction(fn);
|
1356 | if (that === undefined) return fn;
|
1357 | switch (length) {
|
1358 | case 1: return function (a) {
|
1359 | return fn.call(that, a);
|
1360 | };
|
1361 | case 2: return function (a, b) {
|
1362 | return fn.call(that, a, b);
|
1363 | };
|
1364 | case 3: return function (a, b, c) {
|
1365 | return fn.call(that, a, b, c);
|
1366 | };
|
1367 | }
|
1368 | return function (/* ...args */) {
|
1369 | return fn.apply(that, arguments);
|
1370 | };
|
1371 | };
|
1372 |
|
1373 |
|
1374 | }),
|
1375 |
|
1376 | (function(module, exports) {
|
1377 |
|
1378 | module.exports = function (it) {
|
1379 | if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
1380 | return it;
|
1381 | };
|
1382 |
|
1383 |
|
1384 | }),
|
1385 |
|
1386 | (function(module, exports, __webpack_require__) {
|
1387 |
|
1388 | var dP = __webpack_require__(14);
|
1389 | var createDesc = __webpack_require__(22);
|
1390 | module.exports = __webpack_require__(18) ? function (object, key, value) {
|
1391 | return dP.f(object, key, createDesc(1, value));
|
1392 | } : function (object, key, value) {
|
1393 | object[key] = value;
|
1394 | return object;
|
1395 | };
|
1396 |
|
1397 |
|
1398 | }),
|
1399 |
|
1400 | (function(module, exports, __webpack_require__) {
|
1401 |
|
1402 | var anObject = __webpack_require__(15);
|
1403 | var IE8_DOM_DEFINE = __webpack_require__(17);
|
1404 | var toPrimitive = __webpack_require__(21);
|
1405 | var dP = Object.defineProperty;
|
1406 |
|
1407 | exports.f = __webpack_require__(18) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
|
1408 | anObject(O);
|
1409 | P = toPrimitive(P, true);
|
1410 | anObject(Attributes);
|
1411 | if (IE8_DOM_DEFINE) try {
|
1412 | return dP(O, P, Attributes);
|
1413 | } catch (e) { }
|
1414 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
|
1415 | if ('value' in Attributes) O[P] = Attributes.value;
|
1416 | return O;
|
1417 | };
|
1418 |
|
1419 |
|
1420 | }),
|
1421 |
|
1422 | (function(module, exports, __webpack_require__) {
|
1423 |
|
1424 | var isObject = __webpack_require__(16);
|
1425 | module.exports = function (it) {
|
1426 | if (!isObject(it)) throw TypeError(it + ' is not an object!');
|
1427 | return it;
|
1428 | };
|
1429 |
|
1430 |
|
1431 | }),
|
1432 |
|
1433 | (function(module, exports) {
|
1434 |
|
1435 | module.exports = function (it) {
|
1436 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
1437 | };
|
1438 |
|
1439 |
|
1440 | }),
|
1441 |
|
1442 | (function(module, exports, __webpack_require__) {
|
1443 |
|
1444 | module.exports = !__webpack_require__(18) && !__webpack_require__(19)(function () {
|
1445 | return Object.defineProperty(__webpack_require__(20)('div'), 'a', { get: function () { return 7; } }).a != 7;
|
1446 | });
|
1447 |
|
1448 |
|
1449 | }),
|
1450 |
|
1451 | (function(module, exports, __webpack_require__) {
|
1452 |
|
1453 |
|
1454 | module.exports = !__webpack_require__(19)(function () {
|
1455 | return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
1456 | });
|
1457 |
|
1458 |
|
1459 | }),
|
1460 |
|
1461 | (function(module, exports) {
|
1462 |
|
1463 | module.exports = function (exec) {
|
1464 | try {
|
1465 | return !!exec();
|
1466 | } catch (e) {
|
1467 | return true;
|
1468 | }
|
1469 | };
|
1470 |
|
1471 |
|
1472 | }),
|
1473 |
|
1474 | (function(module, exports, __webpack_require__) {
|
1475 |
|
1476 | var isObject = __webpack_require__(16);
|
1477 | var document = __webpack_require__(10).document;
|
1478 |
|
1479 | var is = isObject(document) && isObject(document.createElement);
|
1480 | module.exports = function (it) {
|
1481 | return is ? document.createElement(it) : {};
|
1482 | };
|
1483 |
|
1484 |
|
1485 | }),
|
1486 |
|
1487 | (function(module, exports, __webpack_require__) {
|
1488 |
|
1489 |
|
1490 | var isObject = __webpack_require__(16);
|
1491 |
|
1492 |
|
1493 | module.exports = function (it, S) {
|
1494 | if (!isObject(it)) return it;
|
1495 | var fn, val;
|
1496 | if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
1497 | if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
|
1498 | if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
1499 | throw TypeError("Can't convert object to primitive value");
|
1500 | };
|
1501 |
|
1502 |
|
1503 | }),
|
1504 |
|
1505 | (function(module, exports) {
|
1506 |
|
1507 | module.exports = function (bitmap, value) {
|
1508 | return {
|
1509 | enumerable: !(bitmap & 1),
|
1510 | configurable: !(bitmap & 2),
|
1511 | writable: !(bitmap & 4),
|
1512 | value: value
|
1513 | };
|
1514 | };
|
1515 |
|
1516 |
|
1517 | }),
|
1518 |
|
1519 | (function(module, exports, __webpack_require__) {
|
1520 |
|
1521 | 'use strict';
|
1522 |
|
1523 | var getKeys = __webpack_require__(24);
|
1524 | var gOPS = __webpack_require__(39);
|
1525 | var pIE = __webpack_require__(40);
|
1526 | var toObject = __webpack_require__(41);
|
1527 | var IObject = __webpack_require__(28);
|
1528 | var $assign = Object.assign;
|
1529 |
|
1530 |
|
1531 | module.exports = !$assign || __webpack_require__(19)(function () {
|
1532 | var A = {};
|
1533 | var B = {};
|
1534 |
|
1535 | var S = Symbol();
|
1536 | var K = 'abcdefghijklmnopqrst';
|
1537 | A[S] = 7;
|
1538 | K.split('').forEach(function (k) { B[k] = k; });
|
1539 | return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
|
1540 | }) ? function assign(target, source) {
|
1541 | var T = toObject(target);
|
1542 | var aLen = arguments.length;
|
1543 | var index = 1;
|
1544 | var getSymbols = gOPS.f;
|
1545 | var isEnum = pIE.f;
|
1546 | while (aLen > index) {
|
1547 | var S = IObject(arguments[index++]);
|
1548 | var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
|
1549 | var length = keys.length;
|
1550 | var j = 0;
|
1551 | var key;
|
1552 | while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
|
1553 | } return T;
|
1554 | } : $assign;
|
1555 |
|
1556 |
|
1557 | }),
|
1558 |
|
1559 | (function(module, exports, __webpack_require__) {
|
1560 |
|
1561 |
|
1562 | var $keys = __webpack_require__(25);
|
1563 | var enumBugKeys = __webpack_require__(38);
|
1564 |
|
1565 | module.exports = Object.keys || function keys(O) {
|
1566 | return $keys(O, enumBugKeys);
|
1567 | };
|
1568 |
|
1569 |
|
1570 | }),
|
1571 |
|
1572 | (function(module, exports, __webpack_require__) {
|
1573 |
|
1574 | var has = __webpack_require__(26);
|
1575 | var toIObject = __webpack_require__(27);
|
1576 | var arrayIndexOf = __webpack_require__(31)(false);
|
1577 | var IE_PROTO = __webpack_require__(35)('IE_PROTO');
|
1578 |
|
1579 | module.exports = function (object, names) {
|
1580 | var O = toIObject(object);
|
1581 | var i = 0;
|
1582 | var result = [];
|
1583 | var key;
|
1584 | for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
|
1585 |
|
1586 | while (names.length > i) if (has(O, key = names[i++])) {
|
1587 | ~arrayIndexOf(result, key) || result.push(key);
|
1588 | }
|
1589 | return result;
|
1590 | };
|
1591 |
|
1592 |
|
1593 | }),
|
1594 |
|
1595 | (function(module, exports) {
|
1596 |
|
1597 | var hasOwnProperty = {}.hasOwnProperty;
|
1598 | module.exports = function (it, key) {
|
1599 | return hasOwnProperty.call(it, key);
|
1600 | };
|
1601 |
|
1602 |
|
1603 | }),
|
1604 |
|
1605 | (function(module, exports, __webpack_require__) {
|
1606 |
|
1607 |
|
1608 | var IObject = __webpack_require__(28);
|
1609 | var defined = __webpack_require__(30);
|
1610 | module.exports = function (it) {
|
1611 | return IObject(defined(it));
|
1612 | };
|
1613 |
|
1614 |
|
1615 | }),
|
1616 |
|
1617 | (function(module, exports, __webpack_require__) {
|
1618 |
|
1619 |
|
1620 | var cof = __webpack_require__(29);
|
1621 |
|
1622 | module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
1623 | return cof(it) == 'String' ? it.split('') : Object(it);
|
1624 | };
|
1625 |
|
1626 |
|
1627 | }),
|
1628 |
|
1629 | (function(module, exports) {
|
1630 |
|
1631 | var toString = {}.toString;
|
1632 |
|
1633 | module.exports = function (it) {
|
1634 | return toString.call(it).slice(8, -1);
|
1635 | };
|
1636 |
|
1637 |
|
1638 | }),
|
1639 |
|
1640 | (function(module, exports) {
|
1641 |
|
1642 |
|
1643 | module.exports = function (it) {
|
1644 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
1645 | return it;
|
1646 | };
|
1647 |
|
1648 |
|
1649 | }),
|
1650 |
|
1651 | (function(module, exports, __webpack_require__) {
|
1652 |
|
1653 |
|
1654 |
|
1655 | var toIObject = __webpack_require__(27);
|
1656 | var toLength = __webpack_require__(32);
|
1657 | var toAbsoluteIndex = __webpack_require__(34);
|
1658 | module.exports = function (IS_INCLUDES) {
|
1659 | return function ($this, el, fromIndex) {
|
1660 | var O = toIObject($this);
|
1661 | var length = toLength(O.length);
|
1662 | var index = toAbsoluteIndex(fromIndex, length);
|
1663 | var value;
|
1664 |
|
1665 |
|
1666 | if (IS_INCLUDES && el != el) while (length > index) {
|
1667 | value = O[index++];
|
1668 |
|
1669 | if (value != value) return true;
|
1670 |
|
1671 | } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
1672 | if (O[index] === el) return IS_INCLUDES || index || 0;
|
1673 | } return !IS_INCLUDES && -1;
|
1674 | };
|
1675 | };
|
1676 |
|
1677 |
|
1678 | }),
|
1679 |
|
1680 | (function(module, exports, __webpack_require__) {
|
1681 |
|
1682 |
|
1683 | var toInteger = __webpack_require__(33);
|
1684 | var min = Math.min;
|
1685 | module.exports = function (it) {
|
1686 | return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0;
|
1687 | };
|
1688 |
|
1689 |
|
1690 | }),
|
1691 |
|
1692 | (function(module, exports) {
|
1693 |
|
1694 |
|
1695 | var ceil = Math.ceil;
|
1696 | var floor = Math.floor;
|
1697 | module.exports = function (it) {
|
1698 | return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
1699 | };
|
1700 |
|
1701 |
|
1702 | }),
|
1703 |
|
1704 | (function(module, exports, __webpack_require__) {
|
1705 |
|
1706 | var toInteger = __webpack_require__(33);
|
1707 | var max = Math.max;
|
1708 | var min = Math.min;
|
1709 | module.exports = function (index, length) {
|
1710 | index = toInteger(index);
|
1711 | return index < 0 ? max(index + length, 0) : min(index, length);
|
1712 | };
|
1713 |
|
1714 |
|
1715 | }),
|
1716 |
|
1717 | (function(module, exports, __webpack_require__) {
|
1718 |
|
1719 | var shared = __webpack_require__(36)('keys');
|
1720 | var uid = __webpack_require__(37);
|
1721 | module.exports = function (key) {
|
1722 | return shared[key] || (shared[key] = uid(key));
|
1723 | };
|
1724 |
|
1725 |
|
1726 | }),
|
1727 |
|
1728 | (function(module, exports, __webpack_require__) {
|
1729 |
|
1730 | var global = __webpack_require__(10);
|
1731 | var SHARED = '__core-js_shared__';
|
1732 | var store = global[SHARED] || (global[SHARED] = {});
|
1733 | module.exports = function (key) {
|
1734 | return store[key] || (store[key] = {});
|
1735 | };
|
1736 |
|
1737 |
|
1738 | }),
|
1739 |
|
1740 | (function(module, exports) {
|
1741 |
|
1742 | var id = 0;
|
1743 | var px = Math.random();
|
1744 | module.exports = function (key) {
|
1745 | return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
1746 | };
|
1747 |
|
1748 |
|
1749 | }),
|
1750 |
|
1751 | (function(module, exports) {
|
1752 |
|
1753 |
|
1754 | module.exports = (
|
1755 | 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
1756 | ).split(',');
|
1757 |
|
1758 |
|
1759 | }),
|
1760 |
|
1761 | (function(module, exports) {
|
1762 |
|
1763 | exports.f = Object.getOwnPropertySymbols;
|
1764 |
|
1765 |
|
1766 | }),
|
1767 |
|
1768 | (function(module, exports) {
|
1769 |
|
1770 | exports.f = {}.propertyIsEnumerable;
|
1771 |
|
1772 |
|
1773 | }),
|
1774 |
|
1775 | (function(module, exports, __webpack_require__) {
|
1776 |
|
1777 |
|
1778 | var defined = __webpack_require__(30);
|
1779 | module.exports = function (it) {
|
1780 | return Object(defined(it));
|
1781 | };
|
1782 |
|
1783 |
|
1784 | }),
|
1785 |
|
1786 | (function(module, exports) {
|
1787 |
|
1788 | "use strict";
|
1789 |
|
1790 | exports.__esModule = true;
|
1791 |
|
1792 | exports.default = function (instance, Constructor) {
|
1793 | if (!(instance instanceof Constructor)) {
|
1794 | throw new TypeError("Cannot call a class as a function");
|
1795 | }
|
1796 | };
|
1797 |
|
1798 | }),
|
1799 |
|
1800 | (function(module, exports, __webpack_require__) {
|
1801 |
|
1802 | "use strict";
|
1803 |
|
1804 | exports.__esModule = true;
|
1805 |
|
1806 | var _typeof2 = __webpack_require__(44);
|
1807 |
|
1808 | var _typeof3 = _interopRequireDefault(_typeof2);
|
1809 |
|
1810 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1811 |
|
1812 | exports.default = function (self, call) {
|
1813 | if (!self) {
|
1814 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
1815 | }
|
1816 |
|
1817 | return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
|
1818 | };
|
1819 |
|
1820 | }),
|
1821 |
|
1822 | (function(module, exports, __webpack_require__) {
|
1823 |
|
1824 | "use strict";
|
1825 |
|
1826 | exports.__esModule = true;
|
1827 |
|
1828 | var _iterator = __webpack_require__(45);
|
1829 |
|
1830 | var _iterator2 = _interopRequireDefault(_iterator);
|
1831 |
|
1832 | var _symbol = __webpack_require__(65);
|
1833 |
|
1834 | var _symbol2 = _interopRequireDefault(_symbol);
|
1835 |
|
1836 | var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
|
1837 |
|
1838 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1839 |
|
1840 | exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
|
1841 | return typeof obj === "undefined" ? "undefined" : _typeof(obj);
|
1842 | } : function (obj) {
|
1843 | return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
|
1844 | };
|
1845 |
|
1846 | }),
|
1847 |
|
1848 | (function(module, exports, __webpack_require__) {
|
1849 |
|
1850 | module.exports = { "default": __webpack_require__(46), __esModule: true };
|
1851 |
|
1852 | }),
|
1853 |
|
1854 | (function(module, exports, __webpack_require__) {
|
1855 |
|
1856 | __webpack_require__(47);
|
1857 | __webpack_require__(60);
|
1858 | module.exports = __webpack_require__(64).f('iterator');
|
1859 |
|
1860 |
|
1861 | }),
|
1862 |
|
1863 | (function(module, exports, __webpack_require__) {
|
1864 |
|
1865 | 'use strict';
|
1866 | var $at = __webpack_require__(48)(true);
|
1867 |
|
1868 |
|
1869 | __webpack_require__(49)(String, 'String', function (iterated) {
|
1870 | this._t = String(iterated);
|
1871 | this._i = 0;
|
1872 |
|
1873 | }, function () {
|
1874 | var O = this._t;
|
1875 | var index = this._i;
|
1876 | var point;
|
1877 | if (index >= O.length) return { value: undefined, done: true };
|
1878 | point = $at(O, index);
|
1879 | this._i += point.length;
|
1880 | return { value: point, done: false };
|
1881 | });
|
1882 |
|
1883 |
|
1884 | }),
|
1885 |
|
1886 | (function(module, exports, __webpack_require__) {
|
1887 |
|
1888 | var toInteger = __webpack_require__(33);
|
1889 | var defined = __webpack_require__(30);
|
1890 |
|
1891 |
|
1892 | module.exports = function (TO_STRING) {
|
1893 | return function (that, pos) {
|
1894 | var s = String(defined(that));
|
1895 | var i = toInteger(pos);
|
1896 | var l = s.length;
|
1897 | var a, b;
|
1898 | if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
|
1899 | a = s.charCodeAt(i);
|
1900 | return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
|
1901 | ? TO_STRING ? s.charAt(i) : a
|
1902 | : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
|
1903 | };
|
1904 | };
|
1905 |
|
1906 |
|
1907 | }),
|
1908 |
|
1909 | (function(module, exports, __webpack_require__) {
|
1910 |
|
1911 | 'use strict';
|
1912 | var LIBRARY = __webpack_require__(50);
|
1913 | var $export = __webpack_require__(9);
|
1914 | var redefine = __webpack_require__(51);
|
1915 | var hide = __webpack_require__(13);
|
1916 | var has = __webpack_require__(26);
|
1917 | var Iterators = __webpack_require__(52);
|
1918 | var $iterCreate = __webpack_require__(53);
|
1919 | var setToStringTag = __webpack_require__(57);
|
1920 | var getPrototypeOf = __webpack_require__(59);
|
1921 | var ITERATOR = __webpack_require__(58)('iterator');
|
1922 | var BUGGY = !([].keys && 'next' in [].keys());
|
1923 | var FF_ITERATOR = '@@iterator';
|
1924 | var KEYS = 'keys';
|
1925 | var VALUES = 'values';
|
1926 |
|
1927 | var returnThis = function () { return this; };
|
1928 |
|
1929 | module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
|
1930 | $iterCreate(Constructor, NAME, next);
|
1931 | var getMethod = function (kind) {
|
1932 | if (!BUGGY && kind in proto) return proto[kind];
|
1933 | switch (kind) {
|
1934 | case KEYS: return function keys() { return new Constructor(this, kind); };
|
1935 | case VALUES: return function values() { return new Constructor(this, kind); };
|
1936 | } return function entries() { return new Constructor(this, kind); };
|
1937 | };
|
1938 | var TAG = NAME + ' Iterator';
|
1939 | var DEF_VALUES = DEFAULT == VALUES;
|
1940 | var VALUES_BUG = false;
|
1941 | var proto = Base.prototype;
|
1942 | var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
|
1943 | var $default = (!BUGGY && $native) || getMethod(DEFAULT);
|
1944 | var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
|
1945 | var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
|
1946 | var methods, key, IteratorPrototype;
|
1947 |
|
1948 | if ($anyNative) {
|
1949 | IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
|
1950 | if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
|
1951 |
|
1952 | setToStringTag(IteratorPrototype, TAG, true);
|
1953 |
|
1954 | if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
|
1955 | }
|
1956 | }
|
1957 |
|
1958 | if (DEF_VALUES && $native && $native.name !== VALUES) {
|
1959 | VALUES_BUG = true;
|
1960 | $default = function values() { return $native.call(this); };
|
1961 | }
|
1962 |
|
1963 | if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
|
1964 | hide(proto, ITERATOR, $default);
|
1965 | }
|
1966 |
|
1967 | Iterators[NAME] = $default;
|
1968 | Iterators[TAG] = returnThis;
|
1969 | if (DEFAULT) {
|
1970 | methods = {
|
1971 | values: DEF_VALUES ? $default : getMethod(VALUES),
|
1972 | keys: IS_SET ? $default : getMethod(KEYS),
|
1973 | entries: $entries
|
1974 | };
|
1975 | if (FORCED) for (key in methods) {
|
1976 | if (!(key in proto)) redefine(proto, key, methods[key]);
|
1977 | } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
|
1978 | }
|
1979 | return methods;
|
1980 | };
|
1981 |
|
1982 |
|
1983 | }),
|
1984 |
|
1985 | (function(module, exports) {
|
1986 |
|
1987 | module.exports = true;
|
1988 |
|
1989 |
|
1990 | }),
|
1991 |
|
1992 | (function(module, exports, __webpack_require__) {
|
1993 |
|
1994 | module.exports = __webpack_require__(13);
|
1995 |
|
1996 |
|
1997 | }),
|
1998 |
|
1999 | (function(module, exports) {
|
2000 |
|
2001 | module.exports = {};
|
2002 |
|
2003 |
|
2004 | }),
|
2005 |
|
2006 | (function(module, exports, __webpack_require__) {
|
2007 |
|
2008 | 'use strict';
|
2009 | var create = __webpack_require__(54);
|
2010 | var descriptor = __webpack_require__(22);
|
2011 | var setToStringTag = __webpack_require__(57);
|
2012 | var IteratorPrototype = {};
|
2013 |
|
2014 |
|
2015 | __webpack_require__(13)(IteratorPrototype, __webpack_require__(58)('iterator'), function () { return this; });
|
2016 |
|
2017 | module.exports = function (Constructor, NAME, next) {
|
2018 | Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
|
2019 | setToStringTag(Constructor, NAME + ' Iterator');
|
2020 | };
|
2021 |
|
2022 |
|
2023 | }),
|
2024 |
|
2025 | (function(module, exports, __webpack_require__) {
|
2026 |
|
2027 |
|
2028 | var anObject = __webpack_require__(15);
|
2029 | var dPs = __webpack_require__(55);
|
2030 | var enumBugKeys = __webpack_require__(38);
|
2031 | var IE_PROTO = __webpack_require__(35)('IE_PROTO');
|
2032 | var Empty = function () { };
|
2033 | var PROTOTYPE = 'prototype';
|
2034 |
|
2035 |
|
2036 | var createDict = function () {
|
2037 |
|
2038 | var iframe = __webpack_require__(20)('iframe');
|
2039 | var i = enumBugKeys.length;
|
2040 | var lt = '<';
|
2041 | var gt = '>';
|
2042 | var iframeDocument;
|
2043 | iframe.style.display = 'none';
|
2044 | __webpack_require__(56).appendChild(iframe);
|
2045 | iframe.src = 'javascript:';
|
2046 |
|
2047 |
|
2048 | iframeDocument = iframe.contentWindow.document;
|
2049 | iframeDocument.open();
|
2050 | iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
2051 | iframeDocument.close();
|
2052 | createDict = iframeDocument.F;
|
2053 | while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
|
2054 | return createDict();
|
2055 | };
|
2056 |
|
2057 | module.exports = Object.create || function create(O, Properties) {
|
2058 | var result;
|
2059 | if (O !== null) {
|
2060 | Empty[PROTOTYPE] = anObject(O);
|
2061 | result = new Empty();
|
2062 | Empty[PROTOTYPE] = null;
|
2063 |
|
2064 | result[IE_PROTO] = O;
|
2065 | } else result = createDict();
|
2066 | return Properties === undefined ? result : dPs(result, Properties);
|
2067 | };
|
2068 |
|
2069 |
|
2070 | }),
|
2071 |
|
2072 | (function(module, exports, __webpack_require__) {
|
2073 |
|
2074 | var dP = __webpack_require__(14);
|
2075 | var anObject = __webpack_require__(15);
|
2076 | var getKeys = __webpack_require__(24);
|
2077 |
|
2078 | module.exports = __webpack_require__(18) ? Object.defineProperties : function defineProperties(O, Properties) {
|
2079 | anObject(O);
|
2080 | var keys = getKeys(Properties);
|
2081 | var length = keys.length;
|
2082 | var i = 0;
|
2083 | var P;
|
2084 | while (length > i) dP.f(O, P = keys[i++], Properties[P]);
|
2085 | return O;
|
2086 | };
|
2087 |
|
2088 |
|
2089 | }),
|
2090 |
|
2091 | (function(module, exports, __webpack_require__) {
|
2092 |
|
2093 | var document = __webpack_require__(10).document;
|
2094 | module.exports = document && document.documentElement;
|
2095 |
|
2096 |
|
2097 | }),
|
2098 |
|
2099 | (function(module, exports, __webpack_require__) {
|
2100 |
|
2101 | var def = __webpack_require__(14).f;
|
2102 | var has = __webpack_require__(26);
|
2103 | var TAG = __webpack_require__(58)('toStringTag');
|
2104 |
|
2105 | module.exports = function (it, tag, stat) {
|
2106 | if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
|
2107 | };
|
2108 |
|
2109 |
|
2110 | }),
|
2111 |
|
2112 | (function(module, exports, __webpack_require__) {
|
2113 |
|
2114 | var store = __webpack_require__(36)('wks');
|
2115 | var uid = __webpack_require__(37);
|
2116 | var Symbol = __webpack_require__(10).Symbol;
|
2117 | var USE_SYMBOL = typeof Symbol == 'function';
|
2118 |
|
2119 | var $exports = module.exports = function (name) {
|
2120 | return store[name] || (store[name] =
|
2121 | USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
|
2122 | };
|
2123 |
|
2124 | $exports.store = store;
|
2125 |
|
2126 |
|
2127 | }),
|
2128 |
|
2129 | (function(module, exports, __webpack_require__) {
|
2130 |
|
2131 |
|
2132 | var has = __webpack_require__(26);
|
2133 | var toObject = __webpack_require__(41);
|
2134 | var IE_PROTO = __webpack_require__(35)('IE_PROTO');
|
2135 | var ObjectProto = Object.prototype;
|
2136 |
|
2137 | module.exports = Object.getPrototypeOf || function (O) {
|
2138 | O = toObject(O);
|
2139 | if (has(O, IE_PROTO)) return O[IE_PROTO];
|
2140 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
2141 | return O.constructor.prototype;
|
2142 | } return O instanceof Object ? ObjectProto : null;
|
2143 | };
|
2144 |
|
2145 |
|
2146 | }),
|
2147 |
|
2148 | (function(module, exports, __webpack_require__) {
|
2149 |
|
2150 | __webpack_require__(61);
|
2151 | var global = __webpack_require__(10);
|
2152 | var hide = __webpack_require__(13);
|
2153 | var Iterators = __webpack_require__(52);
|
2154 | var TO_STRING_TAG = __webpack_require__(58)('toStringTag');
|
2155 |
|
2156 | var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
|
2157 | 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
|
2158 | 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
|
2159 | 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
|
2160 | 'TextTrackList,TouchList').split(',');
|
2161 |
|
2162 | for (var i = 0; i < DOMIterables.length; i++) {
|
2163 | var NAME = DOMIterables[i];
|
2164 | var Collection = global[NAME];
|
2165 | var proto = Collection && Collection.prototype;
|
2166 | if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
|
2167 | Iterators[NAME] = Iterators.Array;
|
2168 | }
|
2169 |
|
2170 |
|
2171 | }),
|
2172 |
|
2173 | (function(module, exports, __webpack_require__) {
|
2174 |
|
2175 | 'use strict';
|
2176 | var addToUnscopables = __webpack_require__(62);
|
2177 | var step = __webpack_require__(63);
|
2178 | var Iterators = __webpack_require__(52);
|
2179 | var toIObject = __webpack_require__(27);
|
2180 |
|
2181 |
|
2182 |
|
2183 |
|
2184 |
|
2185 | module.exports = __webpack_require__(49)(Array, 'Array', function (iterated, kind) {
|
2186 | this._t = toIObject(iterated);
|
2187 | this._i = 0;
|
2188 | this._k = kind;
|
2189 |
|
2190 | }, function () {
|
2191 | var O = this._t;
|
2192 | var kind = this._k;
|
2193 | var index = this._i++;
|
2194 | if (!O || index >= O.length) {
|
2195 | this._t = undefined;
|
2196 | return step(1);
|
2197 | }
|
2198 | if (kind == 'keys') return step(0, index);
|
2199 | if (kind == 'values') return step(0, O[index]);
|
2200 | return step(0, [index, O[index]]);
|
2201 | }, 'values');
|
2202 |
|
2203 |
|
2204 | Iterators.Arguments = Iterators.Array;
|
2205 |
|
2206 | addToUnscopables('keys');
|
2207 | addToUnscopables('values');
|
2208 | addToUnscopables('entries');
|
2209 |
|
2210 |
|
2211 | }),
|
2212 |
|
2213 | (function(module, exports) {
|
2214 |
|
2215 | module.exports = function () { };
|
2216 |
|
2217 |
|
2218 | }),
|
2219 |
|
2220 | (function(module, exports) {
|
2221 |
|
2222 | module.exports = function (done, value) {
|
2223 | return { value: value, done: !!done };
|
2224 | };
|
2225 |
|
2226 |
|
2227 | }),
|
2228 |
|
2229 | (function(module, exports, __webpack_require__) {
|
2230 |
|
2231 | exports.f = __webpack_require__(58);
|
2232 |
|
2233 |
|
2234 | }),
|
2235 |
|
2236 | (function(module, exports, __webpack_require__) {
|
2237 |
|
2238 | module.exports = { "default": __webpack_require__(66), __esModule: true };
|
2239 |
|
2240 | }),
|
2241 |
|
2242 | (function(module, exports, __webpack_require__) {
|
2243 |
|
2244 | __webpack_require__(67);
|
2245 | __webpack_require__(75);
|
2246 | __webpack_require__(76);
|
2247 | __webpack_require__(77);
|
2248 | module.exports = __webpack_require__(4).Symbol;
|
2249 |
|
2250 |
|
2251 | }),
|
2252 |
|
2253 | (function(module, exports, __webpack_require__) {
|
2254 |
|
2255 | 'use strict';
|
2256 |
|
2257 | var global = __webpack_require__(10);
|
2258 | var has = __webpack_require__(26);
|
2259 | var DESCRIPTORS = __webpack_require__(18);
|
2260 | var $export = __webpack_require__(9);
|
2261 | var redefine = __webpack_require__(51);
|
2262 | var META = __webpack_require__(68).KEY;
|
2263 | var $fails = __webpack_require__(19);
|
2264 | var shared = __webpack_require__(36);
|
2265 | var setToStringTag = __webpack_require__(57);
|
2266 | var uid = __webpack_require__(37);
|
2267 | var wks = __webpack_require__(58);
|
2268 | var wksExt = __webpack_require__(64);
|
2269 | var wksDefine = __webpack_require__(69);
|
2270 | var enumKeys = __webpack_require__(70);
|
2271 | var isArray = __webpack_require__(71);
|
2272 | var anObject = __webpack_require__(15);
|
2273 | var isObject = __webpack_require__(16);
|
2274 | var toIObject = __webpack_require__(27);
|
2275 | var toPrimitive = __webpack_require__(21);
|
2276 | var createDesc = __webpack_require__(22);
|
2277 | var _create = __webpack_require__(54);
|
2278 | var gOPNExt = __webpack_require__(72);
|
2279 | var $GOPD = __webpack_require__(74);
|
2280 | var $DP = __webpack_require__(14);
|
2281 | var $keys = __webpack_require__(24);
|
2282 | var gOPD = $GOPD.f;
|
2283 | var dP = $DP.f;
|
2284 | var gOPN = gOPNExt.f;
|
2285 | var $Symbol = global.Symbol;
|
2286 | var $JSON = global.JSON;
|
2287 | var _stringify = $JSON && $JSON.stringify;
|
2288 | var PROTOTYPE = 'prototype';
|
2289 | var HIDDEN = wks('_hidden');
|
2290 | var TO_PRIMITIVE = wks('toPrimitive');
|
2291 | var isEnum = {}.propertyIsEnumerable;
|
2292 | var SymbolRegistry = shared('symbol-registry');
|
2293 | var AllSymbols = shared('symbols');
|
2294 | var OPSymbols = shared('op-symbols');
|
2295 | var ObjectProto = Object[PROTOTYPE];
|
2296 | var USE_NATIVE = typeof $Symbol == 'function';
|
2297 | var QObject = global.QObject;
|
2298 |
|
2299 | var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
2300 |
|
2301 |
|
2302 | var setSymbolDesc = DESCRIPTORS && $fails(function () {
|
2303 | return _create(dP({}, 'a', {
|
2304 | get: function () { return dP(this, 'a', { value: 7 }).a; }
|
2305 | })).a != 7;
|
2306 | }) ? function (it, key, D) {
|
2307 | var protoDesc = gOPD(ObjectProto, key);
|
2308 | if (protoDesc) delete ObjectProto[key];
|
2309 | dP(it, key, D);
|
2310 | if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
|
2311 | } : dP;
|
2312 |
|
2313 | var wrap = function (tag) {
|
2314 | var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
|
2315 | sym._k = tag;
|
2316 | return sym;
|
2317 | };
|
2318 |
|
2319 | var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
|
2320 | return typeof it == 'symbol';
|
2321 | } : function (it) {
|
2322 | return it instanceof $Symbol;
|
2323 | };
|
2324 |
|
2325 | var $defineProperty = function defineProperty(it, key, D) {
|
2326 | if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
|
2327 | anObject(it);
|
2328 | key = toPrimitive(key, true);
|
2329 | anObject(D);
|
2330 | if (has(AllSymbols, key)) {
|
2331 | if (!D.enumerable) {
|
2332 | if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
|
2333 | it[HIDDEN][key] = true;
|
2334 | } else {
|
2335 | if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
|
2336 | D = _create(D, { enumerable: createDesc(0, false) });
|
2337 | } return setSymbolDesc(it, key, D);
|
2338 | } return dP(it, key, D);
|
2339 | };
|
2340 | var $defineProperties = function defineProperties(it, P) {
|
2341 | anObject(it);
|
2342 | var keys = enumKeys(P = toIObject(P));
|
2343 | var i = 0;
|
2344 | var l = keys.length;
|
2345 | var key;
|
2346 | while (l > i) $defineProperty(it, key = keys[i++], P[key]);
|
2347 | return it;
|
2348 | };
|
2349 | var $create = function create(it, P) {
|
2350 | return P === undefined ? _create(it) : $defineProperties(_create(it), P);
|
2351 | };
|
2352 | var $propertyIsEnumerable = function propertyIsEnumerable(key) {
|
2353 | var E = isEnum.call(this, key = toPrimitive(key, true));
|
2354 | if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
|
2355 | return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
|
2356 | };
|
2357 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
|
2358 | it = toIObject(it);
|
2359 | key = toPrimitive(key, true);
|
2360 | if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
|
2361 | var D = gOPD(it, key);
|
2362 | if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
|
2363 | return D;
|
2364 | };
|
2365 | var $getOwnPropertyNames = function getOwnPropertyNames(it) {
|
2366 | var names = gOPN(toIObject(it));
|
2367 | var result = [];
|
2368 | var i = 0;
|
2369 | var key;
|
2370 | while (names.length > i) {
|
2371 | if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
|
2372 | } return result;
|
2373 | };
|
2374 | var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
|
2375 | var IS_OP = it === ObjectProto;
|
2376 | var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
|
2377 | var result = [];
|
2378 | var i = 0;
|
2379 | var key;
|
2380 | while (names.length > i) {
|
2381 | if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
|
2382 | } return result;
|
2383 | };
|
2384 |
|
2385 |
|
2386 | if (!USE_NATIVE) {
|
2387 | $Symbol = function Symbol() {
|
2388 | if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
|
2389 | var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
|
2390 | var $set = function (value) {
|
2391 | if (this === ObjectProto) $set.call(OPSymbols, value);
|
2392 | if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
2393 | setSymbolDesc(this, tag, createDesc(1, value));
|
2394 | };
|
2395 | if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
|
2396 | return wrap(tag);
|
2397 | };
|
2398 | redefine($Symbol[PROTOTYPE], 'toString', function toString() {
|
2399 | return this._k;
|
2400 | });
|
2401 |
|
2402 | $GOPD.f = $getOwnPropertyDescriptor;
|
2403 | $DP.f = $defineProperty;
|
2404 | __webpack_require__(73).f = gOPNExt.f = $getOwnPropertyNames;
|
2405 | __webpack_require__(40).f = $propertyIsEnumerable;
|
2406 | __webpack_require__(39).f = $getOwnPropertySymbols;
|
2407 |
|
2408 | if (DESCRIPTORS && !__webpack_require__(50)) {
|
2409 | redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
|
2410 | }
|
2411 |
|
2412 | wksExt.f = function (name) {
|
2413 | return wrap(wks(name));
|
2414 | };
|
2415 | }
|
2416 |
|
2417 | $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
|
2418 |
|
2419 | for (var es6Symbols = (
|
2420 |
|
2421 | 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
|
2422 | ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
|
2423 |
|
2424 | for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
|
2425 |
|
2426 | $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
|
2427 |
|
2428 | 'for': function (key) {
|
2429 | return has(SymbolRegistry, key += '')
|
2430 | ? SymbolRegistry[key]
|
2431 | : SymbolRegistry[key] = $Symbol(key);
|
2432 | },
|
2433 |
|
2434 | keyFor: function keyFor(sym) {
|
2435 | if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
|
2436 | for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
|
2437 | },
|
2438 | useSetter: function () { setter = true; },
|
2439 | useSimple: function () { setter = false; }
|
2440 | });
|
2441 |
|
2442 | $export($export.S + $export.F * !USE_NATIVE, 'Object', {
|
2443 |
|
2444 | create: $create,
|
2445 |
|
2446 | defineProperty: $defineProperty,
|
2447 |
|
2448 | defineProperties: $defineProperties,
|
2449 |
|
2450 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
|
2451 |
|
2452 | getOwnPropertyNames: $getOwnPropertyNames,
|
2453 |
|
2454 | getOwnPropertySymbols: $getOwnPropertySymbols
|
2455 | });
|
2456 |
|
2457 |
|
2458 | $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
|
2459 | var S = $Symbol();
|
2460 |
|
2461 |
|
2462 |
|
2463 | return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
|
2464 | })), 'JSON', {
|
2465 | stringify: function stringify(it) {
|
2466 | var args = [it];
|
2467 | var i = 1;
|
2468 | var replacer, $replacer;
|
2469 | while (arguments.length > i) args.push(arguments[i++]);
|
2470 | $replacer = replacer = args[1];
|
2471 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
2472 | if (!isArray(replacer)) replacer = function (key, value) {
|
2473 | if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
2474 | if (!isSymbol(value)) return value;
|
2475 | };
|
2476 | args[1] = replacer;
|
2477 | return _stringify.apply($JSON, args);
|
2478 | }
|
2479 | });
|
2480 |
|
2481 |
|
2482 | $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(13)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
|
2483 |
|
2484 | setToStringTag($Symbol, 'Symbol');
|
2485 |
|
2486 | setToStringTag(Math, 'Math', true);
|
2487 |
|
2488 | setToStringTag(global.JSON, 'JSON', true);
|
2489 |
|
2490 |
|
2491 | }),
|
2492 |
|
2493 | (function(module, exports, __webpack_require__) {
|
2494 |
|
2495 | var META = __webpack_require__(37)('meta');
|
2496 | var isObject = __webpack_require__(16);
|
2497 | var has = __webpack_require__(26);
|
2498 | var setDesc = __webpack_require__(14).f;
|
2499 | var id = 0;
|
2500 | var isExtensible = Object.isExtensible || function () {
|
2501 | return true;
|
2502 | };
|
2503 | var FREEZE = !__webpack_require__(19)(function () {
|
2504 | return isExtensible(Object.preventExtensions({}));
|
2505 | });
|
2506 | var setMeta = function (it) {
|
2507 | setDesc(it, META, { value: {
|
2508 | i: 'O' + ++id,
|
2509 | w: {}
|
2510 | } });
|
2511 | };
|
2512 | var fastKey = function (it, create) {
|
2513 |
|
2514 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
2515 | if (!has(it, META)) {
|
2516 |
|
2517 | if (!isExtensible(it)) return 'F';
|
2518 |
|
2519 | if (!create) return 'E';
|
2520 |
|
2521 | setMeta(it);
|
2522 |
|
2523 | } return it[META].i;
|
2524 | };
|
2525 | var getWeak = function (it, create) {
|
2526 | if (!has(it, META)) {
|
2527 |
|
2528 | if (!isExtensible(it)) return true;
|
2529 |
|
2530 | if (!create) return false;
|
2531 |
|
2532 | setMeta(it);
|
2533 |
|
2534 | } return it[META].w;
|
2535 | };
|
2536 |
|
2537 | var onFreeze = function (it) {
|
2538 | if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
|
2539 | return it;
|
2540 | };
|
2541 | var meta = module.exports = {
|
2542 | KEY: META,
|
2543 | NEED: false,
|
2544 | fastKey: fastKey,
|
2545 | getWeak: getWeak,
|
2546 | onFreeze: onFreeze
|
2547 | };
|
2548 |
|
2549 |
|
2550 | }),
|
2551 |
|
2552 | (function(module, exports, __webpack_require__) {
|
2553 |
|
2554 | var global = __webpack_require__(10);
|
2555 | var core = __webpack_require__(4);
|
2556 | var LIBRARY = __webpack_require__(50);
|
2557 | var wksExt = __webpack_require__(64);
|
2558 | var defineProperty = __webpack_require__(14).f;
|
2559 | module.exports = function (name) {
|
2560 | var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
|
2561 | if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
|
2562 | };
|
2563 |
|
2564 |
|
2565 | }),
|
2566 |
|
2567 | (function(module, exports, __webpack_require__) {
|
2568 |
|
2569 |
|
2570 | var getKeys = __webpack_require__(24);
|
2571 | var gOPS = __webpack_require__(39);
|
2572 | var pIE = __webpack_require__(40);
|
2573 | module.exports = function (it) {
|
2574 | var result = getKeys(it);
|
2575 | var getSymbols = gOPS.f;
|
2576 | if (getSymbols) {
|
2577 | var symbols = getSymbols(it);
|
2578 | var isEnum = pIE.f;
|
2579 | var i = 0;
|
2580 | var key;
|
2581 | while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
|
2582 | } return result;
|
2583 | };
|
2584 |
|
2585 |
|
2586 | }),
|
2587 |
|
2588 | (function(module, exports, __webpack_require__) {
|
2589 |
|
2590 |
|
2591 | var cof = __webpack_require__(29);
|
2592 | module.exports = Array.isArray || function isArray(arg) {
|
2593 | return cof(arg) == 'Array';
|
2594 | };
|
2595 |
|
2596 |
|
2597 | }),
|
2598 |
|
2599 | (function(module, exports, __webpack_require__) {
|
2600 |
|
2601 |
|
2602 | var toIObject = __webpack_require__(27);
|
2603 | var gOPN = __webpack_require__(73).f;
|
2604 | var toString = {}.toString;
|
2605 |
|
2606 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
2607 | ? Object.getOwnPropertyNames(window) : [];
|
2608 |
|
2609 | var getWindowNames = function (it) {
|
2610 | try {
|
2611 | return gOPN(it);
|
2612 | } catch (e) {
|
2613 | return windowNames.slice();
|
2614 | }
|
2615 | };
|
2616 |
|
2617 | module.exports.f = function getOwnPropertyNames(it) {
|
2618 | return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
|
2619 | };
|
2620 |
|
2621 |
|
2622 | }),
|
2623 |
|
2624 | (function(module, exports, __webpack_require__) {
|
2625 |
|
2626 |
|
2627 | var $keys = __webpack_require__(25);
|
2628 | var hiddenKeys = __webpack_require__(38).concat('length', 'prototype');
|
2629 |
|
2630 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
2631 | return $keys(O, hiddenKeys);
|
2632 | };
|
2633 |
|
2634 |
|
2635 | }),
|
2636 |
|
2637 | (function(module, exports, __webpack_require__) {
|
2638 |
|
2639 | var pIE = __webpack_require__(40);
|
2640 | var createDesc = __webpack_require__(22);
|
2641 | var toIObject = __webpack_require__(27);
|
2642 | var toPrimitive = __webpack_require__(21);
|
2643 | var has = __webpack_require__(26);
|
2644 | var IE8_DOM_DEFINE = __webpack_require__(17);
|
2645 | var gOPD = Object.getOwnPropertyDescriptor;
|
2646 |
|
2647 | exports.f = __webpack_require__(18) ? gOPD : function getOwnPropertyDescriptor(O, P) {
|
2648 | O = toIObject(O);
|
2649 | P = toPrimitive(P, true);
|
2650 | if (IE8_DOM_DEFINE) try {
|
2651 | return gOPD(O, P);
|
2652 | } catch (e) { }
|
2653 | if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
|
2654 | };
|
2655 |
|
2656 |
|
2657 | }),
|
2658 |
|
2659 | (function(module, exports) {
|
2660 |
|
2661 |
|
2662 |
|
2663 | }),
|
2664 |
|
2665 | (function(module, exports, __webpack_require__) {
|
2666 |
|
2667 | __webpack_require__(69)('asyncIterator');
|
2668 |
|
2669 |
|
2670 | }),
|
2671 |
|
2672 | (function(module, exports, __webpack_require__) {
|
2673 |
|
2674 | __webpack_require__(69)('observable');
|
2675 |
|
2676 |
|
2677 | }),
|
2678 |
|
2679 | (function(module, exports, __webpack_require__) {
|
2680 |
|
2681 | "use strict";
|
2682 |
|
2683 | exports.__esModule = true;
|
2684 |
|
2685 | var _setPrototypeOf = __webpack_require__(79);
|
2686 |
|
2687 | var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
|
2688 |
|
2689 | var _create = __webpack_require__(83);
|
2690 |
|
2691 | var _create2 = _interopRequireDefault(_create);
|
2692 |
|
2693 | var _typeof2 = __webpack_require__(44);
|
2694 |
|
2695 | var _typeof3 = _interopRequireDefault(_typeof2);
|
2696 |
|
2697 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2698 |
|
2699 | exports.default = function (subClass, superClass) {
|
2700 | if (typeof superClass !== "function" && superClass !== null) {
|
2701 | throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
|
2702 | }
|
2703 |
|
2704 | subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
|
2705 | constructor: {
|
2706 | value: subClass,
|
2707 | enumerable: false,
|
2708 | writable: true,
|
2709 | configurable: true
|
2710 | }
|
2711 | });
|
2712 | if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
|
2713 | };
|
2714 |
|
2715 | }),
|
2716 |
|
2717 | (function(module, exports, __webpack_require__) {
|
2718 |
|
2719 | module.exports = { "default": __webpack_require__(80), __esModule: true };
|
2720 |
|
2721 | }),
|
2722 |
|
2723 | (function(module, exports, __webpack_require__) {
|
2724 |
|
2725 | __webpack_require__(81);
|
2726 | module.exports = __webpack_require__(4).Object.setPrototypeOf;
|
2727 |
|
2728 |
|
2729 | }),
|
2730 |
|
2731 | (function(module, exports, __webpack_require__) {
|
2732 |
|
2733 |
|
2734 | var $export = __webpack_require__(9);
|
2735 | $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(82).set });
|
2736 |
|
2737 |
|
2738 | }),
|
2739 |
|
2740 | (function(module, exports, __webpack_require__) {
|
2741 |
|
2742 |
|
2743 |
|
2744 | var isObject = __webpack_require__(16);
|
2745 | var anObject = __webpack_require__(15);
|
2746 | var check = function (O, proto) {
|
2747 | anObject(O);
|
2748 | if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
|
2749 | };
|
2750 | module.exports = {
|
2751 | set: Object.setPrototypeOf || ('__proto__' in {} ?
|
2752 | function (test, buggy, set) {
|
2753 | try {
|
2754 | set = __webpack_require__(11)(Function.call, __webpack_require__(74).f(Object.prototype, '__proto__').set, 2);
|
2755 | set(test, []);
|
2756 | buggy = !(test instanceof Array);
|
2757 | } catch (e) { buggy = true; }
|
2758 | return function setPrototypeOf(O, proto) {
|
2759 | check(O, proto);
|
2760 | if (buggy) O.__proto__ = proto;
|
2761 | else set(O, proto);
|
2762 | return O;
|
2763 | };
|
2764 | }({}, false) : undefined),
|
2765 | check: check
|
2766 | };
|
2767 |
|
2768 |
|
2769 | }),
|
2770 |
|
2771 | (function(module, exports, __webpack_require__) {
|
2772 |
|
2773 | module.exports = { "default": __webpack_require__(84), __esModule: true };
|
2774 |
|
2775 | }),
|
2776 |
|
2777 | (function(module, exports, __webpack_require__) {
|
2778 |
|
2779 | __webpack_require__(85);
|
2780 | var $Object = __webpack_require__(4).Object;
|
2781 | module.exports = function create(P, D) {
|
2782 | return $Object.create(P, D);
|
2783 | };
|
2784 |
|
2785 |
|
2786 | }),
|
2787 |
|
2788 | (function(module, exports, __webpack_require__) {
|
2789 |
|
2790 | var $export = __webpack_require__(9);
|
2791 |
|
2792 | $export($export.S, 'Object', { create: __webpack_require__(54) });
|
2793 |
|
2794 |
|
2795 | }),
|
2796 |
|
2797 | (function(module, exports, __webpack_require__) {
|
2798 |
|
2799 | 'use strict';
|
2800 |
|
2801 | module.exports = __webpack_require__(87);
|
2802 |
|
2803 |
|
2804 | }),
|
2805 |
|
2806 | (function(module, exports, __webpack_require__) {
|
2807 |
|
2808 | |
2809 |
|
2810 |
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 |
|
2819 | 'use strict';
|
2820 |
|
2821 | var ReactDOM = __webpack_require__(88);
|
2822 | var ReactDOMServer = __webpack_require__(233);
|
2823 | var ReactIsomorphic = __webpack_require__(237);
|
2824 |
|
2825 | var assign = __webpack_require__(124);
|
2826 | var deprecated = __webpack_require__(242);
|
2827 |
|
2828 |
|
2829 | var React = {};
|
2830 |
|
2831 | assign(React, ReactIsomorphic);
|
2832 |
|
2833 | assign(React, {
|
2834 |
|
2835 | findDOMNode: deprecated('findDOMNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.findDOMNode),
|
2836 | render: deprecated('render', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.render),
|
2837 | unmountComponentAtNode: deprecated('unmountComponentAtNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.unmountComponentAtNode),
|
2838 |
|
2839 |
|
2840 | renderToString: deprecated('renderToString', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToString),
|
2841 | renderToStaticMarkup: deprecated('renderToStaticMarkup', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToStaticMarkup)
|
2842 | });
|
2843 |
|
2844 | React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM;
|
2845 | React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMServer;
|
2846 |
|
2847 | module.exports = React;
|
2848 |
|
2849 | }),
|
2850 |
|
2851 | (function(module, exports, __webpack_require__) {
|
2852 |
|
2853 | (function(process) { |
2854 |
|
2855 |
|
2856 |
|
2857 |
|
2858 |
|
2859 |
|
2860 |
|
2861 |
|
2862 |
|
2863 |
|
2864 |
|
2865 |
|
2866 | 'use strict';
|
2867 |
|
2868 | var ReactCurrentOwner = __webpack_require__(90);
|
2869 | var ReactDOMTextComponent = __webpack_require__(91);
|
2870 | var ReactDefaultInjection = __webpack_require__(156);
|
2871 | var ReactInstanceHandles = __webpack_require__(130);
|
2872 | var ReactMount = __webpack_require__(113);
|
2873 | var ReactPerf = __webpack_require__(103);
|
2874 | var ReactReconciler = __webpack_require__(135);
|
2875 | var ReactUpdates = __webpack_require__(139);
|
2876 | var ReactVersion = __webpack_require__(231);
|
2877 |
|
2878 | var findDOMNode = __webpack_require__(176);
|
2879 | var renderSubtreeIntoContainer = __webpack_require__(232);
|
2880 | var warning = __webpack_require__(110);
|
2881 |
|
2882 | ReactDefaultInjection.inject();
|
2883 |
|
2884 | var render = ReactPerf.measure('React', 'render', ReactMount.render);
|
2885 |
|
2886 | var React = {
|
2887 | findDOMNode: findDOMNode,
|
2888 | render: render,
|
2889 | unmountComponentAtNode: ReactMount.unmountComponentAtNode,
|
2890 | version: ReactVersion,
|
2891 |
|
2892 |
|
2893 | unstable_batchedUpdates: ReactUpdates.batchedUpdates,
|
2894 | unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
|
2895 | };
|
2896 |
|
2897 |
|
2898 |
|
2899 |
|
2900 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
|
2901 | __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
|
2902 | CurrentOwner: ReactCurrentOwner,
|
2903 | InstanceHandles: ReactInstanceHandles,
|
2904 | Mount: ReactMount,
|
2905 | Reconciler: ReactReconciler,
|
2906 | TextComponent: ReactDOMTextComponent
|
2907 | });
|
2908 | }
|
2909 |
|
2910 | if (process.env.NODE_ENV !== 'production') {
|
2911 | var ExecutionEnvironment = __webpack_require__(94);
|
2912 | if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
|
2913 |
|
2914 |
|
2915 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
|
2916 |
|
2917 | if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
|
2918 | console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools');
|
2919 | }
|
2920 | }
|
2921 |
|
2922 |
|
2923 |
|
2924 | var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
|
2925 |
|
2926 | process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : undefined;
|
2927 |
|
2928 | var expectedFeatures = [
|
2929 |
|
2930 | Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim,
|
2931 |
|
2932 |
|
2933 | Object.create, Object.freeze];
|
2934 |
|
2935 | for (var i = 0; i < expectedFeatures.length; i++) {
|
2936 | if (!expectedFeatures[i]) {
|
2937 | console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills');
|
2938 | break;
|
2939 | }
|
2940 | }
|
2941 | }
|
2942 | }
|
2943 |
|
2944 | module.exports = React;
|
2945 | }.call(exports, __webpack_require__(89)))
|
2946 |
|
2947 | }),
|
2948 |
|
2949 | (function(module, exports) {
|
2950 |
|
2951 |
|
2952 | var process = module.exports = {};
|
2953 |
|
2954 |
|
2955 |
|
2956 |
|
2957 |
|
2958 |
|
2959 | var cachedSetTimeout;
|
2960 | var cachedClearTimeout;
|
2961 |
|
2962 | function defaultSetTimout() {
|
2963 | throw new Error('setTimeout has not been defined');
|
2964 | }
|
2965 | function defaultClearTimeout () {
|
2966 | throw new Error('clearTimeout has not been defined');
|
2967 | }
|
2968 | (function () {
|
2969 | try {
|
2970 | if (typeof setTimeout === 'function') {
|
2971 | cachedSetTimeout = setTimeout;
|
2972 | } else {
|
2973 | cachedSetTimeout = defaultSetTimout;
|
2974 | }
|
2975 | } catch (e) {
|
2976 | cachedSetTimeout = defaultSetTimout;
|
2977 | }
|
2978 | try {
|
2979 | if (typeof clearTimeout === 'function') {
|
2980 | cachedClearTimeout = clearTimeout;
|
2981 | } else {
|
2982 | cachedClearTimeout = defaultClearTimeout;
|
2983 | }
|
2984 | } catch (e) {
|
2985 | cachedClearTimeout = defaultClearTimeout;
|
2986 | }
|
2987 | } ())
|
2988 | function runTimeout(fun) {
|
2989 | if (cachedSetTimeout === setTimeout) {
|
2990 |
|
2991 | return setTimeout(fun, 0);
|
2992 | }
|
2993 |
|
2994 | if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
2995 | cachedSetTimeout = setTimeout;
|
2996 | return setTimeout(fun, 0);
|
2997 | }
|
2998 | try {
|
2999 |
|
3000 | return cachedSetTimeout(fun, 0);
|
3001 | } catch(e){
|
3002 | try {
|
3003 |
|
3004 | return cachedSetTimeout.call(null, fun, 0);
|
3005 | } catch(e){
|
3006 |
|
3007 | return cachedSetTimeout.call(this, fun, 0);
|
3008 | }
|
3009 | }
|
3010 |
|
3011 |
|
3012 | }
|
3013 | function runClearTimeout(marker) {
|
3014 | if (cachedClearTimeout === clearTimeout) {
|
3015 |
|
3016 | return clearTimeout(marker);
|
3017 | }
|
3018 |
|
3019 | if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
3020 | cachedClearTimeout = clearTimeout;
|
3021 | return clearTimeout(marker);
|
3022 | }
|
3023 | try {
|
3024 |
|
3025 | return cachedClearTimeout(marker);
|
3026 | } catch (e){
|
3027 | try {
|
3028 |
|
3029 | return cachedClearTimeout.call(null, marker);
|
3030 | } catch (e){
|
3031 |
|
3032 |
|
3033 | return cachedClearTimeout.call(this, marker);
|
3034 | }
|
3035 | }
|
3036 |
|
3037 |
|
3038 |
|
3039 | }
|
3040 | var queue = [];
|
3041 | var draining = false;
|
3042 | var currentQueue;
|
3043 | var queueIndex = -1;
|
3044 |
|
3045 | function cleanUpNextTick() {
|
3046 | if (!draining || !currentQueue) {
|
3047 | return;
|
3048 | }
|
3049 | draining = false;
|
3050 | if (currentQueue.length) {
|
3051 | queue = currentQueue.concat(queue);
|
3052 | } else {
|
3053 | queueIndex = -1;
|
3054 | }
|
3055 | if (queue.length) {
|
3056 | drainQueue();
|
3057 | }
|
3058 | }
|
3059 |
|
3060 | function drainQueue() {
|
3061 | if (draining) {
|
3062 | return;
|
3063 | }
|
3064 | var timeout = runTimeout(cleanUpNextTick);
|
3065 | draining = true;
|
3066 |
|
3067 | var len = queue.length;
|
3068 | while(len) {
|
3069 | currentQueue = queue;
|
3070 | queue = [];
|
3071 | while (++queueIndex < len) {
|
3072 | if (currentQueue) {
|
3073 | currentQueue[queueIndex].run();
|
3074 | }
|
3075 | }
|
3076 | queueIndex = -1;
|
3077 | len = queue.length;
|
3078 | }
|
3079 | currentQueue = null;
|
3080 | draining = false;
|
3081 | runClearTimeout(timeout);
|
3082 | }
|
3083 |
|
3084 | process.nextTick = function (fun) {
|
3085 | var args = new Array(arguments.length - 1);
|
3086 | if (arguments.length > 1) {
|
3087 | for (var i = 1; i < arguments.length; i++) {
|
3088 | args[i - 1] = arguments[i];
|
3089 | }
|
3090 | }
|
3091 | queue.push(new Item(fun, args));
|
3092 | if (queue.length === 1 && !draining) {
|
3093 | runTimeout(drainQueue);
|
3094 | }
|
3095 | };
|
3096 |
|
3097 |
|
3098 | function Item(fun, array) {
|
3099 | this.fun = fun;
|
3100 | this.array = array;
|
3101 | }
|
3102 | Item.prototype.run = function () {
|
3103 | this.fun.apply(null, this.array);
|
3104 | };
|
3105 | process.title = 'browser';
|
3106 | process.browser = true;
|
3107 | process.env = {};
|
3108 | process.argv = [];
|
3109 | process.version = '';
|
3110 | process.versions = {};
|
3111 |
|
3112 | function noop() {}
|
3113 |
|
3114 | process.on = noop;
|
3115 | process.addListener = noop;
|
3116 | process.once = noop;
|
3117 | process.off = noop;
|
3118 | process.removeListener = noop;
|
3119 | process.removeAllListeners = noop;
|
3120 | process.emit = noop;
|
3121 | process.prependListener = noop;
|
3122 | process.prependOnceListener = noop;
|
3123 |
|
3124 | process.listeners = function (name) { return [] }
|
3125 |
|
3126 | process.binding = function (name) {
|
3127 | throw new Error('process.binding is not supported');
|
3128 | };
|
3129 |
|
3130 | process.cwd = function () { return '/' };
|
3131 | process.chdir = function (dir) {
|
3132 | throw new Error('process.chdir is not supported');
|
3133 | };
|
3134 | process.umask = function() { return 0; };
|
3135 |
|
3136 |
|
3137 | }),
|
3138 |
|
3139 | (function(module, exports) {
|
3140 |
|
3141 | |
3142 |
|
3143 |
|
3144 |
|
3145 |
|
3146 |
|
3147 |
|
3148 |
|
3149 |
|
3150 |
|
3151 |
|
3152 | 'use strict';
|
3153 |
|
3154 | |
3155 |
|
3156 |
|
3157 |
|
3158 |
|
3159 |
|
3160 | var ReactCurrentOwner = {
|
3161 |
|
3162 | |
3163 |
|
3164 |
|
3165 |
|
3166 | current: null
|
3167 |
|
3168 | };
|
3169 |
|
3170 | module.exports = ReactCurrentOwner;
|
3171 |
|
3172 | }),
|
3173 |
|
3174 | (function(module, exports, __webpack_require__) {
|
3175 |
|
3176 | (function(process) { |
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 | 'use strict';
|
3189 |
|
3190 | var DOMChildrenOperations = __webpack_require__(92);
|
3191 | var DOMPropertyOperations = __webpack_require__(107);
|
3192 | var ReactComponentBrowserEnvironment = __webpack_require__(111);
|
3193 | var ReactMount = __webpack_require__(113);
|
3194 |
|
3195 | var assign = __webpack_require__(124);
|
3196 | var escapeTextContentForBrowser = __webpack_require__(106);
|
3197 | var setTextContent = __webpack_require__(105);
|
3198 | var validateDOMNesting = __webpack_require__(155);
|
3199 |
|
3200 | |
3201 |
|
3202 |
|
3203 |
|
3204 |
|
3205 |
|
3206 |
|
3207 |
|
3208 |
|
3209 |
|
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 | var ReactDOMTextComponent = function (props) {
|
3216 |
|
3217 | };
|
3218 |
|
3219 | assign(ReactDOMTextComponent.prototype, {
|
3220 |
|
3221 | |
3222 |
|
3223 |
|
3224 |
|
3225 | construct: function (text) {
|
3226 |
|
3227 | this._currentElement = text;
|
3228 | this._stringText = '' + text;
|
3229 |
|
3230 |
|
3231 | this._rootNodeID = null;
|
3232 | this._mountIndex = 0;
|
3233 | },
|
3234 |
|
3235 | |
3236 |
|
3237 |
|
3238 |
|
3239 |
|
3240 |
|
3241 |
|
3242 |
|
3243 |
|
3244 | mountComponent: function (rootID, transaction, context) {
|
3245 | if (process.env.NODE_ENV !== 'production') {
|
3246 | if (context[validateDOMNesting.ancestorInfoContextKey]) {
|
3247 | validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]);
|
3248 | }
|
3249 | }
|
3250 |
|
3251 | this._rootNodeID = rootID;
|
3252 | if (transaction.useCreateElement) {
|
3253 | var ownerDocument = context[ReactMount.ownerDocumentContextKey];
|
3254 | var el = ownerDocument.createElement('span');
|
3255 | DOMPropertyOperations.setAttributeForID(el, rootID);
|
3256 |
|
3257 | ReactMount.getID(el);
|
3258 | setTextContent(el, this._stringText);
|
3259 | return el;
|
3260 | } else {
|
3261 | var escapedText = escapeTextContentForBrowser(this._stringText);
|
3262 |
|
3263 | if (transaction.renderToStaticMarkup) {
|
3264 |
|
3265 |
|
3266 |
|
3267 | return escapedText;
|
3268 | }
|
3269 |
|
3270 | return '<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' + escapedText + '</span>';
|
3271 | }
|
3272 | },
|
3273 |
|
3274 | |
3275 |
|
3276 |
|
3277 |
|
3278 |
|
3279 |
|
3280 |
|
3281 | receiveComponent: function (nextText, transaction) {
|
3282 | if (nextText !== this._currentElement) {
|
3283 | this._currentElement = nextText;
|
3284 | var nextStringText = '' + nextText;
|
3285 | if (nextStringText !== this._stringText) {
|
3286 |
|
3287 |
|
3288 |
|
3289 | this._stringText = nextStringText;
|
3290 | var node = ReactMount.getNode(this._rootNodeID);
|
3291 | DOMChildrenOperations.updateTextContent(node, nextStringText);
|
3292 | }
|
3293 | }
|
3294 | },
|
3295 |
|
3296 | unmountComponent: function () {
|
3297 | ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
|
3298 | }
|
3299 |
|
3300 | });
|
3301 |
|
3302 | module.exports = ReactDOMTextComponent;
|
3303 | }.call(exports, __webpack_require__(89)))
|
3304 |
|
3305 | }),
|
3306 |
|
3307 | (function(module, exports, __webpack_require__) {
|
3308 |
|
3309 | (function(process) { |
3310 |
|
3311 |
|
3312 |
|
3313 |
|
3314 |
|
3315 |
|
3316 |
|
3317 |
|
3318 |
|
3319 |
|
3320 |
|
3321 | 'use strict';
|
3322 |
|
3323 | var Danger = __webpack_require__(93);
|
3324 | var ReactMultiChildUpdateTypes = __webpack_require__(101);
|
3325 | var ReactPerf = __webpack_require__(103);
|
3326 |
|
3327 | var setInnerHTML = __webpack_require__(104);
|
3328 | var setTextContent = __webpack_require__(105);
|
3329 | var invariant = __webpack_require__(98);
|
3330 |
|
3331 | |
3332 |
|
3333 |
|
3334 |
|
3335 |
|
3336 |
|
3337 |
|
3338 |
|
3339 | function insertChildAt(parentNode, childNode, index) {
|
3340 |
|
3341 |
|
3342 |
|
3343 |
|
3344 |
|
3345 |
|
3346 |
|
3347 | var beforeChild = index >= parentNode.childNodes.length ? null : parentNode.childNodes.item(index);
|
3348 |
|
3349 | parentNode.insertBefore(childNode, beforeChild);
|
3350 | }
|
3351 |
|
3352 | |
3353 |
|
3354 |
|
3355 | var DOMChildrenOperations = {
|
3356 |
|
3357 | dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
|
3358 |
|
3359 | updateTextContent: setTextContent,
|
3360 |
|
3361 | |
3362 |
|
3363 |
|
3364 |
|
3365 |
|
3366 |
|
3367 |
|
3368 |
|
3369 | processUpdates: function (updates, markupList) {
|
3370 | var update;
|
3371 |
|
3372 | var initialChildren = null;
|
3373 |
|
3374 | var updatedChildren = null;
|
3375 |
|
3376 | for (var i = 0; i < updates.length; i++) {
|
3377 | update = updates[i];
|
3378 | if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {
|
3379 | var updatedIndex = update.fromIndex;
|
3380 | var updatedChild = update.parentNode.childNodes[updatedIndex];
|
3381 | var parentID = update.parentID;
|
3382 |
|
3383 | !updatedChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processUpdates(): Unable to find child %s of element. This ' + 'probably means the DOM was unexpectedly mutated (e.g., by the ' + 'browser), usually due to forgetting a <tbody> when using tables, ' + 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements ' + 'in an <svg> parent. Try inspecting the child nodes of the element ' + 'with React ID `%s`.', updatedIndex, parentID) : invariant(false) : undefined;
|
3384 |
|
3385 | initialChildren = initialChildren || {};
|
3386 | initialChildren[parentID] = initialChildren[parentID] || [];
|
3387 | initialChildren[parentID][updatedIndex] = updatedChild;
|
3388 |
|
3389 | updatedChildren = updatedChildren || [];
|
3390 | updatedChildren.push(updatedChild);
|
3391 | }
|
3392 | }
|
3393 |
|
3394 | var renderedMarkup;
|
3395 |
|
3396 | if (markupList.length && typeof markupList[0] === 'string') {
|
3397 | renderedMarkup = Danger.dangerouslyRenderMarkup(markupList);
|
3398 | } else {
|
3399 | renderedMarkup = markupList;
|
3400 | }
|
3401 |
|
3402 |
|
3403 | if (updatedChildren) {
|
3404 | for (var j = 0; j < updatedChildren.length; j++) {
|
3405 | updatedChildren[j].parentNode.removeChild(updatedChildren[j]);
|
3406 | }
|
3407 | }
|
3408 |
|
3409 | for (var k = 0; k < updates.length; k++) {
|
3410 | update = updates[k];
|
3411 | switch (update.type) {
|
3412 | case ReactMultiChildUpdateTypes.INSERT_MARKUP:
|
3413 | insertChildAt(update.parentNode, renderedMarkup[update.markupIndex], update.toIndex);
|
3414 | break;
|
3415 | case ReactMultiChildUpdateTypes.MOVE_EXISTING:
|
3416 | insertChildAt(update.parentNode, initialChildren[update.parentID][update.fromIndex], update.toIndex);
|
3417 | break;
|
3418 | case ReactMultiChildUpdateTypes.SET_MARKUP:
|
3419 | setInnerHTML(update.parentNode, update.content);
|
3420 | break;
|
3421 | case ReactMultiChildUpdateTypes.TEXT_CONTENT:
|
3422 | setTextContent(update.parentNode, update.content);
|
3423 | break;
|
3424 | case ReactMultiChildUpdateTypes.REMOVE_NODE:
|
3425 |
|
3426 | break;
|
3427 | }
|
3428 | }
|
3429 | }
|
3430 |
|
3431 | };
|
3432 |
|
3433 | ReactPerf.measureMethods(DOMChildrenOperations, 'DOMChildrenOperations', {
|
3434 | updateTextContent: 'updateTextContent'
|
3435 | });
|
3436 |
|
3437 | module.exports = DOMChildrenOperations;
|
3438 | }.call(exports, __webpack_require__(89)))
|
3439 |
|
3440 | }),
|
3441 |
|
3442 | (function(module, exports, __webpack_require__) {
|
3443 |
|
3444 | (function(process) { |
3445 |
|
3446 |
|
3447 |
|
3448 |
|
3449 |
|
3450 |
|
3451 |
|
3452 |
|
3453 |
|
3454 |
|
3455 |
|
3456 | 'use strict';
|
3457 |
|
3458 | var ExecutionEnvironment = __webpack_require__(94);
|
3459 |
|
3460 | var createNodesFromMarkup = __webpack_require__(95);
|
3461 | var emptyFunction = __webpack_require__(100);
|
3462 | var getMarkupWrap = __webpack_require__(99);
|
3463 | var invariant = __webpack_require__(98);
|
3464 |
|
3465 | var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
|
3466 | var RESULT_INDEX_ATTR = 'data-danger-index';
|
3467 |
|
3468 | |
3469 |
|
3470 |
|
3471 |
|
3472 |
|
3473 |
|
3474 |
|
3475 |
|
3476 |
|
3477 |
|
3478 |
|
3479 | function getNodeName(markup) {
|
3480 | return markup.substring(1, markup.indexOf(' '));
|
3481 | }
|
3482 |
|
3483 | var Danger = {
|
3484 |
|
3485 | |
3486 |
|
3487 |
|
3488 |
|
3489 |
|
3490 |
|
3491 |
|
3492 |
|
3493 |
|
3494 | dangerouslyRenderMarkup: function (markupList) {
|
3495 | !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString for server rendering.') : invariant(false) : undefined;
|
3496 | var nodeName;
|
3497 | var markupByNodeName = {};
|
3498 |
|
3499 | for (var i = 0; i < markupList.length; i++) {
|
3500 | !markupList[i] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : undefined;
|
3501 | nodeName = getNodeName(markupList[i]);
|
3502 | nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
|
3503 | markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
|
3504 | markupByNodeName[nodeName][i] = markupList[i];
|
3505 | }
|
3506 | var resultList = [];
|
3507 | var resultListAssignmentCount = 0;
|
3508 | for (nodeName in markupByNodeName) {
|
3509 | if (!markupByNodeName.hasOwnProperty(nodeName)) {
|
3510 | continue;
|
3511 | }
|
3512 | var markupListByNodeName = markupByNodeName[nodeName];
|
3513 |
|
3514 |
|
3515 |
|
3516 |
|
3517 | var resultIndex;
|
3518 | for (resultIndex in markupListByNodeName) {
|
3519 | if (markupListByNodeName.hasOwnProperty(resultIndex)) {
|
3520 | var markup = markupListByNodeName[resultIndex];
|
3521 |
|
3522 |
|
3523 |
|
3524 |
|
3525 | markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP,
|
3526 |
|
3527 | '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ');
|
3528 | }
|
3529 | }
|
3530 |
|
3531 |
|
3532 | var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction
|
3533 | );
|
3534 |
|
3535 | for (var j = 0; j < renderNodes.length; ++j) {
|
3536 | var renderNode = renderNodes[j];
|
3537 | if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
|
3538 |
|
3539 | resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
|
3540 | renderNode.removeAttribute(RESULT_INDEX_ATTR);
|
3541 |
|
3542 | !!resultList.hasOwnProperty(resultIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : undefined;
|
3543 |
|
3544 | resultList[resultIndex] = renderNode;
|
3545 |
|
3546 |
|
3547 |
|
3548 | resultListAssignmentCount += 1;
|
3549 | } else if (process.env.NODE_ENV !== 'production') {
|
3550 | console.error('Danger: Discarding unexpected node:', renderNode);
|
3551 | }
|
3552 | }
|
3553 | }
|
3554 |
|
3555 |
|
3556 |
|
3557 | !(resultListAssignmentCount === resultList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : undefined;
|
3558 |
|
3559 | !(resultList.length === markupList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : undefined;
|
3560 |
|
3561 | return resultList;
|
3562 | },
|
3563 |
|
3564 | |
3565 |
|
3566 |
|
3567 |
|
3568 |
|
3569 |
|
3570 |
|
3571 |
|
3572 | dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
|
3573 | !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString() for server rendering.') : invariant(false) : undefined;
|
3574 | !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : undefined;
|
3575 | !(oldChild.tagName.toLowerCase() !== 'html') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See ReactDOMServer.renderToString().') : invariant(false) : undefined;
|
3576 |
|
3577 | var newChild;
|
3578 | if (typeof markup === 'string') {
|
3579 | newChild = createNodesFromMarkup(markup, emptyFunction)[0];
|
3580 | } else {
|
3581 | newChild = markup;
|
3582 | }
|
3583 | oldChild.parentNode.replaceChild(newChild, oldChild);
|
3584 | }
|
3585 |
|
3586 | };
|
3587 |
|
3588 | module.exports = Danger;
|
3589 | }.call(exports, __webpack_require__(89)))
|
3590 |
|
3591 | }),
|
3592 |
|
3593 | (function(module, exports) {
|
3594 |
|
3595 | |
3596 |
|
3597 |
|
3598 |
|
3599 |
|
3600 |
|
3601 |
|
3602 |
|
3603 |
|
3604 |
|
3605 |
|
3606 | 'use strict';
|
3607 |
|
3608 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
3609 |
|
3610 | |
3611 |
|
3612 |
|
3613 |
|
3614 |
|
3615 |
|
3616 | var ExecutionEnvironment = {
|
3617 |
|
3618 | canUseDOM: canUseDOM,
|
3619 |
|
3620 | canUseWorkers: typeof Worker !== 'undefined',
|
3621 |
|
3622 | canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
|
3623 |
|
3624 | canUseViewport: canUseDOM && !!window.screen,
|
3625 |
|
3626 | isInWorker: !canUseDOM
|
3627 |
|
3628 | };
|
3629 |
|
3630 | module.exports = ExecutionEnvironment;
|
3631 |
|
3632 | }),
|
3633 |
|
3634 | (function(module, exports, __webpack_require__) {
|
3635 |
|
3636 | (function(process) { |
3637 |
|
3638 |
|
3639 |
|
3640 |
|
3641 |
|
3642 |
|
3643 |
|
3644 |
|
3645 |
|
3646 |
|
3647 |
|
3648 |
|
3649 |
|
3650 | 'use strict';
|
3651 |
|
3652 | var ExecutionEnvironment = __webpack_require__(94);
|
3653 |
|
3654 | var createArrayFromMixed = __webpack_require__(96);
|
3655 | var getMarkupWrap = __webpack_require__(99);
|
3656 | var invariant = __webpack_require__(98);
|
3657 |
|
3658 | |
3659 |
|
3660 |
|
3661 | var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
|
3662 |
|
3663 | |
3664 |
|
3665 |
|
3666 | var nodeNamePattern = /^\s*<(\w+)/;
|
3667 |
|
3668 | |
3669 |
|
3670 |
|
3671 |
|
3672 |
|
3673 |
|
3674 | function getNodeName(markup) {
|
3675 | var nodeNameMatch = markup.match(nodeNamePattern);
|
3676 | return nodeNameMatch && nodeNameMatch[1].toLowerCase();
|
3677 | }
|
3678 |
|
3679 | |
3680 |
|
3681 |
|
3682 |
|
3683 |
|
3684 |
|
3685 |
|
3686 |
|
3687 |
|
3688 |
|
3689 | function createNodesFromMarkup(markup, handleScript) {
|
3690 | var node = dummyNode;
|
3691 | !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : undefined;
|
3692 | var nodeName = getNodeName(markup);
|
3693 |
|
3694 | var wrap = nodeName && getMarkupWrap(nodeName);
|
3695 | if (wrap) {
|
3696 | node.innerHTML = wrap[1] + markup + wrap[2];
|
3697 |
|
3698 | var wrapDepth = wrap[0];
|
3699 | while (wrapDepth--) {
|
3700 | node = node.lastChild;
|
3701 | }
|
3702 | } else {
|
3703 | node.innerHTML = markup;
|
3704 | }
|
3705 |
|
3706 | var scripts = node.getElementsByTagName('script');
|
3707 | if (scripts.length) {
|
3708 | !handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : undefined;
|
3709 | createArrayFromMixed(scripts).forEach(handleScript);
|
3710 | }
|
3711 |
|
3712 | var nodes = createArrayFromMixed(node.childNodes);
|
3713 | while (node.lastChild) {
|
3714 | node.removeChild(node.lastChild);
|
3715 | }
|
3716 | return nodes;
|
3717 | }
|
3718 |
|
3719 | module.exports = createNodesFromMarkup;
|
3720 | }.call(exports, __webpack_require__(89)))
|
3721 |
|
3722 | }),
|
3723 |
|
3724 | (function(module, exports, __webpack_require__) {
|
3725 |
|
3726 | |
3727 |
|
3728 |
|
3729 |
|
3730 |
|
3731 |
|
3732 |
|
3733 |
|
3734 |
|
3735 |
|
3736 |
|
3737 |
|
3738 | 'use strict';
|
3739 |
|
3740 | var toArray = __webpack_require__(97);
|
3741 |
|
3742 | |
3743 |
|
3744 |
|
3745 |
|
3746 |
|
3747 |
|
3748 |
|
3749 |
|
3750 |
|
3751 |
|
3752 |
|
3753 |
|
3754 |
|
3755 |
|
3756 |
|
3757 | function hasArrayNature(obj) {
|
3758 | return(
|
3759 |
|
3760 | !!obj && (
|
3761 |
|
3762 | typeof obj == 'object' || typeof obj == 'function') &&
|
3763 |
|
3764 | 'length' in obj &&
|
3765 |
|
3766 | !('setInterval' in obj) &&
|
3767 |
|
3768 |
|
3769 | typeof obj.nodeType != 'number' && (
|
3770 |
|
3771 | Array.isArray(obj) ||
|
3772 |
|
3773 | 'callee' in obj ||
|
3774 |
|
3775 | 'item' in obj)
|
3776 | );
|
3777 | }
|
3778 |
|
3779 | |
3780 |
|
3781 |
|
3782 |
|
3783 |
|
3784 |
|
3785 |
|
3786 |
|
3787 |
|
3788 |
|
3789 |
|
3790 |
|
3791 |
|
3792 |
|
3793 |
|
3794 |
|
3795 |
|
3796 |
|
3797 |
|
3798 |
|
3799 |
|
3800 | function createArrayFromMixed(obj) {
|
3801 | if (!hasArrayNature(obj)) {
|
3802 | return [obj];
|
3803 | } else if (Array.isArray(obj)) {
|
3804 | return obj.slice();
|
3805 | } else {
|
3806 | return toArray(obj);
|
3807 | }
|
3808 | }
|
3809 |
|
3810 | module.exports = createArrayFromMixed;
|
3811 |
|
3812 | }),
|
3813 |
|
3814 | (function(module, exports, __webpack_require__) {
|
3815 |
|
3816 | (function(process) { |
3817 |
|
3818 |
|
3819 |
|
3820 |
|
3821 |
|
3822 |
|
3823 |
|
3824 |
|
3825 |
|
3826 |
|
3827 |
|
3828 | 'use strict';
|
3829 |
|
3830 | var invariant = __webpack_require__(98);
|
3831 |
|
3832 | |
3833 |
|
3834 |
|
3835 |
|
3836 |
|
3837 |
|
3838 |
|
3839 |
|
3840 |
|
3841 | function toArray(obj) {
|
3842 | var length = obj.length;
|
3843 |
|
3844 |
|
3845 |
|
3846 | !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : undefined;
|
3847 |
|
3848 | !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : undefined;
|
3849 |
|
3850 | !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : undefined;
|
3851 |
|
3852 |
|
3853 |
|
3854 |
|
3855 | if (obj.hasOwnProperty) {
|
3856 | try {
|
3857 | return Array.prototype.slice.call(obj);
|
3858 | } catch (e) {
|
3859 |
|
3860 | }
|
3861 | }
|
3862 |
|
3863 |
|
3864 |
|
3865 | var ret = Array(length);
|
3866 | for (var ii = 0; ii < length; ii++) {
|
3867 | ret[ii] = obj[ii];
|
3868 | }
|
3869 | return ret;
|
3870 | }
|
3871 |
|
3872 | module.exports = toArray;
|
3873 | }.call(exports, __webpack_require__(89)))
|
3874 |
|
3875 | }),
|
3876 |
|
3877 | (function(module, exports, __webpack_require__) {
|
3878 |
|
3879 | (function(process) { |
3880 |
|
3881 |
|
3882 |
|
3883 |
|
3884 |
|
3885 |
|
3886 |
|
3887 |
|
3888 |
|
3889 |
|
3890 | 'use strict';
|
3891 |
|
3892 | |
3893 |
|
3894 |
|
3895 |
|
3896 |
|
3897 |
|
3898 |
|
3899 |
|
3900 |
|
3901 |
|
3902 |
|
3903 | function invariant(condition, format, a, b, c, d, e, f) {
|
3904 | if (process.env.NODE_ENV !== 'production') {
|
3905 | if (format === undefined) {
|
3906 | throw new Error('invariant requires an error message argument');
|
3907 | }
|
3908 | }
|
3909 |
|
3910 | if (!condition) {
|
3911 | var error;
|
3912 | if (format === undefined) {
|
3913 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
3914 | } else {
|
3915 | var args = [a, b, c, d, e, f];
|
3916 | var argIndex = 0;
|
3917 | error = new Error(format.replace(/%s/g, function () {
|
3918 | return args[argIndex++];
|
3919 | }));
|
3920 | error.name = 'Invariant Violation';
|
3921 | }
|
3922 |
|
3923 | error.framesToPop = 1;
|
3924 | throw error;
|
3925 | }
|
3926 | }
|
3927 |
|
3928 | module.exports = invariant;
|
3929 | }.call(exports, __webpack_require__(89)))
|
3930 |
|
3931 | }),
|
3932 |
|
3933 | (function(module, exports, __webpack_require__) {
|
3934 |
|
3935 | (function(process) { |
3936 |
|
3937 |
|
3938 |
|
3939 |
|
3940 |
|
3941 |
|
3942 |
|
3943 |
|
3944 |
|
3945 |
|
3946 |
|
3947 |
|
3948 | 'use strict';
|
3949 |
|
3950 | var ExecutionEnvironment = __webpack_require__(94);
|
3951 |
|
3952 | var invariant = __webpack_require__(98);
|
3953 |
|
3954 | |
3955 |
|
3956 |
|
3957 | var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
|
3958 |
|
3959 | |
3960 |
|
3961 |
|
3962 |
|
3963 |
|
3964 |
|
3965 |
|
3966 | var shouldWrap = {};
|
3967 |
|
3968 | var selectWrap = [1, '<select multiple="true">', '</select>'];
|
3969 | var tableWrap = [1, '<table>', '</table>'];
|
3970 | var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
|
3971 |
|
3972 | var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
|
3973 |
|
3974 | var markupWrap = {
|
3975 | '*': [1, '?<div>', '</div>'],
|
3976 |
|
3977 | 'area': [1, '<map>', '</map>'],
|
3978 | 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
|
3979 | 'legend': [1, '<fieldset>', '</fieldset>'],
|
3980 | 'param': [1, '<object>', '</object>'],
|
3981 | 'tr': [2, '<table><tbody>', '</tbody></table>'],
|
3982 |
|
3983 | 'optgroup': selectWrap,
|
3984 | 'option': selectWrap,
|
3985 |
|
3986 | 'caption': tableWrap,
|
3987 | 'colgroup': tableWrap,
|
3988 | 'tbody': tableWrap,
|
3989 | 'tfoot': tableWrap,
|
3990 | 'thead': tableWrap,
|
3991 |
|
3992 | 'td': trWrap,
|
3993 | 'th': trWrap
|
3994 | };
|
3995 |
|
3996 |
|
3997 |
|
3998 |
|
3999 | var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
|
4000 | svgElements.forEach(function (nodeName) {
|
4001 | markupWrap[nodeName] = svgWrap;
|
4002 | shouldWrap[nodeName] = true;
|
4003 | });
|
4004 |
|
4005 | |
4006 |
|
4007 |
|
4008 |
|
4009 |
|
4010 |
|
4011 |
|
4012 |
|
4013 | function getMarkupWrap(nodeName) {
|
4014 | !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : undefined;
|
4015 | if (!markupWrap.hasOwnProperty(nodeName)) {
|
4016 | nodeName = '*';
|
4017 | }
|
4018 | if (!shouldWrap.hasOwnProperty(nodeName)) {
|
4019 | if (nodeName === '*') {
|
4020 | dummyNode.innerHTML = '<link />';
|
4021 | } else {
|
4022 | dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
|
4023 | }
|
4024 | shouldWrap[nodeName] = !dummyNode.firstChild;
|
4025 | }
|
4026 | return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
|
4027 | }
|
4028 |
|
4029 | module.exports = getMarkupWrap;
|
4030 | }.call(exports, __webpack_require__(89)))
|
4031 |
|
4032 | }),
|
4033 |
|
4034 | (function(module, exports) {
|
4035 |
|
4036 | |
4037 |
|
4038 |
|
4039 |
|
4040 |
|
4041 |
|
4042 |
|
4043 |
|
4044 |
|
4045 |
|
4046 |
|
4047 | "use strict";
|
4048 |
|
4049 | function makeEmptyFunction(arg) {
|
4050 | return function () {
|
4051 | return arg;
|
4052 | };
|
4053 | }
|
4054 |
|
4055 | |
4056 |
|
4057 |
|
4058 |
|
4059 |
|
4060 | function emptyFunction() {}
|
4061 |
|
4062 | emptyFunction.thatReturns = makeEmptyFunction;
|
4063 | emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
4064 | emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
4065 | emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
4066 | emptyFunction.thatReturnsThis = function () {
|
4067 | return this;
|
4068 | };
|
4069 | emptyFunction.thatReturnsArgument = function (arg) {
|
4070 | return arg;
|
4071 | };
|
4072 |
|
4073 | module.exports = emptyFunction;
|
4074 |
|
4075 | }),
|
4076 |
|
4077 | (function(module, exports, __webpack_require__) {
|
4078 |
|
4079 | |
4080 |
|
4081 |
|
4082 |
|
4083 |
|
4084 |
|
4085 |
|
4086 |
|
4087 |
|
4088 |
|
4089 |
|
4090 | 'use strict';
|
4091 |
|
4092 | var keyMirror = __webpack_require__(102);
|
4093 |
|
4094 | |
4095 |
|
4096 |
|
4097 |
|
4098 |
|
4099 |
|
4100 |
|
4101 |
|
4102 | var ReactMultiChildUpdateTypes = keyMirror({
|
4103 | INSERT_MARKUP: null,
|
4104 | MOVE_EXISTING: null,
|
4105 | REMOVE_NODE: null,
|
4106 | SET_MARKUP: null,
|
4107 | TEXT_CONTENT: null
|
4108 | });
|
4109 |
|
4110 | module.exports = ReactMultiChildUpdateTypes;
|
4111 |
|
4112 | }),
|
4113 |
|
4114 | (function(module, exports, __webpack_require__) {
|
4115 |
|
4116 | (function(process) { |
4117 |
|
4118 |
|
4119 |
|
4120 |
|
4121 |
|
4122 |
|
4123 |
|
4124 |
|
4125 |
|
4126 |
|
4127 |
|
4128 | 'use strict';
|
4129 |
|
4130 | var invariant = __webpack_require__(98);
|
4131 |
|
4132 | |
4133 |
|
4134 |
|
4135 |
|
4136 |
|
4137 |
|
4138 |
|
4139 |
|
4140 |
|
4141 |
|
4142 |
|
4143 |
|
4144 |
|
4145 |
|
4146 |
|
4147 |
|
4148 |
|
4149 |
|
4150 | var keyMirror = function (obj) {
|
4151 | var ret = {};
|
4152 | var key;
|
4153 | !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : undefined;
|
4154 | for (key in obj) {
|
4155 | if (!obj.hasOwnProperty(key)) {
|
4156 | continue;
|
4157 | }
|
4158 | ret[key] = key;
|
4159 | }
|
4160 | return ret;
|
4161 | };
|
4162 |
|
4163 | module.exports = keyMirror;
|
4164 | }.call(exports, __webpack_require__(89)))
|
4165 |
|
4166 | }),
|
4167 |
|
4168 | (function(module, exports, __webpack_require__) {
|
4169 |
|
4170 | (function(process) { |
4171 |
|
4172 |
|
4173 |
|
4174 |
|
4175 |
|
4176 |
|
4177 |
|
4178 |
|
4179 |
|
4180 |
|
4181 |
|
4182 | 'use strict';
|
4183 |
|
4184 | |
4185 |
|
4186 |
|
4187 |
|
4188 | var ReactPerf = {
|
4189 | |
4190 |
|
4191 |
|
4192 |
|
4193 | enableMeasure: false,
|
4194 |
|
4195 | |
4196 |
|
4197 |
|
4198 |
|
4199 | storedMeasure: _noMeasure,
|
4200 |
|
4201 | |
4202 |
|
4203 |
|
4204 |
|
4205 |
|
4206 | measureMethods: function (object, objectName, methodNames) {
|
4207 | if (process.env.NODE_ENV !== 'production') {
|
4208 | for (var key in methodNames) {
|
4209 | if (!methodNames.hasOwnProperty(key)) {
|
4210 | continue;
|
4211 | }
|
4212 | object[key] = ReactPerf.measure(objectName, methodNames[key], object[key]);
|
4213 | }
|
4214 | }
|
4215 | },
|
4216 |
|
4217 | |
4218 |
|
4219 |
|
4220 |
|
4221 |
|
4222 |
|
4223 |
|
4224 |
|
4225 | measure: function (objName, fnName, func) {
|
4226 | if (process.env.NODE_ENV !== 'production') {
|
4227 | var measuredFunc = null;
|
4228 | var wrapper = function () {
|
4229 | if (ReactPerf.enableMeasure) {
|
4230 | if (!measuredFunc) {
|
4231 | measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
|
4232 | }
|
4233 | return measuredFunc.apply(this, arguments);
|
4234 | }
|
4235 | return func.apply(this, arguments);
|
4236 | };
|
4237 | wrapper.displayName = objName + '_' + fnName;
|
4238 | return wrapper;
|
4239 | }
|
4240 | return func;
|
4241 | },
|
4242 |
|
4243 | injection: {
|
4244 | |
4245 |
|
4246 |
|
4247 | injectMeasure: function (measure) {
|
4248 | ReactPerf.storedMeasure = measure;
|
4249 | }
|
4250 | }
|
4251 | };
|
4252 |
|
4253 | |
4254 |
|
4255 |
|
4256 |
|
4257 |
|
4258 |
|
4259 |
|
4260 |
|
4261 | function _noMeasure(objName, fnName, func) {
|
4262 | return func;
|
4263 | }
|
4264 |
|
4265 | module.exports = ReactPerf;
|
4266 | }.call(exports, __webpack_require__(89)))
|
4267 |
|
4268 | }),
|
4269 |
|
4270 | (function(module, exports, __webpack_require__) {
|
4271 |
|
4272 | |
4273 |
|
4274 |
|
4275 |
|
4276 |
|
4277 |
|
4278 |
|
4279 |
|
4280 |
|
4281 |
|
4282 |
|
4283 |
|
4284 |
|
4285 | 'use strict';
|
4286 |
|
4287 | var ExecutionEnvironment = __webpack_require__(94);
|
4288 |
|
4289 | var WHITESPACE_TEST = /^[ \r\n\t\f]/;
|
4290 | var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
|
4291 |
|
4292 | |
4293 |
|
4294 |
|
4295 |
|
4296 |
|
4297 |
|
4298 |
|
4299 |
|
4300 | var setInnerHTML = function (node, html) {
|
4301 | node.innerHTML = html;
|
4302 | };
|
4303 |
|
4304 |
|
4305 | if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
|
4306 | setInnerHTML = function (node, html) {
|
4307 | MSApp.execUnsafeLocalFunction(function () {
|
4308 | node.innerHTML = html;
|
4309 | });
|
4310 | };
|
4311 | }
|
4312 |
|
4313 | if (ExecutionEnvironment.canUseDOM) {
|
4314 |
|
4315 |
|
4316 |
|
4317 |
|
4318 |
|
4319 |
|
4320 | var testElement = document.createElement('div');
|
4321 | testElement.innerHTML = ' ';
|
4322 | if (testElement.innerHTML === '') {
|
4323 | setInnerHTML = function (node, html) {
|
4324 |
|
4325 |
|
4326 |
|
4327 |
|
4328 |
|
4329 | if (node.parentNode) {
|
4330 | node.parentNode.replaceChild(node, node);
|
4331 | }
|
4332 |
|
4333 |
|
4334 |
|
4335 |
|
4336 |
|
4337 | if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
|
4338 |
|
4339 |
|
4340 |
|
4341 |
|
4342 |
|
4343 |
|
4344 | node.innerHTML = String.fromCharCode(0xFEFF) + html;
|
4345 |
|
4346 |
|
4347 |
|
4348 | var textNode = node.firstChild;
|
4349 | if (textNode.data.length === 1) {
|
4350 | node.removeChild(textNode);
|
4351 | } else {
|
4352 | textNode.deleteData(0, 1);
|
4353 | }
|
4354 | } else {
|
4355 | node.innerHTML = html;
|
4356 | }
|
4357 | };
|
4358 | }
|
4359 | }
|
4360 |
|
4361 | module.exports = setInnerHTML;
|
4362 |
|
4363 | }),
|
4364 |
|
4365 | (function(module, exports, __webpack_require__) {
|
4366 |
|
4367 | |
4368 |
|
4369 |
|
4370 |
|
4371 |
|
4372 |
|
4373 |
|
4374 |
|
4375 |
|
4376 |
|
4377 |
|
4378 | 'use strict';
|
4379 |
|
4380 | var ExecutionEnvironment = __webpack_require__(94);
|
4381 | var escapeTextContentForBrowser = __webpack_require__(106);
|
4382 | var setInnerHTML = __webpack_require__(104);
|
4383 |
|
4384 | |
4385 |
|
4386 |
|
4387 |
|
4388 |
|
4389 |
|
4390 |
|
4391 |
|
4392 |
|
4393 |
|
4394 | var setTextContent = function (node, text) {
|
4395 | node.textContent = text;
|
4396 | };
|
4397 |
|
4398 | if (ExecutionEnvironment.canUseDOM) {
|
4399 | if (!('textContent' in document.documentElement)) {
|
4400 | setTextContent = function (node, text) {
|
4401 | setInnerHTML(node, escapeTextContentForBrowser(text));
|
4402 | };
|
4403 | }
|
4404 | }
|
4405 |
|
4406 | module.exports = setTextContent;
|
4407 |
|
4408 | }),
|
4409 |
|
4410 | (function(module, exports) {
|
4411 |
|
4412 | |
4413 |
|
4414 |
|
4415 |
|
4416 |
|
4417 |
|
4418 |
|
4419 |
|
4420 |
|
4421 |
|
4422 |
|
4423 | 'use strict';
|
4424 |
|
4425 | var ESCAPE_LOOKUP = {
|
4426 | '&': '&',
|
4427 | '>': '>',
|
4428 | '<': '<',
|
4429 | '"': '"',
|
4430 | '\'': '''
|
4431 | };
|
4432 |
|
4433 | var ESCAPE_REGEX = /[&><"']/g;
|
4434 |
|
4435 | function escaper(match) {
|
4436 | return ESCAPE_LOOKUP[match];
|
4437 | }
|
4438 |
|
4439 | |
4440 |
|
4441 |
|
4442 |
|
4443 |
|
4444 |
|
4445 | function escapeTextContentForBrowser(text) {
|
4446 | return ('' + text).replace(ESCAPE_REGEX, escaper);
|
4447 | }
|
4448 |
|
4449 | module.exports = escapeTextContentForBrowser;
|
4450 |
|
4451 | }),
|
4452 |
|
4453 | (function(module, exports, __webpack_require__) {
|
4454 |
|
4455 | (function(process) { |
4456 |
|
4457 |
|
4458 |
|
4459 |
|
4460 |
|
4461 |
|
4462 |
|
4463 |
|
4464 |
|
4465 |
|
4466 |
|
4467 | 'use strict';
|
4468 |
|
4469 | var DOMProperty = __webpack_require__(108);
|
4470 | var ReactPerf = __webpack_require__(103);
|
4471 |
|
4472 | var quoteAttributeValueForBrowser = __webpack_require__(109);
|
4473 | var warning = __webpack_require__(110);
|
4474 |
|
4475 |
|
4476 | var VALID_ATTRIBUTE_NAME_REGEX = /^[a-zA-Z_][\w\.\-]*$/;
|
4477 | var illegalAttributeNameCache = {};
|
4478 | var validatedAttributeNameCache = {};
|
4479 |
|
4480 | function isAttributeNameSafe(attributeName) {
|
4481 | if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
|
4482 | return true;
|
4483 | }
|
4484 | if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
|
4485 | return false;
|
4486 | }
|
4487 | if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
4488 | validatedAttributeNameCache[attributeName] = true;
|
4489 | return true;
|
4490 | }
|
4491 | illegalAttributeNameCache[attributeName] = true;
|
4492 | process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : undefined;
|
4493 | return false;
|
4494 | }
|
4495 |
|
4496 | function shouldIgnoreValue(propertyInfo, value) {
|
4497 | return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
|
4498 | }
|
4499 |
|
4500 | if (process.env.NODE_ENV !== 'production') {
|
4501 | var reactProps = {
|
4502 | children: true,
|
4503 | dangerouslySetInnerHTML: true,
|
4504 | key: true,
|
4505 | ref: true
|
4506 | };
|
4507 | var warnedProperties = {};
|
4508 |
|
4509 | var warnUnknownProperty = function (name) {
|
4510 | if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
|
4511 | return;
|
4512 | }
|
4513 |
|
4514 | warnedProperties[name] = true;
|
4515 | var lowerCasedName = name.toLowerCase();
|
4516 |
|
4517 |
|
4518 | var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
|
4519 |
|
4520 |
|
4521 |
|
4522 | process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : undefined;
|
4523 | };
|
4524 | }
|
4525 |
|
4526 | |
4527 |
|
4528 |
|
4529 | var DOMPropertyOperations = {
|
4530 |
|
4531 | |
4532 |
|
4533 |
|
4534 |
|
4535 |
|
4536 |
|
4537 | createMarkupForID: function (id) {
|
4538 | return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
|
4539 | },
|
4540 |
|
4541 | setAttributeForID: function (node, id) {
|
4542 | node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
|
4543 | },
|
4544 |
|
4545 | |
4546 |
|
4547 |
|
4548 |
|
4549 |
|
4550 |
|
4551 |
|
4552 | createMarkupForProperty: function (name, value) {
|
4553 | var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
4554 | if (propertyInfo) {
|
4555 | if (shouldIgnoreValue(propertyInfo, value)) {
|
4556 | return '';
|
4557 | }
|
4558 | var attributeName = propertyInfo.attributeName;
|
4559 | if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
|
4560 | return attributeName + '=""';
|
4561 | }
|
4562 | return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
4563 | } else if (DOMProperty.isCustomAttribute(name)) {
|
4564 | if (value == null) {
|
4565 | return '';
|
4566 | }
|
4567 | return name + '=' + quoteAttributeValueForBrowser(value);
|
4568 | } else if (process.env.NODE_ENV !== 'production') {
|
4569 | warnUnknownProperty(name);
|
4570 | }
|
4571 | return null;
|
4572 | },
|
4573 |
|
4574 | |
4575 |
|
4576 |
|
4577 |
|
4578 |
|
4579 |
|
4580 |
|
4581 | createMarkupForCustomAttribute: function (name, value) {
|
4582 | if (!isAttributeNameSafe(name) || value == null) {
|
4583 | return '';
|
4584 | }
|
4585 | return name + '=' + quoteAttributeValueForBrowser(value);
|
4586 | },
|
4587 |
|
4588 | |
4589 |
|
4590 |
|
4591 |
|
4592 |
|
4593 |
|
4594 |
|
4595 | setValueForProperty: function (node, name, value) {
|
4596 | var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
4597 | if (propertyInfo) {
|
4598 | var mutationMethod = propertyInfo.mutationMethod;
|
4599 | if (mutationMethod) {
|
4600 | mutationMethod(node, value);
|
4601 | } else if (shouldIgnoreValue(propertyInfo, value)) {
|
4602 | this.deleteValueForProperty(node, name);
|
4603 | } else if (propertyInfo.mustUseAttribute) {
|
4604 | var attributeName = propertyInfo.attributeName;
|
4605 | var namespace = propertyInfo.attributeNamespace;
|
4606 |
|
4607 |
|
4608 | if (namespace) {
|
4609 | node.setAttributeNS(namespace, attributeName, '' + value);
|
4610 | } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
|
4611 | node.setAttribute(attributeName, '');
|
4612 | } else {
|
4613 | node.setAttribute(attributeName, '' + value);
|
4614 | }
|
4615 | } else {
|
4616 | var propName = propertyInfo.propertyName;
|
4617 |
|
4618 |
|
4619 | if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {
|
4620 |
|
4621 |
|
4622 | node[propName] = value;
|
4623 | }
|
4624 | }
|
4625 | } else if (DOMProperty.isCustomAttribute(name)) {
|
4626 | DOMPropertyOperations.setValueForAttribute(node, name, value);
|
4627 | } else if (process.env.NODE_ENV !== 'production') {
|
4628 | warnUnknownProperty(name);
|
4629 | }
|
4630 | },
|
4631 |
|
4632 | setValueForAttribute: function (node, name, value) {
|
4633 | if (!isAttributeNameSafe(name)) {
|
4634 | return;
|
4635 | }
|
4636 | if (value == null) {
|
4637 | node.removeAttribute(name);
|
4638 | } else {
|
4639 | node.setAttribute(name, '' + value);
|
4640 | }
|
4641 | },
|
4642 |
|
4643 | |
4644 |
|
4645 |
|
4646 |
|
4647 |
|
4648 |
|
4649 | deleteValueForProperty: function (node, name) {
|
4650 | var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
4651 | if (propertyInfo) {
|
4652 | var mutationMethod = propertyInfo.mutationMethod;
|
4653 | if (mutationMethod) {
|
4654 | mutationMethod(node, undefined);
|
4655 | } else if (propertyInfo.mustUseAttribute) {
|
4656 | node.removeAttribute(propertyInfo.attributeName);
|
4657 | } else {
|
4658 | var propName = propertyInfo.propertyName;
|
4659 | var defaultValue = DOMProperty.getDefaultValueForProperty(node.nodeName, propName);
|
4660 | if (!propertyInfo.hasSideEffects || '' + node[propName] !== defaultValue) {
|
4661 | node[propName] = defaultValue;
|
4662 | }
|
4663 | }
|
4664 | } else if (DOMProperty.isCustomAttribute(name)) {
|
4665 | node.removeAttribute(name);
|
4666 | } else if (process.env.NODE_ENV !== 'production') {
|
4667 | warnUnknownProperty(name);
|
4668 | }
|
4669 | }
|
4670 |
|
4671 | };
|
4672 |
|
4673 | ReactPerf.measureMethods(DOMPropertyOperations, 'DOMPropertyOperations', {
|
4674 | setValueForProperty: 'setValueForProperty',
|
4675 | setValueForAttribute: 'setValueForAttribute',
|
4676 | deleteValueForProperty: 'deleteValueForProperty'
|
4677 | });
|
4678 |
|
4679 | module.exports = DOMPropertyOperations;
|
4680 | }.call(exports, __webpack_require__(89)))
|
4681 |
|
4682 | }),
|
4683 |
|
4684 | (function(module, exports, __webpack_require__) {
|
4685 |
|
4686 | (function(process) { |
4687 |
|
4688 |
|
4689 |
|
4690 |
|
4691 |
|
4692 |
|
4693 |
|
4694 |
|
4695 |
|
4696 |
|
4697 |
|
4698 | 'use strict';
|
4699 |
|
4700 | var invariant = __webpack_require__(98);
|
4701 |
|
4702 | function checkMask(value, bitmask) {
|
4703 | return (value & bitmask) === bitmask;
|
4704 | }
|
4705 |
|
4706 | var DOMPropertyInjection = {
|
4707 | |
4708 |
|
4709 |
|
4710 |
|
4711 | MUST_USE_ATTRIBUTE: 0x1,
|
4712 | MUST_USE_PROPERTY: 0x2,
|
4713 | HAS_SIDE_EFFECTS: 0x4,
|
4714 | HAS_BOOLEAN_VALUE: 0x8,
|
4715 | HAS_NUMERIC_VALUE: 0x10,
|
4716 | HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
|
4717 | HAS_OVERLOADED_BOOLEAN_VALUE: 0x40,
|
4718 |
|
4719 | |
4720 |
|
4721 |
|
4722 |
|
4723 |
|
4724 |
|
4725 |
|
4726 |
|
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 |
|
4733 |
|
4734 |
|
4735 |
|
4736 |
|
4737 |
|
4738 |
|
4739 |
|
4740 |
|
4741 |
|
4742 |
|
4743 |
|
4744 |
|
4745 |
|
4746 |
|
4747 | injectDOMPropertyConfig: function (domPropertyConfig) {
|
4748 | var Injection = DOMPropertyInjection;
|
4749 | var Properties = domPropertyConfig.Properties || {};
|
4750 | var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
|
4751 | var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
|
4752 | var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
|
4753 | var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
|
4754 |
|
4755 | if (domPropertyConfig.isCustomAttribute) {
|
4756 | DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
|
4757 | }
|
4758 |
|
4759 | for (var propName in Properties) {
|
4760 | !!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(false) : undefined;
|
4761 |
|
4762 | var lowerCased = propName.toLowerCase();
|
4763 | var propConfig = Properties[propName];
|
4764 |
|
4765 | var propertyInfo = {
|
4766 | attributeName: lowerCased,
|
4767 | attributeNamespace: null,
|
4768 | propertyName: propName,
|
4769 | mutationMethod: null,
|
4770 |
|
4771 | mustUseAttribute: checkMask(propConfig, Injection.MUST_USE_ATTRIBUTE),
|
4772 | mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
|
4773 | hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS),
|
4774 | hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
|
4775 | hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
|
4776 | hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
|
4777 | hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
|
4778 | };
|
4779 |
|
4780 | !(!propertyInfo.mustUseAttribute || !propertyInfo.mustUseProperty) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Cannot require using both attribute and property: %s', propName) : invariant(false) : undefined;
|
4781 | !(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : undefined;
|
4782 | !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : undefined;
|
4783 |
|
4784 | if (process.env.NODE_ENV !== 'production') {
|
4785 | DOMProperty.getPossibleStandardName[lowerCased] = propName;
|
4786 | }
|
4787 |
|
4788 | if (DOMAttributeNames.hasOwnProperty(propName)) {
|
4789 | var attributeName = DOMAttributeNames[propName];
|
4790 | propertyInfo.attributeName = attributeName;
|
4791 | if (process.env.NODE_ENV !== 'production') {
|
4792 | DOMProperty.getPossibleStandardName[attributeName] = propName;
|
4793 | }
|
4794 | }
|
4795 |
|
4796 | if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
|
4797 | propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
|
4798 | }
|
4799 |
|
4800 | if (DOMPropertyNames.hasOwnProperty(propName)) {
|
4801 | propertyInfo.propertyName = DOMPropertyNames[propName];
|
4802 | }
|
4803 |
|
4804 | if (DOMMutationMethods.hasOwnProperty(propName)) {
|
4805 | propertyInfo.mutationMethod = DOMMutationMethods[propName];
|
4806 | }
|
4807 |
|
4808 | DOMProperty.properties[propName] = propertyInfo;
|
4809 | }
|
4810 | }
|
4811 | };
|
4812 | var defaultValueCache = {};
|
4813 |
|
4814 | |
4815 |
|
4816 |
|
4817 |
|
4818 |
|
4819 |
|
4820 |
|
4821 |
|
4822 |
|
4823 |
|
4824 |
|
4825 |
|
4826 |
|
4827 | var DOMProperty = {
|
4828 |
|
4829 | ID_ATTRIBUTE_NAME: 'data-reactid',
|
4830 |
|
4831 | |
4832 |
|
4833 |
|
4834 |
|
4835 |
|
4836 |
|
4837 |
|
4838 |
|
4839 |
|
4840 |
|
4841 |
|
4842 |
|
4843 |
|
4844 |
|
4845 |
|
4846 |
|
4847 |
|
4848 |
|
4849 |
|
4850 |
|
4851 |
|
4852 |
|
4853 |
|
4854 |
|
4855 |
|
4856 |
|
4857 |
|
4858 |
|
4859 |
|
4860 |
|
4861 |
|
4862 |
|
4863 |
|
4864 |
|
4865 |
|
4866 |
|
4867 | properties: {},
|
4868 |
|
4869 | |
4870 |
|
4871 |
|
4872 |
|
4873 |
|
4874 | getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} : null,
|
4875 |
|
4876 | |
4877 |
|
4878 |
|
4879 | _isCustomAttributeFunctions: [],
|
4880 |
|
4881 | |
4882 |
|
4883 |
|
4884 |
|
4885 | isCustomAttribute: function (attributeName) {
|
4886 | for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
|
4887 | var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
|
4888 | if (isCustomAttributeFn(attributeName)) {
|
4889 | return true;
|
4890 | }
|
4891 | }
|
4892 | return false;
|
4893 | },
|
4894 |
|
4895 | |
4896 |
|
4897 |
|
4898 |
|
4899 |
|
4900 |
|
4901 |
|
4902 |
|
4903 | getDefaultValueForProperty: function (nodeName, prop) {
|
4904 | var nodeDefaults = defaultValueCache[nodeName];
|
4905 | var testElement;
|
4906 | if (!nodeDefaults) {
|
4907 | defaultValueCache[nodeName] = nodeDefaults = {};
|
4908 | }
|
4909 | if (!(prop in nodeDefaults)) {
|
4910 | testElement = document.createElement(nodeName);
|
4911 | nodeDefaults[prop] = testElement[prop];
|
4912 | }
|
4913 | return nodeDefaults[prop];
|
4914 | },
|
4915 |
|
4916 | injection: DOMPropertyInjection
|
4917 | };
|
4918 |
|
4919 | module.exports = DOMProperty;
|
4920 | }.call(exports, __webpack_require__(89)))
|
4921 |
|
4922 | }),
|
4923 |
|
4924 | (function(module, exports, __webpack_require__) {
|
4925 |
|
4926 | |
4927 |
|
4928 |
|
4929 |
|
4930 |
|
4931 |
|
4932 |
|
4933 |
|
4934 |
|
4935 |
|
4936 |
|
4937 | 'use strict';
|
4938 |
|
4939 | var escapeTextContentForBrowser = __webpack_require__(106);
|
4940 |
|
4941 | |
4942 |
|
4943 |
|
4944 |
|
4945 |
|
4946 |
|
4947 | function quoteAttributeValueForBrowser(value) {
|
4948 | return '"' + escapeTextContentForBrowser(value) + '"';
|
4949 | }
|
4950 |
|
4951 | module.exports = quoteAttributeValueForBrowser;
|
4952 |
|
4953 | }),
|
4954 |
|
4955 | (function(module, exports, __webpack_require__) {
|
4956 |
|
4957 | (function(process) { |
4958 |
|
4959 |
|
4960 |
|
4961 |
|
4962 |
|
4963 |
|
4964 |
|
4965 |
|
4966 |
|
4967 |
|
4968 | 'use strict';
|
4969 |
|
4970 | var emptyFunction = __webpack_require__(100);
|
4971 |
|
4972 | |
4973 |
|
4974 |
|
4975 |
|
4976 |
|
4977 |
|
4978 |
|
4979 | var warning = emptyFunction;
|
4980 |
|
4981 | if (process.env.NODE_ENV !== 'production') {
|
4982 | warning = function (condition, format) {
|
4983 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
4984 | args[_key - 2] = arguments[_key];
|
4985 | }
|
4986 |
|
4987 | if (format === undefined) {
|
4988 | throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
4989 | }
|
4990 |
|
4991 | if (format.indexOf('Failed Composite propType: ') === 0) {
|
4992 | return;
|
4993 | }
|
4994 |
|
4995 | if (!condition) {
|
4996 | var argIndex = 0;
|
4997 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
4998 | return args[argIndex++];
|
4999 | });
|
5000 | if (typeof console !== 'undefined') {
|
5001 | console.error(message);
|
5002 | }
|
5003 | try {
|
5004 |
|
5005 |
|
5006 |
|
5007 | throw new Error(message);
|
5008 | } catch (x) {}
|
5009 | }
|
5010 | };
|
5011 | }
|
5012 |
|
5013 | module.exports = warning;
|
5014 | }.call(exports, __webpack_require__(89)))
|
5015 |
|
5016 | }),
|
5017 |
|
5018 | (function(module, exports, __webpack_require__) {
|
5019 |
|
5020 | |
5021 |
|
5022 |
|
5023 |
|
5024 |
|
5025 |
|
5026 |
|
5027 |
|
5028 |
|
5029 |
|
5030 |
|
5031 | 'use strict';
|
5032 |
|
5033 | var ReactDOMIDOperations = __webpack_require__(112);
|
5034 | var ReactMount = __webpack_require__(113);
|
5035 |
|
5036 | |
5037 |
|
5038 |
|
5039 |
|
5040 |
|
5041 | var ReactComponentBrowserEnvironment = {
|
5042 |
|
5043 | processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
|
5044 |
|
5045 | replaceNodeWithMarkupByID: ReactDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID,
|
5046 |
|
5047 | |
5048 |
|
5049 |
|
5050 |
|
5051 |
|
5052 |
|
5053 |
|
5054 | unmountIDFromEnvironment: function (rootNodeID) {
|
5055 | ReactMount.purgeID(rootNodeID);
|
5056 | }
|
5057 |
|
5058 | };
|
5059 |
|
5060 | module.exports = ReactComponentBrowserEnvironment;
|
5061 |
|
5062 | }),
|
5063 |
|
5064 | (function(module, exports, __webpack_require__) {
|
5065 |
|
5066 | (function(process) { |
5067 |
|
5068 |
|
5069 |
|
5070 |
|
5071 |
|
5072 |
|
5073 |
|
5074 |
|
5075 |
|
5076 |
|
5077 |
|
5078 | 'use strict';
|
5079 |
|
5080 | var DOMChildrenOperations = __webpack_require__(92);
|
5081 | var DOMPropertyOperations = __webpack_require__(107);
|
5082 | var ReactMount = __webpack_require__(113);
|
5083 | var ReactPerf = __webpack_require__(103);
|
5084 |
|
5085 | var invariant = __webpack_require__(98);
|
5086 |
|
5087 | |
5088 |
|
5089 |
|
5090 |
|
5091 |
|
5092 |
|
5093 | var INVALID_PROPERTY_ERRORS = {
|
5094 | dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.',
|
5095 | style: '`style` must be set using `updateStylesByID()`.'
|
5096 | };
|
5097 |
|
5098 | |
5099 |
|
5100 |
|
5101 | var ReactDOMIDOperations = {
|
5102 |
|
5103 | |
5104 |
|
5105 |
|
5106 |
|
5107 |
|
5108 |
|
5109 |
|
5110 |
|
5111 |
|
5112 | updatePropertyByID: function (id, name, value) {
|
5113 | var node = ReactMount.getNode(id);
|
5114 | !!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined;
|
5115 |
|
5116 |
|
5117 |
|
5118 |
|
5119 | if (value != null) {
|
5120 | DOMPropertyOperations.setValueForProperty(node, name, value);
|
5121 | } else {
|
5122 | DOMPropertyOperations.deleteValueForProperty(node, name);
|
5123 | }
|
5124 | },
|
5125 |
|
5126 | |
5127 |
|
5128 |
|
5129 |
|
5130 |
|
5131 |
|
5132 |
|
5133 |
|
5134 | dangerouslyReplaceNodeWithMarkupByID: function (id, markup) {
|
5135 | var node = ReactMount.getNode(id);
|
5136 | DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup);
|
5137 | },
|
5138 |
|
5139 | |
5140 |
|
5141 |
|
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 | dangerouslyProcessChildrenUpdates: function (updates, markup) {
|
5147 | for (var i = 0; i < updates.length; i++) {
|
5148 | updates[i].parentNode = ReactMount.getNode(updates[i].parentID);
|
5149 | }
|
5150 | DOMChildrenOperations.processUpdates(updates, markup);
|
5151 | }
|
5152 | };
|
5153 |
|
5154 | ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', {
|
5155 | dangerouslyReplaceNodeWithMarkupByID: 'dangerouslyReplaceNodeWithMarkupByID',
|
5156 | dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates'
|
5157 | });
|
5158 |
|
5159 | module.exports = ReactDOMIDOperations;
|
5160 | }.call(exports, __webpack_require__(89)))
|
5161 |
|
5162 | }),
|
5163 |
|
5164 | (function(module, exports, __webpack_require__) {
|
5165 |
|
5166 | (function(process) { |
5167 |
|
5168 |
|
5169 |
|
5170 |
|
5171 |
|
5172 |
|
5173 |
|
5174 |
|
5175 |
|
5176 |
|
5177 | 'use strict';
|
5178 |
|
5179 | var DOMProperty = __webpack_require__(108);
|
5180 | var ReactBrowserEventEmitter = __webpack_require__(114);
|
5181 | var ReactCurrentOwner = __webpack_require__(90);
|
5182 | var ReactDOMFeatureFlags = __webpack_require__(126);
|
5183 | var ReactElement = __webpack_require__(127);
|
5184 | var ReactEmptyComponentRegistry = __webpack_require__(129);
|
5185 | var ReactInstanceHandles = __webpack_require__(130);
|
5186 | var ReactInstanceMap = __webpack_require__(132);
|
5187 | var ReactMarkupChecksum = __webpack_require__(133);
|
5188 | var ReactPerf = __webpack_require__(103);
|
5189 | var ReactReconciler = __webpack_require__(135);
|
5190 | var ReactUpdateQueue = __webpack_require__(138);
|
5191 | var ReactUpdates = __webpack_require__(139);
|
5192 |
|
5193 | var assign = __webpack_require__(124);
|
5194 | var emptyObject = __webpack_require__(143);
|
5195 | var containsNode = __webpack_require__(144);
|
5196 | var instantiateReactComponent = __webpack_require__(147);
|
5197 | var invariant = __webpack_require__(98);
|
5198 | var setInnerHTML = __webpack_require__(104);
|
5199 | var shouldUpdateReactComponent = __webpack_require__(152);
|
5200 | var validateDOMNesting = __webpack_require__(155);
|
5201 | var warning = __webpack_require__(110);
|
5202 |
|
5203 | var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
|
5204 | var nodeCache = {};
|
5205 |
|
5206 | var ELEMENT_NODE_TYPE = 1;
|
5207 | var DOC_NODE_TYPE = 9;
|
5208 | var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
|
5209 |
|
5210 | var ownerDocumentContextKey = '__ReactMount_ownerDocument$' + Math.random().toString(36).slice(2);
|
5211 |
|
5212 |
|
5213 | var instancesByReactRootID = {};
|
5214 |
|
5215 |
|
5216 | var containersByReactRootID = {};
|
5217 |
|
5218 | if (process.env.NODE_ENV !== 'production') {
|
5219 |
|
5220 | var rootElementsByReactRootID = {};
|
5221 | }
|
5222 |
|
5223 |
|
5224 | var findComponentRootReusableArray = [];
|
5225 |
|
5226 | |
5227 |
|
5228 |
|
5229 |
|
5230 |
|
5231 |
|
5232 | function firstDifferenceIndex(string1, string2) {
|
5233 | var minLen = Math.min(string1.length, string2.length);
|
5234 | for (var i = 0; i < minLen; i++) {
|
5235 | if (string1.charAt(i) !== string2.charAt(i)) {
|
5236 | return i;
|
5237 | }
|
5238 | }
|
5239 | return string1.length === string2.length ? -1 : minLen;
|
5240 | }
|
5241 |
|
5242 | |
5243 |
|
5244 |
|
5245 |
|
5246 |
|
5247 | function getReactRootElementInContainer(container) {
|
5248 | if (!container) {
|
5249 | return null;
|
5250 | }
|
5251 |
|
5252 | if (container.nodeType === DOC_NODE_TYPE) {
|
5253 | return container.documentElement;
|
5254 | } else {
|
5255 | return container.firstChild;
|
5256 | }
|
5257 | }
|
5258 |
|
5259 | |
5260 |
|
5261 |
|
5262 |
|
5263 | function getReactRootID(container) {
|
5264 | var rootElement = getReactRootElementInContainer(container);
|
5265 | return rootElement && ReactMount.getID(rootElement);
|
5266 | }
|
5267 |
|
5268 | |
5269 |
|
5270 |
|
5271 |
|
5272 |
|
5273 |
|
5274 |
|
5275 |
|
5276 |
|
5277 |
|
5278 | function getID(node) {
|
5279 | var id = internalGetID(node);
|
5280 | if (id) {
|
5281 | if (nodeCache.hasOwnProperty(id)) {
|
5282 | var cached = nodeCache[id];
|
5283 | if (cached !== node) {
|
5284 | !!isValid(cached, id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(false) : undefined;
|
5285 |
|
5286 | nodeCache[id] = node;
|
5287 | }
|
5288 | } else {
|
5289 | nodeCache[id] = node;
|
5290 | }
|
5291 | }
|
5292 |
|
5293 | return id;
|
5294 | }
|
5295 |
|
5296 | function internalGetID(node) {
|
5297 |
|
5298 |
|
5299 |
|
5300 | return node && node.getAttribute && node.getAttribute(ATTR_NAME) || '';
|
5301 | }
|
5302 |
|
5303 | |
5304 |
|
5305 |
|
5306 |
|
5307 |
|
5308 |
|
5309 | function setID(node, id) {
|
5310 | var oldID = internalGetID(node);
|
5311 | if (oldID !== id) {
|
5312 | delete nodeCache[oldID];
|
5313 | }
|
5314 | node.setAttribute(ATTR_NAME, id);
|
5315 | nodeCache[id] = node;
|
5316 | }
|
5317 |
|
5318 | |
5319 |
|
5320 |
|
5321 |
|
5322 |
|
5323 |
|
5324 |
|
5325 | function getNode(id) {
|
5326 | if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
|
5327 | nodeCache[id] = ReactMount.findReactNodeByID(id);
|
5328 | }
|
5329 | return nodeCache[id];
|
5330 | }
|
5331 |
|
5332 | |
5333 |
|
5334 |
|
5335 |
|
5336 |
|
5337 |
|
5338 |
|
5339 | function getNodeFromInstance(instance) {
|
5340 | var id = ReactInstanceMap.get(instance)._rootNodeID;
|
5341 | if (ReactEmptyComponentRegistry.isNullComponentID(id)) {
|
5342 | return null;
|
5343 | }
|
5344 | if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
|
5345 | nodeCache[id] = ReactMount.findReactNodeByID(id);
|
5346 | }
|
5347 | return nodeCache[id];
|
5348 | }
|
5349 |
|
5350 | |
5351 |
|
5352 |
|
5353 |
|
5354 |
|
5355 |
|
5356 |
|
5357 |
|
5358 |
|
5359 |
|
5360 | function isValid(node, id) {
|
5361 | if (node) {
|
5362 | !(internalGetID(node) === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(false) : undefined;
|
5363 |
|
5364 | var container = ReactMount.findReactContainerForID(id);
|
5365 | if (container && containsNode(container, node)) {
|
5366 | return true;
|
5367 | }
|
5368 | }
|
5369 |
|
5370 | return false;
|
5371 | }
|
5372 |
|
5373 | |
5374 |
|
5375 |
|
5376 |
|
5377 |
|
5378 | function purgeID(id) {
|
5379 | delete nodeCache[id];
|
5380 | }
|
5381 |
|
5382 | var deepestNodeSoFar = null;
|
5383 | function findDeepestCachedAncestorImpl(ancestorID) {
|
5384 | var ancestor = nodeCache[ancestorID];
|
5385 | if (ancestor && isValid(ancestor, ancestorID)) {
|
5386 | deepestNodeSoFar = ancestor;
|
5387 | } else {
|
5388 |
|
5389 |
|
5390 | return false;
|
5391 | }
|
5392 | }
|
5393 |
|
5394 | |
5395 |
|
5396 |
|
5397 | function findDeepestCachedAncestor(targetID) {
|
5398 | deepestNodeSoFar = null;
|
5399 | ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);
|
5400 |
|
5401 | var foundNode = deepestNodeSoFar;
|
5402 | deepestNodeSoFar = null;
|
5403 | return foundNode;
|
5404 | }
|
5405 |
|
5406 | |
5407 |
|
5408 |
|
5409 |
|
5410 |
|
5411 |
|
5412 |
|
5413 |
|
5414 |
|
5415 | function mountComponentIntoNode(componentInstance, rootID, container, transaction, shouldReuseMarkup, context) {
|
5416 | if (ReactDOMFeatureFlags.useCreateElement) {
|
5417 | context = assign({}, context);
|
5418 | if (container.nodeType === DOC_NODE_TYPE) {
|
5419 | context[ownerDocumentContextKey] = container;
|
5420 | } else {
|
5421 | context[ownerDocumentContextKey] = container.ownerDocument;
|
5422 | }
|
5423 | }
|
5424 | if (process.env.NODE_ENV !== 'production') {
|
5425 | if (context === emptyObject) {
|
5426 | context = {};
|
5427 | }
|
5428 | var tag = container.nodeName.toLowerCase();
|
5429 | context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(null, tag, null);
|
5430 | }
|
5431 | var markup = ReactReconciler.mountComponent(componentInstance, rootID, transaction, context);
|
5432 | componentInstance._renderedComponent._topLevelWrapper = componentInstance;
|
5433 | ReactMount._mountImageIntoNode(markup, container, shouldReuseMarkup, transaction);
|
5434 | }
|
5435 |
|
5436 | |
5437 |
|
5438 |
|
5439 |
|
5440 |
|
5441 |
|
5442 |
|
5443 |
|
5444 | function batchedMountComponentIntoNode(componentInstance, rootID, container, shouldReuseMarkup, context) {
|
5445 | var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
|
5446 | shouldReuseMarkup);
|
5447 | transaction.perform(mountComponentIntoNode, null, componentInstance, rootID, container, transaction, shouldReuseMarkup, context);
|
5448 | ReactUpdates.ReactReconcileTransaction.release(transaction);
|
5449 | }
|
5450 |
|
5451 | |
5452 |
|
5453 |
|
5454 |
|
5455 |
|
5456 |
|
5457 |
|
5458 |
|
5459 |
|
5460 | function unmountComponentFromNode(instance, container) {
|
5461 | ReactReconciler.unmountComponent(instance);
|
5462 |
|
5463 | if (container.nodeType === DOC_NODE_TYPE) {
|
5464 | container = container.documentElement;
|
5465 | }
|
5466 |
|
5467 |
|
5468 | while (container.lastChild) {
|
5469 | container.removeChild(container.lastChild);
|
5470 | }
|
5471 | }
|
5472 |
|
5473 | |
5474 |
|
5475 |
|
5476 |
|
5477 |
|
5478 |
|
5479 |
|
5480 |
|
5481 |
|
5482 |
|
5483 | function hasNonRootReactChild(node) {
|
5484 | var reactRootID = getReactRootID(node);
|
5485 | return reactRootID ? reactRootID !== ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID) : false;
|
5486 | }
|
5487 |
|
5488 | |
5489 |
|
5490 |
|
5491 |
|
5492 | function findFirstReactDOMImpl(node) {
|
5493 |
|
5494 |
|
5495 | for (; node && node.parentNode !== node; node = node.parentNode) {
|
5496 | if (node.nodeType !== 1) {
|
5497 |
|
5498 | continue;
|
5499 | }
|
5500 | var nodeID = internalGetID(node);
|
5501 | if (!nodeID) {
|
5502 | continue;
|
5503 | }
|
5504 | var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
|
5505 |
|
5506 |
|
5507 |
|
5508 |
|
5509 |
|
5510 | var current = node;
|
5511 | var lastID;
|
5512 | do {
|
5513 | lastID = internalGetID(current);
|
5514 | current = current.parentNode;
|
5515 | if (current == null) {
|
5516 |
|
5517 |
|
5518 | return null;
|
5519 | }
|
5520 | } while (lastID !== reactRootID);
|
5521 |
|
5522 | if (current === containersByReactRootID[reactRootID]) {
|
5523 | return node;
|
5524 | }
|
5525 | }
|
5526 | return null;
|
5527 | }
|
5528 |
|
5529 | |
5530 |
|
5531 |
|
5532 |
|
5533 |
|
5534 | var TopLevelWrapper = function () {};
|
5535 | TopLevelWrapper.prototype.isReactComponent = {};
|
5536 | if (process.env.NODE_ENV !== 'production') {
|
5537 | TopLevelWrapper.displayName = 'TopLevelWrapper';
|
5538 | }
|
5539 | TopLevelWrapper.prototype.render = function () {
|
5540 |
|
5541 | return this.props;
|
5542 | };
|
5543 |
|
5544 | |
5545 |
|
5546 |
|
5547 |
|
5548 |
|
5549 |
|
5550 |
|
5551 |
|
5552 |
|
5553 |
|
5554 |
|
5555 |
|
5556 |
|
5557 |
|
5558 |
|
5559 |
|
5560 |
|
5561 |
|
5562 | var ReactMount = {
|
5563 |
|
5564 | TopLevelWrapper: TopLevelWrapper,
|
5565 |
|
5566 |
|
5567 | _instancesByReactRootID: instancesByReactRootID,
|
5568 |
|
5569 | |
5570 |
|
5571 |
|
5572 |
|
5573 |
|
5574 |
|
5575 |
|
5576 |
|
5577 | scrollMonitor: function (container, renderCallback) {
|
5578 | renderCallback();
|
5579 | },
|
5580 |
|
5581 | |
5582 |
|
5583 |
|
5584 |
|
5585 |
|
5586 |
|
5587 |
|
5588 | _updateRootComponent: function (prevComponent, nextElement, container, callback) {
|
5589 | ReactMount.scrollMonitor(container, function () {
|
5590 | ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
|
5591 | if (callback) {
|
5592 | ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
|
5593 | }
|
5594 | });
|
5595 |
|
5596 | if (process.env.NODE_ENV !== 'production') {
|
5597 |
|
5598 | rootElementsByReactRootID[getReactRootID(container)] = getReactRootElementInContainer(container);
|
5599 | }
|
5600 |
|
5601 | return prevComponent;
|
5602 | },
|
5603 |
|
5604 | |
5605 |
|
5606 |
|
5607 |
|
5608 |
|
5609 |
|
5610 |
|
5611 | _registerComponent: function (nextComponent, container) {
|
5612 | !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : undefined;
|
5613 |
|
5614 | ReactBrowserEventEmitter.ensureScrollValueMonitoring();
|
5615 |
|
5616 | var reactRootID = ReactMount.registerContainer(container);
|
5617 | instancesByReactRootID[reactRootID] = nextComponent;
|
5618 | return reactRootID;
|
5619 | },
|
5620 |
|
5621 | |
5622 |
|
5623 |
|
5624 |
|
5625 |
|
5626 |
|
5627 |
|
5628 | _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
|
5629 |
|
5630 |
|
5631 |
|
5632 | process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined;
|
5633 |
|
5634 | var componentInstance = instantiateReactComponent(nextElement, null);
|
5635 | var reactRootID = ReactMount._registerComponent(componentInstance, container);
|
5636 |
|
5637 |
|
5638 |
|
5639 |
|
5640 |
|
5641 | ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, reactRootID, container, shouldReuseMarkup, context);
|
5642 |
|
5643 | if (process.env.NODE_ENV !== 'production') {
|
5644 |
|
5645 | rootElementsByReactRootID[reactRootID] = getReactRootElementInContainer(container);
|
5646 | }
|
5647 |
|
5648 | return componentInstance;
|
5649 | },
|
5650 |
|
5651 | |
5652 |
|
5653 |
|
5654 |
|
5655 |
|
5656 |
|
5657 |
|
5658 |
|
5659 |
|
5660 |
|
5661 |
|
5662 |
|
5663 |
|
5664 | renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
|
5665 | !(parentComponent != null && parentComponent._reactInternalInstance != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : undefined;
|
5666 | return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
|
5667 | },
|
5668 |
|
5669 | _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
|
5670 | !ReactElement.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing an element string, make sure to instantiate ' + 'it by passing it to React.createElement.' : typeof nextElement === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' :
|
5671 |
|
5672 | nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : undefined;
|
5673 |
|
5674 | process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : undefined;
|
5675 |
|
5676 | var nextWrappedElement = new ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
|
5677 |
|
5678 | var prevComponent = instancesByReactRootID[getReactRootID(container)];
|
5679 |
|
5680 | if (prevComponent) {
|
5681 | var prevWrappedElement = prevComponent._currentElement;
|
5682 | var prevElement = prevWrappedElement.props;
|
5683 | if (shouldUpdateReactComponent(prevElement, nextElement)) {
|
5684 | var publicInst = prevComponent._renderedComponent.getPublicInstance();
|
5685 | var updatedCallback = callback && function () {
|
5686 | callback.call(publicInst);
|
5687 | };
|
5688 | ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);
|
5689 | return publicInst;
|
5690 | } else {
|
5691 | ReactMount.unmountComponentAtNode(container);
|
5692 | }
|
5693 | }
|
5694 |
|
5695 | var reactRootElement = getReactRootElementInContainer(container);
|
5696 | var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
|
5697 | var containerHasNonRootReactChild = hasNonRootReactChild(container);
|
5698 |
|
5699 | if (process.env.NODE_ENV !== 'production') {
|
5700 | process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : undefined;
|
5701 |
|
5702 | if (!containerHasReactMarkup || reactRootElement.nextSibling) {
|
5703 | var rootElementSibling = reactRootElement;
|
5704 | while (rootElementSibling) {
|
5705 | if (internalGetID(rootElementSibling)) {
|
5706 | process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : undefined;
|
5707 | break;
|
5708 | }
|
5709 | rootElementSibling = rootElementSibling.nextSibling;
|
5710 | }
|
5711 | }
|
5712 | }
|
5713 |
|
5714 | var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
|
5715 | var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();
|
5716 | if (callback) {
|
5717 | callback.call(component);
|
5718 | }
|
5719 | return component;
|
5720 | },
|
5721 |
|
5722 | |
5723 |
|
5724 |
|
5725 |
|
5726 |
|
5727 |
|
5728 |
|
5729 |
|
5730 |
|
5731 |
|
5732 |
|
5733 |
|
5734 | render: function (nextElement, container, callback) {
|
5735 | return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
|
5736 | },
|
5737 |
|
5738 | |
5739 |
|
5740 |
|
5741 |
|
5742 |
|
5743 |
|
5744 |
|
5745 |
|
5746 | registerContainer: function (container) {
|
5747 | var reactRootID = getReactRootID(container);
|
5748 | if (reactRootID) {
|
5749 |
|
5750 | reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID);
|
5751 | }
|
5752 | if (!reactRootID) {
|
5753 |
|
5754 | reactRootID = ReactInstanceHandles.createReactRootID();
|
5755 | }
|
5756 | containersByReactRootID[reactRootID] = container;
|
5757 | return reactRootID;
|
5758 | },
|
5759 |
|
5760 | |
5761 |
|
5762 |
|
5763 |
|
5764 |
|
5765 |
|
5766 |
|
5767 | unmountComponentAtNode: function (container) {
|
5768 |
|
5769 |
|
5770 |
|
5771 |
|
5772 | process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined;
|
5773 |
|
5774 | !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : undefined;
|
5775 |
|
5776 | var reactRootID = getReactRootID(container);
|
5777 | var component = instancesByReactRootID[reactRootID];
|
5778 | if (!component) {
|
5779 |
|
5780 |
|
5781 | var containerHasNonRootReactChild = hasNonRootReactChild(container);
|
5782 |
|
5783 |
|
5784 | var containerID = internalGetID(container);
|
5785 | var isContainerReactRoot = containerID && containerID === ReactInstanceHandles.getReactRootIDFromNodeID(containerID);
|
5786 |
|
5787 | if (process.env.NODE_ENV !== 'production') {
|
5788 | process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : undefined;
|
5789 | }
|
5790 |
|
5791 | return false;
|
5792 | }
|
5793 | ReactUpdates.batchedUpdates(unmountComponentFromNode, component, container);
|
5794 | delete instancesByReactRootID[reactRootID];
|
5795 | delete containersByReactRootID[reactRootID];
|
5796 | if (process.env.NODE_ENV !== 'production') {
|
5797 | delete rootElementsByReactRootID[reactRootID];
|
5798 | }
|
5799 | return true;
|
5800 | },
|
5801 |
|
5802 | |
5803 |
|
5804 |
|
5805 |
|
5806 |
|
5807 |
|
5808 |
|
5809 | findReactContainerForID: function (id) {
|
5810 | var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id);
|
5811 | var container = containersByReactRootID[reactRootID];
|
5812 |
|
5813 | if (process.env.NODE_ENV !== 'production') {
|
5814 | var rootElement = rootElementsByReactRootID[reactRootID];
|
5815 | if (rootElement && rootElement.parentNode !== container) {
|
5816 | process.env.NODE_ENV !== 'production' ? warning(
|
5817 |
|
5818 |
|
5819 | internalGetID(rootElement) === reactRootID, 'ReactMount: Root element ID differed from reactRootID.') : undefined;
|
5820 | var containerChild = container.firstChild;
|
5821 | if (containerChild && reactRootID === internalGetID(containerChild)) {
|
5822 |
|
5823 |
|
5824 |
|
5825 |
|
5826 | rootElementsByReactRootID[reactRootID] = containerChild;
|
5827 | } else {
|
5828 | process.env.NODE_ENV !== 'production' ? warning(false, 'ReactMount: Root element has been removed from its original ' + 'container. New container: %s', rootElement.parentNode) : undefined;
|
5829 | }
|
5830 | }
|
5831 | }
|
5832 |
|
5833 | return container;
|
5834 | },
|
5835 |
|
5836 | |
5837 |
|
5838 |
|
5839 |
|
5840 |
|
5841 |
|
5842 | findReactNodeByID: function (id) {
|
5843 | var reactRoot = ReactMount.findReactContainerForID(id);
|
5844 | return ReactMount.findComponentRoot(reactRoot, id);
|
5845 | },
|
5846 |
|
5847 | |
5848 |
|
5849 |
|
5850 |
|
5851 |
|
5852 |
|
5853 |
|
5854 |
|
5855 | getFirstReactDOM: function (node) {
|
5856 | return findFirstReactDOMImpl(node);
|
5857 | },
|
5858 |
|
5859 | |
5860 |
|
5861 |
|
5862 |
|
5863 |
|
5864 |
|
5865 |
|
5866 |
|
5867 |
|
5868 |
|
5869 | findComponentRoot: function (ancestorNode, targetID) {
|
5870 | var firstChildren = findComponentRootReusableArray;
|
5871 | var childIndex = 0;
|
5872 |
|
5873 | var deepestAncestor = findDeepestCachedAncestor(targetID) || ancestorNode;
|
5874 |
|
5875 | if (process.env.NODE_ENV !== 'production') {
|
5876 |
|
5877 | process.env.NODE_ENV !== 'production' ? warning(deepestAncestor != null, 'React can\'t find the root component node for data-reactid value ' + '`%s`. If you\'re seeing this message, it probably means that ' + 'you\'ve loaded two copies of React on the page. At this time, only ' + 'a single copy of React can be loaded at a time.', targetID) : undefined;
|
5878 | }
|
5879 |
|
5880 | firstChildren[0] = deepestAncestor.firstChild;
|
5881 | firstChildren.length = 1;
|
5882 |
|
5883 | while (childIndex < firstChildren.length) {
|
5884 | var child = firstChildren[childIndex++];
|
5885 | var targetChild;
|
5886 |
|
5887 | while (child) {
|
5888 | var childID = ReactMount.getID(child);
|
5889 | if (childID) {
|
5890 |
|
5891 |
|
5892 |
|
5893 |
|
5894 |
|
5895 | if (targetID === childID) {
|
5896 | targetChild = child;
|
5897 | } else if (ReactInstanceHandles.isAncestorIDOf(childID, targetID)) {
|
5898 |
|
5899 |
|
5900 |
|
5901 |
|
5902 | firstChildren.length = childIndex = 0;
|
5903 | firstChildren.push(child.firstChild);
|
5904 | }
|
5905 | } else {
|
5906 |
|
5907 |
|
5908 |
|
5909 |
|
5910 |
|
5911 | firstChildren.push(child.firstChild);
|
5912 | }
|
5913 |
|
5914 | child = child.nextSibling;
|
5915 | }
|
5916 |
|
5917 | if (targetChild) {
|
5918 |
|
5919 |
|
5920 |
|
5921 | firstChildren.length = 0;
|
5922 |
|
5923 | return targetChild;
|
5924 | }
|
5925 | }
|
5926 |
|
5927 | firstChildren.length = 0;
|
5928 |
|
5929 | true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + 'usually due to forgetting a <tbody> when using tables, nesting tags ' + 'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' + 'parent. ' + 'Try inspecting the child nodes of the element with React ID `%s`.', targetID, ReactMount.getID(ancestorNode)) : invariant(false) : undefined;
|
5930 | },
|
5931 |
|
5932 | _mountImageIntoNode: function (markup, container, shouldReuseMarkup, transaction) {
|
5933 | !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : undefined;
|
5934 |
|
5935 | if (shouldReuseMarkup) {
|
5936 | var rootElement = getReactRootElementInContainer(container);
|
5937 | if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
|
5938 | return;
|
5939 | } else {
|
5940 | var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
5941 | rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
5942 |
|
5943 | var rootMarkup = rootElement.outerHTML;
|
5944 | rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
|
5945 |
|
5946 | var normalizedMarkup = markup;
|
5947 | if (process.env.NODE_ENV !== 'production') {
|
5948 |
|
5949 |
|
5950 |
|
5951 |
|
5952 | var normalizer;
|
5953 | if (container.nodeType === ELEMENT_NODE_TYPE) {
|
5954 | normalizer = document.createElement('div');
|
5955 | normalizer.innerHTML = markup;
|
5956 | normalizedMarkup = normalizer.innerHTML;
|
5957 | } else {
|
5958 | normalizer = document.createElement('iframe');
|
5959 | document.body.appendChild(normalizer);
|
5960 | normalizer.contentDocument.write(markup);
|
5961 | normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
|
5962 | document.body.removeChild(normalizer);
|
5963 | }
|
5964 | }
|
5965 |
|
5966 | var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
|
5967 | var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
|
5968 |
|
5969 | !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\n%s', difference) : invariant(false) : undefined;
|
5970 |
|
5971 | if (process.env.NODE_ENV !== 'production') {
|
5972 | process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : undefined;
|
5973 | }
|
5974 | }
|
5975 | }
|
5976 |
|
5977 | !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See ReactDOMServer.renderToString() for server rendering.') : invariant(false) : undefined;
|
5978 |
|
5979 | if (transaction.useCreateElement) {
|
5980 | while (container.lastChild) {
|
5981 | container.removeChild(container.lastChild);
|
5982 | }
|
5983 | container.appendChild(markup);
|
5984 | } else {
|
5985 | setInnerHTML(container, markup);
|
5986 | }
|
5987 | },
|
5988 |
|
5989 | ownerDocumentContextKey: ownerDocumentContextKey,
|
5990 |
|
5991 | |
5992 |
|
5993 |
|
5994 |
|
5995 | getReactRootID: getReactRootID,
|
5996 |
|
5997 | getID: getID,
|
5998 |
|
5999 | setID: setID,
|
6000 |
|
6001 | getNode: getNode,
|
6002 |
|
6003 | getNodeFromInstance: getNodeFromInstance,
|
6004 |
|
6005 | isValid: isValid,
|
6006 |
|
6007 | purgeID: purgeID
|
6008 | };
|
6009 |
|
6010 | ReactPerf.measureMethods(ReactMount, 'ReactMount', {
|
6011 | _renderNewRootComponent: '_renderNewRootComponent',
|
6012 | _mountImageIntoNode: '_mountImageIntoNode'
|
6013 | });
|
6014 |
|
6015 | module.exports = ReactMount;
|
6016 | }.call(exports, __webpack_require__(89)))
|
6017 |
|
6018 | }),
|
6019 |
|
6020 | (function(module, exports, __webpack_require__) {
|
6021 |
|
6022 | |
6023 |
|
6024 |
|
6025 |
|
6026 |
|
6027 |
|
6028 |
|
6029 |
|
6030 |
|
6031 |
|
6032 |
|
6033 |
|
6034 | 'use strict';
|
6035 |
|
6036 | var EventConstants = __webpack_require__(115);
|
6037 | var EventPluginHub = __webpack_require__(116);
|
6038 | var EventPluginRegistry = __webpack_require__(117);
|
6039 | var ReactEventEmitterMixin = __webpack_require__(122);
|
6040 | var ReactPerf = __webpack_require__(103);
|
6041 | var ViewportMetrics = __webpack_require__(123);
|
6042 |
|
6043 | var assign = __webpack_require__(124);
|
6044 | var isEventSupported = __webpack_require__(125);
|
6045 |
|
6046 | |
6047 |
|
6048 |
|
6049 |
|
6050 |
|
6051 |
|
6052 |
|
6053 |
|
6054 |
|
6055 |
|
6056 |
|
6057 |
|
6058 |
|
6059 |
|
6060 |
|
6061 |
|
6062 |
|
6063 |
|
6064 |
|
6065 |
|
6066 |
|
6067 |
|
6068 |
|
6069 |
|
6070 |
|
6071 |
|
6072 |
|
6073 |
|
6074 |
|
6075 |
|
6076 |
|
6077 |
|
6078 |
|
6079 |
|
6080 |
|
6081 |
|
6082 |
|
6083 |
|
6084 |
|
6085 |
|
6086 |
|
6087 |
|
6088 |
|
6089 |
|
6090 |
|
6091 |
|
6092 |
|
6093 |
|
6094 |
|
6095 |
|
6096 |
|
6097 |
|
6098 |
|
6099 |
|
6100 |
|
6101 | var alreadyListeningTo = {};
|
6102 | var isMonitoringScrollValue = false;
|
6103 | var reactTopListenersCounter = 0;
|
6104 |
|
6105 |
|
6106 |
|
6107 |
|
6108 | var topEventMapping = {
|
6109 | topAbort: 'abort',
|
6110 | topBlur: 'blur',
|
6111 | topCanPlay: 'canplay',
|
6112 | topCanPlayThrough: 'canplaythrough',
|
6113 | topChange: 'change',
|
6114 | topClick: 'click',
|
6115 | topCompositionEnd: 'compositionend',
|
6116 | topCompositionStart: 'compositionstart',
|
6117 | topCompositionUpdate: 'compositionupdate',
|
6118 | topContextMenu: 'contextmenu',
|
6119 | topCopy: 'copy',
|
6120 | topCut: 'cut',
|
6121 | topDoubleClick: 'dblclick',
|
6122 | topDrag: 'drag',
|
6123 | topDragEnd: 'dragend',
|
6124 | topDragEnter: 'dragenter',
|
6125 | topDragExit: 'dragexit',
|
6126 | topDragLeave: 'dragleave',
|
6127 | topDragOver: 'dragover',
|
6128 | topDragStart: 'dragstart',
|
6129 | topDrop: 'drop',
|
6130 | topDurationChange: 'durationchange',
|
6131 | topEmptied: 'emptied',
|
6132 | topEncrypted: 'encrypted',
|
6133 | topEnded: 'ended',
|
6134 | topError: 'error',
|
6135 | topFocus: 'focus',
|
6136 | topInput: 'input',
|
6137 | topKeyDown: 'keydown',
|
6138 | topKeyPress: 'keypress',
|
6139 | topKeyUp: 'keyup',
|
6140 | topLoadedData: 'loadeddata',
|
6141 | topLoadedMetadata: 'loadedmetadata',
|
6142 | topLoadStart: 'loadstart',
|
6143 | topMouseDown: 'mousedown',
|
6144 | topMouseMove: 'mousemove',
|
6145 | topMouseOut: 'mouseout',
|
6146 | topMouseOver: 'mouseover',
|
6147 | topMouseUp: 'mouseup',
|
6148 | topPaste: 'paste',
|
6149 | topPause: 'pause',
|
6150 | topPlay: 'play',
|
6151 | topPlaying: 'playing',
|
6152 | topProgress: 'progress',
|
6153 | topRateChange: 'ratechange',
|
6154 | topScroll: 'scroll',
|
6155 | topSeeked: 'seeked',
|
6156 | topSeeking: 'seeking',
|
6157 | topSelectionChange: 'selectionchange',
|
6158 | topStalled: 'stalled',
|
6159 | topSuspend: 'suspend',
|
6160 | topTextInput: 'textInput',
|
6161 | topTimeUpdate: 'timeupdate',
|
6162 | topTouchCancel: 'touchcancel',
|
6163 | topTouchEnd: 'touchend',
|
6164 | topTouchMove: 'touchmove',
|
6165 | topTouchStart: 'touchstart',
|
6166 | topVolumeChange: 'volumechange',
|
6167 | topWaiting: 'waiting',
|
6168 | topWheel: 'wheel'
|
6169 | };
|
6170 |
|
6171 | |
6172 |
|
6173 |
|
6174 | var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
|
6175 |
|
6176 | function getListeningForDocument(mountAt) {
|
6177 |
|
6178 |
|
6179 | if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
|
6180 | mountAt[topListenersIDKey] = reactTopListenersCounter++;
|
6181 | alreadyListeningTo[mountAt[topListenersIDKey]] = {};
|
6182 | }
|
6183 | return alreadyListeningTo[mountAt[topListenersIDKey]];
|
6184 | }
|
6185 |
|
6186 | |
6187 |
|
6188 |
|
6189 |
|
6190 |
|
6191 |
|
6192 |
|
6193 |
|
6194 |
|
6195 |
|
6196 | var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
|
6197 |
|
6198 | |
6199 |
|
6200 |
|
6201 | ReactEventListener: null,
|
6202 |
|
6203 | injection: {
|
6204 | |
6205 |
|
6206 |
|
6207 | injectReactEventListener: function (ReactEventListener) {
|
6208 | ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
|
6209 | ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
|
6210 | }
|
6211 | },
|
6212 |
|
6213 | |
6214 |
|
6215 |
|
6216 |
|
6217 |
|
6218 | setEnabled: function (enabled) {
|
6219 | if (ReactBrowserEventEmitter.ReactEventListener) {
|
6220 | ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
|
6221 | }
|
6222 | },
|
6223 |
|
6224 | |
6225 |
|
6226 |
|
6227 | isEnabled: function () {
|
6228 | return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
|
6229 | },
|
6230 |
|
6231 | |
6232 |
|
6233 |
|
6234 |
|
6235 |
|
6236 |
|
6237 |
|
6238 |
|
6239 |
|
6240 |
|
6241 |
|
6242 |
|
6243 |
|
6244 |
|
6245 |
|
6246 |
|
6247 |
|
6248 |
|
6249 |
|
6250 |
|
6251 |
|
6252 | listenTo: function (registrationName, contentDocumentHandle) {
|
6253 | var mountAt = contentDocumentHandle;
|
6254 | var isListening = getListeningForDocument(mountAt);
|
6255 | var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
|
6256 |
|
6257 | var topLevelTypes = EventConstants.topLevelTypes;
|
6258 | for (var i = 0; i < dependencies.length; i++) {
|
6259 | var dependency = dependencies[i];
|
6260 | if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
|
6261 | if (dependency === topLevelTypes.topWheel) {
|
6262 | if (isEventSupported('wheel')) {
|
6263 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
|
6264 | } else if (isEventSupported('mousewheel')) {
|
6265 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
|
6266 | } else {
|
6267 |
|
6268 |
|
6269 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
|
6270 | }
|
6271 | } else if (dependency === topLevelTypes.topScroll) {
|
6272 |
|
6273 | if (isEventSupported('scroll', true)) {
|
6274 | ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
|
6275 | } else {
|
6276 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
|
6277 | }
|
6278 | } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
|
6279 |
|
6280 | if (isEventSupported('focus', true)) {
|
6281 | ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
|
6282 | ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
|
6283 | } else if (isEventSupported('focusin')) {
|
6284 |
|
6285 |
|
6286 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
|
6287 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
|
6288 | }
|
6289 |
|
6290 |
|
6291 | isListening[topLevelTypes.topBlur] = true;
|
6292 | isListening[topLevelTypes.topFocus] = true;
|
6293 | } else if (topEventMapping.hasOwnProperty(dependency)) {
|
6294 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
|
6295 | }
|
6296 |
|
6297 | isListening[dependency] = true;
|
6298 | }
|
6299 | }
|
6300 | },
|
6301 |
|
6302 | trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
|
6303 | return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
|
6304 | },
|
6305 |
|
6306 | trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
|
6307 | return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
|
6308 | },
|
6309 |
|
6310 | |
6311 |
|
6312 |
|
6313 |
|
6314 |
|
6315 |
|
6316 |
|
6317 |
|
6318 | ensureScrollValueMonitoring: function () {
|
6319 | if (!isMonitoringScrollValue) {
|
6320 | var refresh = ViewportMetrics.refreshScrollValues;
|
6321 | ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
|
6322 | isMonitoringScrollValue = true;
|
6323 | }
|
6324 | },
|
6325 |
|
6326 | eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs,
|
6327 |
|
6328 | registrationNameModules: EventPluginHub.registrationNameModules,
|
6329 |
|
6330 | putListener: EventPluginHub.putListener,
|
6331 |
|
6332 | getListener: EventPluginHub.getListener,
|
6333 |
|
6334 | deleteListener: EventPluginHub.deleteListener,
|
6335 |
|
6336 | deleteAllListeners: EventPluginHub.deleteAllListeners
|
6337 |
|
6338 | });
|
6339 |
|
6340 | ReactPerf.measureMethods(ReactBrowserEventEmitter, 'ReactBrowserEventEmitter', {
|
6341 | putListener: 'putListener',
|
6342 | deleteListener: 'deleteListener'
|
6343 | });
|
6344 |
|
6345 | module.exports = ReactBrowserEventEmitter;
|
6346 |
|
6347 | }),
|
6348 |
|
6349 | (function(module, exports, __webpack_require__) {
|
6350 |
|
6351 | |
6352 |
|
6353 |
|
6354 |
|
6355 |
|
6356 |
|
6357 |
|
6358 |
|
6359 |
|
6360 |
|
6361 |
|
6362 | 'use strict';
|
6363 |
|
6364 | var keyMirror = __webpack_require__(102);
|
6365 |
|
6366 | var PropagationPhases = keyMirror({ bubbled: null, captured: null });
|
6367 |
|
6368 | |
6369 |
|
6370 |
|
6371 | var topLevelTypes = keyMirror({
|
6372 | topAbort: null,
|
6373 | topBlur: null,
|
6374 | topCanPlay: null,
|
6375 | topCanPlayThrough: null,
|
6376 | topChange: null,
|
6377 | topClick: null,
|
6378 | topCompositionEnd: null,
|
6379 | topCompositionStart: null,
|
6380 | topCompositionUpdate: null,
|
6381 | topContextMenu: null,
|
6382 | topCopy: null,
|
6383 | topCut: null,
|
6384 | topDoubleClick: null,
|
6385 | topDrag: null,
|
6386 | topDragEnd: null,
|
6387 | topDragEnter: null,
|
6388 | topDragExit: null,
|
6389 | topDragLeave: null,
|
6390 | topDragOver: null,
|
6391 | topDragStart: null,
|
6392 | topDrop: null,
|
6393 | topDurationChange: null,
|
6394 | topEmptied: null,
|
6395 | topEncrypted: null,
|
6396 | topEnded: null,
|
6397 | topError: null,
|
6398 | topFocus: null,
|
6399 | topInput: null,
|
6400 | topKeyDown: null,
|
6401 | topKeyPress: null,
|
6402 | topKeyUp: null,
|
6403 | topLoad: null,
|
6404 | topLoadedData: null,
|
6405 | topLoadedMetadata: null,
|
6406 | topLoadStart: null,
|
6407 | topMouseDown: null,
|
6408 | topMouseMove: null,
|
6409 | topMouseOut: null,
|
6410 | topMouseOver: null,
|
6411 | topMouseUp: null,
|
6412 | topPaste: null,
|
6413 | topPause: null,
|
6414 | topPlay: null,
|
6415 | topPlaying: null,
|
6416 | topProgress: null,
|
6417 | topRateChange: null,
|
6418 | topReset: null,
|
6419 | topScroll: null,
|
6420 | topSeeked: null,
|
6421 | topSeeking: null,
|
6422 | topSelectionChange: null,
|
6423 | topStalled: null,
|
6424 | topSubmit: null,
|
6425 | topSuspend: null,
|
6426 | topTextInput: null,
|
6427 | topTimeUpdate: null,
|
6428 | topTouchCancel: null,
|
6429 | topTouchEnd: null,
|
6430 | topTouchMove: null,
|
6431 | topTouchStart: null,
|
6432 | topVolumeChange: null,
|
6433 | topWaiting: null,
|
6434 | topWheel: null
|
6435 | });
|
6436 |
|
6437 | var EventConstants = {
|
6438 | topLevelTypes: topLevelTypes,
|
6439 | PropagationPhases: PropagationPhases
|
6440 | };
|
6441 |
|
6442 | module.exports = EventConstants;
|
6443 |
|
6444 | }),
|
6445 |
|
6446 | (function(module, exports, __webpack_require__) {
|
6447 |
|
6448 | (function(process) { |
6449 |
|
6450 |
|
6451 |
|
6452 |
|
6453 |
|
6454 |
|
6455 |
|
6456 |
|
6457 |
|
6458 |
|
6459 | 'use strict';
|
6460 |
|
6461 | var EventPluginRegistry = __webpack_require__(117);
|
6462 | var EventPluginUtils = __webpack_require__(118);
|
6463 | var ReactErrorUtils = __webpack_require__(119);
|
6464 |
|
6465 | var accumulateInto = __webpack_require__(120);
|
6466 | var forEachAccumulated = __webpack_require__(121);
|
6467 | var invariant = __webpack_require__(98);
|
6468 | var warning = __webpack_require__(110);
|
6469 |
|
6470 | |
6471 |
|
6472 |
|
6473 | var listenerBank = {};
|
6474 |
|
6475 | |
6476 |
|
6477 |
|
6478 |
|
6479 | var eventQueue = null;
|
6480 |
|
6481 | |
6482 |
|
6483 |
|
6484 |
|
6485 |
|
6486 |
|
6487 |
|
6488 | var executeDispatchesAndRelease = function (event, simulated) {
|
6489 | if (event) {
|
6490 | EventPluginUtils.executeDispatchesInOrder(event, simulated);
|
6491 |
|
6492 | if (!event.isPersistent()) {
|
6493 | event.constructor.release(event);
|
6494 | }
|
6495 | }
|
6496 | };
|
6497 | var executeDispatchesAndReleaseSimulated = function (e) {
|
6498 | return executeDispatchesAndRelease(e, true);
|
6499 | };
|
6500 | var executeDispatchesAndReleaseTopLevel = function (e) {
|
6501 | return executeDispatchesAndRelease(e, false);
|
6502 | };
|
6503 |
|
6504 | |
6505 |
|
6506 |
|
6507 |
|
6508 | var InstanceHandle = null;
|
6509 |
|
6510 | function validateInstanceHandle() {
|
6511 | var valid = InstanceHandle && InstanceHandle.traverseTwoPhase && InstanceHandle.traverseEnterLeave;
|
6512 | process.env.NODE_ENV !== 'production' ? warning(valid, 'InstanceHandle not injected before use!') : undefined;
|
6513 | }
|
6514 |
|
6515 | |
6516 |
|
6517 |
|
6518 |
|
6519 |
|
6520 |
|
6521 |
|
6522 |
|
6523 |
|
6524 |
|
6525 |
|
6526 |
|
6527 |
|
6528 |
|
6529 |
|
6530 |
|
6531 |
|
6532 |
|
6533 |
|
6534 |
|
6535 |
|
6536 |
|
6537 | var EventPluginHub = {
|
6538 |
|
6539 | |
6540 |
|
6541 |
|
6542 | injection: {
|
6543 |
|
6544 | |
6545 |
|
6546 |
|
6547 |
|
6548 | injectMount: EventPluginUtils.injection.injectMount,
|
6549 |
|
6550 | |
6551 |
|
6552 |
|
6553 |
|
6554 | injectInstanceHandle: function (InjectedInstanceHandle) {
|
6555 | InstanceHandle = InjectedInstanceHandle;
|
6556 | if (process.env.NODE_ENV !== 'production') {
|
6557 | validateInstanceHandle();
|
6558 | }
|
6559 | },
|
6560 |
|
6561 | getInstanceHandle: function () {
|
6562 | if (process.env.NODE_ENV !== 'production') {
|
6563 | validateInstanceHandle();
|
6564 | }
|
6565 | return InstanceHandle;
|
6566 | },
|
6567 |
|
6568 | |
6569 |
|
6570 |
|
6571 |
|
6572 | injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
|
6573 |
|
6574 | |
6575 |
|
6576 |
|
6577 | injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
|
6578 |
|
6579 | },
|
6580 |
|
6581 | eventNameDispatchConfigs: EventPluginRegistry.eventNameDispatchConfigs,
|
6582 |
|
6583 | registrationNameModules: EventPluginRegistry.registrationNameModules,
|
6584 |
|
6585 | |
6586 |
|
6587 |
|
6588 |
|
6589 |
|
6590 |
|
6591 |
|
6592 | putListener: function (id, registrationName, listener) {
|
6593 | !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : undefined;
|
6594 |
|
6595 | var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
|
6596 | bankForRegistrationName[id] = listener;
|
6597 |
|
6598 | var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
6599 | if (PluginModule && PluginModule.didPutListener) {
|
6600 | PluginModule.didPutListener(id, registrationName, listener);
|
6601 | }
|
6602 | },
|
6603 |
|
6604 | |
6605 |
|
6606 |
|
6607 |
|
6608 |
|
6609 | getListener: function (id, registrationName) {
|
6610 | var bankForRegistrationName = listenerBank[registrationName];
|
6611 | return bankForRegistrationName && bankForRegistrationName[id];
|
6612 | },
|
6613 |
|
6614 | |
6615 |
|
6616 |
|
6617 |
|
6618 |
|
6619 |
|
6620 | deleteListener: function (id, registrationName) {
|
6621 | var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
6622 | if (PluginModule && PluginModule.willDeleteListener) {
|
6623 | PluginModule.willDeleteListener(id, registrationName);
|
6624 | }
|
6625 |
|
6626 | var bankForRegistrationName = listenerBank[registrationName];
|
6627 |
|
6628 | if (bankForRegistrationName) {
|
6629 | delete bankForRegistrationName[id];
|
6630 | }
|
6631 | },
|
6632 |
|
6633 | |
6634 |
|
6635 |
|
6636 |
|
6637 |
|
6638 | deleteAllListeners: function (id) {
|
6639 | for (var registrationName in listenerBank) {
|
6640 | if (!listenerBank[registrationName][id]) {
|
6641 | continue;
|
6642 | }
|
6643 |
|
6644 | var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
6645 | if (PluginModule && PluginModule.willDeleteListener) {
|
6646 | PluginModule.willDeleteListener(id, registrationName);
|
6647 | }
|
6648 |
|
6649 | delete listenerBank[registrationName][id];
|
6650 | }
|
6651 | },
|
6652 |
|
6653 | |
6654 |
|
6655 |
|
6656 |
|
6657 |
|
6658 |
|
6659 |
|
6660 |
|
6661 |
|
6662 |
|
6663 |
|
6664 | extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
6665 | var events;
|
6666 | var plugins = EventPluginRegistry.plugins;
|
6667 | for (var i = 0; i < plugins.length; i++) {
|
6668 |
|
6669 | var possiblePlugin = plugins[i];
|
6670 | if (possiblePlugin) {
|
6671 | var extractedEvents = possiblePlugin.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
|
6672 | if (extractedEvents) {
|
6673 | events = accumulateInto(events, extractedEvents);
|
6674 | }
|
6675 | }
|
6676 | }
|
6677 | return events;
|
6678 | },
|
6679 |
|
6680 | |
6681 |
|
6682 |
|
6683 |
|
6684 |
|
6685 |
|
6686 |
|
6687 | enqueueEvents: function (events) {
|
6688 | if (events) {
|
6689 | eventQueue = accumulateInto(eventQueue, events);
|
6690 | }
|
6691 | },
|
6692 |
|
6693 | |
6694 |
|
6695 |
|
6696 |
|
6697 |
|
6698 | processEventQueue: function (simulated) {
|
6699 |
|
6700 |
|
6701 | var processingEventQueue = eventQueue;
|
6702 | eventQueue = null;
|
6703 | if (simulated) {
|
6704 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
|
6705 | } else {
|
6706 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
|
6707 | }
|
6708 | !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : undefined;
|
6709 |
|
6710 | ReactErrorUtils.rethrowCaughtError();
|
6711 | },
|
6712 |
|
6713 | |
6714 |
|
6715 |
|
6716 | __purge: function () {
|
6717 | listenerBank = {};
|
6718 | },
|
6719 |
|
6720 | __getListenerBank: function () {
|
6721 | return listenerBank;
|
6722 | }
|
6723 |
|
6724 | };
|
6725 |
|
6726 | module.exports = EventPluginHub;
|
6727 | }.call(exports, __webpack_require__(89)))
|
6728 |
|
6729 | }),
|
6730 |
|
6731 | (function(module, exports, __webpack_require__) {
|
6732 |
|
6733 | (function(process) { |
6734 |
|
6735 |
|
6736 |
|
6737 |
|
6738 |
|
6739 |
|
6740 |
|
6741 |
|
6742 |
|
6743 |
|
6744 |
|
6745 | 'use strict';
|
6746 |
|
6747 | var invariant = __webpack_require__(98);
|
6748 |
|
6749 | |
6750 |
|
6751 |
|
6752 | var EventPluginOrder = null;
|
6753 |
|
6754 | |
6755 |
|
6756 |
|
6757 | var namesToPlugins = {};
|
6758 |
|
6759 | |
6760 |
|
6761 |
|
6762 |
|
6763 |
|
6764 | function recomputePluginOrdering() {
|
6765 | if (!EventPluginOrder) {
|
6766 |
|
6767 | return;
|
6768 | }
|
6769 | for (var pluginName in namesToPlugins) {
|
6770 | var PluginModule = namesToPlugins[pluginName];
|
6771 | var pluginIndex = EventPluginOrder.indexOf(pluginName);
|
6772 | !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : undefined;
|
6773 | if (EventPluginRegistry.plugins[pluginIndex]) {
|
6774 | continue;
|
6775 | }
|
6776 | !PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : undefined;
|
6777 | EventPluginRegistry.plugins[pluginIndex] = PluginModule;
|
6778 | var publishedEvents = PluginModule.eventTypes;
|
6779 | for (var eventName in publishedEvents) {
|
6780 | !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : undefined;
|
6781 | }
|
6782 | }
|
6783 | }
|
6784 |
|
6785 | |
6786 |
|
6787 |
|
6788 |
|
6789 |
|
6790 |
|
6791 |
|
6792 |
|
6793 | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
|
6794 | !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : undefined;
|
6795 | EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
|
6796 |
|
6797 | var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
|
6798 | if (phasedRegistrationNames) {
|
6799 | for (var phaseName in phasedRegistrationNames) {
|
6800 | if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
|
6801 | var phasedRegistrationName = phasedRegistrationNames[phaseName];
|
6802 | publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
|
6803 | }
|
6804 | }
|
6805 | return true;
|
6806 | } else if (dispatchConfig.registrationName) {
|
6807 | publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
|
6808 | return true;
|
6809 | }
|
6810 | return false;
|
6811 | }
|
6812 |
|
6813 | |
6814 |
|
6815 |
|
6816 |
|
6817 |
|
6818 |
|
6819 |
|
6820 |
|
6821 | function publishRegistrationName(registrationName, PluginModule, eventName) {
|
6822 | !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : undefined;
|
6823 | EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
|
6824 | EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
|
6825 | }
|
6826 |
|
6827 | |
6828 |
|
6829 |
|
6830 |
|
6831 |
|
6832 | var EventPluginRegistry = {
|
6833 |
|
6834 | |
6835 |
|
6836 |
|
6837 | plugins: [],
|
6838 |
|
6839 | |
6840 |
|
6841 |
|
6842 | eventNameDispatchConfigs: {},
|
6843 |
|
6844 | |
6845 |
|
6846 |
|
6847 | registrationNameModules: {},
|
6848 |
|
6849 | |
6850 |
|
6851 |
|
6852 | registrationNameDependencies: {},
|
6853 |
|
6854 | |
6855 |
|
6856 |
|
6857 |
|
6858 |
|
6859 |
|
6860 |
|
6861 |
|
6862 |
|
6863 | injectEventPluginOrder: function (InjectedEventPluginOrder) {
|
6864 | !!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : undefined;
|
6865 |
|
6866 | EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
|
6867 | recomputePluginOrdering();
|
6868 | },
|
6869 |
|
6870 | |
6871 |
|
6872 |
|
6873 |
|
6874 |
|
6875 |
|
6876 |
|
6877 |
|
6878 |
|
6879 |
|
6880 | injectEventPluginsByName: function (injectedNamesToPlugins) {
|
6881 | var isOrderingDirty = false;
|
6882 | for (var pluginName in injectedNamesToPlugins) {
|
6883 | if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
|
6884 | continue;
|
6885 | }
|
6886 | var PluginModule = injectedNamesToPlugins[pluginName];
|
6887 | if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
|
6888 | !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : undefined;
|
6889 | namesToPlugins[pluginName] = PluginModule;
|
6890 | isOrderingDirty = true;
|
6891 | }
|
6892 | }
|
6893 | if (isOrderingDirty) {
|
6894 | recomputePluginOrdering();
|
6895 | }
|
6896 | },
|
6897 |
|
6898 | |
6899 |
|
6900 |
|
6901 |
|
6902 |
|
6903 |
|
6904 |
|
6905 | getPluginModuleForEvent: function (event) {
|
6906 | var dispatchConfig = event.dispatchConfig;
|
6907 | if (dispatchConfig.registrationName) {
|
6908 | return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
|
6909 | }
|
6910 | for (var phase in dispatchConfig.phasedRegistrationNames) {
|
6911 | if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
|
6912 | continue;
|
6913 | }
|
6914 | var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
|
6915 | if (PluginModule) {
|
6916 | return PluginModule;
|
6917 | }
|
6918 | }
|
6919 | return null;
|
6920 | },
|
6921 |
|
6922 | |
6923 |
|
6924 |
|
6925 |
|
6926 | _resetEventPlugins: function () {
|
6927 | EventPluginOrder = null;
|
6928 | for (var pluginName in namesToPlugins) {
|
6929 | if (namesToPlugins.hasOwnProperty(pluginName)) {
|
6930 | delete namesToPlugins[pluginName];
|
6931 | }
|
6932 | }
|
6933 | EventPluginRegistry.plugins.length = 0;
|
6934 |
|
6935 | var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
|
6936 | for (var eventName in eventNameDispatchConfigs) {
|
6937 | if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
|
6938 | delete eventNameDispatchConfigs[eventName];
|
6939 | }
|
6940 | }
|
6941 |
|
6942 | var registrationNameModules = EventPluginRegistry.registrationNameModules;
|
6943 | for (var registrationName in registrationNameModules) {
|
6944 | if (registrationNameModules.hasOwnProperty(registrationName)) {
|
6945 | delete registrationNameModules[registrationName];
|
6946 | }
|
6947 | }
|
6948 | }
|
6949 |
|
6950 | };
|
6951 |
|
6952 | module.exports = EventPluginRegistry;
|
6953 | }.call(exports, __webpack_require__(89)))
|
6954 |
|
6955 | }),
|
6956 |
|
6957 | (function(module, exports, __webpack_require__) {
|
6958 |
|
6959 | (function(process) { |
6960 |
|
6961 |
|
6962 |
|
6963 |
|
6964 |
|
6965 |
|
6966 |
|
6967 |
|
6968 |
|
6969 |
|
6970 | 'use strict';
|
6971 |
|
6972 | var EventConstants = __webpack_require__(115);
|
6973 | var ReactErrorUtils = __webpack_require__(119);
|
6974 |
|
6975 | var invariant = __webpack_require__(98);
|
6976 | var warning = __webpack_require__(110);
|
6977 |
|
6978 | |
6979 |
|
6980 |
|
6981 |
|
6982 | |
6983 |
|
6984 |
|
6985 |
|
6986 | var injection = {
|
6987 | Mount: null,
|
6988 | injectMount: function (InjectedMount) {
|
6989 | injection.Mount = InjectedMount;
|
6990 | if (process.env.NODE_ENV !== 'production') {
|
6991 | process.env.NODE_ENV !== 'production' ? warning(InjectedMount && InjectedMount.getNode && InjectedMount.getID, 'EventPluginUtils.injection.injectMount(...): Injected Mount ' + 'module is missing getNode or getID.') : undefined;
|
6992 | }
|
6993 | }
|
6994 | };
|
6995 |
|
6996 | var topLevelTypes = EventConstants.topLevelTypes;
|
6997 |
|
6998 | function isEndish(topLevelType) {
|
6999 | return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
|
7000 | }
|
7001 |
|
7002 | function isMoveish(topLevelType) {
|
7003 | return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
|
7004 | }
|
7005 | function isStartish(topLevelType) {
|
7006 | return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
|
7007 | }
|
7008 |
|
7009 | var validateEventDispatches;
|
7010 | if (process.env.NODE_ENV !== 'production') {
|
7011 | validateEventDispatches = function (event) {
|
7012 | var dispatchListeners = event._dispatchListeners;
|
7013 | var dispatchIDs = event._dispatchIDs;
|
7014 |
|
7015 | var listenersIsArr = Array.isArray(dispatchListeners);
|
7016 | var idsIsArr = Array.isArray(dispatchIDs);
|
7017 | var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0;
|
7018 | var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
|
7019 |
|
7020 | process.env.NODE_ENV !== 'production' ? warning(idsIsArr === listenersIsArr && IDsLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : undefined;
|
7021 | };
|
7022 | }
|
7023 |
|
7024 | |
7025 |
|
7026 |
|
7027 |
|
7028 |
|
7029 |
|
7030 |
|
7031 | function executeDispatch(event, simulated, listener, domID) {
|
7032 | var type = event.type || 'unknown-event';
|
7033 | event.currentTarget = injection.Mount.getNode(domID);
|
7034 | if (simulated) {
|
7035 | ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event, domID);
|
7036 | } else {
|
7037 | ReactErrorUtils.invokeGuardedCallback(type, listener, event, domID);
|
7038 | }
|
7039 | event.currentTarget = null;
|
7040 | }
|
7041 |
|
7042 | |
7043 |
|
7044 |
|
7045 | function executeDispatchesInOrder(event, simulated) {
|
7046 | var dispatchListeners = event._dispatchListeners;
|
7047 | var dispatchIDs = event._dispatchIDs;
|
7048 | if (process.env.NODE_ENV !== 'production') {
|
7049 | validateEventDispatches(event);
|
7050 | }
|
7051 | if (Array.isArray(dispatchListeners)) {
|
7052 | for (var i = 0; i < dispatchListeners.length; i++) {
|
7053 | if (event.isPropagationStopped()) {
|
7054 | break;
|
7055 | }
|
7056 |
|
7057 | executeDispatch(event, simulated, dispatchListeners[i], dispatchIDs[i]);
|
7058 | }
|
7059 | } else if (dispatchListeners) {
|
7060 | executeDispatch(event, simulated, dispatchListeners, dispatchIDs);
|
7061 | }
|
7062 | event._dispatchListeners = null;
|
7063 | event._dispatchIDs = null;
|
7064 | }
|
7065 |
|
7066 | |
7067 |
|
7068 |
|
7069 |
|
7070 |
|
7071 |
|
7072 |
|
7073 | function executeDispatchesInOrderStopAtTrueImpl(event) {
|
7074 | var dispatchListeners = event._dispatchListeners;
|
7075 | var dispatchIDs = event._dispatchIDs;
|
7076 | if (process.env.NODE_ENV !== 'production') {
|
7077 | validateEventDispatches(event);
|
7078 | }
|
7079 | if (Array.isArray(dispatchListeners)) {
|
7080 | for (var i = 0; i < dispatchListeners.length; i++) {
|
7081 | if (event.isPropagationStopped()) {
|
7082 | break;
|
7083 | }
|
7084 |
|
7085 | if (dispatchListeners[i](event, dispatchIDs[i])) {
|
7086 | return dispatchIDs[i];
|
7087 | }
|
7088 | }
|
7089 | } else if (dispatchListeners) {
|
7090 | if (dispatchListeners(event, dispatchIDs)) {
|
7091 | return dispatchIDs;
|
7092 | }
|
7093 | }
|
7094 | return null;
|
7095 | }
|
7096 |
|
7097 | |
7098 |
|
7099 |
|
7100 | function executeDispatchesInOrderStopAtTrue(event) {
|
7101 | var ret = executeDispatchesInOrderStopAtTrueImpl(event);
|
7102 | event._dispatchIDs = null;
|
7103 | event._dispatchListeners = null;
|
7104 | return ret;
|
7105 | }
|
7106 |
|
7107 | |
7108 |
|
7109 |
|
7110 |
|
7111 |
|
7112 |
|
7113 |
|
7114 |
|
7115 |
|
7116 | function executeDirectDispatch(event) {
|
7117 | if (process.env.NODE_ENV !== 'production') {
|
7118 | validateEventDispatches(event);
|
7119 | }
|
7120 | var dispatchListener = event._dispatchListeners;
|
7121 | var dispatchID = event._dispatchIDs;
|
7122 | !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : undefined;
|
7123 | var res = dispatchListener ? dispatchListener(event, dispatchID) : null;
|
7124 | event._dispatchListeners = null;
|
7125 | event._dispatchIDs = null;
|
7126 | return res;
|
7127 | }
|
7128 |
|
7129 | |
7130 |
|
7131 |
|
7132 |
|
7133 | function hasDispatches(event) {
|
7134 | return !!event._dispatchListeners;
|
7135 | }
|
7136 |
|
7137 | |
7138 |
|
7139 |
|
7140 | var EventPluginUtils = {
|
7141 | isEndish: isEndish,
|
7142 | isMoveish: isMoveish,
|
7143 | isStartish: isStartish,
|
7144 |
|
7145 | executeDirectDispatch: executeDirectDispatch,
|
7146 | executeDispatchesInOrder: executeDispatchesInOrder,
|
7147 | executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
|
7148 | hasDispatches: hasDispatches,
|
7149 |
|
7150 | getNode: function (id) {
|
7151 | return injection.Mount.getNode(id);
|
7152 | },
|
7153 | getID: function (node) {
|
7154 | return injection.Mount.getID(node);
|
7155 | },
|
7156 |
|
7157 | injection: injection
|
7158 | };
|
7159 |
|
7160 | module.exports = EventPluginUtils;
|
7161 | }.call(exports, __webpack_require__(89)))
|
7162 |
|
7163 | }),
|
7164 |
|
7165 | (function(module, exports, __webpack_require__) {
|
7166 |
|
7167 | (function(process) { |
7168 |
|
7169 |
|
7170 |
|
7171 |
|
7172 |
|
7173 |
|
7174 |
|
7175 |
|
7176 |
|
7177 |
|
7178 |
|
7179 | 'use strict';
|
7180 |
|
7181 | var caughtError = null;
|
7182 |
|
7183 | |
7184 |
|
7185 |
|
7186 |
|
7187 |
|
7188 |
|
7189 |
|
7190 |
|
7191 | function invokeGuardedCallback(name, func, a, b) {
|
7192 | try {
|
7193 | return func(a, b);
|
7194 | } catch (x) {
|
7195 | if (caughtError === null) {
|
7196 | caughtError = x;
|
7197 | }
|
7198 | return undefined;
|
7199 | }
|
7200 | }
|
7201 |
|
7202 | var ReactErrorUtils = {
|
7203 | invokeGuardedCallback: invokeGuardedCallback,
|
7204 |
|
7205 | |
7206 |
|
7207 |
|
7208 |
|
7209 | invokeGuardedCallbackWithCatch: invokeGuardedCallback,
|
7210 |
|
7211 | |
7212 |
|
7213 |
|
7214 |
|
7215 | rethrowCaughtError: function () {
|
7216 | if (caughtError) {
|
7217 | var error = caughtError;
|
7218 | caughtError = null;
|
7219 | throw error;
|
7220 | }
|
7221 | }
|
7222 | };
|
7223 |
|
7224 | if (process.env.NODE_ENV !== 'production') {
|
7225 | |
7226 |
|
7227 |
|
7228 |
|
7229 | if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
|
7230 | var fakeNode = document.createElement('react');
|
7231 | ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
|
7232 | var boundFunc = func.bind(null, a, b);
|
7233 | var evtType = 'react-' + name;
|
7234 | fakeNode.addEventListener(evtType, boundFunc, false);
|
7235 | var evt = document.createEvent('Event');
|
7236 | evt.initEvent(evtType, false, false);
|
7237 | fakeNode.dispatchEvent(evt);
|
7238 | fakeNode.removeEventListener(evtType, boundFunc, false);
|
7239 | };
|
7240 | }
|
7241 | }
|
7242 |
|
7243 | module.exports = ReactErrorUtils;
|
7244 | }.call(exports, __webpack_require__(89)))
|
7245 |
|
7246 | }),
|
7247 |
|
7248 | (function(module, exports, __webpack_require__) {
|
7249 |
|
7250 | (function(process) { |
7251 |
|
7252 |
|
7253 |
|
7254 |
|
7255 |
|
7256 |
|
7257 |
|
7258 |
|
7259 |
|
7260 |
|
7261 | 'use strict';
|
7262 |
|
7263 | var invariant = __webpack_require__(98);
|
7264 |
|
7265 | |
7266 |
|
7267 |
|
7268 |
|
7269 |
|
7270 |
|
7271 |
|
7272 |
|
7273 |
|
7274 |
|
7275 |
|
7276 |
|
7277 |
|
7278 |
|
7279 | function accumulateInto(current, next) {
|
7280 | !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : undefined;
|
7281 | if (current == null) {
|
7282 | return next;
|
7283 | }
|
7284 |
|
7285 |
|
7286 |
|
7287 | var currentIsArray = Array.isArray(current);
|
7288 | var nextIsArray = Array.isArray(next);
|
7289 |
|
7290 | if (currentIsArray && nextIsArray) {
|
7291 | current.push.apply(current, next);
|
7292 | return current;
|
7293 | }
|
7294 |
|
7295 | if (currentIsArray) {
|
7296 | current.push(next);
|
7297 | return current;
|
7298 | }
|
7299 |
|
7300 | if (nextIsArray) {
|
7301 |
|
7302 | return [current].concat(next);
|
7303 | }
|
7304 |
|
7305 | return [current, next];
|
7306 | }
|
7307 |
|
7308 | module.exports = accumulateInto;
|
7309 | }.call(exports, __webpack_require__(89)))
|
7310 |
|
7311 | }),
|
7312 |
|
7313 | (function(module, exports) {
|
7314 |
|
7315 | |
7316 |
|
7317 |
|
7318 |
|
7319 |
|
7320 |
|
7321 |
|
7322 |
|
7323 |
|
7324 |
|
7325 |
|
7326 | 'use strict';
|
7327 |
|
7328 | |
7329 |
|
7330 |
|
7331 |
|
7332 |
|
7333 |
|
7334 |
|
7335 | var forEachAccumulated = function (arr, cb, scope) {
|
7336 | if (Array.isArray(arr)) {
|
7337 | arr.forEach(cb, scope);
|
7338 | } else if (arr) {
|
7339 | cb.call(scope, arr);
|
7340 | }
|
7341 | };
|
7342 |
|
7343 | module.exports = forEachAccumulated;
|
7344 |
|
7345 | }),
|
7346 |
|
7347 | (function(module, exports, __webpack_require__) {
|
7348 |
|
7349 | |
7350 |
|
7351 |
|
7352 |
|
7353 |
|
7354 |
|
7355 |
|
7356 |
|
7357 |
|
7358 |
|
7359 |
|
7360 | 'use strict';
|
7361 |
|
7362 | var EventPluginHub = __webpack_require__(116);
|
7363 |
|
7364 | function runEventQueueInBatch(events) {
|
7365 | EventPluginHub.enqueueEvents(events);
|
7366 | EventPluginHub.processEventQueue(false);
|
7367 | }
|
7368 |
|
7369 | var ReactEventEmitterMixin = {
|
7370 |
|
7371 | |
7372 |
|
7373 |
|
7374 |
|
7375 |
|
7376 |
|
7377 |
|
7378 |
|
7379 |
|
7380 | handleTopLevel: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
7381 | var events = EventPluginHub.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
|
7382 | runEventQueueInBatch(events);
|
7383 | }
|
7384 | };
|
7385 |
|
7386 | module.exports = ReactEventEmitterMixin;
|
7387 |
|
7388 | }),
|
7389 |
|
7390 | (function(module, exports) {
|
7391 |
|
7392 | |
7393 |
|
7394 |
|
7395 |
|
7396 |
|
7397 |
|
7398 |
|
7399 |
|
7400 |
|
7401 |
|
7402 |
|
7403 | 'use strict';
|
7404 |
|
7405 | var ViewportMetrics = {
|
7406 |
|
7407 | currentScrollLeft: 0,
|
7408 |
|
7409 | currentScrollTop: 0,
|
7410 |
|
7411 | refreshScrollValues: function (scrollPosition) {
|
7412 | ViewportMetrics.currentScrollLeft = scrollPosition.x;
|
7413 | ViewportMetrics.currentScrollTop = scrollPosition.y;
|
7414 | }
|
7415 |
|
7416 | };
|
7417 |
|
7418 | module.exports = ViewportMetrics;
|
7419 |
|
7420 | }),
|
7421 |
|
7422 | (function(module, exports) {
|
7423 |
|
7424 | |
7425 |
|
7426 |
|
7427 |
|
7428 |
|
7429 |
|
7430 |
|
7431 |
|
7432 |
|
7433 |
|
7434 |
|
7435 |
|
7436 |
|
7437 | 'use strict';
|
7438 |
|
7439 | function assign(target, sources) {
|
7440 | if (target == null) {
|
7441 | throw new TypeError('Object.assign target cannot be null or undefined');
|
7442 | }
|
7443 |
|
7444 | var to = Object(target);
|
7445 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
7446 |
|
7447 | for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
|
7448 | var nextSource = arguments[nextIndex];
|
7449 | if (nextSource == null) {
|
7450 | continue;
|
7451 | }
|
7452 |
|
7453 | var from = Object(nextSource);
|
7454 |
|
7455 |
|
7456 |
|
7457 |
|
7458 |
|
7459 |
|
7460 | for (var key in from) {
|
7461 | if (hasOwnProperty.call(from, key)) {
|
7462 | to[key] = from[key];
|
7463 | }
|
7464 | }
|
7465 | }
|
7466 |
|
7467 | return to;
|
7468 | }
|
7469 |
|
7470 | module.exports = assign;
|
7471 |
|
7472 | }),
|
7473 |
|
7474 | (function(module, exports, __webpack_require__) {
|
7475 |
|
7476 | |
7477 |
|
7478 |
|
7479 |
|
7480 |
|
7481 |
|
7482 |
|
7483 |
|
7484 |
|
7485 |
|
7486 |
|
7487 | 'use strict';
|
7488 |
|
7489 | var ExecutionEnvironment = __webpack_require__(94);
|
7490 |
|
7491 | var useHasFeature;
|
7492 | if (ExecutionEnvironment.canUseDOM) {
|
7493 | useHasFeature = document.implementation && document.implementation.hasFeature &&
|
7494 |
|
7495 |
|
7496 | document.implementation.hasFeature('', '') !== true;
|
7497 | }
|
7498 |
|
7499 | |
7500 |
|
7501 |
|
7502 |
|
7503 |
|
7504 |
|
7505 |
|
7506 |
|
7507 |
|
7508 |
|
7509 |
|
7510 |
|
7511 |
|
7512 |
|
7513 | function isEventSupported(eventNameSuffix, capture) {
|
7514 | if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
|
7515 | return false;
|
7516 | }
|
7517 |
|
7518 | var eventName = 'on' + eventNameSuffix;
|
7519 | var isSupported = (eventName in document);
|
7520 |
|
7521 | if (!isSupported) {
|
7522 | var element = document.createElement('div');
|
7523 | element.setAttribute(eventName, 'return;');
|
7524 | isSupported = typeof element[eventName] === 'function';
|
7525 | }
|
7526 |
|
7527 | if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
|
7528 |
|
7529 | isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
|
7530 | }
|
7531 |
|
7532 | return isSupported;
|
7533 | }
|
7534 |
|
7535 | module.exports = isEventSupported;
|
7536 |
|
7537 | }),
|
7538 |
|
7539 | (function(module, exports) {
|
7540 |
|
7541 | |
7542 |
|
7543 |
|
7544 |
|
7545 |
|
7546 |
|
7547 |
|
7548 |
|
7549 |
|
7550 |
|
7551 |
|
7552 | 'use strict';
|
7553 |
|
7554 | var ReactDOMFeatureFlags = {
|
7555 | useCreateElement: false
|
7556 | };
|
7557 |
|
7558 | module.exports = ReactDOMFeatureFlags;
|
7559 |
|
7560 | }),
|
7561 |
|
7562 | (function(module, exports, __webpack_require__) {
|
7563 |
|
7564 | (function(process) { |
7565 |
|
7566 |
|
7567 |
|
7568 |
|
7569 |
|
7570 |
|
7571 |
|
7572 |
|
7573 |
|
7574 |
|
7575 | 'use strict';
|
7576 |
|
7577 | var ReactCurrentOwner = __webpack_require__(90);
|
7578 |
|
7579 | var assign = __webpack_require__(124);
|
7580 | var canDefineProperty = __webpack_require__(128);
|
7581 |
|
7582 |
|
7583 |
|
7584 | var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
7585 |
|
7586 | var RESERVED_PROPS = {
|
7587 | key: true,
|
7588 | ref: true,
|
7589 | __self: true,
|
7590 | __source: true
|
7591 | };
|
7592 |
|
7593 | |
7594 |
|
7595 |
|
7596 |
|
7597 |
|
7598 |
|
7599 |
|
7600 |
|
7601 |
|
7602 |
|
7603 |
|
7604 |
|
7605 |
|
7606 |
|
7607 |
|
7608 |
|
7609 |
|
7610 |
|
7611 | var ReactElement = function (type, key, ref, self, source, owner, props) {
|
7612 | var element = {
|
7613 |
|
7614 | $$typeof: REACT_ELEMENT_TYPE,
|
7615 |
|
7616 |
|
7617 | type: type,
|
7618 | key: key,
|
7619 | ref: ref,
|
7620 | props: props,
|
7621 |
|
7622 |
|
7623 | _owner: owner
|
7624 | };
|
7625 |
|
7626 | if (process.env.NODE_ENV !== 'production') {
|
7627 |
|
7628 |
|
7629 |
|
7630 |
|
7631 | element._store = {};
|
7632 |
|
7633 |
|
7634 |
|
7635 |
|
7636 |
|
7637 | if (canDefineProperty) {
|
7638 | Object.defineProperty(element._store, 'validated', {
|
7639 | configurable: false,
|
7640 | enumerable: false,
|
7641 | writable: true,
|
7642 | value: false
|
7643 | });
|
7644 |
|
7645 | Object.defineProperty(element, '_self', {
|
7646 | configurable: false,
|
7647 | enumerable: false,
|
7648 | writable: false,
|
7649 | value: self
|
7650 | });
|
7651 |
|
7652 |
|
7653 | Object.defineProperty(element, '_source', {
|
7654 | configurable: false,
|
7655 | enumerable: false,
|
7656 | writable: false,
|
7657 | value: source
|
7658 | });
|
7659 | } else {
|
7660 | element._store.validated = false;
|
7661 | element._self = self;
|
7662 | element._source = source;
|
7663 | }
|
7664 | Object.freeze(element.props);
|
7665 | Object.freeze(element);
|
7666 | }
|
7667 |
|
7668 | return element;
|
7669 | };
|
7670 |
|
7671 | ReactElement.createElement = function (type, config, children) {
|
7672 | var propName;
|
7673 |
|
7674 |
|
7675 | var props = {};
|
7676 |
|
7677 | var key = null;
|
7678 | var ref = null;
|
7679 | var self = null;
|
7680 | var source = null;
|
7681 |
|
7682 | if (config != null) {
|
7683 | ref = config.ref === undefined ? null : config.ref;
|
7684 | key = config.key === undefined ? null : '' + config.key;
|
7685 | self = config.__self === undefined ? null : config.__self;
|
7686 | source = config.__source === undefined ? null : config.__source;
|
7687 |
|
7688 | for (propName in config) {
|
7689 | if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
7690 | props[propName] = config[propName];
|
7691 | }
|
7692 | }
|
7693 | }
|
7694 |
|
7695 |
|
7696 |
|
7697 | var childrenLength = arguments.length - 2;
|
7698 | if (childrenLength === 1) {
|
7699 | props.children = children;
|
7700 | } else if (childrenLength > 1) {
|
7701 | var childArray = Array(childrenLength);
|
7702 | for (var i = 0; i < childrenLength; i++) {
|
7703 | childArray[i] = arguments[i + 2];
|
7704 | }
|
7705 | props.children = childArray;
|
7706 | }
|
7707 |
|
7708 |
|
7709 | if (type && type.defaultProps) {
|
7710 | var defaultProps = type.defaultProps;
|
7711 | for (propName in defaultProps) {
|
7712 | if (typeof props[propName] === 'undefined') {
|
7713 | props[propName] = defaultProps[propName];
|
7714 | }
|
7715 | }
|
7716 | }
|
7717 |
|
7718 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
7719 | };
|
7720 |
|
7721 | ReactElement.createFactory = function (type) {
|
7722 | var factory = ReactElement.createElement.bind(null, type);
|
7723 |
|
7724 |
|
7725 |
|
7726 |
|
7727 |
|
7728 | factory.type = type;
|
7729 | return factory;
|
7730 | };
|
7731 |
|
7732 | ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
|
7733 | var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
7734 |
|
7735 | return newElement;
|
7736 | };
|
7737 |
|
7738 | ReactElement.cloneAndReplaceProps = function (oldElement, newProps) {
|
7739 | var newElement = ReactElement(oldElement.type, oldElement.key, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, newProps);
|
7740 |
|
7741 | if (process.env.NODE_ENV !== 'production') {
|
7742 |
|
7743 | newElement._store.validated = oldElement._store.validated;
|
7744 | }
|
7745 |
|
7746 | return newElement;
|
7747 | };
|
7748 |
|
7749 | ReactElement.cloneElement = function (element, config, children) {
|
7750 | var propName;
|
7751 |
|
7752 |
|
7753 | var props = assign({}, element.props);
|
7754 |
|
7755 |
|
7756 | var key = element.key;
|
7757 | var ref = element.ref;
|
7758 |
|
7759 | var self = element._self;
|
7760 |
|
7761 |
|
7762 |
|
7763 | var source = element._source;
|
7764 |
|
7765 |
|
7766 | var owner = element._owner;
|
7767 |
|
7768 | if (config != null) {
|
7769 | if (config.ref !== undefined) {
|
7770 |
|
7771 | ref = config.ref;
|
7772 | owner = ReactCurrentOwner.current;
|
7773 | }
|
7774 | if (config.key !== undefined) {
|
7775 | key = '' + config.key;
|
7776 | }
|
7777 |
|
7778 | for (propName in config) {
|
7779 | if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
7780 | props[propName] = config[propName];
|
7781 | }
|
7782 | }
|
7783 | }
|
7784 |
|
7785 |
|
7786 |
|
7787 | var childrenLength = arguments.length - 2;
|
7788 | if (childrenLength === 1) {
|
7789 | props.children = children;
|
7790 | } else if (childrenLength > 1) {
|
7791 | var childArray = Array(childrenLength);
|
7792 | for (var i = 0; i < childrenLength; i++) {
|
7793 | childArray[i] = arguments[i + 2];
|
7794 | }
|
7795 | props.children = childArray;
|
7796 | }
|
7797 |
|
7798 | return ReactElement(element.type, key, ref, self, source, owner, props);
|
7799 | };
|
7800 |
|
7801 | |
7802 |
|
7803 |
|
7804 |
|
7805 |
|
7806 | ReactElement.isValidElement = function (object) {
|
7807 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
7808 | };
|
7809 |
|
7810 | module.exports = ReactElement;
|
7811 | }.call(exports, __webpack_require__(89)))
|
7812 |
|
7813 | }),
|
7814 |
|
7815 | (function(module, exports, __webpack_require__) {
|
7816 |
|
7817 | (function(process) { |
7818 |
|
7819 |
|
7820 |
|
7821 |
|
7822 |
|
7823 |
|
7824 |
|
7825 |
|
7826 |
|
7827 |
|
7828 | 'use strict';
|
7829 |
|
7830 | var canDefineProperty = false;
|
7831 | if (process.env.NODE_ENV !== 'production') {
|
7832 | try {
|
7833 | Object.defineProperty({}, 'x', { get: function () {} });
|
7834 | canDefineProperty = true;
|
7835 | } catch (x) {
|
7836 |
|
7837 | }
|
7838 | }
|
7839 |
|
7840 | module.exports = canDefineProperty;
|
7841 | }.call(exports, __webpack_require__(89)))
|
7842 |
|
7843 | }),
|
7844 |
|
7845 | (function(module, exports) {
|
7846 |
|
7847 | |
7848 |
|
7849 |
|
7850 |
|
7851 |
|
7852 |
|
7853 |
|
7854 |
|
7855 |
|
7856 |
|
7857 |
|
7858 | 'use strict';
|
7859 |
|
7860 |
|
7861 |
|
7862 | var nullComponentIDsRegistry = {};
|
7863 |
|
7864 | |
7865 |
|
7866 |
|
7867 |
|
7868 | function isNullComponentID(id) {
|
7869 | return !!nullComponentIDsRegistry[id];
|
7870 | }
|
7871 |
|
7872 | |
7873 |
|
7874 |
|
7875 |
|
7876 | function registerNullComponentID(id) {
|
7877 | nullComponentIDsRegistry[id] = true;
|
7878 | }
|
7879 |
|
7880 | |
7881 |
|
7882 |
|
7883 |
|
7884 | function deregisterNullComponentID(id) {
|
7885 | delete nullComponentIDsRegistry[id];
|
7886 | }
|
7887 |
|
7888 | var ReactEmptyComponentRegistry = {
|
7889 | isNullComponentID: isNullComponentID,
|
7890 | registerNullComponentID: registerNullComponentID,
|
7891 | deregisterNullComponentID: deregisterNullComponentID
|
7892 | };
|
7893 |
|
7894 | module.exports = ReactEmptyComponentRegistry;
|
7895 |
|
7896 | }),
|
7897 |
|
7898 | (function(module, exports, __webpack_require__) {
|
7899 |
|
7900 | (function(process) { |
7901 |
|
7902 |
|
7903 |
|
7904 |
|
7905 |
|
7906 |
|
7907 |
|
7908 |
|
7909 |
|
7910 |
|
7911 |
|
7912 | 'use strict';
|
7913 |
|
7914 | var ReactRootIndex = __webpack_require__(131);
|
7915 |
|
7916 | var invariant = __webpack_require__(98);
|
7917 |
|
7918 | var SEPARATOR = '.';
|
7919 | var SEPARATOR_LENGTH = SEPARATOR.length;
|
7920 |
|
7921 | |
7922 |
|
7923 |
|
7924 | var MAX_TREE_DEPTH = 10000;
|
7925 |
|
7926 | |
7927 |
|
7928 |
|
7929 |
|
7930 |
|
7931 |
|
7932 |
|
7933 | function getReactRootIDString(index) {
|
7934 | return SEPARATOR + index.toString(36);
|
7935 | }
|
7936 |
|
7937 | |
7938 |
|
7939 |
|
7940 |
|
7941 |
|
7942 |
|
7943 |
|
7944 |
|
7945 | function isBoundary(id, index) {
|
7946 | return id.charAt(index) === SEPARATOR || index === id.length;
|
7947 | }
|
7948 |
|
7949 | |
7950 |
|
7951 |
|
7952 |
|
7953 |
|
7954 |
|
7955 |
|
7956 | function isValidID(id) {
|
7957 | return id === '' || id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR;
|
7958 | }
|
7959 |
|
7960 | |
7961 |
|
7962 |
|
7963 |
|
7964 |
|
7965 |
|
7966 |
|
7967 |
|
7968 | function isAncestorIDOf(ancestorID, descendantID) {
|
7969 | return descendantID.indexOf(ancestorID) === 0 && isBoundary(descendantID, ancestorID.length);
|
7970 | }
|
7971 |
|
7972 | |
7973 |
|
7974 |
|
7975 |
|
7976 |
|
7977 |
|
7978 |
|
7979 | function getParentID(id) {
|
7980 | return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : '';
|
7981 | }
|
7982 |
|
7983 | |
7984 |
|
7985 |
|
7986 |
|
7987 |
|
7988 |
|
7989 |
|
7990 |
|
7991 |
|
7992 | function getNextDescendantID(ancestorID, destinationID) {
|
7993 | !(isValidID(ancestorID) && isValidID(destinationID)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID) : invariant(false) : undefined;
|
7994 | !isAncestorIDOf(ancestorID, destinationID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID) : invariant(false) : undefined;
|
7995 | if (ancestorID === destinationID) {
|
7996 | return ancestorID;
|
7997 | }
|
7998 |
|
7999 |
|
8000 | var start = ancestorID.length + SEPARATOR_LENGTH;
|
8001 | var i;
|
8002 | for (i = start; i < destinationID.length; i++) {
|
8003 | if (isBoundary(destinationID, i)) {
|
8004 | break;
|
8005 | }
|
8006 | }
|
8007 | return destinationID.substr(0, i);
|
8008 | }
|
8009 |
|
8010 | |
8011 |
|
8012 |
|
8013 |
|
8014 |
|
8015 |
|
8016 |
|
8017 |
|
8018 |
|
8019 |
|
8020 |
|
8021 | function getFirstCommonAncestorID(oneID, twoID) {
|
8022 | var minLength = Math.min(oneID.length, twoID.length);
|
8023 | if (minLength === 0) {
|
8024 | return '';
|
8025 | }
|
8026 | var lastCommonMarkerIndex = 0;
|
8027 |
|
8028 | for (var i = 0; i <= minLength; i++) {
|
8029 | if (isBoundary(oneID, i) && isBoundary(twoID, i)) {
|
8030 | lastCommonMarkerIndex = i;
|
8031 | } else if (oneID.charAt(i) !== twoID.charAt(i)) {
|
8032 | break;
|
8033 | }
|
8034 | }
|
8035 | var longestCommonID = oneID.substr(0, lastCommonMarkerIndex);
|
8036 | !isValidID(longestCommonID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID) : invariant(false) : undefined;
|
8037 | return longestCommonID;
|
8038 | }
|
8039 |
|
8040 | |
8041 |
|
8042 |
|
8043 |
|
8044 |
|
8045 |
|
8046 |
|
8047 |
|
8048 |
|
8049 |
|
8050 |
|
8051 |
|
8052 |
|
8053 | function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
|
8054 | start = start || '';
|
8055 | stop = stop || '';
|
8056 | !(start !== stop) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start) : invariant(false) : undefined;
|
8057 | var traverseUp = isAncestorIDOf(stop, start);
|
8058 | !(traverseUp || isAncestorIDOf(start, stop)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop) : invariant(false) : undefined;
|
8059 |
|
8060 | var depth = 0;
|
8061 | var traverse = traverseUp ? getParentID : getNextDescendantID;
|
8062 | for (var id = start;; id = traverse(id, stop)) {
|
8063 | var ret;
|
8064 | if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) {
|
8065 | ret = cb(id, traverseUp, arg);
|
8066 | }
|
8067 | if (ret === false || id === stop) {
|
8068 |
|
8069 | break;
|
8070 | }
|
8071 | !(depth++ < MAX_TREE_DEPTH) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop, id) : invariant(false) : undefined;
|
8072 | }
|
8073 | }
|
8074 |
|
8075 | /**
|
8076 | * Manages the IDs assigned to DOM representations of React components. This
|
8077 | * uses a specific scheme in order to traverse the DOM efficiently (e.g. in
|
8078 | * order to simulate events).
|
8079 | *
|
8080 | * @internal
|
8081 | */
|
8082 | var ReactInstanceHandles = {
|
8083 |
|
8084 | /**
|
8085 | * Constructs a React root ID
|
8086 | * @return {string} A React root ID.
|
8087 | */
|
8088 | createReactRootID: function () {
|
8089 | return getReactRootIDString(ReactRootIndex.createReactRootIndex());
|
8090 | },
|
8091 |
|
8092 | /**
|
8093 | * Constructs a React ID by joining a root ID with a name.
|
8094 | *
|
8095 | * @param {string} rootID Root ID of a parent component.
|
8096 | * @param {string} name A component's name (as flattened children).
|
8097 | * @return {string} A React ID.
|
8098 | * @internal
|
8099 | */
|
8100 | createReactID: function (rootID, name) {
|
8101 | return rootID + name;
|
8102 | },
|
8103 |
|
8104 | /**
|
8105 | * Gets the DOM ID of the React component that is the root of the tree that
|
8106 | * contains the React component with the supplied DOM ID.
|
8107 | *
|
8108 | * @param {string} id DOM ID of a React component.
|
8109 | * @return {?string} DOM ID of the React component that is the root.
|
8110 | * @internal
|
8111 | */
|
8112 | getReactRootIDFromNodeID: function (id) {
|
8113 | if (id && id.charAt(0) === SEPARATOR && id.length > 1) {
|
8114 | var index = id.indexOf(SEPARATOR, 1);
|
8115 | return index > -1 ? id.substr(0, index) : id;
|
8116 | }
|
8117 | return null;
|
8118 | },
|
8119 |
|
8120 | /**
|
8121 | * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
|
8122 | * should would receive a `mouseEnter` or `mouseLeave` event.
|
8123 | *
|
8124 | * NOTE: Does not invoke the callback on the nearest common ancestor because
|
8125 | * nothing "entered" or "left" that element.
|
8126 | *
|
8127 | * @param {string} leaveID ID being left.
|
8128 | * @param {string} enterID ID being entered.
|
8129 | * @param {function} cb Callback to invoke on each entered/left ID.
|
8130 | * @param {*} upArg Argument to invoke the callback with on left IDs.
|
8131 | * @param {*} downArg Argument to invoke the callback with on entered IDs.
|
8132 | * @internal
|
8133 | */
|
8134 | traverseEnterLeave: function (leaveID, enterID, cb, upArg, downArg) {
|
8135 | var ancestorID = getFirstCommonAncestorID(leaveID, enterID);
|
8136 | if (ancestorID !== leaveID) {
|
8137 | traverseParentPath(leaveID, ancestorID, cb, upArg, false, true);
|
8138 | }
|
8139 | if (ancestorID !== enterID) {
|
8140 | traverseParentPath(ancestorID, enterID, cb, downArg, true, false);
|
8141 | }
|
8142 | },
|
8143 |
|
8144 | /**
|
8145 | * Simulates the traversal of a two-phase, capture/bubble event dispatch.
|
8146 | *
|
8147 | * NOTE: This traversal happens on IDs without touching the DOM.
|
8148 | *
|
8149 | * @param {string} targetID ID of the target node.
|
8150 | * @param {function} cb Callback to invoke.
|
8151 | * @param {*} arg Argument to invoke the callback with.
|
8152 | * @internal
|
8153 | */
|
8154 | traverseTwoPhase: function (targetID, cb, arg) {
|
8155 | if (targetID) {
|
8156 | traverseParentPath('', targetID, cb, arg, true, false);
|
8157 | traverseParentPath(targetID, '', cb, arg, false, true);
|
8158 | }
|
8159 | },
|
8160 |
|
8161 | /**
|
8162 | * Same as `traverseTwoPhase` but skips the `targetID`.
|
8163 | */
|
8164 | traverseTwoPhaseSkipTarget: function (targetID, cb, arg) {
|
8165 | if (targetID) {
|
8166 | traverseParentPath('', targetID, cb, arg, true, true);
|
8167 | traverseParentPath(targetID, '', cb, arg, true, true);
|
8168 | }
|
8169 | },
|
8170 |
|
8171 | /**
|
8172 | * Traverse a node ID, calling the supplied `cb` for each ancestor ID. For
|
8173 | * example, passing `.0.$row-0.1` would result in `cb` getting called
|
8174 | * with `.0`, `.0.$row-0`, and `.0.$row-0.1`.
|
8175 | *
|
8176 | * NOTE: This traversal happens on IDs without touching the DOM.
|
8177 | *
|
8178 | * @param {string} targetID ID of the target node.
|
8179 | * @param {function} cb Callback to invoke.
|
8180 | * @param {*} arg Argument to invoke the callback with.
|
8181 | * @internal
|
8182 | */
|
8183 | traverseAncestors: function (targetID, cb, arg) {
|
8184 | traverseParentPath('', targetID, cb, arg, true, false);
|
8185 | },
|
8186 |
|
8187 | getFirstCommonAncestorID: getFirstCommonAncestorID,
|
8188 |
|
8189 | /**
|
8190 | * Exposed for unit testing.
|
8191 | * @private
|
8192 | */
|
8193 | _getNextDescendantID: getNextDescendantID,
|
8194 |
|
8195 | isAncestorIDOf: isAncestorIDOf,
|
8196 |
|
8197 | SEPARATOR: SEPARATOR
|
8198 |
|
8199 | };
|
8200 |
|
8201 | module.exports = ReactInstanceHandles;
|
8202 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
8203 |
|
8204 | /***/ }),
|
8205 | /* 131 */
|
8206 | /***/ (function(module, exports) {
|
8207 |
|
8208 | /**
|
8209 | * Copyright 2013-2015, Facebook, Inc.
|
8210 | * All rights reserved.
|
8211 | *
|
8212 | * This source code is licensed under the BSD-style license found in the
|
8213 | * LICENSE file in the root directory of this source tree. An additional grant
|
8214 | * of patent rights can be found in the PATENTS file in the same directory.
|
8215 | *
|
8216 | * @providesModule ReactRootIndex
|
8217 | * @typechecks
|
8218 | */
|
8219 |
|
8220 | 'use strict';
|
8221 |
|
8222 | var ReactRootIndexInjection = {
|
8223 | /**
|
8224 | * @param {function} _createReactRootIndex
|
8225 | */
|
8226 | injectCreateReactRootIndex: function (_createReactRootIndex) {
|
8227 | ReactRootIndex.createReactRootIndex = _createReactRootIndex;
|
8228 | }
|
8229 | };
|
8230 |
|
8231 | var ReactRootIndex = {
|
8232 | createReactRootIndex: null,
|
8233 | injection: ReactRootIndexInjection
|
8234 | };
|
8235 |
|
8236 | module.exports = ReactRootIndex;
|
8237 |
|
8238 | /***/ }),
|
8239 | /* 132 */
|
8240 | /***/ (function(module, exports) {
|
8241 |
|
8242 | /**
|
8243 | * Copyright 2013-2015, Facebook, Inc.
|
8244 | * All rights reserved.
|
8245 | *
|
8246 | * This source code is licensed under the BSD-style license found in the
|
8247 | * LICENSE file in the root directory of this source tree. An additional grant
|
8248 | * of patent rights can be found in the PATENTS file in the same directory.
|
8249 | *
|
8250 | * @providesModule ReactInstanceMap
|
8251 | */
|
8252 |
|
8253 | 'use strict';
|
8254 |
|
8255 | /**
|
8256 | * `ReactInstanceMap` maintains a mapping from a public facing stateful
|
8257 | * instance (key) and the internal representation (value). This allows public
|
8258 | * methods to accept the user facing instance as an argument and map them back
|
8259 | * to internal methods.
|
8260 | */
|
8261 |
|
8262 | // TODO: Replace this with ES6: var ReactInstanceMap = new Map();
|
8263 | var ReactInstanceMap = {
|
8264 |
|
8265 | /**
|
8266 | * This API should be called `delete` but we'd have to make sure to always
|
8267 | * transform these to strings for IE support. When this transform is fully
|
8268 | * supported we can rename it.
|
8269 | */
|
8270 | remove: function (key) {
|
8271 | key._reactInternalInstance = undefined;
|
8272 | },
|
8273 |
|
8274 | get: function (key) {
|
8275 | return key._reactInternalInstance;
|
8276 | },
|
8277 |
|
8278 | has: function (key) {
|
8279 | return key._reactInternalInstance !== undefined;
|
8280 | },
|
8281 |
|
8282 | set: function (key, value) {
|
8283 | key._reactInternalInstance = value;
|
8284 | }
|
8285 |
|
8286 | };
|
8287 |
|
8288 | module.exports = ReactInstanceMap;
|
8289 |
|
8290 | /***/ }),
|
8291 | /* 133 */
|
8292 | /***/ (function(module, exports, __webpack_require__) {
|
8293 |
|
8294 | /**
|
8295 | * Copyright 2013-2015, Facebook, Inc.
|
8296 | * All rights reserved.
|
8297 | *
|
8298 | * This source code is licensed under the BSD-style license found in the
|
8299 | * LICENSE file in the root directory of this source tree. An additional grant
|
8300 | * of patent rights can be found in the PATENTS file in the same directory.
|
8301 | *
|
8302 | * @providesModule ReactMarkupChecksum
|
8303 | */
|
8304 |
|
8305 | 'use strict';
|
8306 |
|
8307 | var adler32 = __webpack_require__(134);
|
8308 |
|
8309 | var TAG_END = /\/?>/;
|
8310 |
|
8311 | var ReactMarkupChecksum = {
|
8312 | CHECKSUM_ATTR_NAME: 'data-react-checksum',
|
8313 |
|
8314 | /**
|
8315 | * @param {string} markup Markup string
|
8316 | * @return {string} Markup string with checksum attribute attached
|
8317 | */
|
8318 | addChecksumToMarkup: function (markup) {
|
8319 | var checksum = adler32(markup);
|
8320 |
|
8321 | // Add checksum (handle both parent tags and self-closing tags)
|
8322 | return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
|
8323 | },
|
8324 |
|
8325 | /**
|
8326 | * @param {string} markup to use
|
8327 | * @param {DOMElement} element root React element
|
8328 | * @returns {boolean} whether or not the markup is the same
|
8329 | */
|
8330 | canReuseMarkup: function (markup, element) {
|
8331 | var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
8332 | existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
|
8333 | var markupChecksum = adler32(markup);
|
8334 | return markupChecksum === existingChecksum;
|
8335 | }
|
8336 | };
|
8337 |
|
8338 | module.exports = ReactMarkupChecksum;
|
8339 |
|
8340 | /***/ }),
|
8341 | /* 134 */
|
8342 | /***/ (function(module, exports) {
|
8343 |
|
8344 | /**
|
8345 | * Copyright 2013-2015, Facebook, Inc.
|
8346 | * All rights reserved.
|
8347 | *
|
8348 | * This source code is licensed under the BSD-style license found in the
|
8349 | * LICENSE file in the root directory of this source tree. An additional grant
|
8350 | * of patent rights can be found in the PATENTS file in the same directory.
|
8351 | *
|
8352 | * @providesModule adler32
|
8353 | */
|
8354 |
|
8355 | 'use strict';
|
8356 |
|
8357 | var MOD = 65521;
|
8358 |
|
8359 | // adler32 is not cryptographically strong, and is only used to sanity check that
|
8360 | // markup generated on the server matches the markup generated on the client.
|
8361 | // This implementation (a modified version of the SheetJS version) has been optimized
|
8362 | // for our use case, at the expense of conforming to the adler32 specification
|
8363 | // for non-ascii inputs.
|
8364 | function adler32(data) {
|
8365 | var a = 1;
|
8366 | var b = 0;
|
8367 | var i = 0;
|
8368 | var l = data.length;
|
8369 | var m = l & ~0x3;
|
8370 | while (i < m) {
|
8371 | for (; i < Math.min(i + 4096, m); i += 4) {
|
8372 | b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
|
8373 | }
|
8374 | a %= MOD;
|
8375 | b %= MOD;
|
8376 | }
|
8377 | for (; i < l; i++) {
|
8378 | b += a += data.charCodeAt(i);
|
8379 | }
|
8380 | a %= MOD;
|
8381 | b %= MOD;
|
8382 | return a | b << 16;
|
8383 | }
|
8384 |
|
8385 | module.exports = adler32;
|
8386 |
|
8387 | /***/ }),
|
8388 | /* 135 */
|
8389 | /***/ (function(module, exports, __webpack_require__) {
|
8390 |
|
8391 | /**
|
8392 | * Copyright 2013-2015, Facebook, Inc.
|
8393 | * All rights reserved.
|
8394 | *
|
8395 | * This source code is licensed under the BSD-style license found in the
|
8396 | * LICENSE file in the root directory of this source tree. An additional grant
|
8397 | * of patent rights can be found in the PATENTS file in the same directory.
|
8398 | *
|
8399 | * @providesModule ReactReconciler
|
8400 | */
|
8401 |
|
8402 | 'use strict';
|
8403 |
|
8404 | var ReactRef = __webpack_require__(136);
|
8405 |
|
8406 | /**
|
8407 | * Helper to call ReactRef.attachRefs with this composite component, split out
|
8408 | * to avoid allocations in the transaction mount-ready queue.
|
8409 | */
|
8410 | function attachRefs() {
|
8411 | ReactRef.attachRefs(this, this._currentElement);
|
8412 | }
|
8413 |
|
8414 | var ReactReconciler = {
|
8415 |
|
8416 | /**
|
8417 | * Initializes the component, renders markup, and registers event listeners.
|
8418 | *
|
8419 | * @param {ReactComponent} internalInstance
|
8420 | * @param {string} rootID DOM ID of the root node.
|
8421 | * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
8422 | * @return {?string} Rendered markup to be inserted into the DOM.
|
8423 | * @final
|
8424 | * @internal
|
8425 | */
|
8426 | mountComponent: function (internalInstance, rootID, transaction, context) {
|
8427 | var markup = internalInstance.mountComponent(rootID, transaction, context);
|
8428 | if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
|
8429 | transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
|
8430 | }
|
8431 | return markup;
|
8432 | },
|
8433 |
|
8434 | /**
|
8435 | * Releases any resources allocated by `mountComponent`.
|
8436 | *
|
8437 | * @final
|
8438 | * @internal
|
8439 | */
|
8440 | unmountComponent: function (internalInstance) {
|
8441 | ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
|
8442 | internalInstance.unmountComponent();
|
8443 | },
|
8444 |
|
8445 | /**
|
8446 | * Update a component using a new element.
|
8447 | *
|
8448 | * @param {ReactComponent} internalInstance
|
8449 | * @param {ReactElement} nextElement
|
8450 | * @param {ReactReconcileTransaction} transaction
|
8451 | * @param {object} context
|
8452 | * @internal
|
8453 | */
|
8454 | receiveComponent: function (internalInstance, nextElement, transaction, context) {
|
8455 | var prevElement = internalInstance._currentElement;
|
8456 |
|
8457 | if (nextElement === prevElement && context === internalInstance._context) {
|
8458 | // Since elements are immutable after the owner is rendered,
|
8459 | // we can do a cheap identity compare here to determine if this is a
|
8460 | // superfluous reconcile. It's possible for state to be mutable but such
|
8461 | // change should trigger an update of the owner which would recreate
|
8462 | // the element. We explicitly check for the existence of an owner since
|
8463 | // it's possible for an element created outside a composite to be
|
8464 | // deeply mutated and reused.
|
8465 |
|
8466 | // TODO: Bailing out early is just a perf optimization right?
|
8467 | // TODO: Removing the return statement should affect correctness?
|
8468 | return;
|
8469 | }
|
8470 |
|
8471 | var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
|
8472 |
|
8473 | if (refsChanged) {
|
8474 | ReactRef.detachRefs(internalInstance, prevElement);
|
8475 | }
|
8476 |
|
8477 | internalInstance.receiveComponent(nextElement, transaction, context);
|
8478 |
|
8479 | if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
|
8480 | transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
|
8481 | }
|
8482 | },
|
8483 |
|
8484 | /**
|
8485 | * Flush any dirty changes in a component.
|
8486 | *
|
8487 | * @param {ReactComponent} internalInstance
|
8488 | * @param {ReactReconcileTransaction} transaction
|
8489 | * @internal
|
8490 | */
|
8491 | performUpdateIfNecessary: function (internalInstance, transaction) {
|
8492 | internalInstance.performUpdateIfNecessary(transaction);
|
8493 | }
|
8494 |
|
8495 | };
|
8496 |
|
8497 | module.exports = ReactReconciler;
|
8498 |
|
8499 | /***/ }),
|
8500 | /* 136 */
|
8501 | /***/ (function(module, exports, __webpack_require__) {
|
8502 |
|
8503 | /**
|
8504 | * Copyright 2013-2015, Facebook, Inc.
|
8505 | * All rights reserved.
|
8506 | *
|
8507 | * This source code is licensed under the BSD-style license found in the
|
8508 | * LICENSE file in the root directory of this source tree. An additional grant
|
8509 | * of patent rights can be found in the PATENTS file in the same directory.
|
8510 | *
|
8511 | * @providesModule ReactRef
|
8512 | */
|
8513 |
|
8514 | 'use strict';
|
8515 |
|
8516 | var ReactOwner = __webpack_require__(137);
|
8517 |
|
8518 | var ReactRef = {};
|
8519 |
|
8520 | function attachRef(ref, component, owner) {
|
8521 | if (typeof ref === 'function') {
|
8522 | ref(component.getPublicInstance());
|
8523 | } else {
|
8524 | // Legacy ref
|
8525 | ReactOwner.addComponentAsRefTo(component, ref, owner);
|
8526 | }
|
8527 | }
|
8528 |
|
8529 | function detachRef(ref, component, owner) {
|
8530 | if (typeof ref === 'function') {
|
8531 | ref(null);
|
8532 | } else {
|
8533 | // Legacy ref
|
8534 | ReactOwner.removeComponentAsRefFrom(component, ref, owner);
|
8535 | }
|
8536 | }
|
8537 |
|
8538 | ReactRef.attachRefs = function (instance, element) {
|
8539 | if (element === null || element === false) {
|
8540 | return;
|
8541 | }
|
8542 | var ref = element.ref;
|
8543 | if (ref != null) {
|
8544 | attachRef(ref, instance, element._owner);
|
8545 | }
|
8546 | };
|
8547 |
|
8548 | ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
|
8549 | // If either the owner or a `ref` has changed, make sure the newest owner
|
8550 | // has stored a reference to `this`, and the previous owner (if different)
|
8551 | // has forgotten the reference to `this`. We use the element instead
|
8552 | // of the public this.props because the post processing cannot determine
|
8553 | // a ref. The ref conceptually lives on the element.
|
8554 |
|
8555 | // TODO: Should this even be possible? The owner cannot change because
|
8556 | // it's forbidden by shouldUpdateReactComponent. The ref can change
|
8557 | // if you swap the keys of but not the refs. Reconsider where this check
|
8558 | // is made. It probably belongs where the key checking and
|
8559 | // instantiateReactComponent is done.
|
8560 |
|
8561 | var prevEmpty = prevElement === null || prevElement === false;
|
8562 | var nextEmpty = nextElement === null || nextElement === false;
|
8563 |
|
8564 | return(
|
8565 | // This has a few false positives w/r/t empty components.
|
8566 | prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref
|
8567 | );
|
8568 | };
|
8569 |
|
8570 | ReactRef.detachRefs = function (instance, element) {
|
8571 | if (element === null || element === false) {
|
8572 | return;
|
8573 | }
|
8574 | var ref = element.ref;
|
8575 | if (ref != null) {
|
8576 | detachRef(ref, instance, element._owner);
|
8577 | }
|
8578 | };
|
8579 |
|
8580 | module.exports = ReactRef;
|
8581 |
|
8582 | /***/ }),
|
8583 | /* 137 */
|
8584 | /***/ (function(module, exports, __webpack_require__) {
|
8585 |
|
8586 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
8587 | * Copyright 2013-2015, Facebook, Inc.
|
8588 | * All rights reserved.
|
8589 | *
|
8590 | * This source code is licensed under the BSD-style license found in the
|
8591 | * LICENSE file in the root directory of this source tree. An additional grant
|
8592 | * of patent rights can be found in the PATENTS file in the same directory.
|
8593 | *
|
8594 | * @providesModule ReactOwner
|
8595 | */
|
8596 |
|
8597 | 'use strict';
|
8598 |
|
8599 | var invariant = __webpack_require__(98);
|
8600 |
|
8601 | /**
|
8602 | * ReactOwners are capable of storing references to owned components.
|
8603 | *
|
8604 | * All components are capable of //being// referenced by owner components, but
|
8605 | * only ReactOwner components are capable of //referencing// owned components.
|
8606 | * The named reference is known as a "ref".
|
8607 | *
|
8608 | * Refs are available when mounted and updated during reconciliation.
|
8609 | *
|
8610 | * var MyComponent = React.createClass({
|
8611 | * render: function() {
|
8612 | * return (
|
8613 | * <div onClick={this.handleClick}>
|
8614 | * <CustomComponent ref="custom" />
|
8615 | * </div>
|
8616 | * );
|
8617 | * },
|
8618 | * handleClick: function() {
|
8619 | * this.refs.custom.handleClick();
|
8620 | * },
|
8621 | * componentDidMount: function() {
|
8622 | * this.refs.custom.initialize();
|
8623 | * }
|
8624 | * });
|
8625 | *
|
8626 | * Refs should rarely be used. When refs are used, they should only be done to
|
8627 | * control data that is not handled by React's data flow.
|
8628 | *
|
8629 | * @class ReactOwner
|
8630 | */
|
8631 | var ReactOwner = {
|
8632 |
|
8633 | /**
|
8634 | * @param {?object} object
|
8635 | * @return {boolean} True if `object` is a valid owner.
|
8636 | * @final
|
8637 | */
|
8638 | isValidOwner: function (object) {
|
8639 | return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
|
8640 | },
|
8641 |
|
8642 | /**
|
8643 | * Adds a component by ref to an owner component.
|
8644 | *
|
8645 | * @param {ReactComponent} component Component to reference.
|
8646 | * @param {string} ref Name by which to refer to the component.
|
8647 | * @param {ReactOwner} owner Component on which to record the ref.
|
8648 | * @final
|
8649 | * @internal
|
8650 | */
|
8651 | addComponentAsRefTo: function (component, ref, owner) {
|
8652 | !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might ' + 'be adding a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : undefined;
|
8653 | owner.attachRef(ref, component);
|
8654 | },
|
8655 |
|
8656 | /**
|
8657 | * Removes a component by ref from an owner component.
|
8658 | *
|
8659 | * @param {ReactComponent} component Component to dereference.
|
8660 | * @param {string} ref Name of the ref to remove.
|
8661 | * @param {ReactOwner} owner Component on which the ref is recorded.
|
8662 | * @final
|
8663 | * @internal
|
8664 | */
|
8665 | removeComponentAsRefFrom: function (component, ref, owner) {
|
8666 | !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might ' + 'be removing a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : undefined;
|
8667 | // Check that `component` is still the current ref because we do not want to
|
8668 | // detach the ref if another component stole it.
|
8669 | if (owner.getPublicInstance().refs[ref] === component.getPublicInstance()) {
|
8670 | owner.detachRef(ref);
|
8671 | }
|
8672 | }
|
8673 |
|
8674 | };
|
8675 |
|
8676 | module.exports = ReactOwner;
|
8677 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
8678 |
|
8679 | /***/ }),
|
8680 | /* 138 */
|
8681 | /***/ (function(module, exports, __webpack_require__) {
|
8682 |
|
8683 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
8684 | * Copyright 2015, Facebook, Inc.
|
8685 | * All rights reserved.
|
8686 | *
|
8687 | * This source code is licensed under the BSD-style license found in the
|
8688 | * LICENSE file in the root directory of this source tree. An additional grant
|
8689 | * of patent rights can be found in the PATENTS file in the same directory.
|
8690 | *
|
8691 | * @providesModule ReactUpdateQueue
|
8692 | */
|
8693 |
|
8694 | 'use strict';
|
8695 |
|
8696 | var ReactCurrentOwner = __webpack_require__(90);
|
8697 | var ReactElement = __webpack_require__(127);
|
8698 | var ReactInstanceMap = __webpack_require__(132);
|
8699 | var ReactUpdates = __webpack_require__(139);
|
8700 |
|
8701 | var assign = __webpack_require__(124);
|
8702 | var invariant = __webpack_require__(98);
|
8703 | var warning = __webpack_require__(110);
|
8704 |
|
8705 | function enqueueUpdate(internalInstance) {
|
8706 | ReactUpdates.enqueueUpdate(internalInstance);
|
8707 | }
|
8708 |
|
8709 | function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
|
8710 | var internalInstance = ReactInstanceMap.get(publicInstance);
|
8711 | if (!internalInstance) {
|
8712 | if (process.env.NODE_ENV !== 'production') {
|
8713 | // Only warn when we have a callerName. Otherwise we should be silent.
|
8714 | // We're probably calling from enqueueCallback. We don't want to warn
|
8715 | // there because we already warned for the corresponding lifecycle method.
|
8716 | process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : undefined;
|
8717 | }
|
8718 | return null;
|
8719 | }
|
8720 |
|
8721 | if (process.env.NODE_ENV !== 'production') {
|
8722 | process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition ' + '(such as within `render`). Render methods should be a pure function ' + 'of props and state.', callerName) : undefined;
|
8723 | }
|
8724 |
|
8725 | return internalInstance;
|
8726 | }
|
8727 |
|
8728 | /**
|
8729 | * ReactUpdateQueue allows for state updates to be scheduled into a later
|
8730 | * reconciliation step.
|
8731 | */
|
8732 | var ReactUpdateQueue = {
|
8733 |
|
8734 | /**
|
8735 | * Checks whether or not this composite component is mounted.
|
8736 | * @param {ReactClass} publicInstance The instance we want to test.
|
8737 | * @return {boolean} True if mounted, false otherwise.
|
8738 | * @protected
|
8739 | * @final
|
8740 | */
|
8741 | isMounted: function (publicInstance) {
|
8742 | if (process.env.NODE_ENV !== 'production') {
|
8743 | var owner = ReactCurrentOwner.current;
|
8744 | if (owner !== null) {
|
8745 | process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : undefined;
|
8746 | owner._warnedAboutRefsInRender = true;
|
8747 | }
|
8748 | }
|
8749 | var internalInstance = ReactInstanceMap.get(publicInstance);
|
8750 | if (internalInstance) {
|
8751 | // During componentWillMount and render this will still be null but after
|
8752 | // that will always render to something. At least for now. So we can use
|
8753 | // this hack.
|
8754 | return !!internalInstance._renderedComponent;
|
8755 | } else {
|
8756 | return false;
|
8757 | }
|
8758 | },
|
8759 |
|
8760 | /**
|
8761 | * Enqueue a callback that will be executed after all the pending updates
|
8762 | * have processed.
|
8763 | *
|
8764 | * @param {ReactClass} publicInstance The instance to use as `this` context.
|
8765 | * @param {?function} callback Called after state is updated.
|
8766 | * @internal
|
8767 | */
|
8768 | enqueueCallback: function (publicInstance, callback) {
|
8769 | !(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
|
8770 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
|
8771 |
|
8772 | // Previously we would throw an error if we didn't have an internal
|
8773 | // instance. Since we want to make it a no-op instead, we mirror the same
|
8774 | // behavior we have in other enqueue* methods.
|
8775 | // We also need to ignore callbacks in componentWillMount. See
|
8776 | // enqueueUpdates.
|
8777 | if (!internalInstance) {
|
8778 | return null;
|
8779 | }
|
8780 |
|
8781 | if (internalInstance._pendingCallbacks) {
|
8782 | internalInstance._pendingCallbacks.push(callback);
|
8783 | } else {
|
8784 | internalInstance._pendingCallbacks = [callback];
|
8785 | }
|
8786 | // TODO: The callback here is ignored when setState is called from
|
8787 | // componentWillMount. Either fix it or disallow doing so completely in
|
8788 | // favor of getInitialState. Alternatively, we can disallow
|
8789 | // componentWillMount during server-side rendering.
|
8790 | enqueueUpdate(internalInstance);
|
8791 | },
|
8792 |
|
8793 | enqueueCallbackInternal: function (internalInstance, callback) {
|
8794 | !(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
|
8795 | if (internalInstance._pendingCallbacks) {
|
8796 | internalInstance._pendingCallbacks.push(callback);
|
8797 | } else {
|
8798 | internalInstance._pendingCallbacks = [callback];
|
8799 | }
|
8800 | enqueueUpdate(internalInstance);
|
8801 | },
|
8802 |
|
8803 | /**
|
8804 | * Forces an update. This should only be invoked when it is known with
|
8805 | * certainty that we are **not** in a DOM transaction.
|
8806 | *
|
8807 | * You may want to call this when you know that some deeper aspect of the
|
8808 | * component's state has changed but `setState` was not called.
|
8809 | *
|
8810 | * This will not invoke `shouldComponentUpdate`, but it will invoke
|
8811 | * `componentWillUpdate` and `componentDidUpdate`.
|
8812 | *
|
8813 | * @param {ReactClass} publicInstance The instance that should rerender.
|
8814 | * @internal
|
8815 | */
|
8816 | enqueueForceUpdate: function (publicInstance) {
|
8817 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
|
8818 |
|
8819 | if (!internalInstance) {
|
8820 | return;
|
8821 | }
|
8822 |
|
8823 | internalInstance._pendingForceUpdate = true;
|
8824 |
|
8825 | enqueueUpdate(internalInstance);
|
8826 | },
|
8827 |
|
8828 | /**
|
8829 | * Replaces all of the state. Always use this or `setState` to mutate state.
|
8830 | * You should treat `this.state` as immutable.
|
8831 | *
|
8832 | * There is no guarantee that `this.state` will be immediately updated, so
|
8833 | * accessing `this.state` after calling this method may return the old value.
|
8834 | *
|
8835 | * @param {ReactClass} publicInstance The instance that should rerender.
|
8836 | * @param {object} completeState Next state.
|
8837 | * @internal
|
8838 | */
|
8839 | enqueueReplaceState: function (publicInstance, completeState) {
|
8840 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
|
8841 |
|
8842 | if (!internalInstance) {
|
8843 | return;
|
8844 | }
|
8845 |
|
8846 | internalInstance._pendingStateQueue = [completeState];
|
8847 | internalInstance._pendingReplaceState = true;
|
8848 |
|
8849 | enqueueUpdate(internalInstance);
|
8850 | },
|
8851 |
|
8852 | /**
|
8853 | * Sets a subset of the state. This only exists because _pendingState is
|
8854 | * internal. This provides a merging strategy that is not available to deep
|
8855 | * properties which is confusing. TODO: Expose pendingState or don't use it
|
8856 | * during the merge.
|
8857 | *
|
8858 | * @param {ReactClass} publicInstance The instance that should rerender.
|
8859 | * @param {object} partialState Next partial state to be merged with state.
|
8860 | * @internal
|
8861 | */
|
8862 | enqueueSetState: function (publicInstance, partialState) {
|
8863 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
|
8864 |
|
8865 | if (!internalInstance) {
|
8866 | return;
|
8867 | }
|
8868 |
|
8869 | var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
|
8870 | queue.push(partialState);
|
8871 |
|
8872 | enqueueUpdate(internalInstance);
|
8873 | },
|
8874 |
|
8875 | /**
|
8876 | * Sets a subset of the props.
|
8877 | *
|
8878 | * @param {ReactClass} publicInstance The instance that should rerender.
|
8879 | * @param {object} partialProps Subset of the next props.
|
8880 | * @internal
|
8881 | */
|
8882 | enqueueSetProps: function (publicInstance, partialProps) {
|
8883 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setProps');
|
8884 | if (!internalInstance) {
|
8885 | return;
|
8886 | }
|
8887 | ReactUpdateQueue.enqueueSetPropsInternal(internalInstance, partialProps);
|
8888 | },
|
8889 |
|
8890 | enqueueSetPropsInternal: function (internalInstance, partialProps) {
|
8891 | var topLevelWrapper = internalInstance._topLevelWrapper;
|
8892 | !topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setProps(...): You called `setProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
|
8893 |
|
8894 | // Merge with the pending element if it exists, otherwise with existing
|
8895 | // element props.
|
8896 | var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
|
8897 | var element = wrapElement.props;
|
8898 | var props = assign({}, element.props, partialProps);
|
8899 | topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
|
8900 |
|
8901 | enqueueUpdate(topLevelWrapper);
|
8902 | },
|
8903 |
|
8904 | /**
|
8905 | * Replaces all of the props.
|
8906 | *
|
8907 | * @param {ReactClass} publicInstance The instance that should rerender.
|
8908 | * @param {object} props New props.
|
8909 | * @internal
|
8910 | */
|
8911 | enqueueReplaceProps: function (publicInstance, props) {
|
8912 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceProps');
|
8913 | if (!internalInstance) {
|
8914 | return;
|
8915 | }
|
8916 | ReactUpdateQueue.enqueueReplacePropsInternal(internalInstance, props);
|
8917 | },
|
8918 |
|
8919 | enqueueReplacePropsInternal: function (internalInstance, props) {
|
8920 | var topLevelWrapper = internalInstance._topLevelWrapper;
|
8921 | !topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'replaceProps(...): You called `replaceProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
|
8922 |
|
8923 | // Merge with the pending element if it exists, otherwise with existing
|
8924 | // element props.
|
8925 | var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
|
8926 | var element = wrapElement.props;
|
8927 | topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
|
8928 |
|
8929 | enqueueUpdate(topLevelWrapper);
|
8930 | },
|
8931 |
|
8932 | enqueueElementInternal: function (internalInstance, newElement) {
|
8933 | internalInstance._pendingElement = newElement;
|
8934 | enqueueUpdate(internalInstance);
|
8935 | }
|
8936 |
|
8937 | };
|
8938 |
|
8939 | module.exports = ReactUpdateQueue;
|
8940 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
8941 |
|
8942 | /***/ }),
|
8943 | /* 139 */
|
8944 | /***/ (function(module, exports, __webpack_require__) {
|
8945 |
|
8946 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
8947 | * Copyright 2013-2015, Facebook, Inc.
|
8948 | * All rights reserved.
|
8949 | *
|
8950 | * This source code is licensed under the BSD-style license found in the
|
8951 | * LICENSE file in the root directory of this source tree. An additional grant
|
8952 | * of patent rights can be found in the PATENTS file in the same directory.
|
8953 | *
|
8954 | * @providesModule ReactUpdates
|
8955 | */
|
8956 |
|
8957 | 'use strict';
|
8958 |
|
8959 | var CallbackQueue = __webpack_require__(140);
|
8960 | var PooledClass = __webpack_require__(141);
|
8961 | var ReactPerf = __webpack_require__(103);
|
8962 | var ReactReconciler = __webpack_require__(135);
|
8963 | var Transaction = __webpack_require__(142);
|
8964 |
|
8965 | var assign = __webpack_require__(124);
|
8966 | var invariant = __webpack_require__(98);
|
8967 |
|
8968 | var dirtyComponents = [];
|
8969 | var asapCallbackQueue = CallbackQueue.getPooled();
|
8970 | var asapEnqueued = false;
|
8971 |
|
8972 | var batchingStrategy = null;
|
8973 |
|
8974 | function ensureInjected() {
|
8975 | !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : undefined;
|
8976 | }
|
8977 |
|
8978 | var NESTED_UPDATES = {
|
8979 | initialize: function () {
|
8980 | this.dirtyComponentsLength = dirtyComponents.length;
|
8981 | },
|
8982 | close: function () {
|
8983 | if (this.dirtyComponentsLength !== dirtyComponents.length) {
|
8984 | // Additional updates were enqueued by componentDidUpdate handlers or
|
8985 | // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
|
8986 | // these new updates so that if A's componentDidUpdate calls setState on
|
8987 | // B, B will update before the callback A's updater provided when calling
|
8988 | // setState.
|
8989 | dirtyComponents.splice(0, this.dirtyComponentsLength);
|
8990 | flushBatchedUpdates();
|
8991 | } else {
|
8992 | dirtyComponents.length = 0;
|
8993 | }
|
8994 | }
|
8995 | };
|
8996 |
|
8997 | var UPDATE_QUEUEING = {
|
8998 | initialize: function () {
|
8999 | this.callbackQueue.reset();
|
9000 | },
|
9001 | close: function () {
|
9002 | this.callbackQueue.notifyAll();
|
9003 | }
|
9004 | };
|
9005 |
|
9006 | var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
|
9007 |
|
9008 | function ReactUpdatesFlushTransaction() {
|
9009 | this.reinitializeTransaction();
|
9010 | this.dirtyComponentsLength = null;
|
9011 | this.callbackQueue = CallbackQueue.getPooled();
|
9012 | this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( /* forceHTML */false);
|
9013 | }
|
9014 |
|
9015 | assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
|
9016 | getTransactionWrappers: function () {
|
9017 | return TRANSACTION_WRAPPERS;
|
9018 | },
|
9019 |
|
9020 | destructor: function () {
|
9021 | this.dirtyComponentsLength = null;
|
9022 | CallbackQueue.release(this.callbackQueue);
|
9023 | this.callbackQueue = null;
|
9024 | ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
|
9025 | this.reconcileTransaction = null;
|
9026 | },
|
9027 |
|
9028 | perform: function (method, scope, a) {
|
9029 | // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
|
9030 | // with this transaction's wrappers around it.
|
9031 | return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
|
9032 | }
|
9033 | });
|
9034 |
|
9035 | PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
|
9036 |
|
9037 | function batchedUpdates(callback, a, b, c, d, e) {
|
9038 | ensureInjected();
|
9039 | batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
|
9040 | }
|
9041 |
|
9042 | /**
|
9043 | * Array comparator for ReactComponents by mount ordering.
|
9044 | *
|
9045 | * @param {ReactComponent} c1 first component you're comparing
|
9046 | * @param {ReactComponent} c2 second component you're comparing
|
9047 | * @return {number} Return value usable by Array.prototype.sort().
|
9048 | */
|
9049 | function mountOrderComparator(c1, c2) {
|
9050 | return c1._mountOrder - c2._mountOrder;
|
9051 | }
|
9052 |
|
9053 | function runBatchedUpdates(transaction) {
|
9054 | var len = transaction.dirtyComponentsLength;
|
9055 | !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : undefined;
|
9056 |
|
9057 | // Since reconciling a component higher in the owner hierarchy usually (not
|
9058 | // always -- see shouldComponentUpdate()) will reconcile children, reconcile
|
9059 | // them before their children by sorting the array.
|
9060 | dirtyComponents.sort(mountOrderComparator);
|
9061 |
|
9062 | for (var i = 0; i < len; i++) {
|
9063 | // If a component is unmounted before pending changes apply, it will still
|
9064 | // be here, but we assume that it has cleared its _pendingCallbacks and
|
9065 | // that performUpdateIfNecessary is a noop.
|
9066 | var component = dirtyComponents[i];
|
9067 |
|
9068 | // If performUpdateIfNecessary happens to enqueue any new updates, we
|
9069 | // shouldn't execute the callbacks until the next render happens, so
|
9070 | // stash the callbacks first
|
9071 | var callbacks = component._pendingCallbacks;
|
9072 | component._pendingCallbacks = null;
|
9073 |
|
9074 | ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction);
|
9075 |
|
9076 | if (callbacks) {
|
9077 | for (var j = 0; j < callbacks.length; j++) {
|
9078 | transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
|
9079 | }
|
9080 | }
|
9081 | }
|
9082 | }
|
9083 |
|
9084 | var flushBatchedUpdates = function () {
|
9085 | // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
|
9086 | // array and perform any updates enqueued by mount-ready handlers (i.e.,
|
9087 | // componentDidUpdate) but we need to check here too in order to catch
|
9088 | // updates enqueued by setState callbacks and asap calls.
|
9089 | while (dirtyComponents.length || asapEnqueued) {
|
9090 | if (dirtyComponents.length) {
|
9091 | var transaction = ReactUpdatesFlushTransaction.getPooled();
|
9092 | transaction.perform(runBatchedUpdates, null, transaction);
|
9093 | ReactUpdatesFlushTransaction.release(transaction);
|
9094 | }
|
9095 |
|
9096 | if (asapEnqueued) {
|
9097 | asapEnqueued = false;
|
9098 | var queue = asapCallbackQueue;
|
9099 | asapCallbackQueue = CallbackQueue.getPooled();
|
9100 | queue.notifyAll();
|
9101 | CallbackQueue.release(queue);
|
9102 | }
|
9103 | }
|
9104 | };
|
9105 | flushBatchedUpdates = ReactPerf.measure('ReactUpdates', 'flushBatchedUpdates', flushBatchedUpdates);
|
9106 |
|
9107 | /**
|
9108 | * Mark a component as needing a rerender, adding an optional callback to a
|
9109 | * list of functions which will be executed once the rerender occurs.
|
9110 | */
|
9111 | function enqueueUpdate(component) {
|
9112 | ensureInjected();
|
9113 |
|
9114 | // Various parts of our code (such as ReactCompositeComponent's
|
9115 | // _renderValidatedComponent) assume that calls to render aren't nested;
|
9116 | // verify that that's the case. (This is called by each top-level update
|
9117 | // function, like setProps, setState, forceUpdate, etc.; creation and
|
9118 | // destruction of top-level components is guarded in ReactMount.)
|
9119 |
|
9120 | if (!batchingStrategy.isBatchingUpdates) {
|
9121 | batchingStrategy.batchedUpdates(enqueueUpdate, component);
|
9122 | return;
|
9123 | }
|
9124 |
|
9125 | dirtyComponents.push(component);
|
9126 | }
|
9127 |
|
9128 | /**
|
9129 | * Enqueue a callback to be run at the end of the current batching cycle. Throws
|
9130 | * if no updates are currently being performed.
|
9131 | */
|
9132 | function asap(callback, context) {
|
9133 | !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;
|
9134 | asapCallbackQueue.enqueue(callback, context);
|
9135 | asapEnqueued = true;
|
9136 | }
|
9137 |
|
9138 | var ReactUpdatesInjection = {
|
9139 | injectReconcileTransaction: function (ReconcileTransaction) {
|
9140 | !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : undefined;
|
9141 | ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
|
9142 | },
|
9143 |
|
9144 | injectBatchingStrategy: function (_batchingStrategy) {
|
9145 | !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : undefined;
|
9146 | !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : undefined;
|
9147 | !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : undefined;
|
9148 | batchingStrategy = _batchingStrategy;
|
9149 | }
|
9150 | };
|
9151 |
|
9152 | var ReactUpdates = {
|
9153 | /**
|
9154 | * React references `ReactReconcileTransaction` using this property in order
|
9155 | * to allow dependency injection.
|
9156 | *
|
9157 | * @internal
|
9158 | */
|
9159 | ReactReconcileTransaction: null,
|
9160 |
|
9161 | batchedUpdates: batchedUpdates,
|
9162 | enqueueUpdate: enqueueUpdate,
|
9163 | flushBatchedUpdates: flushBatchedUpdates,
|
9164 | injection: ReactUpdatesInjection,
|
9165 | asap: asap
|
9166 | };
|
9167 |
|
9168 | module.exports = ReactUpdates;
|
9169 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
9170 |
|
9171 | /***/ }),
|
9172 | /* 140 */
|
9173 | /***/ (function(module, exports, __webpack_require__) {
|
9174 |
|
9175 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
9176 | * Copyright 2013-2015, Facebook, Inc.
|
9177 | * All rights reserved.
|
9178 | *
|
9179 | * This source code is licensed under the BSD-style license found in the
|
9180 | * LICENSE file in the root directory of this source tree. An additional grant
|
9181 | * of patent rights can be found in the PATENTS file in the same directory.
|
9182 | *
|
9183 | * @providesModule CallbackQueue
|
9184 | */
|
9185 |
|
9186 | 'use strict';
|
9187 |
|
9188 | var PooledClass = __webpack_require__(141);
|
9189 |
|
9190 | var assign = __webpack_require__(124);
|
9191 | var invariant = __webpack_require__(98);
|
9192 |
|
9193 | /**
|
9194 | * A specialized pseudo-event module to help keep track of components waiting to
|
9195 | * be notified when their DOM representations are available for use.
|
9196 | *
|
9197 | * This implements `PooledClass`, so you should never need to instantiate this.
|
9198 | * Instead, use `CallbackQueue.getPooled()`.
|
9199 | *
|
9200 | * @class ReactMountReady
|
9201 | * @implements PooledClass
|
9202 | * @internal
|
9203 | */
|
9204 | function CallbackQueue() {
|
9205 | this._callbacks = null;
|
9206 | this._contexts = null;
|
9207 | }
|
9208 |
|
9209 | assign(CallbackQueue.prototype, {
|
9210 |
|
9211 | /**
|
9212 | * Enqueues a callback to be invoked when `notifyAll` is invoked.
|
9213 | *
|
9214 | * @param {function} callback Invoked when `notifyAll` is invoked.
|
9215 | * @param {?object} context Context to call `callback` with.
|
9216 | * @internal
|
9217 | */
|
9218 | enqueue: function (callback, context) {
|
9219 | this._callbacks = this._callbacks || [];
|
9220 | this._contexts = this._contexts || [];
|
9221 | this._callbacks.push(callback);
|
9222 | this._contexts.push(context);
|
9223 | },
|
9224 |
|
9225 | /**
|
9226 | * Invokes all enqueued callbacks and clears the queue. This is invoked after
|
9227 | * the DOM representation of a component has been created or updated.
|
9228 | *
|
9229 | * @internal
|
9230 | */
|
9231 | notifyAll: function () {
|
9232 | var callbacks = this._callbacks;
|
9233 | var contexts = this._contexts;
|
9234 | if (callbacks) {
|
9235 | !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : undefined;
|
9236 | this._callbacks = null;
|
9237 | this._contexts = null;
|
9238 | for (var i = 0; i < callbacks.length; i++) {
|
9239 | callbacks[i].call(contexts[i]);
|
9240 | }
|
9241 | callbacks.length = 0;
|
9242 | contexts.length = 0;
|
9243 | }
|
9244 | },
|
9245 |
|
9246 | /**
|
9247 | * Resets the internal queue.
|
9248 | *
|
9249 | * @internal
|
9250 | */
|
9251 | reset: function () {
|
9252 | this._callbacks = null;
|
9253 | this._contexts = null;
|
9254 | },
|
9255 |
|
9256 | /**
|
9257 | * `PooledClass` looks for this.
|
9258 | */
|
9259 | destructor: function () {
|
9260 | this.reset();
|
9261 | }
|
9262 |
|
9263 | });
|
9264 |
|
9265 | PooledClass.addPoolingTo(CallbackQueue);
|
9266 |
|
9267 | module.exports = CallbackQueue;
|
9268 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
9269 |
|
9270 | /***/ }),
|
9271 | /* 141 */
|
9272 | /***/ (function(module, exports, __webpack_require__) {
|
9273 |
|
9274 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
9275 | * Copyright 2013-2015, Facebook, Inc.
|
9276 | * All rights reserved.
|
9277 | *
|
9278 | * This source code is licensed under the BSD-style license found in the
|
9279 | * LICENSE file in the root directory of this source tree. An additional grant
|
9280 | * of patent rights can be found in the PATENTS file in the same directory.
|
9281 | *
|
9282 | * @providesModule PooledClass
|
9283 | */
|
9284 |
|
9285 | 'use strict';
|
9286 |
|
9287 | var invariant = __webpack_require__(98);
|
9288 |
|
9289 | /**
|
9290 | * Static poolers. Several custom versions for each potential number of
|
9291 | * arguments. A completely generic pooler is easy to implement, but would
|
9292 | * require accessing the `arguments` object. In each of these, `this` refers to
|
9293 | * the Class itself, not an instance. If any others are needed, simply add them
|
9294 | * here, or in their own files.
|
9295 | */
|
9296 | var oneArgumentPooler = function (copyFieldsFrom) {
|
9297 | var Klass = this;
|
9298 | if (Klass.instancePool.length) {
|
9299 | var instance = Klass.instancePool.pop();
|
9300 | Klass.call(instance, copyFieldsFrom);
|
9301 | return instance;
|
9302 | } else {
|
9303 | return new Klass(copyFieldsFrom);
|
9304 | }
|
9305 | };
|
9306 |
|
9307 | var twoArgumentPooler = function (a1, a2) {
|
9308 | var Klass = this;
|
9309 | if (Klass.instancePool.length) {
|
9310 | var instance = Klass.instancePool.pop();
|
9311 | Klass.call(instance, a1, a2);
|
9312 | return instance;
|
9313 | } else {
|
9314 | return new Klass(a1, a2);
|
9315 | }
|
9316 | };
|
9317 |
|
9318 | var threeArgumentPooler = function (a1, a2, a3) {
|
9319 | var Klass = this;
|
9320 | if (Klass.instancePool.length) {
|
9321 | var instance = Klass.instancePool.pop();
|
9322 | Klass.call(instance, a1, a2, a3);
|
9323 | return instance;
|
9324 | } else {
|
9325 | return new Klass(a1, a2, a3);
|
9326 | }
|
9327 | };
|
9328 |
|
9329 | var fourArgumentPooler = function (a1, a2, a3, a4) {
|
9330 | var Klass = this;
|
9331 | if (Klass.instancePool.length) {
|
9332 | var instance = Klass.instancePool.pop();
|
9333 | Klass.call(instance, a1, a2, a3, a4);
|
9334 | return instance;
|
9335 | } else {
|
9336 | return new Klass(a1, a2, a3, a4);
|
9337 | }
|
9338 | };
|
9339 |
|
9340 | var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
9341 | var Klass = this;
|
9342 | if (Klass.instancePool.length) {
|
9343 | var instance = Klass.instancePool.pop();
|
9344 | Klass.call(instance, a1, a2, a3, a4, a5);
|
9345 | return instance;
|
9346 | } else {
|
9347 | return new Klass(a1, a2, a3, a4, a5);
|
9348 | }
|
9349 | };
|
9350 |
|
9351 | var standardReleaser = function (instance) {
|
9352 | var Klass = this;
|
9353 | !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : undefined;
|
9354 | instance.destructor();
|
9355 | if (Klass.instancePool.length < Klass.poolSize) {
|
9356 | Klass.instancePool.push(instance);
|
9357 | }
|
9358 | };
|
9359 |
|
9360 | var DEFAULT_POOL_SIZE = 10;
|
9361 | var DEFAULT_POOLER = oneArgumentPooler;
|
9362 |
|
9363 | /**
|
9364 | * Augments `CopyConstructor` to be a poolable class, augmenting only the class
|
9365 | * itself (statically) not adding any prototypical fields. Any CopyConstructor
|
9366 | * you give this may have a `poolSize` property, and will look for a
|
9367 | * prototypical `destructor` on instances (optional).
|
9368 | *
|
9369 | * @param {Function} CopyConstructor Constructor that can be used to reset.
|
9370 | * @param {Function} pooler Customizable pooler.
|
9371 | */
|
9372 | var addPoolingTo = function (CopyConstructor, pooler) {
|
9373 | var NewKlass = CopyConstructor;
|
9374 | NewKlass.instancePool = [];
|
9375 | NewKlass.getPooled = pooler || DEFAULT_POOLER;
|
9376 | if (!NewKlass.poolSize) {
|
9377 | NewKlass.poolSize = DEFAULT_POOL_SIZE;
|
9378 | }
|
9379 | NewKlass.release = standardReleaser;
|
9380 | return NewKlass;
|
9381 | };
|
9382 |
|
9383 | var PooledClass = {
|
9384 | addPoolingTo: addPoolingTo,
|
9385 | oneArgumentPooler: oneArgumentPooler,
|
9386 | twoArgumentPooler: twoArgumentPooler,
|
9387 | threeArgumentPooler: threeArgumentPooler,
|
9388 | fourArgumentPooler: fourArgumentPooler,
|
9389 | fiveArgumentPooler: fiveArgumentPooler
|
9390 | };
|
9391 |
|
9392 | module.exports = PooledClass;
|
9393 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
9394 |
|
9395 | /***/ }),
|
9396 | /* 142 */
|
9397 | /***/ (function(module, exports, __webpack_require__) {
|
9398 |
|
9399 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
9400 | * Copyright 2013-2015, Facebook, Inc.
|
9401 | * All rights reserved.
|
9402 | *
|
9403 | * This source code is licensed under the BSD-style license found in the
|
9404 | * LICENSE file in the root directory of this source tree. An additional grant
|
9405 | * of patent rights can be found in the PATENTS file in the same directory.
|
9406 | *
|
9407 | * @providesModule Transaction
|
9408 | */
|
9409 |
|
9410 | 'use strict';
|
9411 |
|
9412 | var invariant = __webpack_require__(98);
|
9413 |
|
9414 | /**
|
9415 | * `Transaction` creates a black box that is able to wrap any method such that
|
9416 | * certain invariants are maintained before and after the method is invoked
|
9417 | * (Even if an exception is thrown while invoking the wrapped method). Whoever
|
9418 | * instantiates a transaction can provide enforcers of the invariants at
|
9419 | * creation time. The `Transaction` class itself will supply one additional
|
9420 | * automatic invariant for you - the invariant that any transaction instance
|
9421 | * should not be run while it is already being run. You would typically create a
|
9422 | * single instance of a `Transaction` for reuse multiple times, that potentially
|
9423 | * is used to wrap several different methods. Wrappers are extremely simple -
|
9424 | * they only require implementing two methods.
|
9425 | *
|
9426 | * <pre>
|
9427 | * wrappers (injected at creation time)
|
9428 | * + +
|
9429 | * | |
|
9430 | * +-----------------|--------|--------------+
|
9431 | * | v | |
|
9432 | * | +---------------+ | |
|
9433 | * | +--| wrapper1 |---|----+ |
|
9434 | * | | +---------------+ v | |
|
9435 | * | | +-------------+ | |
|
9436 | * | | +----| wrapper2 |--------+ |
|
9437 | * | | | +-------------+ | | |
|
9438 | * | | | | | |
|
9439 | * | v v v v | wrapper
|
9440 | * | +---+ +---+ +---------+ +---+ +---+ | invariants
|
9441 | * perform(anyMethod) | | | | | | | | | | | | maintained
|
9442 | * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
|
9443 | * | | | | | | | | | | | |
|
9444 | * | | | | | | | | | | | |
|
9445 | * | | | | | | | | | | | |
|
9446 | * | +---+ +---+ +---------+ +---+ +---+ |
|
9447 | * | initialize close |
|
9448 | * +-----------------------------------------+
|
9449 | * </pre>
|
9450 | *
|
9451 | * Use cases:
|
9452 | * - Preserving the input selection ranges before/after reconciliation.
|
9453 | * Restoring selection even in the event of an unexpected error.
|
9454 | * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
|
9455 | * while guaranteeing that afterwards, the event system is reactivated.
|
9456 | * - Flushing a queue of collected DOM mutations to the main UI thread after a
|
9457 | * reconciliation takes place in a worker thread.
|
9458 | * - Invoking any collected `componentDidUpdate` callbacks after rendering new
|
9459 | * content.
|
9460 | * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
|
9461 | * to preserve the `scrollTop` (an automatic scroll aware DOM).
|
9462 | * - (Future use case): Layout calculations before and after DOM updates.
|
9463 | *
|
9464 | * Transactional plugin API:
|
9465 | * - A module that has an `initialize` method that returns any precomputation.
|
9466 | * - and a `close` method that accepts the precomputation. `close` is invoked
|
9467 | * when the wrapped process is completed, or has failed.
|
9468 | *
|
9469 | * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
|
9470 | * that implement `initialize` and `close`.
|
9471 | * @return {Transaction} Single transaction for reuse in thread.
|
9472 | *
|
9473 | * @class Transaction
|
9474 | */
|
9475 | var Mixin = {
|
9476 | /**
|
9477 | * Sets up this instance so that it is prepared for collecting metrics. Does
|
9478 | * so such that this setup method may be used on an instance that is already
|
9479 | * initialized, in a way that does not consume additional memory upon reuse.
|
9480 | * That can be useful if you decide to make your subclass of this mixin a
|
9481 | * "PooledClass".
|
9482 | */
|
9483 | reinitializeTransaction: function () {
|
9484 | this.transactionWrappers = this.getTransactionWrappers();
|
9485 | if (this.wrapperInitData) {
|
9486 | this.wrapperInitData.length = 0;
|
9487 | } else {
|
9488 | this.wrapperInitData = [];
|
9489 | }
|
9490 | this._isInTransaction = false;
|
9491 | },
|
9492 |
|
9493 | _isInTransaction: false,
|
9494 |
|
9495 | /**
|
9496 | * @abstract
|
9497 | * @return {Array<TransactionWrapper>} Array of transaction wrappers.
|
9498 | */
|
9499 | getTransactionWrappers: null,
|
9500 |
|
9501 | isInTransaction: function () {
|
9502 | return !!this._isInTransaction;
|
9503 | },
|
9504 |
|
9505 | /**
|
9506 | * Executes the function within a safety window. Use this for the top level
|
9507 | * methods that result in large amounts of computation/mutations that would
|
9508 | * need to be safety checked. The optional arguments helps prevent the need
|
9509 | * to bind in many cases.
|
9510 | *
|
9511 | * @param {function} method Member of scope to call.
|
9512 | * @param {Object} scope Scope to invoke from.
|
9513 | * @param {Object?=} a Argument to pass to the method.
|
9514 | * @param {Object?=} b Argument to pass to the method.
|
9515 | * @param {Object?=} c Argument to pass to the method.
|
9516 | * @param {Object?=} d Argument to pass to the method.
|
9517 | * @param {Object?=} e Argument to pass to the method.
|
9518 | * @param {Object?=} f Argument to pass to the method.
|
9519 | *
|
9520 | * @return {*} Return value from `method`.
|
9521 | */
|
9522 | perform: function (method, scope, a, b, c, d, e, f) {
|
9523 | !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : undefined;
|
9524 | var errorThrown;
|
9525 | var ret;
|
9526 | try {
|
9527 | this._isInTransaction = true;
|
9528 | // Catching errors makes debugging more difficult, so we start with
|
9529 | // errorThrown set to true before setting it to false after calling
|
9530 | // close -- if it's still set to true in the finally block, it means
|
9531 | // one of these calls threw.
|
9532 | errorThrown = true;
|
9533 | this.initializeAll(0);
|
9534 | ret = method.call(scope, a, b, c, d, e, f);
|
9535 | errorThrown = false;
|
9536 | } finally {
|
9537 | try {
|
9538 | if (errorThrown) {
|
9539 | // If `method` throws, prefer to show that stack trace over any thrown
|
9540 | // by invoking `closeAll`.
|
9541 | try {
|
9542 | this.closeAll(0);
|
9543 | } catch (err) {}
|
9544 | } else {
|
9545 | // Since `method` didn't throw, we don't want to silence the exception
|
9546 | // here.
|
9547 | this.closeAll(0);
|
9548 | }
|
9549 | } finally {
|
9550 | this._isInTransaction = false;
|
9551 | }
|
9552 | }
|
9553 | return ret;
|
9554 | },
|
9555 |
|
9556 | initializeAll: function (startIndex) {
|
9557 | var transactionWrappers = this.transactionWrappers;
|
9558 | for (var i = startIndex; i < transactionWrappers.length; i++) {
|
9559 | var wrapper = transactionWrappers[i];
|
9560 | try {
|
9561 | // Catching errors makes debugging more difficult, so we start with the
|
9562 | // OBSERVED_ERROR state before overwriting it with the real return value
|
9563 | // of initialize -- if it's still set to OBSERVED_ERROR in the finally
|
9564 | // block, it means wrapper.initialize threw.
|
9565 | this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
|
9566 | this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
|
9567 | } finally {
|
9568 | if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
|
9569 | // The initializer for wrapper i threw an error; initialize the
|
9570 | // remaining wrappers but silence any exceptions from them to ensure
|
9571 | // that the first error is the one to bubble up.
|
9572 | try {
|
9573 | this.initializeAll(i + 1);
|
9574 | } catch (err) {}
|
9575 | }
|
9576 | }
|
9577 | }
|
9578 | },
|
9579 |
|
9580 | /**
|
9581 | * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
|
9582 | * them the respective return values of `this.transactionWrappers.init[i]`
|
9583 | * (`close`rs that correspond to initializers that failed will not be
|
9584 | * invoked).
|
9585 | */
|
9586 | closeAll: function (startIndex) {
|
9587 | !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : undefined;
|
9588 | var transactionWrappers = this.transactionWrappers;
|
9589 | for (var i = startIndex; i < transactionWrappers.length; i++) {
|
9590 | var wrapper = transactionWrappers[i];
|
9591 | var initData = this.wrapperInitData[i];
|
9592 | var errorThrown;
|
9593 | try {
|
9594 | // Catching errors makes debugging more difficult, so we start with
|
9595 | // errorThrown set to true before setting it to false after calling
|
9596 | // close -- if it's still set to true in the finally block, it means
|
9597 | // wrapper.close threw.
|
9598 | errorThrown = true;
|
9599 | if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
|
9600 | wrapper.close.call(this, initData);
|
9601 | }
|
9602 | errorThrown = false;
|
9603 | } finally {
|
9604 | if (errorThrown) {
|
9605 | // The closer for wrapper i threw an error; close the remaining
|
9606 | // wrappers but silence any exceptions from them to ensure that the
|
9607 | // first error is the one to bubble up.
|
9608 | try {
|
9609 | this.closeAll(i + 1);
|
9610 | } catch (e) {}
|
9611 | }
|
9612 | }
|
9613 | }
|
9614 | this.wrapperInitData.length = 0;
|
9615 | }
|
9616 | };
|
9617 |
|
9618 | var Transaction = {
|
9619 |
|
9620 | Mixin: Mixin,
|
9621 |
|
9622 | /**
|
9623 | * Token to look for to determine if an error occurred.
|
9624 | */
|
9625 | OBSERVED_ERROR: {}
|
9626 |
|
9627 | };
|
9628 |
|
9629 | module.exports = Transaction;
|
9630 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
9631 |
|
9632 | /***/ }),
|
9633 | /* 143 */
|
9634 | /***/ (function(module, exports, __webpack_require__) {
|
9635 |
|
9636 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
9637 | * Copyright 2013-2015, Facebook, Inc.
|
9638 | * All rights reserved.
|
9639 | *
|
9640 | * This source code is licensed under the BSD-style license found in the
|
9641 | * LICENSE file in the root directory of this source tree. An additional grant
|
9642 | * of patent rights can be found in the PATENTS file in the same directory.
|
9643 | *
|
9644 | * @providesModule emptyObject
|
9645 | */
|
9646 |
|
9647 | 'use strict';
|
9648 |
|
9649 | var emptyObject = {};
|
9650 |
|
9651 | if (process.env.NODE_ENV !== 'production') {
|
9652 | Object.freeze(emptyObject);
|
9653 | }
|
9654 |
|
9655 | module.exports = emptyObject;
|
9656 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
9657 |
|
9658 | /***/ }),
|
9659 | /* 144 */
|
9660 | /***/ (function(module, exports, __webpack_require__) {
|
9661 |
|
9662 | /**
|
9663 | * Copyright 2013-2015, Facebook, Inc.
|
9664 | * All rights reserved.
|
9665 | *
|
9666 | * This source code is licensed under the BSD-style license found in the
|
9667 | * LICENSE file in the root directory of this source tree. An additional grant
|
9668 | * of patent rights can be found in the PATENTS file in the same directory.
|
9669 | *
|
9670 | * @providesModule containsNode
|
9671 | * @typechecks
|
9672 | */
|
9673 |
|
9674 | 'use strict';
|
9675 |
|
9676 | var isTextNode = __webpack_require__(145);
|
9677 |
|
9678 | /*eslint-disable no-bitwise */
|
9679 |
|
9680 | /**
|
9681 | * Checks if a given DOM node contains or is another DOM node.
|
9682 | *
|
9683 | * @param {?DOMNode} outerNode Outer DOM node.
|
9684 | * @param {?DOMNode} innerNode Inner DOM node.
|
9685 | * @return {boolean} True if `outerNode` contains or is `innerNode`.
|
9686 | */
|
9687 | function containsNode(_x, _x2) {
|
9688 | var _again = true;
|
9689 |
|
9690 | _function: while (_again) {
|
9691 | var outerNode = _x,
|
9692 | innerNode = _x2;
|
9693 | _again = false;
|
9694 |
|
9695 | if (!outerNode || !innerNode) {
|
9696 | return false;
|
9697 | } else if (outerNode === innerNode) {
|
9698 | return true;
|
9699 | } else if (isTextNode(outerNode)) {
|
9700 | return false;
|
9701 | } else if (isTextNode(innerNode)) {
|
9702 | _x = outerNode;
|
9703 | _x2 = innerNode.parentNode;
|
9704 | _again = true;
|
9705 | continue _function;
|
9706 | } else if (outerNode.contains) {
|
9707 | return outerNode.contains(innerNode);
|
9708 | } else if (outerNode.compareDocumentPosition) {
|
9709 | return !!(outerNode.compareDocumentPosition(innerNode) & 16);
|
9710 | } else {
|
9711 | return false;
|
9712 | }
|
9713 | }
|
9714 | }
|
9715 |
|
9716 | module.exports = containsNode;
|
9717 |
|
9718 | /***/ }),
|
9719 | /* 145 */
|
9720 | /***/ (function(module, exports, __webpack_require__) {
|
9721 |
|
9722 | /**
|
9723 | * Copyright 2013-2015, Facebook, Inc.
|
9724 | * All rights reserved.
|
9725 | *
|
9726 | * This source code is licensed under the BSD-style license found in the
|
9727 | * LICENSE file in the root directory of this source tree. An additional grant
|
9728 | * of patent rights can be found in the PATENTS file in the same directory.
|
9729 | *
|
9730 | * @providesModule isTextNode
|
9731 | * @typechecks
|
9732 | */
|
9733 |
|
9734 | 'use strict';
|
9735 |
|
9736 | var isNode = __webpack_require__(146);
|
9737 |
|
9738 | /**
|
9739 | * @param {*} object The object to check.
|
9740 | * @return {boolean} Whether or not the object is a DOM text node.
|
9741 | */
|
9742 | function isTextNode(object) {
|
9743 | return isNode(object) && object.nodeType == 3;
|
9744 | }
|
9745 |
|
9746 | module.exports = isTextNode;
|
9747 |
|
9748 | /***/ }),
|
9749 | /* 146 */
|
9750 | /***/ (function(module, exports) {
|
9751 |
|
9752 | /**
|
9753 | * Copyright 2013-2015, Facebook, Inc.
|
9754 | * All rights reserved.
|
9755 | *
|
9756 | * This source code is licensed under the BSD-style license found in the
|
9757 | * LICENSE file in the root directory of this source tree. An additional grant
|
9758 | * of patent rights can be found in the PATENTS file in the same directory.
|
9759 | *
|
9760 | * @providesModule isNode
|
9761 | * @typechecks
|
9762 | */
|
9763 |
|
9764 | /**
|
9765 | * @param {*} object The object to check.
|
9766 | * @return {boolean} Whether or not the object is a DOM node.
|
9767 | */
|
9768 | 'use strict';
|
9769 |
|
9770 | function isNode(object) {
|
9771 | return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
|
9772 | }
|
9773 |
|
9774 | module.exports = isNode;
|
9775 |
|
9776 | /***/ }),
|
9777 | /* 147 */
|
9778 | /***/ (function(module, exports, __webpack_require__) {
|
9779 |
|
9780 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
9781 | * Copyright 2013-2015, Facebook, Inc.
|
9782 | * All rights reserved.
|
9783 | *
|
9784 | * This source code is licensed under the BSD-style license found in the
|
9785 | * LICENSE file in the root directory of this source tree. An additional grant
|
9786 | * of patent rights can be found in the PATENTS file in the same directory.
|
9787 | *
|
9788 | * @providesModule instantiateReactComponent
|
9789 | * @typechecks static-only
|
9790 | */
|
9791 |
|
9792 | 'use strict';
|
9793 |
|
9794 | var ReactCompositeComponent = __webpack_require__(148);
|
9795 | var ReactEmptyComponent = __webpack_require__(153);
|
9796 | var ReactNativeComponent = __webpack_require__(154);
|
9797 |
|
9798 | var assign = __webpack_require__(124);
|
9799 | var invariant = __webpack_require__(98);
|
9800 | var warning = __webpack_require__(110);
|
9801 |
|
9802 | // To avoid a cyclic dependency, we create the final class in this module
|
9803 | var ReactCompositeComponentWrapper = function () {};
|
9804 | assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
|
9805 | _instantiateReactComponent: instantiateReactComponent
|
9806 | });
|
9807 |
|
9808 | function getDeclarationErrorAddendum(owner) {
|
9809 | if (owner) {
|
9810 | var name = owner.getName();
|
9811 | if (name) {
|
9812 | return ' Check the render method of `' + name + '`.';
|
9813 | }
|
9814 | }
|
9815 | return '';
|
9816 | }
|
9817 |
|
9818 | /**
|
9819 | * Check if the type reference is a known internal type. I.e. not a user
|
9820 | * provided composite type.
|
9821 | *
|
9822 | * @param {function} type
|
9823 | * @return {boolean} Returns true if this is a valid internal type.
|
9824 | */
|
9825 | function isInternalComponentType(type) {
|
9826 | return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
|
9827 | }
|
9828 |
|
9829 | /**
|
9830 | * Given a ReactNode, create an instance that will actually be mounted.
|
9831 | *
|
9832 | * @param {ReactNode} node
|
9833 | * @return {object} A new instance of the element's constructor.
|
9834 | * @protected
|
9835 | */
|
9836 | function instantiateReactComponent(node) {
|
9837 | var instance;
|
9838 |
|
9839 | if (node === null || node === false) {
|
9840 | instance = new ReactEmptyComponent(instantiateReactComponent);
|
9841 | } else if (typeof node === 'object') {
|
9842 | var element = node;
|
9843 | !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : undefined;
|
9844 |
|
9845 | // Special case string values
|
9846 | if (typeof element.type === 'string') {
|
9847 | instance = ReactNativeComponent.createInternalComponent(element);
|
9848 | } else if (isInternalComponentType(element.type)) {
|
9849 | // This is temporarily available for custom components that are not string
|
9850 | // representations. I.e. ART. Once those are updated to use the string
|
9851 | // representation, we can drop this code path.
|
9852 | instance = new element.type(element);
|
9853 | } else {
|
9854 | instance = new ReactCompositeComponentWrapper();
|
9855 | }
|
9856 | } else if (typeof node === 'string' || typeof node === 'number') {
|
9857 | instance = ReactNativeComponent.createInstanceForText(node);
|
9858 | } else {
|
9859 | true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : undefined;
|
9860 | }
|
9861 |
|
9862 | if (process.env.NODE_ENV !== 'production') {
|
9863 | process.env.NODE_ENV !== 'production' ? warning(typeof instance.construct === 'function' && typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : undefined;
|
9864 | }
|
9865 |
|
9866 | // Sets up the instance. This can probably just move into the constructor now.
|
9867 | instance.construct(node);
|
9868 |
|
9869 | // These two fields are used by the DOM and ART diffing algorithms
|
9870 | // respectively. Instead of using expandos on components, we should be
|
9871 | // storing the state needed by the diffing algorithms elsewhere.
|
9872 | instance._mountIndex = 0;
|
9873 | instance._mountImage = null;
|
9874 |
|
9875 | if (process.env.NODE_ENV !== 'production') {
|
9876 | instance._isOwnerNecessary = false;
|
9877 | instance._warnedAboutRefsInRender = false;
|
9878 | }
|
9879 |
|
9880 | // Internal instances should fully constructed at this point, so they should
|
9881 | // not get any new fields added to them at this point.
|
9882 | if (process.env.NODE_ENV !== 'production') {
|
9883 | if (Object.preventExtensions) {
|
9884 | Object.preventExtensions(instance);
|
9885 | }
|
9886 | }
|
9887 |
|
9888 | return instance;
|
9889 | }
|
9890 |
|
9891 | module.exports = instantiateReactComponent;
|
9892 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
9893 |
|
9894 | /***/ }),
|
9895 | /* 148 */
|
9896 | /***/ (function(module, exports, __webpack_require__) {
|
9897 |
|
9898 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
9899 | * Copyright 2013-2015, Facebook, Inc.
|
9900 | * All rights reserved.
|
9901 | *
|
9902 | * This source code is licensed under the BSD-style license found in the
|
9903 | * LICENSE file in the root directory of this source tree. An additional grant
|
9904 | * of patent rights can be found in the PATENTS file in the same directory.
|
9905 | *
|
9906 | * @providesModule ReactCompositeComponent
|
9907 | */
|
9908 |
|
9909 | 'use strict';
|
9910 |
|
9911 | var ReactComponentEnvironment = __webpack_require__(149);
|
9912 | var ReactCurrentOwner = __webpack_require__(90);
|
9913 | var ReactElement = __webpack_require__(127);
|
9914 | var ReactInstanceMap = __webpack_require__(132);
|
9915 | var ReactPerf = __webpack_require__(103);
|
9916 | var ReactPropTypeLocations = __webpack_require__(150);
|
9917 | var ReactPropTypeLocationNames = __webpack_require__(151);
|
9918 | var ReactReconciler = __webpack_require__(135);
|
9919 | var ReactUpdateQueue = __webpack_require__(138);
|
9920 |
|
9921 | var assign = __webpack_require__(124);
|
9922 | var emptyObject = __webpack_require__(143);
|
9923 | var invariant = __webpack_require__(98);
|
9924 | var shouldUpdateReactComponent = __webpack_require__(152);
|
9925 | var warning = __webpack_require__(110);
|
9926 |
|
9927 | function getDeclarationErrorAddendum(component) {
|
9928 | var owner = component._currentElement._owner || null;
|
9929 | if (owner) {
|
9930 | var name = owner.getName();
|
9931 | if (name) {
|
9932 | return ' Check the render method of `' + name + '`.';
|
9933 | }
|
9934 | }
|
9935 | return '';
|
9936 | }
|
9937 |
|
9938 | function StatelessComponent(Component) {}
|
9939 | StatelessComponent.prototype.render = function () {
|
9940 | var Component = ReactInstanceMap.get(this)._currentElement.type;
|
9941 | return Component(this.props, this.context, this.updater);
|
9942 | };
|
9943 |
|
9944 | /**
|
9945 | * ------------------ The Life-Cycle of a Composite Component ------------------
|
9946 | *
|
9947 | * - constructor: Initialization of state. The instance is now retained.
|
9948 | * - componentWillMount
|
9949 | * - render
|
9950 | * - [children's constructors]
|
9951 | * - [children's componentWillMount and render]
|
9952 | * - [children's componentDidMount]
|
9953 | * - componentDidMount
|
9954 | *
|
9955 | * Update Phases:
|
9956 | * - componentWillReceiveProps (only called if parent updated)
|
9957 | * - shouldComponentUpdate
|
9958 | * - componentWillUpdate
|
9959 | * - render
|
9960 | * - [children's constructors or receive props phases]
|
9961 | * - componentDidUpdate
|
9962 | *
|
9963 | * - componentWillUnmount
|
9964 | * - [children's componentWillUnmount]
|
9965 | * - [children destroyed]
|
9966 | * - (destroyed): The instance is now blank, released by React and ready for GC.
|
9967 | *
|
9968 | * -----------------------------------------------------------------------------
|
9969 | */
|
9970 |
|
9971 | /**
|
9972 | * An incrementing ID assigned to each component when it is mounted. This is
|
9973 | * used to enforce the order in which `ReactUpdates` updates dirty components.
|
9974 | *
|
9975 | * @private
|
9976 | */
|
9977 | var nextMountID = 1;
|
9978 |
|
9979 | /**
|
9980 | * @lends {ReactCompositeComponent.prototype}
|
9981 | */
|
9982 | var ReactCompositeComponentMixin = {
|
9983 |
|
9984 | /**
|
9985 | * Base constructor for all composite component.
|
9986 | *
|
9987 | * @param {ReactElement} element
|
9988 | * @final
|
9989 | * @internal
|
9990 | */
|
9991 | construct: function (element) {
|
9992 | this._currentElement = element;
|
9993 | this._rootNodeID = null;
|
9994 | this._instance = null;
|
9995 |
|
9996 | // See ReactUpdateQueue
|
9997 | this._pendingElement = null;
|
9998 | this._pendingStateQueue = null;
|
9999 | this._pendingReplaceState = false;
|
10000 | this._pendingForceUpdate = false;
|
10001 |
|
10002 | this._renderedComponent = null;
|
10003 |
|
10004 | this._context = null;
|
10005 | this._mountOrder = 0;
|
10006 | this._topLevelWrapper = null;
|
10007 |
|
10008 | // See ReactUpdates and ReactUpdateQueue.
|
10009 | this._pendingCallbacks = null;
|
10010 | },
|
10011 |
|
10012 | /**
|
10013 | * Initializes the component, renders markup, and registers event listeners.
|
10014 | *
|
10015 | * @param {string} rootID DOM ID of the root node.
|
10016 | * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
10017 | * @return {?string} Rendered markup to be inserted into the DOM.
|
10018 | * @final
|
10019 | * @internal
|
10020 | */
|
10021 | mountComponent: function (rootID, transaction, context) {
|
10022 | this._context = context;
|
10023 | this._mountOrder = nextMountID++;
|
10024 | this._rootNodeID = rootID;
|
10025 |
|
10026 | var publicProps = this._processProps(this._currentElement.props);
|
10027 | var publicContext = this._processContext(context);
|
10028 |
|
10029 | var Component = this._currentElement.type;
|
10030 |
|
10031 | // Initialize the public class
|
10032 | var inst;
|
10033 | var renderedElement;
|
10034 |
|
10035 | // This is a way to detect if Component is a stateless arrow function
|
10036 | // component, which is not newable. It might not be 100% reliable but is
|
10037 | // something we can do until we start detecting that Component extends
|
10038 | // React.Component. We already assume that typeof Component === 'function'.
|
10039 | var canInstantiate = ('prototype' in Component);
|
10040 |
|
10041 | if (canInstantiate) {
|
10042 | if (process.env.NODE_ENV !== 'production') {
|
10043 | ReactCurrentOwner.current = this;
|
10044 | try {
|
10045 | inst = new Component(publicProps, publicContext, ReactUpdateQueue);
|
10046 | } finally {
|
10047 | ReactCurrentOwner.current = null;
|
10048 | }
|
10049 | } else {
|
10050 | inst = new Component(publicProps, publicContext, ReactUpdateQueue);
|
10051 | }
|
10052 | }
|
10053 |
|
10054 | if (!canInstantiate || inst === null || inst === false || ReactElement.isValidElement(inst)) {
|
10055 | renderedElement = inst;
|
10056 | inst = new StatelessComponent(Component);
|
10057 | }
|
10058 |
|
10059 | if (process.env.NODE_ENV !== 'production') {
|
10060 | // This will throw later in _renderValidatedComponent, but add an early
|
10061 | // warning now to help debugging
|
10062 | if (inst.render == null) {
|
10063 | process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`, returned ' + 'null/false from a stateless component, or tried to render an ' + 'element whose type is a function that isn\'t a React component.', Component.displayName || Component.name || 'Component') : undefined;
|
10064 | } else {
|
10065 | // We support ES6 inheriting from React.Component, the module pattern,
|
10066 | // and stateless components, but not ES6 classes that don't extend
|
10067 | process.env.NODE_ENV !== 'production' ? warning(Component.prototype && Component.prototype.isReactComponent || !canInstantiate || !(inst instanceof Component), '%s(...): React component classes must extend React.Component.', Component.displayName || Component.name || 'Component') : undefined;
|
10068 | }
|
10069 | }
|
10070 |
|
10071 | // These should be set up in the constructor, but as a convenience for
|
10072 | // simpler class abstractions, we set them up after the fact.
|
10073 | inst.props = publicProps;
|
10074 | inst.context = publicContext;
|
10075 | inst.refs = emptyObject;
|
10076 | inst.updater = ReactUpdateQueue;
|
10077 |
|
10078 | this._instance = inst;
|
10079 |
|
10080 | // Store a reference from the instance back to the internal representation
|
10081 | ReactInstanceMap.set(inst, this);
|
10082 |
|
10083 | if (process.env.NODE_ENV !== 'production') {
|
10084 | // Since plain JS classes are defined without any special initialization
|
10085 | // logic, we can not catch common errors early. Therefore, we have to
|
10086 | // catch them here, at initialization time, instead.
|
10087 | process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : undefined;
|
10088 | process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : undefined;
|
10089 | process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : undefined;
|
10090 | process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : undefined;
|
10091 | process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : undefined;
|
10092 | process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : undefined;
|
10093 | process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : undefined;
|
10094 | }
|
10095 |
|
10096 | var initialState = inst.state;
|
10097 | if (initialState === undefined) {
|
10098 | inst.state = initialState = null;
|
10099 | }
|
10100 | !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
|
10101 |
|
10102 | this._pendingStateQueue = null;
|
10103 | this._pendingReplaceState = false;
|
10104 | this._pendingForceUpdate = false;
|
10105 |
|
10106 | if (inst.componentWillMount) {
|
10107 | inst.componentWillMount();
|
10108 | // When mounting, calls to `setState` by `componentWillMount` will set
|
10109 | // `this._pendingStateQueue` without triggering a re-render.
|
10110 | if (this._pendingStateQueue) {
|
10111 | inst.state = this._processPendingState(inst.props, inst.context);
|
10112 | }
|
10113 | }
|
10114 |
|
10115 | // If not a stateless component, we now render
|
10116 | if (renderedElement === undefined) {
|
10117 | renderedElement = this._renderValidatedComponent();
|
10118 | }
|
10119 |
|
10120 | this._renderedComponent = this._instantiateReactComponent(renderedElement);
|
10121 |
|
10122 | var markup = ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, this._processChildContext(context));
|
10123 | if (inst.componentDidMount) {
|
10124 | transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
|
10125 | }
|
10126 |
|
10127 | return markup;
|
10128 | },
|
10129 |
|
10130 | /**
|
10131 | * Releases any resources allocated by `mountComponent`.
|
10132 | *
|
10133 | * @final
|
10134 | * @internal
|
10135 | */
|
10136 | unmountComponent: function () {
|
10137 | var inst = this._instance;
|
10138 |
|
10139 | if (inst.componentWillUnmount) {
|
10140 | inst.componentWillUnmount();
|
10141 | }
|
10142 |
|
10143 | ReactReconciler.unmountComponent(this._renderedComponent);
|
10144 | this._renderedComponent = null;
|
10145 | this._instance = null;
|
10146 |
|
10147 | // Reset pending fields
|
10148 | // Even if this component is scheduled for another update in ReactUpdates,
|
10149 | // it would still be ignored because these fields are reset.
|
10150 | this._pendingStateQueue = null;
|
10151 | this._pendingReplaceState = false;
|
10152 | this._pendingForceUpdate = false;
|
10153 | this._pendingCallbacks = null;
|
10154 | this._pendingElement = null;
|
10155 |
|
10156 | // These fields do not really need to be reset since this object is no
|
10157 | // longer accessible.
|
10158 | this._context = null;
|
10159 | this._rootNodeID = null;
|
10160 | this._topLevelWrapper = null;
|
10161 |
|
10162 | // Delete the reference from the instance to this internal representation
|
10163 | // which allow the internals to be properly cleaned up even if the user
|
10164 | // leaks a reference to the public instance.
|
10165 | ReactInstanceMap.remove(inst);
|
10166 |
|
10167 | // Some existing components rely on inst.props even after they've been
|
10168 | // destroyed (in event handlers).
|
10169 | // TODO: inst.props = null;
|
10170 | // TODO: inst.state = null;
|
10171 | // TODO: inst.context = null;
|
10172 | },
|
10173 |
|
10174 | /**
|
10175 | * Filters the context object to only contain keys specified in
|
10176 | * `contextTypes`
|
10177 | *
|
10178 | * @param {object} context
|
10179 | * @return {?object}
|
10180 | * @private
|
10181 | */
|
10182 | _maskContext: function (context) {
|
10183 | var maskedContext = null;
|
10184 | var Component = this._currentElement.type;
|
10185 | var contextTypes = Component.contextTypes;
|
10186 | if (!contextTypes) {
|
10187 | return emptyObject;
|
10188 | }
|
10189 | maskedContext = {};
|
10190 | for (var contextName in contextTypes) {
|
10191 | maskedContext[contextName] = context[contextName];
|
10192 | }
|
10193 | return maskedContext;
|
10194 | },
|
10195 |
|
10196 | /**
|
10197 | * Filters the context object to only contain keys specified in
|
10198 | * `contextTypes`, and asserts that they are valid.
|
10199 | *
|
10200 | * @param {object} context
|
10201 | * @return {?object}
|
10202 | * @private
|
10203 | */
|
10204 | _processContext: function (context) {
|
10205 | var maskedContext = this._maskContext(context);
|
10206 | if (process.env.NODE_ENV !== 'production') {
|
10207 | var Component = this._currentElement.type;
|
10208 | if (Component.contextTypes) {
|
10209 | this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
|
10210 | }
|
10211 | }
|
10212 | return maskedContext;
|
10213 | },
|
10214 |
|
10215 | /**
|
10216 | * @param {object} currentContext
|
10217 | * @return {object}
|
10218 | * @private
|
10219 | */
|
10220 | _processChildContext: function (currentContext) {
|
10221 | var Component = this._currentElement.type;
|
10222 | var inst = this._instance;
|
10223 | var childContext = inst.getChildContext && inst.getChildContext();
|
10224 | if (childContext) {
|
10225 | !(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
|
10226 | if (process.env.NODE_ENV !== 'production') {
|
10227 | this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
|
10228 | }
|
10229 | for (var name in childContext) {
|
10230 | !(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : undefined;
|
10231 | }
|
10232 | return assign({}, currentContext, childContext);
|
10233 | }
|
10234 | return currentContext;
|
10235 | },
|
10236 |
|
10237 | /**
|
10238 | * Processes props by setting default values for unspecified props and
|
10239 | * asserting that the props are valid. Does not mutate its argument; returns
|
10240 | * a new props object with defaults merged in.
|
10241 | *
|
10242 | * @param {object} newProps
|
10243 | * @return {object}
|
10244 | * @private
|
10245 | */
|
10246 | _processProps: function (newProps) {
|
10247 | if (process.env.NODE_ENV !== 'production') {
|
10248 | var Component = this._currentElement.type;
|
10249 | if (Component.propTypes) {
|
10250 | this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop);
|
10251 | }
|
10252 | }
|
10253 | return newProps;
|
10254 | },
|
10255 |
|
10256 | /**
|
10257 | * Assert that the props are valid
|
10258 | *
|
10259 | * @param {object} propTypes Map of prop name to a ReactPropType
|
10260 | * @param {object} props
|
10261 | * @param {string} location e.g. "prop", "context", "child context"
|
10262 | * @private
|
10263 | */
|
10264 | _checkPropTypes: function (propTypes, props, location) {
|
10265 | // TODO: Stop validating prop types here and only use the element
|
10266 | // validation.
|
10267 | var componentName = this.getName();
|
10268 | for (var propName in propTypes) {
|
10269 | if (propTypes.hasOwnProperty(propName)) {
|
10270 | var error;
|
10271 | try {
|
10272 | // This is intentionally an invariant that gets caught. It's the same
|
10273 | // behavior as without this statement except with a better message.
|
10274 | !(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually ' + 'from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
|
10275 | error = propTypes[propName](props, propName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
10276 | } catch (ex) {
|
10277 | error = ex;
|
10278 | }
|
10279 | if (error instanceof Error) {
|
10280 | // We may want to extend this logic for similar errors in
|
10281 | // top-level render calls, so I'm abstracting it away into
|
10282 | // a function to minimize refactoring in the future
|
10283 | var addendum = getDeclarationErrorAddendum(this);
|
10284 |
|
10285 | if (location === ReactPropTypeLocations.prop) {
|
10286 | // Preface gives us something to blacklist in warning module
|
10287 | process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : undefined;
|
10288 | } else {
|
10289 | process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : undefined;
|
10290 | }
|
10291 | }
|
10292 | }
|
10293 | }
|
10294 | },
|
10295 |
|
10296 | receiveComponent: function (nextElement, transaction, nextContext) {
|
10297 | var prevElement = this._currentElement;
|
10298 | var prevContext = this._context;
|
10299 |
|
10300 | this._pendingElement = null;
|
10301 |
|
10302 | this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
|
10303 | },
|
10304 |
|
10305 | /**
|
10306 | * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
|
10307 | * is set, update the component.
|
10308 | *
|
10309 | * @param {ReactReconcileTransaction} transaction
|
10310 | * @internal
|
10311 | */
|
10312 | performUpdateIfNecessary: function (transaction) {
|
10313 | if (this._pendingElement != null) {
|
10314 | ReactReconciler.receiveComponent(this, this._pendingElement || this._currentElement, transaction, this._context);
|
10315 | }
|
10316 |
|
10317 | if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
|
10318 | this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
|
10319 | }
|
10320 | },
|
10321 |
|
10322 | /**
|
10323 | * Perform an update to a mounted component. The componentWillReceiveProps and
|
10324 | * shouldComponentUpdate methods are called, then (assuming the update isn't
|
10325 | * skipped) the remaining update lifecycle methods are called and the DOM
|
10326 | * representation is updated.
|
10327 | *
|
10328 | * By default, this implements React's rendering and reconciliation algorithm.
|
10329 | * Sophisticated clients may wish to override this.
|
10330 | *
|
10331 | * @param {ReactReconcileTransaction} transaction
|
10332 | * @param {ReactElement} prevParentElement
|
10333 | * @param {ReactElement} nextParentElement
|
10334 | * @internal
|
10335 | * @overridable
|
10336 | */
|
10337 | updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
|
10338 | var inst = this._instance;
|
10339 |
|
10340 | var nextContext = this._context === nextUnmaskedContext ? inst.context : this._processContext(nextUnmaskedContext);
|
10341 | var nextProps;
|
10342 |
|
10343 | // Distinguish between a props update versus a simple state update
|
10344 | if (prevParentElement === nextParentElement) {
|
10345 | // Skip checking prop types again -- we don't read inst.props to avoid
|
10346 | // warning for DOM component props in this upgrade
|
10347 | nextProps = nextParentElement.props;
|
10348 | } else {
|
10349 | nextProps = this._processProps(nextParentElement.props);
|
10350 | // An update here will schedule an update but immediately set
|
10351 | // _pendingStateQueue which will ensure that any state updates gets
|
10352 | // immediately reconciled instead of waiting for the next batch.
|
10353 |
|
10354 | if (inst.componentWillReceiveProps) {
|
10355 | inst.componentWillReceiveProps(nextProps, nextContext);
|
10356 | }
|
10357 | }
|
10358 |
|
10359 | var nextState = this._processPendingState(nextProps, nextContext);
|
10360 |
|
10361 | var shouldUpdate = this._pendingForceUpdate || !inst.shouldComponentUpdate || inst.shouldComponentUpdate(nextProps, nextState, nextContext);
|
10362 |
|
10363 | if (process.env.NODE_ENV !== 'production') {
|
10364 | process.env.NODE_ENV !== 'production' ? warning(typeof shouldUpdate !== 'undefined', '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : undefined;
|
10365 | }
|
10366 |
|
10367 | if (shouldUpdate) {
|
10368 | this._pendingForceUpdate = false;
|
10369 | // Will set `this.props`, `this.state` and `this.context`.
|
10370 | this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
|
10371 | } else {
|
10372 | // If it's determined that a component should not update, we still want
|
10373 | // to set props and state but we shortcut the rest of the update.
|
10374 | this._currentElement = nextParentElement;
|
10375 | this._context = nextUnmaskedContext;
|
10376 | inst.props = nextProps;
|
10377 | inst.state = nextState;
|
10378 | inst.context = nextContext;
|
10379 | }
|
10380 | },
|
10381 |
|
10382 | _processPendingState: function (props, context) {
|
10383 | var inst = this._instance;
|
10384 | var queue = this._pendingStateQueue;
|
10385 | var replace = this._pendingReplaceState;
|
10386 | this._pendingReplaceState = false;
|
10387 | this._pendingStateQueue = null;
|
10388 |
|
10389 | if (!queue) {
|
10390 | return inst.state;
|
10391 | }
|
10392 |
|
10393 | if (replace && queue.length === 1) {
|
10394 | return queue[0];
|
10395 | }
|
10396 |
|
10397 | var nextState = assign({}, replace ? queue[0] : inst.state);
|
10398 | for (var i = replace ? 1 : 0; i < queue.length; i++) {
|
10399 | var partial = queue[i];
|
10400 | assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
|
10401 | }
|
10402 |
|
10403 | return nextState;
|
10404 | },
|
10405 |
|
10406 | /**
|
10407 | * Merges new props and state, notifies delegate methods of update and
|
10408 | * performs update.
|
10409 | *
|
10410 | * @param {ReactElement} nextElement Next element
|
10411 | * @param {object} nextProps Next public object to set as properties.
|
10412 | * @param {?object} nextState Next object to set as state.
|
10413 | * @param {?object} nextContext Next public object to set as context.
|
10414 | * @param {ReactReconcileTransaction} transaction
|
10415 | * @param {?object} unmaskedContext
|
10416 | * @private
|
10417 | */
|
10418 | _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
|
10419 | var inst = this._instance;
|
10420 |
|
10421 | var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
|
10422 | var prevProps;
|
10423 | var prevState;
|
10424 | var prevContext;
|
10425 | if (hasComponentDidUpdate) {
|
10426 | prevProps = inst.props;
|
10427 | prevState = inst.state;
|
10428 | prevContext = inst.context;
|
10429 | }
|
10430 |
|
10431 | if (inst.componentWillUpdate) {
|
10432 | inst.componentWillUpdate(nextProps, nextState, nextContext);
|
10433 | }
|
10434 |
|
10435 | this._currentElement = nextElement;
|
10436 | this._context = unmaskedContext;
|
10437 | inst.props = nextProps;
|
10438 | inst.state = nextState;
|
10439 | inst.context = nextContext;
|
10440 |
|
10441 | this._updateRenderedComponent(transaction, unmaskedContext);
|
10442 |
|
10443 | if (hasComponentDidUpdate) {
|
10444 | transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
|
10445 | }
|
10446 | },
|
10447 |
|
10448 | /**
|
10449 | * Call the component's `render` method and update the DOM accordingly.
|
10450 | *
|
10451 | * @param {ReactReconcileTransaction} transaction
|
10452 | * @internal
|
10453 | */
|
10454 | _updateRenderedComponent: function (transaction, context) {
|
10455 | var prevComponentInstance = this._renderedComponent;
|
10456 | var prevRenderedElement = prevComponentInstance._currentElement;
|
10457 | var nextRenderedElement = this._renderValidatedComponent();
|
10458 | if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
|
10459 | ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
|
10460 | } else {
|
10461 | // These two IDs are actually the same! But nothing should rely on that.
|
10462 | var thisID = this._rootNodeID;
|
10463 | var prevComponentID = prevComponentInstance._rootNodeID;
|
10464 | ReactReconciler.unmountComponent(prevComponentInstance);
|
10465 |
|
10466 | this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);
|
10467 | var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, thisID, transaction, this._processChildContext(context));
|
10468 | this._replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
|
10469 | }
|
10470 | },
|
10471 |
|
10472 | /**
|
10473 | * @protected
|
10474 | */
|
10475 | _replaceNodeWithMarkupByID: function (prevComponentID, nextMarkup) {
|
10476 | ReactComponentEnvironment.replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
|
10477 | },
|
10478 |
|
10479 | /**
|
10480 | * @protected
|
10481 | */
|
10482 | _renderValidatedComponentWithoutOwnerOrContext: function () {
|
10483 | var inst = this._instance;
|
10484 | var renderedComponent = inst.render();
|
10485 | if (process.env.NODE_ENV !== 'production') {
|
10486 | // We allow auto-mocks to proceed as if they're returning null.
|
10487 | if (typeof renderedComponent === 'undefined' && inst.render._isMockFunction) {
|
10488 | // This is probably bad practice. Consider warning here and
|
10489 | // deprecating this convenience.
|
10490 | renderedComponent = null;
|
10491 | }
|
10492 | }
|
10493 |
|
10494 | return renderedComponent;
|
10495 | },
|
10496 |
|
10497 | /**
|
10498 | * @private
|
10499 | */
|
10500 | _renderValidatedComponent: function () {
|
10501 | var renderedComponent;
|
10502 | ReactCurrentOwner.current = this;
|
10503 | try {
|
10504 | renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
|
10505 | } finally {
|
10506 | ReactCurrentOwner.current = null;
|
10507 | }
|
10508 | !(
|
10509 | // TODO: An `isValidNode` function would probably be more appropriate
|
10510 | renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid ReactComponent must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
|
10511 | return renderedComponent;
|
10512 | },
|
10513 |
|
10514 | /**
|
10515 | * Lazily allocates the refs object and stores `component` as `ref`.
|
10516 | *
|
10517 | * @param {string} ref Reference name.
|
10518 | * @param {component} component Component to store as `ref`.
|
10519 | * @final
|
10520 | * @private
|
10521 | */
|
10522 | attachRef: function (ref, component) {
|
10523 | var inst = this.getPublicInstance();
|
10524 | !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : undefined;
|
10525 | var publicComponentInstance = component.getPublicInstance();
|
10526 | if (process.env.NODE_ENV !== 'production') {
|
10527 | var componentName = component && component.getName ? component.getName() : 'a component';
|
10528 | process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : undefined;
|
10529 | }
|
10530 | var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
|
10531 | refs[ref] = publicComponentInstance;
|
10532 | },
|
10533 |
|
10534 | /**
|
10535 | * Detaches a reference name.
|
10536 | *
|
10537 | * @param {string} ref Name to dereference.
|
10538 | * @final
|
10539 | * @private
|
10540 | */
|
10541 | detachRef: function (ref) {
|
10542 | var refs = this.getPublicInstance().refs;
|
10543 | delete refs[ref];
|
10544 | },
|
10545 |
|
10546 | /**
|
10547 | * Get a text description of the component that can be used to identify it
|
10548 | * in error messages.
|
10549 | * @return {string} The name or null.
|
10550 | * @internal
|
10551 | */
|
10552 | getName: function () {
|
10553 | var type = this._currentElement.type;
|
10554 | var constructor = this._instance && this._instance.constructor;
|
10555 | return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
|
10556 | },
|
10557 |
|
10558 | /**
|
10559 | * Get the publicly accessible representation of this component - i.e. what
|
10560 | * is exposed by refs and returned by render. Can be null for stateless
|
10561 | * components.
|
10562 | *
|
10563 | * @return {ReactComponent} the public component instance.
|
10564 | * @internal
|
10565 | */
|
10566 | getPublicInstance: function () {
|
10567 | var inst = this._instance;
|
10568 | if (inst instanceof StatelessComponent) {
|
10569 | return null;
|
10570 | }
|
10571 | return inst;
|
10572 | },
|
10573 |
|
10574 | // Stub
|
10575 | _instantiateReactComponent: null
|
10576 |
|
10577 | };
|
10578 |
|
10579 | ReactPerf.measureMethods(ReactCompositeComponentMixin, 'ReactCompositeComponent', {
|
10580 | mountComponent: 'mountComponent',
|
10581 | updateComponent: 'updateComponent',
|
10582 | _renderValidatedComponent: '_renderValidatedComponent'
|
10583 | });
|
10584 |
|
10585 | var ReactCompositeComponent = {
|
10586 |
|
10587 | Mixin: ReactCompositeComponentMixin
|
10588 |
|
10589 | };
|
10590 |
|
10591 | module.exports = ReactCompositeComponent;
|
10592 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
10593 |
|
10594 | /***/ }),
|
10595 | /* 149 */
|
10596 | /***/ (function(module, exports, __webpack_require__) {
|
10597 |
|
10598 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
10599 | * Copyright 2014-2015, Facebook, Inc.
|
10600 | * All rights reserved.
|
10601 | *
|
10602 | * This source code is licensed under the BSD-style license found in the
|
10603 | * LICENSE file in the root directory of this source tree. An additional grant
|
10604 | * of patent rights can be found in the PATENTS file in the same directory.
|
10605 | *
|
10606 | * @providesModule ReactComponentEnvironment
|
10607 | */
|
10608 |
|
10609 | 'use strict';
|
10610 |
|
10611 | var invariant = __webpack_require__(98);
|
10612 |
|
10613 | var injected = false;
|
10614 |
|
10615 | var ReactComponentEnvironment = {
|
10616 |
|
10617 | /**
|
10618 | * Optionally injectable environment dependent cleanup hook. (server vs.
|
10619 | * browser etc). Example: A browser system caches DOM nodes based on component
|
10620 | * ID and must remove that cache entry when this instance is unmounted.
|
10621 | */
|
10622 | unmountIDFromEnvironment: null,
|
10623 |
|
10624 | /**
|
10625 | * Optionally injectable hook for swapping out mount images in the middle of
|
10626 | * the tree.
|
10627 | */
|
10628 | replaceNodeWithMarkupByID: null,
|
10629 |
|
10630 | /**
|
10631 | * Optionally injectable hook for processing a queue of child updates. Will
|
10632 | * later move into MultiChildComponents.
|
10633 | */
|
10634 | processChildrenUpdates: null,
|
10635 |
|
10636 | injection: {
|
10637 | injectEnvironment: function (environment) {
|
10638 | !!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : undefined;
|
10639 | ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment;
|
10640 | ReactComponentEnvironment.replaceNodeWithMarkupByID = environment.replaceNodeWithMarkupByID;
|
10641 | ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
|
10642 | injected = true;
|
10643 | }
|
10644 | }
|
10645 |
|
10646 | };
|
10647 |
|
10648 | module.exports = ReactComponentEnvironment;
|
10649 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
10650 |
|
10651 | /***/ }),
|
10652 | /* 150 */
|
10653 | /***/ (function(module, exports, __webpack_require__) {
|
10654 |
|
10655 | /**
|
10656 | * Copyright 2013-2015, Facebook, Inc.
|
10657 | * All rights reserved.
|
10658 | *
|
10659 | * This source code is licensed under the BSD-style license found in the
|
10660 | * LICENSE file in the root directory of this source tree. An additional grant
|
10661 | * of patent rights can be found in the PATENTS file in the same directory.
|
10662 | *
|
10663 | * @providesModule ReactPropTypeLocations
|
10664 | */
|
10665 |
|
10666 | 'use strict';
|
10667 |
|
10668 | var keyMirror = __webpack_require__(102);
|
10669 |
|
10670 | var ReactPropTypeLocations = keyMirror({
|
10671 | prop: null,
|
10672 | context: null,
|
10673 | childContext: null
|
10674 | });
|
10675 |
|
10676 | module.exports = ReactPropTypeLocations;
|
10677 |
|
10678 | /***/ }),
|
10679 | /* 151 */
|
10680 | /***/ (function(module, exports, __webpack_require__) {
|
10681 |
|
10682 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
10683 | * Copyright 2013-2015, Facebook, Inc.
|
10684 | * All rights reserved.
|
10685 | *
|
10686 | * This source code is licensed under the BSD-style license found in the
|
10687 | * LICENSE file in the root directory of this source tree. An additional grant
|
10688 | * of patent rights can be found in the PATENTS file in the same directory.
|
10689 | *
|
10690 | * @providesModule ReactPropTypeLocationNames
|
10691 | */
|
10692 |
|
10693 | 'use strict';
|
10694 |
|
10695 | var ReactPropTypeLocationNames = {};
|
10696 |
|
10697 | if (process.env.NODE_ENV !== 'production') {
|
10698 | ReactPropTypeLocationNames = {
|
10699 | prop: 'prop',
|
10700 | context: 'context',
|
10701 | childContext: 'child context'
|
10702 | };
|
10703 | }
|
10704 |
|
10705 | module.exports = ReactPropTypeLocationNames;
|
10706 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
10707 |
|
10708 | /***/ }),
|
10709 | /* 152 */
|
10710 | /***/ (function(module, exports) {
|
10711 |
|
10712 | /**
|
10713 | * Copyright 2013-2015, Facebook, Inc.
|
10714 | * All rights reserved.
|
10715 | *
|
10716 | * This source code is licensed under the BSD-style license found in the
|
10717 | * LICENSE file in the root directory of this source tree. An additional grant
|
10718 | * of patent rights can be found in the PATENTS file in the same directory.
|
10719 | *
|
10720 | * @providesModule shouldUpdateReactComponent
|
10721 | * @typechecks static-only
|
10722 | */
|
10723 |
|
10724 | 'use strict';
|
10725 |
|
10726 | /**
|
10727 | * Given a `prevElement` and `nextElement`, determines if the existing
|
10728 | * instance should be updated as opposed to being destroyed or replaced by a new
|
10729 | * instance. Both arguments are elements. This ensures that this logic can
|
10730 | * operate on stateless trees without any backing instance.
|
10731 | *
|
10732 | * @param {?object} prevElement
|
10733 | * @param {?object} nextElement
|
10734 | * @return {boolean} True if the existing instance should be updated.
|
10735 | * @protected
|
10736 | */
|
10737 | function shouldUpdateReactComponent(prevElement, nextElement) {
|
10738 | var prevEmpty = prevElement === null || prevElement === false;
|
10739 | var nextEmpty = nextElement === null || nextElement === false;
|
10740 | if (prevEmpty || nextEmpty) {
|
10741 | return prevEmpty === nextEmpty;
|
10742 | }
|
10743 |
|
10744 | var prevType = typeof prevElement;
|
10745 | var nextType = typeof nextElement;
|
10746 | if (prevType === 'string' || prevType === 'number') {
|
10747 | return nextType === 'string' || nextType === 'number';
|
10748 | } else {
|
10749 | return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
|
10750 | }
|
10751 | return false;
|
10752 | }
|
10753 |
|
10754 | module.exports = shouldUpdateReactComponent;
|
10755 |
|
10756 | /***/ }),
|
10757 | /* 153 */
|
10758 | /***/ (function(module, exports, __webpack_require__) {
|
10759 |
|
10760 | /**
|
10761 | * Copyright 2014-2015, Facebook, Inc.
|
10762 | * All rights reserved.
|
10763 | *
|
10764 | * This source code is licensed under the BSD-style license found in the
|
10765 | * LICENSE file in the root directory of this source tree. An additional grant
|
10766 | * of patent rights can be found in the PATENTS file in the same directory.
|
10767 | *
|
10768 | * @providesModule ReactEmptyComponent
|
10769 | */
|
10770 |
|
10771 | 'use strict';
|
10772 |
|
10773 | var ReactElement = __webpack_require__(127);
|
10774 | var ReactEmptyComponentRegistry = __webpack_require__(129);
|
10775 | var ReactReconciler = __webpack_require__(135);
|
10776 |
|
10777 | var assign = __webpack_require__(124);
|
10778 |
|
10779 | var placeholderElement;
|
10780 |
|
10781 | var ReactEmptyComponentInjection = {
|
10782 | injectEmptyComponent: function (component) {
|
10783 | placeholderElement = ReactElement.createElement(component);
|
10784 | }
|
10785 | };
|
10786 |
|
10787 | function registerNullComponentID() {
|
10788 | ReactEmptyComponentRegistry.registerNullComponentID(this._rootNodeID);
|
10789 | }
|
10790 |
|
10791 | var ReactEmptyComponent = function (instantiate) {
|
10792 | this._currentElement = null;
|
10793 | this._rootNodeID = null;
|
10794 | this._renderedComponent = instantiate(placeholderElement);
|
10795 | };
|
10796 | assign(ReactEmptyComponent.prototype, {
|
10797 | construct: function (element) {},
|
10798 | mountComponent: function (rootID, transaction, context) {
|
10799 | transaction.getReactMountReady().enqueue(registerNullComponentID, this);
|
10800 | this._rootNodeID = rootID;
|
10801 | return ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, context);
|
10802 | },
|
10803 | receiveComponent: function () {},
|
10804 | unmountComponent: function (rootID, transaction, context) {
|
10805 | ReactReconciler.unmountComponent(this._renderedComponent);
|
10806 | ReactEmptyComponentRegistry.deregisterNullComponentID(this._rootNodeID);
|
10807 | this._rootNodeID = null;
|
10808 | this._renderedComponent = null;
|
10809 | }
|
10810 | });
|
10811 |
|
10812 | ReactEmptyComponent.injection = ReactEmptyComponentInjection;
|
10813 |
|
10814 | module.exports = ReactEmptyComponent;
|
10815 |
|
10816 | /***/ }),
|
10817 | /* 154 */
|
10818 | /***/ (function(module, exports, __webpack_require__) {
|
10819 |
|
10820 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
10821 | * Copyright 2014-2015, Facebook, Inc.
|
10822 | * All rights reserved.
|
10823 | *
|
10824 | * This source code is licensed under the BSD-style license found in the
|
10825 | * LICENSE file in the root directory of this source tree. An additional grant
|
10826 | * of patent rights can be found in the PATENTS file in the same directory.
|
10827 | *
|
10828 | * @providesModule ReactNativeComponent
|
10829 | */
|
10830 |
|
10831 | 'use strict';
|
10832 |
|
10833 | var assign = __webpack_require__(124);
|
10834 | var invariant = __webpack_require__(98);
|
10835 |
|
10836 | var autoGenerateWrapperClass = null;
|
10837 | var genericComponentClass = null;
|
10838 | // This registry keeps track of wrapper classes around native tags.
|
10839 | var tagToComponentClass = {};
|
10840 | var textComponentClass = null;
|
10841 |
|
10842 | var ReactNativeComponentInjection = {
|
10843 | // This accepts a class that receives the tag string. This is a catch all
|
10844 | // that can render any kind of tag.
|
10845 | injectGenericComponentClass: function (componentClass) {
|
10846 | genericComponentClass = componentClass;
|
10847 | },
|
10848 | // This accepts a text component class that takes the text string to be
|
10849 | // rendered as props.
|
10850 | injectTextComponentClass: function (componentClass) {
|
10851 | textComponentClass = componentClass;
|
10852 | },
|
10853 | // This accepts a keyed object with classes as values. Each key represents a
|
10854 | // tag. That particular tag will use this class instead of the generic one.
|
10855 | injectComponentClasses: function (componentClasses) {
|
10856 | assign(tagToComponentClass, componentClasses);
|
10857 | }
|
10858 | };
|
10859 |
|
10860 | /**
|
10861 | * Get a composite component wrapper class for a specific tag.
|
10862 | *
|
10863 | * @param {ReactElement} element The tag for which to get the class.
|
10864 | * @return {function} The React class constructor function.
|
10865 | */
|
10866 | function getComponentClassForElement(element) {
|
10867 | if (typeof element.type === 'function') {
|
10868 | return element.type;
|
10869 | }
|
10870 | var tag = element.type;
|
10871 | var componentClass = tagToComponentClass[tag];
|
10872 | if (componentClass == null) {
|
10873 | tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag);
|
10874 | }
|
10875 | return componentClass;
|
10876 | }
|
10877 |
|
10878 | /**
|
10879 | * Get a native internal component class for a specific tag.
|
10880 | *
|
10881 | * @param {ReactElement} element The element to create.
|
10882 | * @return {function} The internal class constructor function.
|
10883 | */
|
10884 | function createInternalComponent(element) {
|
10885 | !genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : undefined;
|
10886 | return new genericComponentClass(element.type, element.props);
|
10887 | }
|
10888 |
|
10889 | /**
|
10890 | * @param {ReactText} text
|
10891 | * @return {ReactComponent}
|
10892 | */
|
10893 | function createInstanceForText(text) {
|
10894 | return new textComponentClass(text);
|
10895 | }
|
10896 |
|
10897 | /**
|
10898 | * @param {ReactComponent} component
|
10899 | * @return {boolean}
|
10900 | */
|
10901 | function isTextComponent(component) {
|
10902 | return component instanceof textComponentClass;
|
10903 | }
|
10904 |
|
10905 | var ReactNativeComponent = {
|
10906 | getComponentClassForElement: getComponentClassForElement,
|
10907 | createInternalComponent: createInternalComponent,
|
10908 | createInstanceForText: createInstanceForText,
|
10909 | isTextComponent: isTextComponent,
|
10910 | injection: ReactNativeComponentInjection
|
10911 | };
|
10912 |
|
10913 | module.exports = ReactNativeComponent;
|
10914 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
10915 |
|
10916 | /***/ }),
|
10917 | /* 155 */
|
10918 | /***/ (function(module, exports, __webpack_require__) {
|
10919 |
|
10920 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
10921 | * Copyright 2015, Facebook, Inc.
|
10922 | * All rights reserved.
|
10923 | *
|
10924 | * This source code is licensed under the BSD-style license found in the
|
10925 | * LICENSE file in the root directory of this source tree. An additional grant
|
10926 | * of patent rights can be found in the PATENTS file in the same directory.
|
10927 | *
|
10928 | * @providesModule validateDOMNesting
|
10929 | */
|
10930 |
|
10931 | 'use strict';
|
10932 |
|
10933 | var assign = __webpack_require__(124);
|
10934 | var emptyFunction = __webpack_require__(100);
|
10935 | var warning = __webpack_require__(110);
|
10936 |
|
10937 | var validateDOMNesting = emptyFunction;
|
10938 |
|
10939 | if (process.env.NODE_ENV !== 'production') {
|
10940 | // This validation code was written based on the HTML5 parsing spec:
|
10941 | // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
|
10942 | //
|
10943 | // Note: this does not catch all invalid nesting, nor does it try to (as it's
|
10944 | // not clear what practical benefit doing so provides); instead, we warn only
|
10945 | // for cases where the parser will give a parse tree differing from what React
|
10946 | // intended. For example, <b><div></div></b> is invalid but we don't warn
|
10947 | // because it still parses correctly; we do warn for other cases like nested
|
10948 | // <p> tags where the beginning of the second element implicitly closes the
|
10949 | // first, causing a confusing mess.
|
10950 |
|
10951 | // https://html.spec.whatwg.org/multipage/syntax.html#special
|
10952 | var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
|
10953 |
|
10954 | // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
|
10955 | var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
|
10956 |
|
10957 | // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
|
10958 | // TODO: Distinguish by namespace here -- for <title>, including it here
|
10959 | // errs on the side of fewer warnings
|
10960 | 'foreignObject', 'desc', 'title'];
|
10961 |
|
10962 | // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
|
10963 | var buttonScopeTags = inScopeTags.concat(['button']);
|
10964 |
|
10965 | // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
|
10966 | var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
|
10967 |
|
10968 | var emptyAncestorInfo = {
|
10969 | parentTag: null,
|
10970 |
|
10971 | formTag: null,
|
10972 | aTagInScope: null,
|
10973 | buttonTagInScope: null,
|
10974 | nobrTagInScope: null,
|
10975 | pTagInButtonScope: null,
|
10976 |
|
10977 | listItemTagAutoclosing: null,
|
10978 | dlItemTagAutoclosing: null
|
10979 | };
|
10980 |
|
10981 | var updatedAncestorInfo = function (oldInfo, tag, instance) {
|
10982 | var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);
|
10983 | var info = { tag: tag, instance: instance };
|
10984 |
|
10985 | if (inScopeTags.indexOf(tag) !== -1) {
|
10986 | ancestorInfo.aTagInScope = null;
|
10987 | ancestorInfo.buttonTagInScope = null;
|
10988 | ancestorInfo.nobrTagInScope = null;
|
10989 | }
|
10990 | if (buttonScopeTags.indexOf(tag) !== -1) {
|
10991 | ancestorInfo.pTagInButtonScope = null;
|
10992 | }
|
10993 |
|
10994 | // See rules for 'li', 'dd', 'dt' start tags in
|
10995 | // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
|
10996 | if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
|
10997 | ancestorInfo.listItemTagAutoclosing = null;
|
10998 | ancestorInfo.dlItemTagAutoclosing = null;
|
10999 | }
|
11000 |
|
11001 | ancestorInfo.parentTag = info;
|
11002 |
|
11003 | if (tag === 'form') {
|
11004 | ancestorInfo.formTag = info;
|
11005 | }
|
11006 | if (tag === 'a') {
|
11007 | ancestorInfo.aTagInScope = info;
|
11008 | }
|
11009 | if (tag === 'button') {
|
11010 | ancestorInfo.buttonTagInScope = info;
|
11011 | }
|
11012 | if (tag === 'nobr') {
|
11013 | ancestorInfo.nobrTagInScope = info;
|
11014 | }
|
11015 | if (tag === 'p') {
|
11016 | ancestorInfo.pTagInButtonScope = info;
|
11017 | }
|
11018 | if (tag === 'li') {
|
11019 | ancestorInfo.listItemTagAutoclosing = info;
|
11020 | }
|
11021 | if (tag === 'dd' || tag === 'dt') {
|
11022 | ancestorInfo.dlItemTagAutoclosing = info;
|
11023 | }
|
11024 |
|
11025 | return ancestorInfo;
|
11026 | };
|
11027 |
|
11028 | /**
|
11029 | * Returns whether
|
11030 | */
|
11031 | var isTagValidWithParent = function (tag, parentTag) {
|
11032 | // First, let's check if we're in an unusual parsing mode...
|
11033 | switch (parentTag) {
|
11034 | // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
|
11035 | case 'select':
|
11036 | return tag === 'option' || tag === 'optgroup' || tag === '#text';
|
11037 | case 'optgroup':
|
11038 | return tag === 'option' || tag === '#text';
|
11039 | // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
|
11040 | // but
|
11041 | case 'option':
|
11042 | return tag === '#text';
|
11043 |
|
11044 | // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
|
11045 | // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
|
11046 | // No special behavior since these rules fall back to "in body" mode for
|
11047 | // all except special table nodes which cause bad parsing behavior anyway.
|
11048 |
|
11049 | // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
|
11050 | case 'tr':
|
11051 | return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
|
11052 |
|
11053 | // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
|
11054 | case 'tbody':
|
11055 | case 'thead':
|
11056 | case 'tfoot':
|
11057 | return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
|
11058 |
|
11059 | // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
|
11060 | case 'colgroup':
|
11061 | return tag === 'col' || tag === 'template';
|
11062 |
|
11063 | // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
|
11064 | case 'table':
|
11065 | return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
|
11066 |
|
11067 | // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
|
11068 | case 'head':
|
11069 | return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
|
11070 |
|
11071 | // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
|
11072 | case 'html':
|
11073 | return tag === 'head' || tag === 'body';
|
11074 | }
|
11075 |
|
11076 | // Probably in the "in body" parsing mode, so we outlaw only tag combos
|
11077 | // where the parsing rules cause implicit opens or closes to be added.
|
11078 | // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
|
11079 | switch (tag) {
|
11080 | case 'h1':
|
11081 | case 'h2':
|
11082 | case 'h3':
|
11083 | case 'h4':
|
11084 | case 'h5':
|
11085 | case 'h6':
|
11086 | return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
|
11087 |
|
11088 | case 'rp':
|
11089 | case 'rt':
|
11090 | return impliedEndTags.indexOf(parentTag) === -1;
|
11091 |
|
11092 | case 'caption':
|
11093 | case 'col':
|
11094 | case 'colgroup':
|
11095 | case 'frame':
|
11096 | case 'head':
|
11097 | case 'tbody':
|
11098 | case 'td':
|
11099 | case 'tfoot':
|
11100 | case 'th':
|
11101 | case 'thead':
|
11102 | case 'tr':
|
11103 | // These tags are only valid with a few parents that have special child
|
11104 | // parsing rules -- if we're down here, then none of those matched and
|
11105 | // so we allow it only if we don't know what the parent is, as all other
|
11106 | // cases are invalid.
|
11107 | return parentTag == null;
|
11108 | }
|
11109 |
|
11110 | return true;
|
11111 | };
|
11112 |
|
11113 | /**
|
11114 | * Returns whether
|
11115 | */
|
11116 | var findInvalidAncestorForTag = function (tag, ancestorInfo) {
|
11117 | switch (tag) {
|
11118 | case 'address':
|
11119 | case 'article':
|
11120 | case 'aside':
|
11121 | case 'blockquote':
|
11122 | case 'center':
|
11123 | case 'details':
|
11124 | case 'dialog':
|
11125 | case 'dir':
|
11126 | case 'div':
|
11127 | case 'dl':
|
11128 | case 'fieldset':
|
11129 | case 'figcaption':
|
11130 | case 'figure':
|
11131 | case 'footer':
|
11132 | case 'header':
|
11133 | case 'hgroup':
|
11134 | case 'main':
|
11135 | case 'menu':
|
11136 | case 'nav':
|
11137 | case 'ol':
|
11138 | case 'p':
|
11139 | case 'section':
|
11140 | case 'summary':
|
11141 | case 'ul':
|
11142 |
|
11143 | case 'pre':
|
11144 | case 'listing':
|
11145 |
|
11146 | case 'table':
|
11147 |
|
11148 | case 'hr':
|
11149 |
|
11150 | case 'xmp':
|
11151 |
|
11152 | case 'h1':
|
11153 | case 'h2':
|
11154 | case 'h3':
|
11155 | case 'h4':
|
11156 | case 'h5':
|
11157 | case 'h6':
|
11158 | return ancestorInfo.pTagInButtonScope;
|
11159 |
|
11160 | case 'form':
|
11161 | return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
|
11162 |
|
11163 | case 'li':
|
11164 | return ancestorInfo.listItemTagAutoclosing;
|
11165 |
|
11166 | case 'dd':
|
11167 | case 'dt':
|
11168 | return ancestorInfo.dlItemTagAutoclosing;
|
11169 |
|
11170 | case 'button':
|
11171 | return ancestorInfo.buttonTagInScope;
|
11172 |
|
11173 | case 'a':
|
11174 | // Spec says something about storing a list of markers, but it sounds
|
11175 | // equivalent to this check.
|
11176 | return ancestorInfo.aTagInScope;
|
11177 |
|
11178 | case 'nobr':
|
11179 | return ancestorInfo.nobrTagInScope;
|
11180 | }
|
11181 |
|
11182 | return null;
|
11183 | };
|
11184 |
|
11185 | /**
|
11186 | * Given a ReactCompositeComponent instance, return a list of its recursive
|
11187 | * owners, starting at the root and ending with the instance itself.
|
11188 | */
|
11189 | var findOwnerStack = function (instance) {
|
11190 | if (!instance) {
|
11191 | return [];
|
11192 | }
|
11193 |
|
11194 | var stack = [];
|
11195 | /*eslint-disable space-after-keywords */
|
11196 | do {
|
11197 | /*eslint-enable space-after-keywords */
|
11198 | stack.push(instance);
|
11199 | } while (instance = instance._currentElement._owner);
|
11200 | stack.reverse();
|
11201 | return stack;
|
11202 | };
|
11203 |
|
11204 | var didWarn = {};
|
11205 |
|
11206 | validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
|
11207 | ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
11208 | var parentInfo = ancestorInfo.parentTag;
|
11209 | var parentTag = parentInfo && parentInfo.tag;
|
11210 |
|
11211 | var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
|
11212 | var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
|
11213 | var problematic = invalidParent || invalidAncestor;
|
11214 |
|
11215 | if (problematic) {
|
11216 | var ancestorTag = problematic.tag;
|
11217 | var ancestorInstance = problematic.instance;
|
11218 |
|
11219 | var childOwner = childInstance && childInstance._currentElement._owner;
|
11220 | var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
|
11221 |
|
11222 | var childOwners = findOwnerStack(childOwner);
|
11223 | var ancestorOwners = findOwnerStack(ancestorOwner);
|
11224 |
|
11225 | var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
|
11226 | var i;
|
11227 |
|
11228 | var deepestCommon = -1;
|
11229 | for (i = 0; i < minStackLen; i++) {
|
11230 | if (childOwners[i] === ancestorOwners[i]) {
|
11231 | deepestCommon = i;
|
11232 | } else {
|
11233 | break;
|
11234 | }
|
11235 | }
|
11236 |
|
11237 | var UNKNOWN = '(unknown)';
|
11238 | var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
|
11239 | return inst.getName() || UNKNOWN;
|
11240 | });
|
11241 | var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
|
11242 | return inst.getName() || UNKNOWN;
|
11243 | });
|
11244 | var ownerInfo = [].concat(
|
11245 | // If the parent and child instances have a common owner ancestor, start
|
11246 | // with that -- otherwise we just start with the parent's owners.
|
11247 | deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
|
11248 | // If we're warning about an invalid (non-parent) ancestry, add '...'
|
11249 | invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
|
11250 |
|
11251 | var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
|
11252 | if (didWarn[warnKey]) {
|
11253 | return;
|
11254 | }
|
11255 | didWarn[warnKey] = true;
|
11256 |
|
11257 | if (invalidParent) {
|
11258 | var info = '';
|
11259 | if (ancestorTag === 'table' && childTag === 'tr') {
|
11260 | info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
|
11261 | }
|
11262 | process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a child of <%s>. ' + 'See %s.%s', childTag, ancestorTag, ownerInfo, info) : undefined;
|
11263 | } else {
|
11264 | process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a descendant of ' + '<%s>. See %s.', childTag, ancestorTag, ownerInfo) : undefined;
|
11265 | }
|
11266 | }
|
11267 | };
|
11268 |
|
11269 | validateDOMNesting.ancestorInfoContextKey = '__validateDOMNesting_ancestorInfo$' + Math.random().toString(36).slice(2);
|
11270 |
|
11271 | validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
|
11272 |
|
11273 | // For testing
|
11274 | validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
|
11275 | ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
11276 | var parentInfo = ancestorInfo.parentTag;
|
11277 | var parentTag = parentInfo && parentInfo.tag;
|
11278 | return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
|
11279 | };
|
11280 | }
|
11281 |
|
11282 | module.exports = validateDOMNesting;
|
11283 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
11284 |
|
11285 | /***/ }),
|
11286 | /* 156 */
|
11287 | /***/ (function(module, exports, __webpack_require__) {
|
11288 |
|
11289 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
11290 | * Copyright 2013-2015, Facebook, Inc.
|
11291 | * All rights reserved.
|
11292 | *
|
11293 | * This source code is licensed under the BSD-style license found in the
|
11294 | * LICENSE file in the root directory of this source tree. An additional grant
|
11295 | * of patent rights can be found in the PATENTS file in the same directory.
|
11296 | *
|
11297 | * @providesModule ReactDefaultInjection
|
11298 | */
|
11299 |
|
11300 | 'use strict';
|
11301 |
|
11302 | var BeforeInputEventPlugin = __webpack_require__(157);
|
11303 | var ChangeEventPlugin = __webpack_require__(165);
|
11304 | var ClientReactRootIndex = __webpack_require__(168);
|
11305 | var DefaultEventPluginOrder = __webpack_require__(169);
|
11306 | var EnterLeaveEventPlugin = __webpack_require__(170);
|
11307 | var ExecutionEnvironment = __webpack_require__(94);
|
11308 | var HTMLDOMPropertyConfig = __webpack_require__(174);
|
11309 | var ReactBrowserComponentMixin = __webpack_require__(175);
|
11310 | var ReactComponentBrowserEnvironment = __webpack_require__(111);
|
11311 | var ReactDefaultBatchingStrategy = __webpack_require__(177);
|
11312 | var ReactDOMComponent = __webpack_require__(178);
|
11313 | var ReactDOMTextComponent = __webpack_require__(91);
|
11314 | var ReactEventListener = __webpack_require__(203);
|
11315 | var ReactInjection = __webpack_require__(206);
|
11316 | var ReactInstanceHandles = __webpack_require__(130);
|
11317 | var ReactMount = __webpack_require__(113);
|
11318 | var ReactReconcileTransaction = __webpack_require__(210);
|
11319 | var SelectEventPlugin = __webpack_require__(215);
|
11320 | var ServerReactRootIndex = __webpack_require__(216);
|
11321 | var SimpleEventPlugin = __webpack_require__(217);
|
11322 | var SVGDOMPropertyConfig = __webpack_require__(226);
|
11323 |
|
11324 | var alreadyInjected = false;
|
11325 |
|
11326 | function inject() {
|
11327 | if (alreadyInjected) {
|
11328 | // TODO: This is currently true because these injections are shared between
|
11329 | // the client and the server package. They should be built independently
|
11330 | // and not share any injection state. Then this problem will be solved.
|
11331 | return;
|
11332 | }
|
11333 | alreadyInjected = true;
|
11334 |
|
11335 | ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
|
11336 |
|
11337 | /**
|
11338 | * Inject modules for resolving DOM hierarchy and plugin ordering.
|
11339 | */
|
11340 | ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
|
11341 | ReactInjection.EventPluginHub.injectInstanceHandle(ReactInstanceHandles);
|
11342 | ReactInjection.EventPluginHub.injectMount(ReactMount);
|
11343 |
|
11344 | /**
|
11345 | * Some important event plugins included by default (without having to require
|
11346 | * them).
|
11347 | */
|
11348 | ReactInjection.EventPluginHub.injectEventPluginsByName({
|
11349 | SimpleEventPlugin: SimpleEventPlugin,
|
11350 | EnterLeaveEventPlugin: EnterLeaveEventPlugin,
|
11351 | ChangeEventPlugin: ChangeEventPlugin,
|
11352 | SelectEventPlugin: SelectEventPlugin,
|
11353 | BeforeInputEventPlugin: BeforeInputEventPlugin
|
11354 | });
|
11355 |
|
11356 | ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent);
|
11357 |
|
11358 | ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent);
|
11359 |
|
11360 | ReactInjection.Class.injectMixin(ReactBrowserComponentMixin);
|
11361 |
|
11362 | ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
|
11363 | ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
|
11364 |
|
11365 | ReactInjection.EmptyComponent.injectEmptyComponent('noscript');
|
11366 |
|
11367 | ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
|
11368 | ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
|
11369 |
|
11370 | ReactInjection.RootIndex.injectCreateReactRootIndex(ExecutionEnvironment.canUseDOM ? ClientReactRootIndex.createReactRootIndex : ServerReactRootIndex.createReactRootIndex);
|
11371 |
|
11372 | ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
|
11373 |
|
11374 | if (process.env.NODE_ENV !== 'production') {
|
11375 | var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
|
11376 | if (/[?&]react_perf\b/.test(url)) {
|
11377 | var ReactDefaultPerf = __webpack_require__(227);
|
11378 | ReactDefaultPerf.start();
|
11379 | }
|
11380 | }
|
11381 | }
|
11382 |
|
11383 | module.exports = {
|
11384 | inject: inject
|
11385 | };
|
11386 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
11387 |
|
11388 | /***/ }),
|
11389 | /* 157 */
|
11390 | /***/ (function(module, exports, __webpack_require__) {
|
11391 |
|
11392 | /**
|
11393 | * Copyright 2013-2015 Facebook, Inc.
|
11394 | * All rights reserved.
|
11395 | *
|
11396 | * This source code is licensed under the BSD-style license found in the
|
11397 | * LICENSE file in the root directory of this source tree. An additional grant
|
11398 | * of patent rights can be found in the PATENTS file in the same directory.
|
11399 | *
|
11400 | * @providesModule BeforeInputEventPlugin
|
11401 | * @typechecks static-only
|
11402 | */
|
11403 |
|
11404 | 'use strict';
|
11405 |
|
11406 | var EventConstants = __webpack_require__(115);
|
11407 | var EventPropagators = __webpack_require__(158);
|
11408 | var ExecutionEnvironment = __webpack_require__(94);
|
11409 | var FallbackCompositionState = __webpack_require__(159);
|
11410 | var SyntheticCompositionEvent = __webpack_require__(161);
|
11411 | var SyntheticInputEvent = __webpack_require__(163);
|
11412 |
|
11413 | var keyOf = __webpack_require__(164);
|
11414 |
|
11415 | var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
|
11416 | var START_KEYCODE = 229;
|
11417 |
|
11418 | var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
|
11419 |
|
11420 | var documentMode = null;
|
11421 | if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
|
11422 | documentMode = document.documentMode;
|
11423 | }
|
11424 |
|
11425 | // Webkit offers a very useful `textInput` event that can be used to
|
11426 | // directly represent `beforeInput`. The IE `textinput` event is not as
|
11427 | // useful, so we don't use it.
|
11428 | var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
|
11429 |
|
11430 | // In IE9+, we have access to composition events, but the data supplied
|
11431 | // by the native compositionend event may be incorrect. Japanese ideographic
|
11432 | // spaces, for instance (\u3000) are not recorded correctly.
|
11433 | var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
|
11434 |
|
11435 | /**
|
11436 | * Opera <= 12 includes TextEvent in window, but does not fire
|
11437 | * text input events. Rely on keypress instead.
|
11438 | */
|
11439 | function isPresto() {
|
11440 | var opera = window.opera;
|
11441 | return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
|
11442 | }
|
11443 |
|
11444 | var SPACEBAR_CODE = 32;
|
11445 | var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
|
11446 |
|
11447 | var topLevelTypes = EventConstants.topLevelTypes;
|
11448 |
|
11449 | // Events and their corresponding property names.
|
11450 | var eventTypes = {
|
11451 | beforeInput: {
|
11452 | phasedRegistrationNames: {
|
11453 | bubbled: keyOf({ onBeforeInput: null }),
|
11454 | captured: keyOf({ onBeforeInputCapture: null })
|
11455 | },
|
11456 | dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
|
11457 | },
|
11458 | compositionEnd: {
|
11459 | phasedRegistrationNames: {
|
11460 | bubbled: keyOf({ onCompositionEnd: null }),
|
11461 | captured: keyOf({ onCompositionEndCapture: null })
|
11462 | },
|
11463 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
11464 | },
|
11465 | compositionStart: {
|
11466 | phasedRegistrationNames: {
|
11467 | bubbled: keyOf({ onCompositionStart: null }),
|
11468 | captured: keyOf({ onCompositionStartCapture: null })
|
11469 | },
|
11470 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
11471 | },
|
11472 | compositionUpdate: {
|
11473 | phasedRegistrationNames: {
|
11474 | bubbled: keyOf({ onCompositionUpdate: null }),
|
11475 | captured: keyOf({ onCompositionUpdateCapture: null })
|
11476 | },
|
11477 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
11478 | }
|
11479 | };
|
11480 |
|
11481 | // Track whether we've ever handled a keypress on the space key.
|
11482 | var hasSpaceKeypress = false;
|
11483 |
|
11484 | /**
|
11485 | * Return whether a native keypress event is assumed to be a command.
|
11486 | * This is required because Firefox fires `keypress` events for key commands
|
11487 | * (cut, copy, select-all, etc.) even though no character is inserted.
|
11488 | */
|
11489 | function isKeypressCommand(nativeEvent) {
|
11490 | return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
|
11491 | // ctrlKey && altKey is equivalent to AltGr, and is not a command.
|
11492 | !(nativeEvent.ctrlKey && nativeEvent.altKey);
|
11493 | }
|
11494 |
|
11495 | /**
|
11496 | * Translate native top level events into event types.
|
11497 | *
|
11498 | * @param {string} topLevelType
|
11499 | * @return {object}
|
11500 | */
|
11501 | function getCompositionEventType(topLevelType) {
|
11502 | switch (topLevelType) {
|
11503 | case topLevelTypes.topCompositionStart:
|
11504 | return eventTypes.compositionStart;
|
11505 | case topLevelTypes.topCompositionEnd:
|
11506 | return eventTypes.compositionEnd;
|
11507 | case topLevelTypes.topCompositionUpdate:
|
11508 | return eventTypes.compositionUpdate;
|
11509 | }
|
11510 | }
|
11511 |
|
11512 | /**
|
11513 | * Does our fallback best-guess model think this event signifies that
|
11514 | * composition has begun?
|
11515 | *
|
11516 | * @param {string} topLevelType
|
11517 | * @param {object} nativeEvent
|
11518 | * @return {boolean}
|
11519 | */
|
11520 | function isFallbackCompositionStart(topLevelType, nativeEvent) {
|
11521 | return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
|
11522 | }
|
11523 |
|
11524 | /**
|
11525 | * Does our fallback mode think that this event is the end of composition?
|
11526 | *
|
11527 | * @param {string} topLevelType
|
11528 | * @param {object} nativeEvent
|
11529 | * @return {boolean}
|
11530 | */
|
11531 | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
|
11532 | switch (topLevelType) {
|
11533 | case topLevelTypes.topKeyUp:
|
11534 | // Command keys insert or clear IME input.
|
11535 | return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
|
11536 | case topLevelTypes.topKeyDown:
|
11537 | // Expect IME keyCode on each keydown. If we get any other
|
11538 | // code we must have exited earlier.
|
11539 | return nativeEvent.keyCode !== START_KEYCODE;
|
11540 | case topLevelTypes.topKeyPress:
|
11541 | case topLevelTypes.topMouseDown:
|
11542 | case topLevelTypes.topBlur:
|
11543 | // Events are not possible without cancelling IME.
|
11544 | return true;
|
11545 | default:
|
11546 | return false;
|
11547 | }
|
11548 | }
|
11549 |
|
11550 | /**
|
11551 | * Google Input Tools provides composition data via a CustomEvent,
|
11552 | * with the `data` property populated in the `detail` object. If this
|
11553 | * is available on the event object, use it. If not, this is a plain
|
11554 | * composition event and we have nothing special to extract.
|
11555 | *
|
11556 | * @param {object} nativeEvent
|
11557 | * @return {?string}
|
11558 | */
|
11559 | function getDataFromCustomEvent(nativeEvent) {
|
11560 | var detail = nativeEvent.detail;
|
11561 | if (typeof detail === 'object' && 'data' in detail) {
|
11562 | return detail.data;
|
11563 | }
|
11564 | return null;
|
11565 | }
|
11566 |
|
11567 | // Track the current IME composition fallback object, if any.
|
11568 | var currentComposition = null;
|
11569 |
|
11570 | /**
|
11571 | * @param {string} topLevelType Record from `EventConstants`.
|
11572 | * @param {DOMEventTarget} topLevelTarget The listening component root node.
|
11573 | * @param {string} topLevelTargetID ID of `topLevelTarget`.
|
11574 | * @param {object} nativeEvent Native browser event.
|
11575 | * @return {?object} A SyntheticCompositionEvent.
|
11576 | */
|
11577 | function extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
11578 | var eventType;
|
11579 | var fallbackData;
|
11580 |
|
11581 | if (canUseCompositionEvent) {
|
11582 | eventType = getCompositionEventType(topLevelType);
|
11583 | } else if (!currentComposition) {
|
11584 | if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
|
11585 | eventType = eventTypes.compositionStart;
|
11586 | }
|
11587 | } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
11588 | eventType = eventTypes.compositionEnd;
|
11589 | }
|
11590 |
|
11591 | if (!eventType) {
|
11592 | return null;
|
11593 | }
|
11594 |
|
11595 | if (useFallbackCompositionData) {
|
11596 | // The current composition is stored statically and must not be
|
11597 | // overwritten while composition continues.
|
11598 | if (!currentComposition && eventType === eventTypes.compositionStart) {
|
11599 | currentComposition = FallbackCompositionState.getPooled(topLevelTarget);
|
11600 | } else if (eventType === eventTypes.compositionEnd) {
|
11601 | if (currentComposition) {
|
11602 | fallbackData = currentComposition.getData();
|
11603 | }
|
11604 | }
|
11605 | }
|
11606 |
|
11607 | var event = SyntheticCompositionEvent.getPooled(eventType, topLevelTargetID, nativeEvent, nativeEventTarget);
|
11608 |
|
11609 | if (fallbackData) {
|
11610 | // Inject data generated from fallback path into the synthetic event.
|
11611 | // This matches the property of native CompositionEventInterface.
|
11612 | event.data = fallbackData;
|
11613 | } else {
|
11614 | var customData = getDataFromCustomEvent(nativeEvent);
|
11615 | if (customData !== null) {
|
11616 | event.data = customData;
|
11617 | }
|
11618 | }
|
11619 |
|
11620 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
11621 | return event;
|
11622 | }
|
11623 |
|
11624 | /**
|
11625 | * @param {string} topLevelType Record from `EventConstants`.
|
11626 | * @param {object} nativeEvent Native browser event.
|
11627 | * @return {?string} The string corresponding to this `beforeInput` event.
|
11628 | */
|
11629 | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
|
11630 | switch (topLevelType) {
|
11631 | case topLevelTypes.topCompositionEnd:
|
11632 | return getDataFromCustomEvent(nativeEvent);
|
11633 | case topLevelTypes.topKeyPress:
|
11634 | /**
|
11635 | * If native `textInput` events are available, our goal is to make
|
11636 | * use of them. However, there is a special case: the spacebar key.
|
11637 | * In Webkit, preventing default on a spacebar `textInput` event
|
11638 | * cancels character insertion, but it *also* causes the browser
|
11639 | * to fall back to its default spacebar behavior of scrolling the
|
11640 | * page.
|
11641 | *
|
11642 | * Tracking at:
|
11643 | * https://code.google.com/p/chromium/issues/detail?id=355103
|
11644 | *
|
11645 | * To avoid this issue, use the keypress event as if no `textInput`
|
11646 | * event is available.
|
11647 | */
|
11648 | var which = nativeEvent.which;
|
11649 | if (which !== SPACEBAR_CODE) {
|
11650 | return null;
|
11651 | }
|
11652 |
|
11653 | hasSpaceKeypress = true;
|
11654 | return SPACEBAR_CHAR;
|
11655 |
|
11656 | case topLevelTypes.topTextInput:
|
11657 | // Record the characters to be added to the DOM.
|
11658 | var chars = nativeEvent.data;
|
11659 |
|
11660 | // If it's a spacebar character, assume that we have already handled
|
11661 | // it at the keypress level and bail immediately. Android Chrome
|
11662 | // doesn't give us keycodes, so we need to blacklist it.
|
11663 | if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
|
11664 | return null;
|
11665 | }
|
11666 |
|
11667 | return chars;
|
11668 |
|
11669 | default:
|
11670 | // For other native event types, do nothing.
|
11671 | return null;
|
11672 | }
|
11673 | }
|
11674 |
|
11675 | /**
|
11676 | * For browsers that do not provide the `textInput` event, extract the
|
11677 | * appropriate string to use for SyntheticInputEvent.
|
11678 | *
|
11679 | * @param {string} topLevelType Record from `EventConstants`.
|
11680 | * @param {object} nativeEvent Native browser event.
|
11681 | * @return {?string} The fallback string for this `beforeInput` event.
|
11682 | */
|
11683 | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
|
11684 | // If we are currently composing (IME) and using a fallback to do so,
|
11685 | // try to extract the composed characters from the fallback object.
|
11686 | if (currentComposition) {
|
11687 | if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
11688 | var chars = currentComposition.getData();
|
11689 | FallbackCompositionState.release(currentComposition);
|
11690 | currentComposition = null;
|
11691 | return chars;
|
11692 | }
|
11693 | return null;
|
11694 | }
|
11695 |
|
11696 | switch (topLevelType) {
|
11697 | case topLevelTypes.topPaste:
|
11698 | // If a paste event occurs after a keypress, throw out the input
|
11699 | // chars. Paste events should not lead to BeforeInput events.
|
11700 | return null;
|
11701 | case topLevelTypes.topKeyPress:
|
11702 | /**
|
11703 | * As of v27, Firefox may fire keypress events even when no character
|
11704 | * will be inserted. A few possibilities:
|
11705 | *
|
11706 | * - `which` is `0`. Arrow keys, Esc key, etc.
|
11707 | *
|
11708 | * - `which` is the pressed key code, but no char is available.
|
11709 | * Ex: 'AltGr + d` in Polish. There is no modified character for
|
11710 | * this key combination and no character is inserted into the
|
11711 | * document, but FF fires the keypress for char code `100` anyway.
|
11712 | * No `input` event will occur.
|
11713 | *
|
11714 | * - `which` is the pressed key code, but a command combination is
|
11715 | * being used. Ex: `Cmd+C`. No character is inserted, and no
|
11716 | * `input` event will occur.
|
11717 | */
|
11718 | if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
|
11719 | return String.fromCharCode(nativeEvent.which);
|
11720 | }
|
11721 | return null;
|
11722 | case topLevelTypes.topCompositionEnd:
|
11723 | return useFallbackCompositionData ? null : nativeEvent.data;
|
11724 | default:
|
11725 | return null;
|
11726 | }
|
11727 | }
|
11728 |
|
11729 | /**
|
11730 | * Extract a SyntheticInputEvent for `beforeInput`, based on either native
|
11731 | * `textInput` or fallback behavior.
|
11732 | *
|
11733 | * @param {string} topLevelType Record from `EventConstants`.
|
11734 | * @param {DOMEventTarget} topLevelTarget The listening component root node.
|
11735 | * @param {string} topLevelTargetID ID of `topLevelTarget`.
|
11736 | * @param {object} nativeEvent Native browser event.
|
11737 | * @return {?object} A SyntheticInputEvent.
|
11738 | */
|
11739 | function extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
11740 | var chars;
|
11741 |
|
11742 | if (canUseTextInputEvent) {
|
11743 | chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
|
11744 | } else {
|
11745 | chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
|
11746 | }
|
11747 |
|
11748 | // If no characters are being inserted, no BeforeInput event should
|
11749 | // be fired.
|
11750 | if (!chars) {
|
11751 | return null;
|
11752 | }
|
11753 |
|
11754 | var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, topLevelTargetID, nativeEvent, nativeEventTarget);
|
11755 |
|
11756 | event.data = chars;
|
11757 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
11758 | return event;
|
11759 | }
|
11760 |
|
11761 | /**
|
11762 | * Create an `onBeforeInput` event to match
|
11763 | * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
|
11764 | *
|
11765 | * This event plugin is based on the native `textInput` event
|
11766 | * available in Chrome, Safari, Opera, and IE. This event fires after
|
11767 | * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
|
11768 | *
|
11769 | * `beforeInput` is spec'd but not implemented in any browsers, and
|
11770 | * the `input` event does not provide any useful information about what has
|
11771 | * actually been added, contrary to the spec. Thus, `textInput` is the best
|
11772 | * available event to identify the characters that have actually been inserted
|
11773 | * into the target node.
|
11774 | *
|
11775 | * This plugin is also responsible for emitting `composition` events, thus
|
11776 | * allowing us to share composition fallback code for both `beforeInput` and
|
11777 | * `composition` event types.
|
11778 | */
|
11779 | var BeforeInputEventPlugin = {
|
11780 |
|
11781 | eventTypes: eventTypes,
|
11782 |
|
11783 | /**
|
11784 | * @param {string} topLevelType Record from `EventConstants`.
|
11785 | * @param {DOMEventTarget} topLevelTarget The listening component root node.
|
11786 | * @param {string} topLevelTargetID ID of `topLevelTarget`.
|
11787 | * @param {object} nativeEvent Native browser event.
|
11788 | * @return {*} An accumulation of synthetic events.
|
11789 | * @see {EventPluginHub.extractEvents}
|
11790 | */
|
11791 | extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
11792 | return [extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget)];
|
11793 | }
|
11794 | };
|
11795 |
|
11796 | module.exports = BeforeInputEventPlugin;
|
11797 |
|
11798 | /***/ }),
|
11799 | /* 158 */
|
11800 | /***/ (function(module, exports, __webpack_require__) {
|
11801 |
|
11802 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
11803 | * Copyright 2013-2015, Facebook, Inc.
|
11804 | * All rights reserved.
|
11805 | *
|
11806 | * This source code is licensed under the BSD-style license found in the
|
11807 | * LICENSE file in the root directory of this source tree. An additional grant
|
11808 | * of patent rights can be found in the PATENTS file in the same directory.
|
11809 | *
|
11810 | * @providesModule EventPropagators
|
11811 | */
|
11812 |
|
11813 | 'use strict';
|
11814 |
|
11815 | var EventConstants = __webpack_require__(115);
|
11816 | var EventPluginHub = __webpack_require__(116);
|
11817 |
|
11818 | var warning = __webpack_require__(110);
|
11819 |
|
11820 | var accumulateInto = __webpack_require__(120);
|
11821 | var forEachAccumulated = __webpack_require__(121);
|
11822 |
|
11823 | var PropagationPhases = EventConstants.PropagationPhases;
|
11824 | var getListener = EventPluginHub.getListener;
|
11825 |
|
11826 | /**
|
11827 | * Some event types have a notion of different registration names for different
|
11828 | * "phases" of propagation. This finds listeners by a given phase.
|
11829 | */
|
11830 | function listenerAtPhase(id, event, propagationPhase) {
|
11831 | var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
|
11832 | return getListener(id, registrationName);
|
11833 | }
|
11834 |
|
11835 | /**
|
11836 | * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
|
11837 | * here, allows us to not have to bind or create functions for each event.
|
11838 | * Mutating the event's members allows us to not have to create a wrapping
|
11839 | * "dispatch" object that pairs the event with the listener.
|
11840 | */
|
11841 | function accumulateDirectionalDispatches(domID, upwards, event) {
|
11842 | if (process.env.NODE_ENV !== 'production') {
|
11843 | process.env.NODE_ENV !== 'production' ? warning(domID, 'Dispatching id must not be null') : undefined;
|
11844 | }
|
11845 | var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
|
11846 | var listener = listenerAtPhase(domID, event, phase);
|
11847 | if (listener) {
|
11848 | event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
11849 | event._dispatchIDs = accumulateInto(event._dispatchIDs, domID);
|
11850 | }
|
11851 | }
|
11852 |
|
11853 | /**
|
11854 | * Collect dispatches (must be entirely collected before dispatching - see unit
|
11855 | * tests). Lazily allocate the array to conserve memory. We must loop through
|
11856 | * each event and perform the traversal for each one. We cannot perform a
|
11857 | * single traversal for the entire collection of events because each event may
|
11858 | * have a different target.
|
11859 | */
|
11860 | function accumulateTwoPhaseDispatchesSingle(event) {
|
11861 | if (event && event.dispatchConfig.phasedRegistrationNames) {
|
11862 | EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);
|
11863 | }
|
11864 | }
|
11865 |
|
11866 | /**
|
11867 | * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
|
11868 | */
|
11869 | function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
|
11870 | if (event && event.dispatchConfig.phasedRegistrationNames) {
|
11871 | EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event);
|
11872 | }
|
11873 | }
|
11874 |
|
11875 | /**
|
11876 | * Accumulates without regard to direction, does not look for phased
|
11877 | * registration names. Same as `accumulateDirectDispatchesSingle` but without
|
11878 | * requiring that the `dispatchMarker` be the same as the dispatched ID.
|
11879 | */
|
11880 | function accumulateDispatches(id, ignoredDirection, event) {
|
11881 | if (event && event.dispatchConfig.registrationName) {
|
11882 | var registrationName = event.dispatchConfig.registrationName;
|
11883 | var listener = getListener(id, registrationName);
|
11884 | if (listener) {
|
11885 | event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
11886 | event._dispatchIDs = accumulateInto(event._dispatchIDs, id);
|
11887 | }
|
11888 | }
|
11889 | }
|
11890 |
|
11891 | /**
|
11892 | * Accumulates dispatches on an `SyntheticEvent`, but only for the
|
11893 | * `dispatchMarker`.
|
11894 | * @param {SyntheticEvent} event
|
11895 | */
|
11896 | function accumulateDirectDispatchesSingle(event) {
|
11897 | if (event && event.dispatchConfig.registrationName) {
|
11898 | accumulateDispatches(event.dispatchMarker, null, event);
|
11899 | }
|
11900 | }
|
11901 |
|
11902 | function accumulateTwoPhaseDispatches(events) {
|
11903 | forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
|
11904 | }
|
11905 |
|
11906 | function accumulateTwoPhaseDispatchesSkipTarget(events) {
|
11907 | forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
|
11908 | }
|
11909 |
|
11910 | function accumulateEnterLeaveDispatches(leave, enter, fromID, toID) {
|
11911 | EventPluginHub.injection.getInstanceHandle().traverseEnterLeave(fromID, toID, accumulateDispatches, leave, enter);
|
11912 | }
|
11913 |
|
11914 | function accumulateDirectDispatches(events) {
|
11915 | forEachAccumulated(events, accumulateDirectDispatchesSingle);
|
11916 | }
|
11917 |
|
11918 | /**
|
11919 | * A small set of propagation patterns, each of which will accept a small amount
|
11920 | * of information, and generate a set of "dispatch ready event objects" - which
|
11921 | * are sets of events that have already been annotated with a set of dispatched
|
11922 | * listener functions/ids. The API is designed this way to discourage these
|
11923 | * propagation strategies from actually executing the dispatches, since we
|
11924 | * always want to collect the entire set of dispatches before executing event a
|
11925 | * single one.
|
11926 | *
|
11927 | * @constructor EventPropagators
|
11928 | */
|
11929 | var EventPropagators = {
|
11930 | accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
|
11931 | accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
|
11932 | accumulateDirectDispatches: accumulateDirectDispatches,
|
11933 | accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
|
11934 | };
|
11935 |
|
11936 | module.exports = EventPropagators;
|
11937 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
11938 |
|
11939 | /***/ }),
|
11940 | /* 159 */
|
11941 | /***/ (function(module, exports, __webpack_require__) {
|
11942 |
|
11943 | /**
|
11944 | * Copyright 2013-2015, Facebook, Inc.
|
11945 | * All rights reserved.
|
11946 | *
|
11947 | * This source code is licensed under the BSD-style license found in the
|
11948 | * LICENSE file in the root directory of this source tree. An additional grant
|
11949 | * of patent rights can be found in the PATENTS file in the same directory.
|
11950 | *
|
11951 | * @providesModule FallbackCompositionState
|
11952 | * @typechecks static-only
|
11953 | */
|
11954 |
|
11955 | 'use strict';
|
11956 |
|
11957 | var PooledClass = __webpack_require__(141);
|
11958 |
|
11959 | var assign = __webpack_require__(124);
|
11960 | var getTextContentAccessor = __webpack_require__(160);
|
11961 |
|
11962 | /**
|
11963 | * This helper class stores information about text content of a target node,
|
11964 | * allowing comparison of content before and after a given event.
|
11965 | *
|
11966 | * Identify the node where selection currently begins, then observe
|
11967 | * both its text content and its current position in the DOM. Since the
|
11968 | * browser may natively replace the target node during composition, we can
|
11969 | * use its position to find its replacement.
|
11970 | *
|
11971 | * @param {DOMEventTarget} root
|
11972 | */
|
11973 | function FallbackCompositionState(root) {
|
11974 | this._root = root;
|
11975 | this._startText = this.getText();
|
11976 | this._fallbackText = null;
|
11977 | }
|
11978 |
|
11979 | assign(FallbackCompositionState.prototype, {
|
11980 | destructor: function () {
|
11981 | this._root = null;
|
11982 | this._startText = null;
|
11983 | this._fallbackText = null;
|
11984 | },
|
11985 |
|
11986 | /**
|
11987 | * Get current text of input.
|
11988 | *
|
11989 | * @return {string}
|
11990 | */
|
11991 | getText: function () {
|
11992 | if ('value' in this._root) {
|
11993 | return this._root.value;
|
11994 | }
|
11995 | return this._root[getTextContentAccessor()];
|
11996 | },
|
11997 |
|
11998 | /**
|
11999 | * Determine the differing substring between the initially stored
|
12000 | * text content and the current content.
|
12001 | *
|
12002 | * @return {string}
|
12003 | */
|
12004 | getData: function () {
|
12005 | if (this._fallbackText) {
|
12006 | return this._fallbackText;
|
12007 | }
|
12008 |
|
12009 | var start;
|
12010 | var startValue = this._startText;
|
12011 | var startLength = startValue.length;
|
12012 | var end;
|
12013 | var endValue = this.getText();
|
12014 | var endLength = endValue.length;
|
12015 |
|
12016 | for (start = 0; start < startLength; start++) {
|
12017 | if (startValue[start] !== endValue[start]) {
|
12018 | break;
|
12019 | }
|
12020 | }
|
12021 |
|
12022 | var minEnd = startLength - start;
|
12023 | for (end = 1; end <= minEnd; end++) {
|
12024 | if (startValue[startLength - end] !== endValue[endLength - end]) {
|
12025 | break;
|
12026 | }
|
12027 | }
|
12028 |
|
12029 | var sliceTail = end > 1 ? 1 - end : undefined;
|
12030 | this._fallbackText = endValue.slice(start, sliceTail);
|
12031 | return this._fallbackText;
|
12032 | }
|
12033 | });
|
12034 |
|
12035 | PooledClass.addPoolingTo(FallbackCompositionState);
|
12036 |
|
12037 | module.exports = FallbackCompositionState;
|
12038 |
|
12039 | /***/ }),
|
12040 | /* 160 */
|
12041 | /***/ (function(module, exports, __webpack_require__) {
|
12042 |
|
12043 | /**
|
12044 | * Copyright 2013-2015, Facebook, Inc.
|
12045 | * All rights reserved.
|
12046 | *
|
12047 | * This source code is licensed under the BSD-style license found in the
|
12048 | * LICENSE file in the root directory of this source tree. An additional grant
|
12049 | * of patent rights can be found in the PATENTS file in the same directory.
|
12050 | *
|
12051 | * @providesModule getTextContentAccessor
|
12052 | */
|
12053 |
|
12054 | 'use strict';
|
12055 |
|
12056 | var ExecutionEnvironment = __webpack_require__(94);
|
12057 |
|
12058 | var contentKey = null;
|
12059 |
|
12060 | /**
|
12061 | * Gets the key used to access text content on a DOM node.
|
12062 | *
|
12063 | * @return {?string} Key used to access text content.
|
12064 | * @internal
|
12065 | */
|
12066 | function getTextContentAccessor() {
|
12067 | if (!contentKey && ExecutionEnvironment.canUseDOM) {
|
12068 | // Prefer textContent to innerText because many browsers support both but
|
12069 | // SVG <text> elements don't support innerText even when <div> does.
|
12070 | contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
|
12071 | }
|
12072 | return contentKey;
|
12073 | }
|
12074 |
|
12075 | module.exports = getTextContentAccessor;
|
12076 |
|
12077 | /***/ }),
|
12078 | /* 161 */
|
12079 | /***/ (function(module, exports, __webpack_require__) {
|
12080 |
|
12081 | /**
|
12082 | * Copyright 2013-2015, Facebook, Inc.
|
12083 | * All rights reserved.
|
12084 | *
|
12085 | * This source code is licensed under the BSD-style license found in the
|
12086 | * LICENSE file in the root directory of this source tree. An additional grant
|
12087 | * of patent rights can be found in the PATENTS file in the same directory.
|
12088 | *
|
12089 | * @providesModule SyntheticCompositionEvent
|
12090 | * @typechecks static-only
|
12091 | */
|
12092 |
|
12093 | 'use strict';
|
12094 |
|
12095 | var SyntheticEvent = __webpack_require__(162);
|
12096 |
|
12097 | /**
|
12098 | * @interface Event
|
12099 | * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
|
12100 | */
|
12101 | var CompositionEventInterface = {
|
12102 | data: null
|
12103 | };
|
12104 |
|
12105 | /**
|
12106 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
12107 | * @param {string} dispatchMarker Marker identifying the event target.
|
12108 | * @param {object} nativeEvent Native browser event.
|
12109 | * @extends {SyntheticUIEvent}
|
12110 | */
|
12111 | function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
12112 | SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
12113 | }
|
12114 |
|
12115 | SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
|
12116 |
|
12117 | module.exports = SyntheticCompositionEvent;
|
12118 |
|
12119 | /***/ }),
|
12120 | /* 162 */
|
12121 | /***/ (function(module, exports, __webpack_require__) {
|
12122 |
|
12123 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
12124 | * Copyright 2013-2015, Facebook, Inc.
|
12125 | * All rights reserved.
|
12126 | *
|
12127 | * This source code is licensed under the BSD-style license found in the
|
12128 | * LICENSE file in the root directory of this source tree. An additional grant
|
12129 | * of patent rights can be found in the PATENTS file in the same directory.
|
12130 | *
|
12131 | * @providesModule SyntheticEvent
|
12132 | * @typechecks static-only
|
12133 | */
|
12134 |
|
12135 | 'use strict';
|
12136 |
|
12137 | var PooledClass = __webpack_require__(141);
|
12138 |
|
12139 | var assign = __webpack_require__(124);
|
12140 | var emptyFunction = __webpack_require__(100);
|
12141 | var warning = __webpack_require__(110);
|
12142 |
|
12143 | /**
|
12144 | * @interface Event
|
12145 | * @see http://www.w3.org/TR/DOM-Level-3-Events/
|
12146 | */
|
12147 | var EventInterface = {
|
12148 | type: null,
|
12149 | target: null,
|
12150 | // currentTarget is set when dispatching; no use in copying it here
|
12151 | currentTarget: emptyFunction.thatReturnsNull,
|
12152 | eventPhase: null,
|
12153 | bubbles: null,
|
12154 | cancelable: null,
|
12155 | timeStamp: function (event) {
|
12156 | return event.timeStamp || Date.now();
|
12157 | },
|
12158 | defaultPrevented: null,
|
12159 | isTrusted: null
|
12160 | };
|
12161 |
|
12162 | /**
|
12163 | * Synthetic events are dispatched by event plugins, typically in response to a
|
12164 | * top-level event delegation handler.
|
12165 | *
|
12166 | * These systems should generally use pooling to reduce the frequency of garbage
|
12167 | * collection. The system should check `isPersistent` to determine whether the
|
12168 | * event should be released into the pool after being dispatched. Users that
|
12169 | * need a persisted event should invoke `persist`.
|
12170 | *
|
12171 | * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
|
12172 | * normalizing browser quirks. Subclasses do not necessarily have to implement a
|
12173 | * DOM interface; custom application-specific events can also subclass this.
|
12174 | *
|
12175 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
12176 | * @param {string} dispatchMarker Marker identifying the event target.
|
12177 | * @param {object} nativeEvent Native browser event.
|
12178 | */
|
12179 | function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
12180 | this.dispatchConfig = dispatchConfig;
|
12181 | this.dispatchMarker = dispatchMarker;
|
12182 | this.nativeEvent = nativeEvent;
|
12183 |
|
12184 | var Interface = this.constructor.Interface;
|
12185 | for (var propName in Interface) {
|
12186 | if (!Interface.hasOwnProperty(propName)) {
|
12187 | continue;
|
12188 | }
|
12189 | var normalize = Interface[propName];
|
12190 | if (normalize) {
|
12191 | this[propName] = normalize(nativeEvent);
|
12192 | } else {
|
12193 | if (propName === 'target') {
|
12194 | this.target = nativeEventTarget;
|
12195 | } else {
|
12196 | this[propName] = nativeEvent[propName];
|
12197 | }
|
12198 | }
|
12199 | }
|
12200 |
|
12201 | var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
12202 | if (defaultPrevented) {
|
12203 | this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
12204 | } else {
|
12205 | this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
|
12206 | }
|
12207 | this.isPropagationStopped = emptyFunction.thatReturnsFalse;
|
12208 | }
|
12209 |
|
12210 | assign(SyntheticEvent.prototype, {
|
12211 |
|
12212 | preventDefault: function () {
|
12213 | this.defaultPrevented = true;
|
12214 | var event = this.nativeEvent;
|
12215 | if (process.env.NODE_ENV !== 'production') {
|
12216 | process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `preventDefault` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined;
|
12217 | }
|
12218 | if (!event) {
|
12219 | return;
|
12220 | }
|
12221 |
|
12222 | if (event.preventDefault) {
|
12223 | event.preventDefault();
|
12224 | } else {
|
12225 | event.returnValue = false;
|
12226 | }
|
12227 | this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
12228 | },
|
12229 |
|
12230 | stopPropagation: function () {
|
12231 | var event = this.nativeEvent;
|
12232 | if (process.env.NODE_ENV !== 'production') {
|
12233 | process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `stopPropagation` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined;
|
12234 | }
|
12235 | if (!event) {
|
12236 | return;
|
12237 | }
|
12238 |
|
12239 | if (event.stopPropagation) {
|
12240 | event.stopPropagation();
|
12241 | } else {
|
12242 | event.cancelBubble = true;
|
12243 | }
|
12244 | this.isPropagationStopped = emptyFunction.thatReturnsTrue;
|
12245 | },
|
12246 |
|
12247 | /**
|
12248 | * We release all dispatched `SyntheticEvent`s after each event loop, adding
|
12249 | * them back into the pool. This allows a way to hold onto a reference that
|
12250 | * won't be added back into the pool.
|
12251 | */
|
12252 | persist: function () {
|
12253 | this.isPersistent = emptyFunction.thatReturnsTrue;
|
12254 | },
|
12255 |
|
12256 | /**
|
12257 | * Checks if this event should be released back into the pool.
|
12258 | *
|
12259 | * @return {boolean} True if this should not be released, false otherwise.
|
12260 | */
|
12261 | isPersistent: emptyFunction.thatReturnsFalse,
|
12262 |
|
12263 | /**
|
12264 | * `PooledClass` looks for `destructor` on each instance it releases.
|
12265 | */
|
12266 | destructor: function () {
|
12267 | var Interface = this.constructor.Interface;
|
12268 | for (var propName in Interface) {
|
12269 | this[propName] = null;
|
12270 | }
|
12271 | this.dispatchConfig = null;
|
12272 | this.dispatchMarker = null;
|
12273 | this.nativeEvent = null;
|
12274 | }
|
12275 |
|
12276 | });
|
12277 |
|
12278 | SyntheticEvent.Interface = EventInterface;
|
12279 |
|
12280 | /**
|
12281 | * Helper to reduce boilerplate when creating subclasses.
|
12282 | *
|
12283 | * @param {function} Class
|
12284 | * @param {?object} Interface
|
12285 | */
|
12286 | SyntheticEvent.augmentClass = function (Class, Interface) {
|
12287 | var Super = this;
|
12288 |
|
12289 | var prototype = Object.create(Super.prototype);
|
12290 | assign(prototype, Class.prototype);
|
12291 | Class.prototype = prototype;
|
12292 | Class.prototype.constructor = Class;
|
12293 |
|
12294 | Class.Interface = assign({}, Super.Interface, Interface);
|
12295 | Class.augmentClass = Super.augmentClass;
|
12296 |
|
12297 | PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
|
12298 | };
|
12299 |
|
12300 | PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
|
12301 |
|
12302 | module.exports = SyntheticEvent;
|
12303 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
12304 |
|
12305 | /***/ }),
|
12306 | /* 163 */
|
12307 | /***/ (function(module, exports, __webpack_require__) {
|
12308 |
|
12309 | /**
|
12310 | * Copyright 2013-2015, Facebook, Inc.
|
12311 | * All rights reserved.
|
12312 | *
|
12313 | * This source code is licensed under the BSD-style license found in the
|
12314 | * LICENSE file in the root directory of this source tree. An additional grant
|
12315 | * of patent rights can be found in the PATENTS file in the same directory.
|
12316 | *
|
12317 | * @providesModule SyntheticInputEvent
|
12318 | * @typechecks static-only
|
12319 | */
|
12320 |
|
12321 | 'use strict';
|
12322 |
|
12323 | var SyntheticEvent = __webpack_require__(162);
|
12324 |
|
12325 | /**
|
12326 | * @interface Event
|
12327 | * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
|
12328 | * /#events-inputevents
|
12329 | */
|
12330 | var InputEventInterface = {
|
12331 | data: null
|
12332 | };
|
12333 |
|
12334 | /**
|
12335 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
12336 | * @param {string} dispatchMarker Marker identifying the event target.
|
12337 | * @param {object} nativeEvent Native browser event.
|
12338 | * @extends {SyntheticUIEvent}
|
12339 | */
|
12340 | function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
12341 | SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
12342 | }
|
12343 |
|
12344 | SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
|
12345 |
|
12346 | module.exports = SyntheticInputEvent;
|
12347 |
|
12348 | /***/ }),
|
12349 | /* 164 */
|
12350 | /***/ (function(module, exports) {
|
12351 |
|
12352 | /**
|
12353 | * Copyright 2013-2015, Facebook, Inc.
|
12354 | * All rights reserved.
|
12355 | *
|
12356 | * This source code is licensed under the BSD-style license found in the
|
12357 | * LICENSE file in the root directory of this source tree. An additional grant
|
12358 | * of patent rights can be found in the PATENTS file in the same directory.
|
12359 | *
|
12360 | * @providesModule keyOf
|
12361 | */
|
12362 |
|
12363 | /**
|
12364 | * Allows extraction of a minified key. Let's the build system minify keys
|
12365 | * without losing the ability to dynamically use key strings as values
|
12366 | * themselves. Pass in an object with a single key/val pair and it will return
|
12367 | * you the string key of that single record. Suppose you want to grab the
|
12368 | * value for a key 'className' inside of an object. Key/val minification may
|
12369 | * have aliased that key to be 'xa12'. keyOf({className: null}) will return
|
12370 | * 'xa12' in that case. Resolve keys you want to use once at startup time, then
|
12371 | * reuse those resolutions.
|
12372 | */
|
12373 | "use strict";
|
12374 |
|
12375 | var keyOf = function (oneKeyObj) {
|
12376 | var key;
|
12377 | for (key in oneKeyObj) {
|
12378 | if (!oneKeyObj.hasOwnProperty(key)) {
|
12379 | continue;
|
12380 | }
|
12381 | return key;
|
12382 | }
|
12383 | return null;
|
12384 | };
|
12385 |
|
12386 | module.exports = keyOf;
|
12387 |
|
12388 | /***/ }),
|
12389 | /* 165 */
|
12390 | /***/ (function(module, exports, __webpack_require__) {
|
12391 |
|
12392 | /**
|
12393 | * Copyright 2013-2015, Facebook, Inc.
|
12394 | * All rights reserved.
|
12395 | *
|
12396 | * This source code is licensed under the BSD-style license found in the
|
12397 | * LICENSE file in the root directory of this source tree. An additional grant
|
12398 | * of patent rights can be found in the PATENTS file in the same directory.
|
12399 | *
|
12400 | * @providesModule ChangeEventPlugin
|
12401 | */
|
12402 |
|
12403 | 'use strict';
|
12404 |
|
12405 | var EventConstants = __webpack_require__(115);
|
12406 | var EventPluginHub = __webpack_require__(116);
|
12407 | var EventPropagators = __webpack_require__(158);
|
12408 | var ExecutionEnvironment = __webpack_require__(94);
|
12409 | var ReactUpdates = __webpack_require__(139);
|
12410 | var SyntheticEvent = __webpack_require__(162);
|
12411 |
|
12412 | var getEventTarget = __webpack_require__(166);
|
12413 | var isEventSupported = __webpack_require__(125);
|
12414 | var isTextInputElement = __webpack_require__(167);
|
12415 | var keyOf = __webpack_require__(164);
|
12416 |
|
12417 | var topLevelTypes = EventConstants.topLevelTypes;
|
12418 |
|
12419 | var eventTypes = {
|
12420 | change: {
|
12421 | phasedRegistrationNames: {
|
12422 | bubbled: keyOf({ onChange: null }),
|
12423 | captured: keyOf({ onChangeCapture: null })
|
12424 | },
|
12425 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
|
12426 | }
|
12427 | };
|
12428 |
|
12429 | /**
|
12430 | * For IE shims
|
12431 | */
|
12432 | var activeElement = null;
|
12433 | var activeElementID = null;
|
12434 | var activeElementValue = null;
|
12435 | var activeElementValueProp = null;
|
12436 |
|
12437 | /**
|
12438 | * SECTION: handle `change` event
|
12439 | */
|
12440 | function shouldUseChangeEvent(elem) {
|
12441 | var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
|
12442 | return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
|
12443 | }
|
12444 |
|
12445 | var doesChangeEventBubble = false;
|
12446 | if (ExecutionEnvironment.canUseDOM) {
|
12447 | // See `handleChange` comment below
|
12448 | doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);
|
12449 | }
|
12450 |
|
12451 | function manualDispatchChangeEvent(nativeEvent) {
|
12452 | var event = SyntheticEvent.getPooled(eventTypes.change, activeElementID, nativeEvent, getEventTarget(nativeEvent));
|
12453 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
12454 |
|
12455 | // If change and propertychange bubbled, we'd just bind to it like all the
|
12456 | // other events and have it go through ReactBrowserEventEmitter. Since it
|
12457 | // doesn't, we manually listen for the events and so we have to enqueue and
|
12458 | // process the abstract event manually.
|
12459 | //
|
12460 | // Batching is necessary here in order to ensure that all event handlers run
|
12461 | // before the next rerender (including event handlers attached to ancestor
|
12462 | // elements instead of directly on the input). Without this, controlled
|
12463 | // components don't work properly in conjunction with event bubbling because
|
12464 | // the component is rerendered and the value reverted before all the event
|
12465 | // handlers can run. See https://github.com/facebook/react/issues/708.
|
12466 | ReactUpdates.batchedUpdates(runEventInBatch, event);
|
12467 | }
|
12468 |
|
12469 | function runEventInBatch(event) {
|
12470 | EventPluginHub.enqueueEvents(event);
|
12471 | EventPluginHub.processEventQueue(false);
|
12472 | }
|
12473 |
|
12474 | function startWatchingForChangeEventIE8(target, targetID) {
|
12475 | activeElement = target;
|
12476 | activeElementID = targetID;
|
12477 | activeElement.attachEvent('onchange', manualDispatchChangeEvent);
|
12478 | }
|
12479 |
|
12480 | function stopWatchingForChangeEventIE8() {
|
12481 | if (!activeElement) {
|
12482 | return;
|
12483 | }
|
12484 | activeElement.detachEvent('onchange', manualDispatchChangeEvent);
|
12485 | activeElement = null;
|
12486 | activeElementID = null;
|
12487 | }
|
12488 |
|
12489 | function getTargetIDForChangeEvent(topLevelType, topLevelTarget, topLevelTargetID) {
|
12490 | if (topLevelType === topLevelTypes.topChange) {
|
12491 | return topLevelTargetID;
|
12492 | }
|
12493 | }
|
12494 | function handleEventsForChangeEventIE8(topLevelType, topLevelTarget, topLevelTargetID) {
|
12495 | if (topLevelType === topLevelTypes.topFocus) {
|
12496 | // stopWatching() should be a noop here but we call it just in case we
|
12497 | // missed a blur event somehow.
|
12498 | stopWatchingForChangeEventIE8();
|
12499 | startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID);
|
12500 | } else if (topLevelType === topLevelTypes.topBlur) {
|
12501 | stopWatchingForChangeEventIE8();
|
12502 | }
|
12503 | }
|
12504 |
|
12505 | /**
|
12506 | * SECTION: handle `input` event
|
12507 | */
|
12508 | var isInputEventSupported = false;
|
12509 | if (ExecutionEnvironment.canUseDOM) {
|
12510 | // IE9 claims to support the input event but fails to trigger it when
|
12511 | // deleting text, so we ignore its input events
|
12512 | isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 9);
|
12513 | }
|
12514 |
|
12515 | /**
|
12516 | * (For old IE.) Replacement getter/setter for the `value` property that gets
|
12517 | * set on the active element.
|
12518 | */
|
12519 | var newValueProp = {
|
12520 | get: function () {
|
12521 | return activeElementValueProp.get.call(this);
|
12522 | },
|
12523 | set: function (val) {
|
12524 | // Cast to a string so we can do equality checks.
|
12525 | activeElementValue = '' + val;
|
12526 | activeElementValueProp.set.call(this, val);
|
12527 | }
|
12528 | };
|
12529 |
|
12530 | /**
|
12531 | * (For old IE.) Starts tracking propertychange events on the passed-in element
|
12532 | * and override the value property so that we can distinguish user events from
|
12533 | * value changes in JS.
|
12534 | */
|
12535 | function startWatchingForValueChange(target, targetID) {
|
12536 | activeElement = target;
|
12537 | activeElementID = targetID;
|
12538 | activeElementValue = target.value;
|
12539 | activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
|
12540 |
|
12541 | // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
|
12542 | // on DOM elements
|
12543 | Object.defineProperty(activeElement, 'value', newValueProp);
|
12544 | activeElement.attachEvent('onpropertychange', handlePropertyChange);
|
12545 | }
|
12546 |
|
12547 | /**
|
12548 | * (For old IE.) Removes the event listeners from the currently-tracked element,
|
12549 | * if any exists.
|
12550 | */
|
12551 | function stopWatchingForValueChange() {
|
12552 | if (!activeElement) {
|
12553 | return;
|
12554 | }
|
12555 |
|
12556 | // delete restores the original property definition
|
12557 | delete activeElement.value;
|
12558 | activeElement.detachEvent('onpropertychange', handlePropertyChange);
|
12559 |
|
12560 | activeElement = null;
|
12561 | activeElementID = null;
|
12562 | activeElementValue = null;
|
12563 | activeElementValueProp = null;
|
12564 | }
|
12565 |
|
12566 | /**
|
12567 | * (For old IE.) Handles a propertychange event, sending a `change` event if
|
12568 | * the value of the active element has changed.
|
12569 | */
|
12570 | function handlePropertyChange(nativeEvent) {
|
12571 | if (nativeEvent.propertyName !== 'value') {
|
12572 | return;
|
12573 | }
|
12574 | var value = nativeEvent.srcElement.value;
|
12575 | if (value === activeElementValue) {
|
12576 | return;
|
12577 | }
|
12578 | activeElementValue = value;
|
12579 |
|
12580 | manualDispatchChangeEvent(nativeEvent);
|
12581 | }
|
12582 |
|
12583 | /**
|
12584 | * If a `change` event should be fired, returns the target's ID.
|
12585 | */
|
12586 | function getTargetIDForInputEvent(topLevelType, topLevelTarget, topLevelTargetID) {
|
12587 | if (topLevelType === topLevelTypes.topInput) {
|
12588 | // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
|
12589 | // what we want so fall through here and trigger an abstract event
|
12590 | return topLevelTargetID;
|
12591 | }
|
12592 | }
|
12593 |
|
12594 | // For IE8 and IE9.
|
12595 | function handleEventsForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {
|
12596 | if (topLevelType === topLevelTypes.topFocus) {
|
12597 | // In IE8, we can capture almost all .value changes by adding a
|
12598 | // propertychange handler and looking for events with propertyName
|
12599 | // equal to 'value'
|
12600 | // In IE9, propertychange fires for most input events but is buggy and
|
12601 | // doesn't fire when text is deleted, but conveniently, selectionchange
|
12602 | // appears to fire in all of the remaining cases so we catch those and
|
12603 | // forward the event if the value has changed
|
12604 | // In either case, we don't want to call the event handler if the value
|
12605 | // is changed from JS so we redefine a setter for `.value` that updates
|
12606 | // our activeElementValue variable, allowing us to ignore those changes
|
12607 | //
|
12608 | // stopWatching() should be a noop here but we call it just in case we
|
12609 | // missed a blur event somehow.
|
12610 | stopWatchingForValueChange();
|
12611 | startWatchingForValueChange(topLevelTarget, topLevelTargetID);
|
12612 | } else if (topLevelType === topLevelTypes.topBlur) {
|
12613 | stopWatchingForValueChange();
|
12614 | }
|
12615 | }
|
12616 |
|
12617 | // For IE8 and IE9.
|
12618 | function getTargetIDForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {
|
12619 | if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
|
12620 | // On the selectionchange event, the target is just document which isn't
|
12621 | // helpful for us so just check activeElement instead.
|
12622 | //
|
12623 | // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
|
12624 | // propertychange on the first input event after setting `value` from a
|
12625 | // script and fires only keydown, keypress, keyup. Catching keyup usually
|
12626 | // gets it and catching keydown lets us fire an event for the first
|
12627 | // keystroke if user does a key repeat (it'll be a little delayed: right
|
12628 | // before the second keystroke). Other input methods (e.g., paste) seem to
|
12629 | // fire selectionchange normally.
|
12630 | if (activeElement && activeElement.value !== activeElementValue) {
|
12631 | activeElementValue = activeElement.value;
|
12632 | return activeElementID;
|
12633 | }
|
12634 | }
|
12635 | }
|
12636 |
|
12637 | /**
|
12638 | * SECTION: handle `click` event
|
12639 | */
|
12640 | function shouldUseClickEvent(elem) {
|
12641 | // Use the `click` event to detect changes to checkbox and radio inputs.
|
12642 | // This approach works across all browsers, whereas `change` does not fire
|
12643 | // until `blur` in IE8.
|
12644 | return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
|
12645 | }
|
12646 |
|
12647 | function getTargetIDForClickEvent(topLevelType, topLevelTarget, topLevelTargetID) {
|
12648 | if (topLevelType === topLevelTypes.topClick) {
|
12649 | return topLevelTargetID;
|
12650 | }
|
12651 | }
|
12652 |
|
12653 | /**
|
12654 | * This plugin creates an `onChange` event that normalizes change events
|
12655 | * across form elements. This event fires at a time when it's possible to
|
12656 | * change the element's value without seeing a flicker.
|
12657 | *
|
12658 | * Supported elements are:
|
12659 | * - input (see `isTextInputElement`)
|
12660 | * - textarea
|
12661 | * - select
|
12662 | */
|
12663 | var ChangeEventPlugin = {
|
12664 |
|
12665 | eventTypes: eventTypes,
|
12666 |
|
12667 | /**
|
12668 | * @param {string} topLevelType Record from `EventConstants`.
|
12669 | * @param {DOMEventTarget} topLevelTarget The listening component root node.
|
12670 | * @param {string} topLevelTargetID ID of `topLevelTarget`.
|
12671 | * @param {object} nativeEvent Native browser event.
|
12672 | * @return {*} An accumulation of synthetic events.
|
12673 | * @see {EventPluginHub.extractEvents}
|
12674 | */
|
12675 | extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
12676 |
|
12677 | var getTargetIDFunc, handleEventFunc;
|
12678 | if (shouldUseChangeEvent(topLevelTarget)) {
|
12679 | if (doesChangeEventBubble) {
|
12680 | getTargetIDFunc = getTargetIDForChangeEvent;
|
12681 | } else {
|
12682 | handleEventFunc = handleEventsForChangeEventIE8;
|
12683 | }
|
12684 | } else if (isTextInputElement(topLevelTarget)) {
|
12685 | if (isInputEventSupported) {
|
12686 | getTargetIDFunc = getTargetIDForInputEvent;
|
12687 | } else {
|
12688 | getTargetIDFunc = getTargetIDForInputEventIE;
|
12689 | handleEventFunc = handleEventsForInputEventIE;
|
12690 | }
|
12691 | } else if (shouldUseClickEvent(topLevelTarget)) {
|
12692 | getTargetIDFunc = getTargetIDForClickEvent;
|
12693 | }
|
12694 |
|
12695 | if (getTargetIDFunc) {
|
12696 | var targetID = getTargetIDFunc(topLevelType, topLevelTarget, topLevelTargetID);
|
12697 | if (targetID) {
|
12698 | var event = SyntheticEvent.getPooled(eventTypes.change, targetID, nativeEvent, nativeEventTarget);
|
12699 | event.type = 'change';
|
12700 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
12701 | return event;
|
12702 | }
|
12703 | }
|
12704 |
|
12705 | if (handleEventFunc) {
|
12706 | handleEventFunc(topLevelType, topLevelTarget, topLevelTargetID);
|
12707 | }
|
12708 | }
|
12709 |
|
12710 | };
|
12711 |
|
12712 | module.exports = ChangeEventPlugin;
|
12713 |
|
12714 | /***/ }),
|
12715 | /* 166 */
|
12716 | /***/ (function(module, exports) {
|
12717 |
|
12718 | /**
|
12719 | * Copyright 2013-2015, Facebook, Inc.
|
12720 | * All rights reserved.
|
12721 | *
|
12722 | * This source code is licensed under the BSD-style license found in the
|
12723 | * LICENSE file in the root directory of this source tree. An additional grant
|
12724 | * of patent rights can be found in the PATENTS file in the same directory.
|
12725 | *
|
12726 | * @providesModule getEventTarget
|
12727 | * @typechecks static-only
|
12728 | */
|
12729 |
|
12730 | 'use strict';
|
12731 |
|
12732 | /**
|
12733 | * Gets the target node from a native browser event by accounting for
|
12734 | * inconsistencies in browser DOM APIs.
|
12735 | *
|
12736 | * @param {object} nativeEvent Native browser event.
|
12737 | * @return {DOMEventTarget} Target node.
|
12738 | */
|
12739 | function getEventTarget(nativeEvent) {
|
12740 | var target = nativeEvent.target || nativeEvent.srcElement || window;
|
12741 | // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
|
12742 | // @see http://www.quirksmode.org/js/events_properties.html
|
12743 | return target.nodeType === 3 ? target.parentNode : target;
|
12744 | }
|
12745 |
|
12746 | module.exports = getEventTarget;
|
12747 |
|
12748 | /***/ }),
|
12749 | /* 167 */
|
12750 | /***/ (function(module, exports) {
|
12751 |
|
12752 | /**
|
12753 | * Copyright 2013-2015, Facebook, Inc.
|
12754 | * All rights reserved.
|
12755 | *
|
12756 | * This source code is licensed under the BSD-style license found in the
|
12757 | * LICENSE file in the root directory of this source tree. An additional grant
|
12758 | * of patent rights can be found in the PATENTS file in the same directory.
|
12759 | *
|
12760 | * @providesModule isTextInputElement
|
12761 | */
|
12762 |
|
12763 | 'use strict';
|
12764 |
|
12765 | /**
|
12766 | * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
|
12767 | */
|
12768 | var supportedInputTypes = {
|
12769 | 'color': true,
|
12770 | 'date': true,
|
12771 | 'datetime': true,
|
12772 | 'datetime-local': true,
|
12773 | 'email': true,
|
12774 | 'month': true,
|
12775 | 'number': true,
|
12776 | 'password': true,
|
12777 | 'range': true,
|
12778 | 'search': true,
|
12779 | 'tel': true,
|
12780 | 'text': true,
|
12781 | 'time': true,
|
12782 | 'url': true,
|
12783 | 'week': true
|
12784 | };
|
12785 |
|
12786 | function isTextInputElement(elem) {
|
12787 | var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
12788 | return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');
|
12789 | }
|
12790 |
|
12791 | module.exports = isTextInputElement;
|
12792 |
|
12793 | /***/ }),
|
12794 | /* 168 */
|
12795 | /***/ (function(module, exports) {
|
12796 |
|
12797 | /**
|
12798 | * Copyright 2013-2015, Facebook, Inc.
|
12799 | * All rights reserved.
|
12800 | *
|
12801 | * This source code is licensed under the BSD-style license found in the
|
12802 | * LICENSE file in the root directory of this source tree. An additional grant
|
12803 | * of patent rights can be found in the PATENTS file in the same directory.
|
12804 | *
|
12805 | * @providesModule ClientReactRootIndex
|
12806 | * @typechecks
|
12807 | */
|
12808 |
|
12809 | 'use strict';
|
12810 |
|
12811 | var nextReactRootIndex = 0;
|
12812 |
|
12813 | var ClientReactRootIndex = {
|
12814 | createReactRootIndex: function () {
|
12815 | return nextReactRootIndex++;
|
12816 | }
|
12817 | };
|
12818 |
|
12819 | module.exports = ClientReactRootIndex;
|
12820 |
|
12821 | /***/ }),
|
12822 | /* 169 */
|
12823 | /***/ (function(module, exports, __webpack_require__) {
|
12824 |
|
12825 | /**
|
12826 | * Copyright 2013-2015, Facebook, Inc.
|
12827 | * All rights reserved.
|
12828 | *
|
12829 | * This source code is licensed under the BSD-style license found in the
|
12830 | * LICENSE file in the root directory of this source tree. An additional grant
|
12831 | * of patent rights can be found in the PATENTS file in the same directory.
|
12832 | *
|
12833 | * @providesModule DefaultEventPluginOrder
|
12834 | */
|
12835 |
|
12836 | 'use strict';
|
12837 |
|
12838 | var keyOf = __webpack_require__(164);
|
12839 |
|
12840 | /**
|
12841 | * Module that is injectable into `EventPluginHub`, that specifies a
|
12842 | * deterministic ordering of `EventPlugin`s. A convenient way to reason about
|
12843 | * plugins, without having to package every one of them. This is better than
|
12844 | * having plugins be ordered in the same order that they are injected because
|
12845 | * that ordering would be influenced by the packaging order.
|
12846 | * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
|
12847 | * preventing default on events is convenient in `SimpleEventPlugin` handlers.
|
12848 | */
|
12849 | var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
|
12850 |
|
12851 | module.exports = DefaultEventPluginOrder;
|
12852 |
|
12853 | /***/ }),
|
12854 | /* 170 */
|
12855 | /***/ (function(module, exports, __webpack_require__) {
|
12856 |
|
12857 | /**
|
12858 | * Copyright 2013-2015, Facebook, Inc.
|
12859 | * All rights reserved.
|
12860 | *
|
12861 | * This source code is licensed under the BSD-style license found in the
|
12862 | * LICENSE file in the root directory of this source tree. An additional grant
|
12863 | * of patent rights can be found in the PATENTS file in the same directory.
|
12864 | *
|
12865 | * @providesModule EnterLeaveEventPlugin
|
12866 | * @typechecks static-only
|
12867 | */
|
12868 |
|
12869 | 'use strict';
|
12870 |
|
12871 | var EventConstants = __webpack_require__(115);
|
12872 | var EventPropagators = __webpack_require__(158);
|
12873 | var SyntheticMouseEvent = __webpack_require__(171);
|
12874 |
|
12875 | var ReactMount = __webpack_require__(113);
|
12876 | var keyOf = __webpack_require__(164);
|
12877 |
|
12878 | var topLevelTypes = EventConstants.topLevelTypes;
|
12879 | var getFirstReactDOM = ReactMount.getFirstReactDOM;
|
12880 |
|
12881 | var eventTypes = {
|
12882 | mouseEnter: {
|
12883 | registrationName: keyOf({ onMouseEnter: null }),
|
12884 | dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
|
12885 | },
|
12886 | mouseLeave: {
|
12887 | registrationName: keyOf({ onMouseLeave: null }),
|
12888 | dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
|
12889 | }
|
12890 | };
|
12891 |
|
12892 | var extractedEvents = [null, null];
|
12893 |
|
12894 | var EnterLeaveEventPlugin = {
|
12895 |
|
12896 | eventTypes: eventTypes,
|
12897 |
|
12898 | /**
|
12899 | * For almost every interaction we care about, there will be both a top-level
|
12900 | * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
|
12901 | * we do not extract duplicate events. However, moving the mouse into the
|
12902 | * browser from outside will not fire a `mouseout` event. In this case, we use
|
12903 | * the `mouseover` top-level event.
|
12904 | *
|
12905 | * @param {string} topLevelType Record from `EventConstants`.
|
12906 | * @param {DOMEventTarget} topLevelTarget The listening component root node.
|
12907 | * @param {string} topLevelTargetID ID of `topLevelTarget`.
|
12908 | * @param {object} nativeEvent Native browser event.
|
12909 | * @return {*} An accumulation of synthetic events.
|
12910 | * @see {EventPluginHub.extractEvents}
|
12911 | */
|
12912 | extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
12913 | if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
|
12914 | return null;
|
12915 | }
|
12916 | if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
|
12917 | // Must not be a mouse in or mouse out - ignoring.
|
12918 | return null;
|
12919 | }
|
12920 |
|
12921 | var win;
|
12922 | if (topLevelTarget.window === topLevelTarget) {
|
12923 | // `topLevelTarget` is probably a window object.
|
12924 | win = topLevelTarget;
|
12925 | } else {
|
12926 | // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
|
12927 | var doc = topLevelTarget.ownerDocument;
|
12928 | if (doc) {
|
12929 | win = doc.defaultView || doc.parentWindow;
|
12930 | } else {
|
12931 | win = window;
|
12932 | }
|
12933 | }
|
12934 |
|
12935 | var from;
|
12936 | var to;
|
12937 | var fromID = '';
|
12938 | var toID = '';
|
12939 | if (topLevelType === topLevelTypes.topMouseOut) {
|
12940 | from = topLevelTarget;
|
12941 | fromID = topLevelTargetID;
|
12942 | to = getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement);
|
12943 | if (to) {
|
12944 | toID = ReactMount.getID(to);
|
12945 | } else {
|
12946 | to = win;
|
12947 | }
|
12948 | to = to || win;
|
12949 | } else {
|
12950 | from = win;
|
12951 | to = topLevelTarget;
|
12952 | toID = topLevelTargetID;
|
12953 | }
|
12954 |
|
12955 | if (from === to) {
|
12956 | // Nothing pertains to our managed components.
|
12957 | return null;
|
12958 | }
|
12959 |
|
12960 | var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, fromID, nativeEvent, nativeEventTarget);
|
12961 | leave.type = 'mouseleave';
|
12962 | leave.target = from;
|
12963 | leave.relatedTarget = to;
|
12964 |
|
12965 | var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, toID, nativeEvent, nativeEventTarget);
|
12966 | enter.type = 'mouseenter';
|
12967 | enter.target = to;
|
12968 | enter.relatedTarget = from;
|
12969 |
|
12970 | EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID);
|
12971 |
|
12972 | extractedEvents[0] = leave;
|
12973 | extractedEvents[1] = enter;
|
12974 |
|
12975 | return extractedEvents;
|
12976 | }
|
12977 |
|
12978 | };
|
12979 |
|
12980 | module.exports = EnterLeaveEventPlugin;
|
12981 |
|
12982 | /***/ }),
|
12983 | /* 171 */
|
12984 | /***/ (function(module, exports, __webpack_require__) {
|
12985 |
|
12986 | /**
|
12987 | * Copyright 2013-2015, Facebook, Inc.
|
12988 | * All rights reserved.
|
12989 | *
|
12990 | * This source code is licensed under the BSD-style license found in the
|
12991 | * LICENSE file in the root directory of this source tree. An additional grant
|
12992 | * of patent rights can be found in the PATENTS file in the same directory.
|
12993 | *
|
12994 | * @providesModule SyntheticMouseEvent
|
12995 | * @typechecks static-only
|
12996 | */
|
12997 |
|
12998 | 'use strict';
|
12999 |
|
13000 | var SyntheticUIEvent = __webpack_require__(172);
|
13001 | var ViewportMetrics = __webpack_require__(123);
|
13002 |
|
13003 | var getEventModifierState = __webpack_require__(173);
|
13004 |
|
13005 | /**
|
13006 | * @interface MouseEvent
|
13007 | * @see http://www.w3.org/TR/DOM-Level-3-Events/
|
13008 | */
|
13009 | var MouseEventInterface = {
|
13010 | screenX: null,
|
13011 | screenY: null,
|
13012 | clientX: null,
|
13013 | clientY: null,
|
13014 | ctrlKey: null,
|
13015 | shiftKey: null,
|
13016 | altKey: null,
|
13017 | metaKey: null,
|
13018 | getModifierState: getEventModifierState,
|
13019 | button: function (event) {
|
13020 | // Webkit, Firefox, IE9+
|
13021 | // which: 1 2 3
|
13022 | // button: 0 1 2 (standard)
|
13023 | var button = event.button;
|
13024 | if ('which' in event) {
|
13025 | return button;
|
13026 | }
|
13027 | // IE<9
|
13028 | // which: undefined
|
13029 | // button: 0 0 0
|
13030 | // button: 1 4 2 (onmouseup)
|
13031 | return button === 2 ? 2 : button === 4 ? 1 : 0;
|
13032 | },
|
13033 | buttons: null,
|
13034 | relatedTarget: function (event) {
|
13035 | return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
|
13036 | },
|
13037 | // "Proprietary" Interface.
|
13038 | pageX: function (event) {
|
13039 | return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
|
13040 | },
|
13041 | pageY: function (event) {
|
13042 | return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
|
13043 | }
|
13044 | };
|
13045 |
|
13046 | /**
|
13047 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
13048 | * @param {string} dispatchMarker Marker identifying the event target.
|
13049 | * @param {object} nativeEvent Native browser event.
|
13050 | * @extends {SyntheticUIEvent}
|
13051 | */
|
13052 | function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
13053 | SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
13054 | }
|
13055 |
|
13056 | SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
|
13057 |
|
13058 | module.exports = SyntheticMouseEvent;
|
13059 |
|
13060 | /***/ }),
|
13061 | /* 172 */
|
13062 | /***/ (function(module, exports, __webpack_require__) {
|
13063 |
|
13064 | /**
|
13065 | * Copyright 2013-2015, Facebook, Inc.
|
13066 | * All rights reserved.
|
13067 | *
|
13068 | * This source code is licensed under the BSD-style license found in the
|
13069 | * LICENSE file in the root directory of this source tree. An additional grant
|
13070 | * of patent rights can be found in the PATENTS file in the same directory.
|
13071 | *
|
13072 | * @providesModule SyntheticUIEvent
|
13073 | * @typechecks static-only
|
13074 | */
|
13075 |
|
13076 | 'use strict';
|
13077 |
|
13078 | var SyntheticEvent = __webpack_require__(162);
|
13079 |
|
13080 | var getEventTarget = __webpack_require__(166);
|
13081 |
|
13082 | /**
|
13083 | * @interface UIEvent
|
13084 | * @see http://www.w3.org/TR/DOM-Level-3-Events/
|
13085 | */
|
13086 | var UIEventInterface = {
|
13087 | view: function (event) {
|
13088 | if (event.view) {
|
13089 | return event.view;
|
13090 | }
|
13091 |
|
13092 | var target = getEventTarget(event);
|
13093 | if (target != null && target.window === target) {
|
13094 | // target is a window object
|
13095 | return target;
|
13096 | }
|
13097 |
|
13098 | var doc = target.ownerDocument;
|
13099 | // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
|
13100 | if (doc) {
|
13101 | return doc.defaultView || doc.parentWindow;
|
13102 | } else {
|
13103 | return window;
|
13104 | }
|
13105 | },
|
13106 | detail: function (event) {
|
13107 | return event.detail || 0;
|
13108 | }
|
13109 | };
|
13110 |
|
13111 | /**
|
13112 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
13113 | * @param {string} dispatchMarker Marker identifying the event target.
|
13114 | * @param {object} nativeEvent Native browser event.
|
13115 | * @extends {SyntheticEvent}
|
13116 | */
|
13117 | function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
13118 | SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
13119 | }
|
13120 |
|
13121 | SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
|
13122 |
|
13123 | module.exports = SyntheticUIEvent;
|
13124 |
|
13125 | /***/ }),
|
13126 | /* 173 */
|
13127 | /***/ (function(module, exports) {
|
13128 |
|
13129 | /**
|
13130 | * Copyright 2013-2015, Facebook, Inc.
|
13131 | * All rights reserved.
|
13132 | *
|
13133 | * This source code is licensed under the BSD-style license found in the
|
13134 | * LICENSE file in the root directory of this source tree. An additional grant
|
13135 | * of patent rights can be found in the PATENTS file in the same directory.
|
13136 | *
|
13137 | * @providesModule getEventModifierState
|
13138 | * @typechecks static-only
|
13139 | */
|
13140 |
|
13141 | 'use strict';
|
13142 |
|
13143 | /**
|
13144 | * Translation from modifier key to the associated property in the event.
|
13145 | * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
|
13146 | */
|
13147 |
|
13148 | var modifierKeyToProp = {
|
13149 | 'Alt': 'altKey',
|
13150 | 'Control': 'ctrlKey',
|
13151 | 'Meta': 'metaKey',
|
13152 | 'Shift': 'shiftKey'
|
13153 | };
|
13154 |
|
13155 | // IE8 does not implement getModifierState so we simply map it to the only
|
13156 | // modifier keys exposed by the event itself, does not support Lock-keys.
|
13157 | // Currently, all major browsers except Chrome seems to support Lock-keys.
|
13158 | function modifierStateGetter(keyArg) {
|
13159 | var syntheticEvent = this;
|
13160 | var nativeEvent = syntheticEvent.nativeEvent;
|
13161 | if (nativeEvent.getModifierState) {
|
13162 | return nativeEvent.getModifierState(keyArg);
|
13163 | }
|
13164 | var keyProp = modifierKeyToProp[keyArg];
|
13165 | return keyProp ? !!nativeEvent[keyProp] : false;
|
13166 | }
|
13167 |
|
13168 | function getEventModifierState(nativeEvent) {
|
13169 | return modifierStateGetter;
|
13170 | }
|
13171 |
|
13172 | module.exports = getEventModifierState;
|
13173 |
|
13174 | /***/ }),
|
13175 | /* 174 */
|
13176 | /***/ (function(module, exports, __webpack_require__) {
|
13177 |
|
13178 | /**
|
13179 | * Copyright 2013-2015, Facebook, Inc.
|
13180 | * All rights reserved.
|
13181 | *
|
13182 | * This source code is licensed under the BSD-style license found in the
|
13183 | * LICENSE file in the root directory of this source tree. An additional grant
|
13184 | * of patent rights can be found in the PATENTS file in the same directory.
|
13185 | *
|
13186 | * @providesModule HTMLDOMPropertyConfig
|
13187 | */
|
13188 |
|
13189 | 'use strict';
|
13190 |
|
13191 | var DOMProperty = __webpack_require__(108);
|
13192 | var ExecutionEnvironment = __webpack_require__(94);
|
13193 |
|
13194 | var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
|
13195 | var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
|
13196 | var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
|
13197 | var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
|
13198 | var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
|
13199 | var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
|
13200 | var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
|
13201 |
|
13202 | var hasSVG;
|
13203 | if (ExecutionEnvironment.canUseDOM) {
|
13204 | var implementation = document.implementation;
|
13205 | hasSVG = implementation && implementation.hasFeature && implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1');
|
13206 | }
|
13207 |
|
13208 | var HTMLDOMPropertyConfig = {
|
13209 | isCustomAttribute: RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),
|
13210 | Properties: {
|
13211 | /**
|
13212 | * Standard Properties
|
13213 | */
|
13214 | accept: null,
|
13215 | acceptCharset: null,
|
13216 | accessKey: null,
|
13217 | action: null,
|
13218 | allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
13219 | allowTransparency: MUST_USE_ATTRIBUTE,
|
13220 | alt: null,
|
13221 | async: HAS_BOOLEAN_VALUE,
|
13222 | autoComplete: null,
|
13223 | // autoFocus is polyfilled/normalized by AutoFocusUtils
|
13224 | // autoFocus: HAS_BOOLEAN_VALUE,
|
13225 | autoPlay: HAS_BOOLEAN_VALUE,
|
13226 | capture: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
13227 | cellPadding: null,
|
13228 | cellSpacing: null,
|
13229 | charSet: MUST_USE_ATTRIBUTE,
|
13230 | challenge: MUST_USE_ATTRIBUTE,
|
13231 | checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
13232 | classID: MUST_USE_ATTRIBUTE,
|
13233 | // To set className on SVG elements, it's necessary to use .setAttribute;
|
13234 | // this works on HTML elements too in all browsers except IE8. Conveniently,
|
13235 | // IE8 doesn't support SVG and so we can simply use the attribute in
|
13236 | // browsers that support SVG and the property in browsers that don't,
|
13237 | // regardless of whether the element is HTML or SVG.
|
13238 | className: hasSVG ? MUST_USE_ATTRIBUTE : MUST_USE_PROPERTY,
|
13239 | cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
|
13240 | colSpan: null,
|
13241 | content: null,
|
13242 | contentEditable: null,
|
13243 | contextMenu: MUST_USE_ATTRIBUTE,
|
13244 | controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
13245 | coords: null,
|
13246 | crossOrigin: null,
|
13247 | data: null, // For `<object />` acts as `src`.
|
13248 | dateTime: MUST_USE_ATTRIBUTE,
|
13249 | 'default': HAS_BOOLEAN_VALUE,
|
13250 | defer: HAS_BOOLEAN_VALUE,
|
13251 | dir: null,
|
13252 | disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
13253 | download: HAS_OVERLOADED_BOOLEAN_VALUE,
|
13254 | draggable: null,
|
13255 | encType: null,
|
13256 | form: MUST_USE_ATTRIBUTE,
|
13257 | formAction: MUST_USE_ATTRIBUTE,
|
13258 | formEncType: MUST_USE_ATTRIBUTE,
|
13259 | formMethod: MUST_USE_ATTRIBUTE,
|
13260 | formNoValidate: HAS_BOOLEAN_VALUE,
|
13261 | formTarget: MUST_USE_ATTRIBUTE,
|
13262 | frameBorder: MUST_USE_ATTRIBUTE,
|
13263 | headers: null,
|
13264 | height: MUST_USE_ATTRIBUTE,
|
13265 | hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
13266 | high: null,
|
13267 | href: null,
|
13268 | hrefLang: null,
|
13269 | htmlFor: null,
|
13270 | httpEquiv: null,
|
13271 | icon: null,
|
13272 | id: MUST_USE_PROPERTY,
|
13273 | inputMode: MUST_USE_ATTRIBUTE,
|
13274 | integrity: null,
|
13275 | is: MUST_USE_ATTRIBUTE,
|
13276 | keyParams: MUST_USE_ATTRIBUTE,
|
13277 | keyType: MUST_USE_ATTRIBUTE,
|
13278 | kind: null,
|
13279 | label: null,
|
13280 | lang: null,
|
13281 | list: MUST_USE_ATTRIBUTE,
|
13282 | loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
13283 | low: null,
|
13284 | manifest: MUST_USE_ATTRIBUTE,
|
13285 | marginHeight: null,
|
13286 | marginWidth: null,
|
13287 | max: null,
|
13288 | maxLength: MUST_USE_ATTRIBUTE,
|
13289 | media: MUST_USE_ATTRIBUTE,
|
13290 | mediaGroup: null,
|
13291 | method: null,
|
13292 | min: null,
|
13293 | minLength: MUST_USE_ATTRIBUTE,
|
13294 | multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
13295 | muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
13296 | name: null,
|
13297 | nonce: MUST_USE_ATTRIBUTE,
|
13298 | noValidate: HAS_BOOLEAN_VALUE,
|
13299 | open: HAS_BOOLEAN_VALUE,
|
13300 | optimum: null,
|
13301 | pattern: null,
|
13302 | placeholder: null,
|
13303 | poster: null,
|
13304 | preload: null,
|
13305 | radioGroup: null,
|
13306 | readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
13307 | rel: null,
|
13308 | required: HAS_BOOLEAN_VALUE,
|
13309 | reversed: HAS_BOOLEAN_VALUE,
|
13310 | role: MUST_USE_ATTRIBUTE,
|
13311 | rows: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
|
13312 | rowSpan: null,
|
13313 | sandbox: null,
|
13314 | scope: null,
|
13315 | scoped: HAS_BOOLEAN_VALUE,
|
13316 | scrolling: null,
|
13317 | seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
13318 | selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
13319 | shape: null,
|
13320 | size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
|
13321 | sizes: MUST_USE_ATTRIBUTE,
|
13322 | span: HAS_POSITIVE_NUMERIC_VALUE,
|
13323 | spellCheck: null,
|
13324 | src: null,
|
13325 | srcDoc: MUST_USE_PROPERTY,
|
13326 | srcLang: null,
|
13327 | srcSet: MUST_USE_ATTRIBUTE,
|
13328 | start: HAS_NUMERIC_VALUE,
|
13329 | step: null,
|
13330 | style: null,
|
13331 | summary: null,
|
13332 | tabIndex: null,
|
13333 | target: null,
|
13334 | title: null,
|
13335 | type: null,
|
13336 | useMap: null,
|
13337 | value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
|
13338 | width: MUST_USE_ATTRIBUTE,
|
13339 | wmode: MUST_USE_ATTRIBUTE,
|
13340 | wrap: null,
|
13341 |
|
13342 | /**
|
13343 | * RDFa Properties
|
13344 | */
|
13345 | about: MUST_USE_ATTRIBUTE,
|
13346 | datatype: MUST_USE_ATTRIBUTE,
|
13347 | inlist: MUST_USE_ATTRIBUTE,
|
13348 | prefix: MUST_USE_ATTRIBUTE,
|
13349 | // property is also supported for OpenGraph in meta tags.
|
13350 | property: MUST_USE_ATTRIBUTE,
|
13351 | resource: MUST_USE_ATTRIBUTE,
|
13352 | 'typeof': MUST_USE_ATTRIBUTE,
|
13353 | vocab: MUST_USE_ATTRIBUTE,
|
13354 |
|
13355 | /**
|
13356 | * Non-standard Properties
|
13357 | */
|
13358 | // autoCapitalize and autoCorrect are supported in Mobile Safari for
|
13359 | // keyboard hints.
|
13360 | autoCapitalize: MUST_USE_ATTRIBUTE,
|
13361 | autoCorrect: MUST_USE_ATTRIBUTE,
|
13362 | // autoSave allows WebKit/Blink to persist values of input fields on page reloads
|
13363 | autoSave: null,
|
13364 | // color is for Safari mask-icon link
|
13365 | color: null,
|
13366 | // itemProp, itemScope, itemType are for
|
13367 | // Microdata support. See http://schema.org/docs/gs.html
|
13368 | itemProp: MUST_USE_ATTRIBUTE,
|
13369 | itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
13370 | itemType: MUST_USE_ATTRIBUTE,
|
13371 | // itemID and itemRef are for Microdata support as well but
|
13372 | // only specified in the the WHATWG spec document. See
|
13373 | // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
|
13374 | itemID: MUST_USE_ATTRIBUTE,
|
13375 | itemRef: MUST_USE_ATTRIBUTE,
|
13376 | // results show looking glass icon and recent searches on input
|
13377 | // search fields in WebKit/Blink
|
13378 | results: null,
|
13379 | // IE-only attribute that specifies security restrictions on an iframe
|
13380 | // as an alternative to the sandbox attribute on IE<10
|
13381 | security: MUST_USE_ATTRIBUTE,
|
13382 | // IE-only attribute that controls focus behavior
|
13383 | unselectable: MUST_USE_ATTRIBUTE
|
13384 | },
|
13385 | DOMAttributeNames: {
|
13386 | acceptCharset: 'accept-charset',
|
13387 | className: 'class',
|
13388 | htmlFor: 'for',
|
13389 | httpEquiv: 'http-equiv'
|
13390 | },
|
13391 | DOMPropertyNames: {
|
13392 | autoComplete: 'autocomplete',
|
13393 | autoFocus: 'autofocus',
|
13394 | autoPlay: 'autoplay',
|
13395 | autoSave: 'autosave',
|
13396 | // `encoding` is equivalent to `enctype`, IE8 lacks an `enctype` setter.
|
13397 | // http://www.w3.org/TR/html5/forms.html#dom-fs-encoding
|
13398 | encType: 'encoding',
|
13399 | hrefLang: 'hreflang',
|
13400 | radioGroup: 'radiogroup',
|
13401 | spellCheck: 'spellcheck',
|
13402 | srcDoc: 'srcdoc',
|
13403 | srcSet: 'srcset'
|
13404 | }
|
13405 | };
|
13406 |
|
13407 | module.exports = HTMLDOMPropertyConfig;
|
13408 |
|
13409 | /***/ }),
|
13410 | /* 175 */
|
13411 | /***/ (function(module, exports, __webpack_require__) {
|
13412 |
|
13413 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
13414 | * Copyright 2013-2015, Facebook, Inc.
|
13415 | * All rights reserved.
|
13416 | *
|
13417 | * This source code is licensed under the BSD-style license found in the
|
13418 | * LICENSE file in the root directory of this source tree. An additional grant
|
13419 | * of patent rights can be found in the PATENTS file in the same directory.
|
13420 | *
|
13421 | * @providesModule ReactBrowserComponentMixin
|
13422 | */
|
13423 |
|
13424 | 'use strict';
|
13425 |
|
13426 | var ReactInstanceMap = __webpack_require__(132);
|
13427 |
|
13428 | var findDOMNode = __webpack_require__(176);
|
13429 | var warning = __webpack_require__(110);
|
13430 |
|
13431 | var didWarnKey = '_getDOMNodeDidWarn';
|
13432 |
|
13433 | var ReactBrowserComponentMixin = {
|
13434 | /**
|
13435 | * Returns the DOM node rendered by this component.
|
13436 | *
|
13437 | * @return {DOMElement} The root node of this component.
|
13438 | * @final
|
13439 | * @protected
|
13440 | */
|
13441 | getDOMNode: function () {
|
13442 | process.env.NODE_ENV !== 'production' ? warning(this.constructor[didWarnKey], '%s.getDOMNode(...) is deprecated. Please use ' + 'ReactDOM.findDOMNode(instance) instead.', ReactInstanceMap.get(this).getName() || this.tagName || 'Unknown') : undefined;
|
13443 | this.constructor[didWarnKey] = true;
|
13444 | return findDOMNode(this);
|
13445 | }
|
13446 | };
|
13447 |
|
13448 | module.exports = ReactBrowserComponentMixin;
|
13449 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
13450 |
|
13451 | /***/ }),
|
13452 | /* 176 */
|
13453 | /***/ (function(module, exports, __webpack_require__) {
|
13454 |
|
13455 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
13456 | * Copyright 2013-2015, Facebook, Inc.
|
13457 | * All rights reserved.
|
13458 | *
|
13459 | * This source code is licensed under the BSD-style license found in the
|
13460 | * LICENSE file in the root directory of this source tree. An additional grant
|
13461 | * of patent rights can be found in the PATENTS file in the same directory.
|
13462 | *
|
13463 | * @providesModule findDOMNode
|
13464 | * @typechecks static-only
|
13465 | */
|
13466 |
|
13467 | 'use strict';
|
13468 |
|
13469 | var ReactCurrentOwner = __webpack_require__(90);
|
13470 | var ReactInstanceMap = __webpack_require__(132);
|
13471 | var ReactMount = __webpack_require__(113);
|
13472 |
|
13473 | var invariant = __webpack_require__(98);
|
13474 | var warning = __webpack_require__(110);
|
13475 |
|
13476 | /**
|
13477 | * Returns the DOM node rendered by this element.
|
13478 | *
|
13479 | * @param {ReactComponent|DOMElement} componentOrElement
|
13480 | * @return {?DOMElement} The root node of this element.
|
13481 | */
|
13482 | function findDOMNode(componentOrElement) {
|
13483 | if (process.env.NODE_ENV !== 'production') {
|
13484 | var owner = ReactCurrentOwner.current;
|
13485 | if (owner !== null) {
|
13486 | process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing getDOMNode or findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : undefined;
|
13487 | owner._warnedAboutRefsInRender = true;
|
13488 | }
|
13489 | }
|
13490 | if (componentOrElement == null) {
|
13491 | return null;
|
13492 | }
|
13493 | if (componentOrElement.nodeType === 1) {
|
13494 | return componentOrElement;
|
13495 | }
|
13496 | if (ReactInstanceMap.has(componentOrElement)) {
|
13497 | return ReactMount.getNodeFromInstance(componentOrElement);
|
13498 | }
|
13499 | !(componentOrElement.render == null || typeof componentOrElement.render !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : undefined;
|
13500 | true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : undefined;
|
13501 | }
|
13502 |
|
13503 | module.exports = findDOMNode;
|
13504 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
13505 |
|
13506 | /***/ }),
|
13507 | /* 177 */
|
13508 | /***/ (function(module, exports, __webpack_require__) {
|
13509 |
|
13510 | /**
|
13511 | * Copyright 2013-2015, Facebook, Inc.
|
13512 | * All rights reserved.
|
13513 | *
|
13514 | * This source code is licensed under the BSD-style license found in the
|
13515 | * LICENSE file in the root directory of this source tree. An additional grant
|
13516 | * of patent rights can be found in the PATENTS file in the same directory.
|
13517 | *
|
13518 | * @providesModule ReactDefaultBatchingStrategy
|
13519 | */
|
13520 |
|
13521 | 'use strict';
|
13522 |
|
13523 | var ReactUpdates = __webpack_require__(139);
|
13524 | var Transaction = __webpack_require__(142);
|
13525 |
|
13526 | var assign = __webpack_require__(124);
|
13527 | var emptyFunction = __webpack_require__(100);
|
13528 |
|
13529 | var RESET_BATCHED_UPDATES = {
|
13530 | initialize: emptyFunction,
|
13531 | close: function () {
|
13532 | ReactDefaultBatchingStrategy.isBatchingUpdates = false;
|
13533 | }
|
13534 | };
|
13535 |
|
13536 | var FLUSH_BATCHED_UPDATES = {
|
13537 | initialize: emptyFunction,
|
13538 | close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
|
13539 | };
|
13540 |
|
13541 | var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
|
13542 |
|
13543 | function ReactDefaultBatchingStrategyTransaction() {
|
13544 | this.reinitializeTransaction();
|
13545 | }
|
13546 |
|
13547 | assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
|
13548 | getTransactionWrappers: function () {
|
13549 | return TRANSACTION_WRAPPERS;
|
13550 | }
|
13551 | });
|
13552 |
|
13553 | var transaction = new ReactDefaultBatchingStrategyTransaction();
|
13554 |
|
13555 | var ReactDefaultBatchingStrategy = {
|
13556 | isBatchingUpdates: false,
|
13557 |
|
13558 | /**
|
13559 | * Call the provided function in a context within which calls to `setState`
|
13560 | * and friends are batched such that components aren't updated unnecessarily.
|
13561 | */
|
13562 | batchedUpdates: function (callback, a, b, c, d, e) {
|
13563 | var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
|
13564 |
|
13565 | ReactDefaultBatchingStrategy.isBatchingUpdates = true;
|
13566 |
|
13567 | // The code is written this way to avoid extra allocations
|
13568 | if (alreadyBatchingUpdates) {
|
13569 | callback(a, b, c, d, e);
|
13570 | } else {
|
13571 | transaction.perform(callback, null, a, b, c, d, e);
|
13572 | }
|
13573 | }
|
13574 | };
|
13575 |
|
13576 | module.exports = ReactDefaultBatchingStrategy;
|
13577 |
|
13578 | /***/ }),
|
13579 | /* 178 */
|
13580 | /***/ (function(module, exports, __webpack_require__) {
|
13581 |
|
13582 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
13583 | * Copyright 2013-2015, Facebook, Inc.
|
13584 | * All rights reserved.
|
13585 | *
|
13586 | * This source code is licensed under the BSD-style license found in the
|
13587 | * LICENSE file in the root directory of this source tree. An additional grant
|
13588 | * of patent rights can be found in the PATENTS file in the same directory.
|
13589 | *
|
13590 | * @providesModule ReactDOMComponent
|
13591 | * @typechecks static-only
|
13592 | */
|
13593 |
|
13594 | /* global hasOwnProperty:true */
|
13595 |
|
13596 | 'use strict';
|
13597 |
|
13598 | var AutoFocusUtils = __webpack_require__(179);
|
13599 | var CSSPropertyOperations = __webpack_require__(181);
|
13600 | var DOMProperty = __webpack_require__(108);
|
13601 | var DOMPropertyOperations = __webpack_require__(107);
|
13602 | var EventConstants = __webpack_require__(115);
|
13603 | var ReactBrowserEventEmitter = __webpack_require__(114);
|
13604 | var ReactComponentBrowserEnvironment = __webpack_require__(111);
|
13605 | var ReactDOMButton = __webpack_require__(189);
|
13606 | var ReactDOMInput = __webpack_require__(190);
|
13607 | var ReactDOMOption = __webpack_require__(194);
|
13608 | var ReactDOMSelect = __webpack_require__(197);
|
13609 | var ReactDOMTextarea = __webpack_require__(198);
|
13610 | var ReactMount = __webpack_require__(113);
|
13611 | var ReactMultiChild = __webpack_require__(199);
|
13612 | var ReactPerf = __webpack_require__(103);
|
13613 | var ReactUpdateQueue = __webpack_require__(138);
|
13614 |
|
13615 | var assign = __webpack_require__(124);
|
13616 | var canDefineProperty = __webpack_require__(128);
|
13617 | var escapeTextContentForBrowser = __webpack_require__(106);
|
13618 | var invariant = __webpack_require__(98);
|
13619 | var isEventSupported = __webpack_require__(125);
|
13620 | var keyOf = __webpack_require__(164);
|
13621 | var setInnerHTML = __webpack_require__(104);
|
13622 | var setTextContent = __webpack_require__(105);
|
13623 | var shallowEqual = __webpack_require__(202);
|
13624 | var validateDOMNesting = __webpack_require__(155);
|
13625 | var warning = __webpack_require__(110);
|
13626 |
|
13627 | var deleteListener = ReactBrowserEventEmitter.deleteListener;
|
13628 | var listenTo = ReactBrowserEventEmitter.listenTo;
|
13629 | var registrationNameModules = ReactBrowserEventEmitter.registrationNameModules;
|
13630 |
|
13631 | // For quickly matching children type, to test if can be treated as content.
|
13632 | var CONTENT_TYPES = { 'string': true, 'number': true };
|
13633 |
|
13634 | var CHILDREN = keyOf({ children: null });
|
13635 | var STYLE = keyOf({ style: null });
|
13636 | var HTML = keyOf({ __html: null });
|
13637 |
|
13638 | var ELEMENT_NODE_TYPE = 1;
|
13639 |
|
13640 | function getDeclarationErrorAddendum(internalInstance) {
|
13641 | if (internalInstance) {
|
13642 | var owner = internalInstance._currentElement._owner || null;
|
13643 | if (owner) {
|
13644 | var name = owner.getName();
|
13645 | if (name) {
|
13646 | return ' This DOM node was rendered by `' + name + '`.';
|
13647 | }
|
13648 | }
|
13649 | }
|
13650 | return '';
|
13651 | }
|
13652 |
|
13653 | var legacyPropsDescriptor;
|
13654 | if (process.env.NODE_ENV !== 'production') {
|
13655 | legacyPropsDescriptor = {
|
13656 | props: {
|
13657 | enumerable: false,
|
13658 | get: function () {
|
13659 | var component = this._reactInternalComponent;
|
13660 | process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .props of a DOM node; instead, ' + 'recreate the props as `render` did originally or read the DOM ' + 'properties/attributes directly from this node (e.g., ' + 'this.refs.box.className).%s', getDeclarationErrorAddendum(component)) : undefined;
|
13661 | return component._currentElement.props;
|
13662 | }
|
13663 | }
|
13664 | };
|
13665 | }
|
13666 |
|
13667 | function legacyGetDOMNode() {
|
13668 | if (process.env.NODE_ENV !== 'production') {
|
13669 | var component = this._reactInternalComponent;
|
13670 | process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .getDOMNode() of a DOM node; ' + 'instead, use the node directly.%s', getDeclarationErrorAddendum(component)) : undefined;
|
13671 | }
|
13672 | return this;
|
13673 | }
|
13674 |
|
13675 | function legacyIsMounted() {
|
13676 | var component = this._reactInternalComponent;
|
13677 | if (process.env.NODE_ENV !== 'production') {
|
13678 | process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .isMounted() of a DOM node.%s', getDeclarationErrorAddendum(component)) : undefined;
|
13679 | }
|
13680 | return !!component;
|
13681 | }
|
13682 |
|
13683 | function legacySetStateEtc() {
|
13684 | if (process.env.NODE_ENV !== 'production') {
|
13685 | var component = this._reactInternalComponent;
|
13686 | process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setState(), .replaceState(), or ' + '.forceUpdate() of a DOM node. This is a no-op.%s', getDeclarationErrorAddendum(component)) : undefined;
|
13687 | }
|
13688 | }
|
13689 |
|
13690 | function legacySetProps(partialProps, callback) {
|
13691 | var component = this._reactInternalComponent;
|
13692 | if (process.env.NODE_ENV !== 'production') {
|
13693 | process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
|
13694 | }
|
13695 | if (!component) {
|
13696 | return;
|
13697 | }
|
13698 | ReactUpdateQueue.enqueueSetPropsInternal(component, partialProps);
|
13699 | if (callback) {
|
13700 | ReactUpdateQueue.enqueueCallbackInternal(component, callback);
|
13701 | }
|
13702 | }
|
13703 |
|
13704 | function legacyReplaceProps(partialProps, callback) {
|
13705 | var component = this._reactInternalComponent;
|
13706 | if (process.env.NODE_ENV !== 'production') {
|
13707 | process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .replaceProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
|
13708 | }
|
13709 | if (!component) {
|
13710 | return;
|
13711 | }
|
13712 | ReactUpdateQueue.enqueueReplacePropsInternal(component, partialProps);
|
13713 | if (callback) {
|
13714 | ReactUpdateQueue.enqueueCallbackInternal(component, callback);
|
13715 | }
|
13716 | }
|
13717 |
|
13718 | function friendlyStringify(obj) {
|
13719 | if (typeof obj === 'object') {
|
13720 | if (Array.isArray(obj)) {
|
13721 | return '[' + obj.map(friendlyStringify).join(', ') + ']';
|
13722 | } else {
|
13723 | var pairs = [];
|
13724 | for (var key in obj) {
|
13725 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
13726 | var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
|
13727 | pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
|
13728 | }
|
13729 | }
|
13730 | return '{' + pairs.join(', ') + '}';
|
13731 | }
|
13732 | } else if (typeof obj === 'string') {
|
13733 | return JSON.stringify(obj);
|
13734 | } else if (typeof obj === 'function') {
|
13735 | return '[function object]';
|
13736 | }
|
13737 | // Differs from JSON.stringify in that undefined becauses undefined and that
|
13738 | // inf and nan don't become null
|
13739 | return String(obj);
|
13740 | }
|
13741 |
|
13742 | var styleMutationWarning = {};
|
13743 |
|
13744 | function checkAndWarnForMutatedStyle(style1, style2, component) {
|
13745 | if (style1 == null || style2 == null) {
|
13746 | return;
|
13747 | }
|
13748 | if (shallowEqual(style1, style2)) {
|
13749 | return;
|
13750 | }
|
13751 |
|
13752 | var componentName = component._tag;
|
13753 | var owner = component._currentElement._owner;
|
13754 | var ownerName;
|
13755 | if (owner) {
|
13756 | ownerName = owner.getName();
|
13757 | }
|
13758 |
|
13759 | var hash = ownerName + '|' + componentName;
|
13760 |
|
13761 | if (styleMutationWarning.hasOwnProperty(hash)) {
|
13762 | return;
|
13763 | }
|
13764 |
|
13765 | styleMutationWarning[hash] = true;
|
13766 |
|
13767 | process.env.NODE_ENV !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : undefined;
|
13768 | }
|
13769 |
|
13770 | /**
|
13771 | * @param {object} component
|
13772 | * @param {?object} props
|
13773 | */
|
13774 | function assertValidProps(component, props) {
|
13775 | if (!props) {
|
13776 | return;
|
13777 | }
|
13778 | // Note the use of `==` which checks for null or undefined.
|
13779 | if (process.env.NODE_ENV !== 'production') {
|
13780 | if (voidElementTags[component._tag]) {
|
13781 | process.env.NODE_ENV !== 'production' ? warning(props.children == null && props.dangerouslySetInnerHTML == null, '%s is a void element tag and must not have `children` or ' + 'use `props.dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : undefined;
|
13782 | }
|
13783 | }
|
13784 | if (props.dangerouslySetInnerHTML != null) {
|
13785 | !(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : undefined;
|
13786 | !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://fb.me/react-invariant-dangerously-set-inner-html ' + 'for more information.') : invariant(false) : undefined;
|
13787 | }
|
13788 | if (process.env.NODE_ENV !== 'production') {
|
13789 | process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : undefined;
|
13790 | process.env.NODE_ENV !== 'production' ? warning(!props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : undefined;
|
13791 | }
|
13792 | !(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : undefined;
|
13793 | }
|
13794 |
|
13795 | function enqueuePutListener(id, registrationName, listener, transaction) {
|
13796 | if (process.env.NODE_ENV !== 'production') {
|
13797 | // IE8 has no API for event capturing and the `onScroll` event doesn't
|
13798 | // bubble.
|
13799 | process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : undefined;
|
13800 | }
|
13801 | var container = ReactMount.findReactContainerForID(id);
|
13802 | if (container) {
|
13803 | var doc = container.nodeType === ELEMENT_NODE_TYPE ? container.ownerDocument : container;
|
13804 | listenTo(registrationName, doc);
|
13805 | }
|
13806 | transaction.getReactMountReady().enqueue(putListener, {
|
13807 | id: id,
|
13808 | registrationName: registrationName,
|
13809 | listener: listener
|
13810 | });
|
13811 | }
|
13812 |
|
13813 | function putListener() {
|
13814 | var listenerToPut = this;
|
13815 | ReactBrowserEventEmitter.putListener(listenerToPut.id, listenerToPut.registrationName, listenerToPut.listener);
|
13816 | }
|
13817 |
|
13818 | // There are so many media events, it makes sense to just
|
13819 | // maintain a list rather than create a `trapBubbledEvent` for each
|
13820 | var mediaEvents = {
|
13821 | topAbort: 'abort',
|
13822 | topCanPlay: 'canplay',
|
13823 | topCanPlayThrough: 'canplaythrough',
|
13824 | topDurationChange: 'durationchange',
|
13825 | topEmptied: 'emptied',
|
13826 | topEncrypted: 'encrypted',
|
13827 | topEnded: 'ended',
|
13828 | topError: 'error',
|
13829 | topLoadedData: 'loadeddata',
|
13830 | topLoadedMetadata: 'loadedmetadata',
|
13831 | topLoadStart: 'loadstart',
|
13832 | topPause: 'pause',
|
13833 | topPlay: 'play',
|
13834 | topPlaying: 'playing',
|
13835 | topProgress: 'progress',
|
13836 | topRateChange: 'ratechange',
|
13837 | topSeeked: 'seeked',
|
13838 | topSeeking: 'seeking',
|
13839 | topStalled: 'stalled',
|
13840 | topSuspend: 'suspend',
|
13841 | topTimeUpdate: 'timeupdate',
|
13842 | topVolumeChange: 'volumechange',
|
13843 | topWaiting: 'waiting'
|
13844 | };
|
13845 |
|
13846 | function trapBubbledEventsLocal() {
|
13847 | var inst = this;
|
13848 | // If a component renders to null or if another component fatals and causes
|
13849 | // the state of the tree to be corrupted, `node` here can be null.
|
13850 | !inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : undefined;
|
13851 | var node = ReactMount.getNode(inst._rootNodeID);
|
13852 | !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : undefined;
|
13853 |
|
13854 | switch (inst._tag) {
|
13855 | case 'iframe':
|
13856 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
|
13857 | break;
|
13858 | case 'video':
|
13859 | case 'audio':
|
13860 |
|
13861 | inst._wrapperState.listeners = [];
|
13862 | // create listener for each media event
|
13863 | for (var event in mediaEvents) {
|
13864 | if (mediaEvents.hasOwnProperty(event)) {
|
13865 | inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
|
13866 | }
|
13867 | }
|
13868 |
|
13869 | break;
|
13870 | case 'img':
|
13871 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
|
13872 | break;
|
13873 | case 'form':
|
13874 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
|
13875 | break;
|
13876 | }
|
13877 | }
|
13878 |
|
13879 | function mountReadyInputWrapper() {
|
13880 | ReactDOMInput.mountReadyWrapper(this);
|
13881 | }
|
13882 |
|
13883 | function postUpdateSelectWrapper() {
|
13884 | ReactDOMSelect.postUpdateWrapper(this);
|
13885 | }
|
13886 |
|
13887 | // For HTML, certain tags should omit their close tag. We keep a whitelist for
|
13888 | // those special cased tags.
|
13889 |
|
13890 | var omittedCloseTags = {
|
13891 | 'area': true,
|
13892 | 'base': true,
|
13893 | 'br': true,
|
13894 | 'col': true,
|
13895 | 'embed': true,
|
13896 | 'hr': true,
|
13897 | 'img': true,
|
13898 | 'input': true,
|
13899 | 'keygen': true,
|
13900 | 'link': true,
|
13901 | 'meta': true,
|
13902 | 'param': true,
|
13903 | 'source': true,
|
13904 | 'track': true,
|
13905 | 'wbr': true
|
13906 | };
|
13907 |
|
13908 | // NOTE: menuitem's close tag should be omitted, but that causes problems.
|
13909 | var newlineEatingTags = {
|
13910 | 'listing': true,
|
13911 | 'pre': true,
|
13912 | 'textarea': true
|
13913 | };
|
13914 |
|
13915 | // For HTML, certain tags cannot have children. This has the same purpose as
|
13916 | // `omittedCloseTags` except that `menuitem` should still have its closing tag.
|
13917 |
|
13918 | var voidElementTags = assign({
|
13919 | 'menuitem': true
|
13920 | }, omittedCloseTags);
|
13921 |
|
13922 | // We accept any tag to be rendered but since this gets injected into arbitrary
|
13923 | // HTML, we want to make sure that it's a safe tag.
|
13924 | // http://www.w3.org/TR/REC-xml/#NT-Name
|
13925 |
|
13926 | var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
|
13927 | var validatedTagCache = {};
|
13928 | var hasOwnProperty = ({}).hasOwnProperty;
|
13929 |
|
13930 | function validateDangerousTag(tag) {
|
13931 | if (!hasOwnProperty.call(validatedTagCache, tag)) {
|
13932 | !VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : undefined;
|
13933 | validatedTagCache[tag] = true;
|
13934 | }
|
13935 | }
|
13936 |
|
13937 | function processChildContextDev(context, inst) {
|
13938 | // Pass down our tag name to child components for validation purposes
|
13939 | context = assign({}, context);
|
13940 | var info = context[validateDOMNesting.ancestorInfoContextKey];
|
13941 | context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(info, inst._tag, inst);
|
13942 | return context;
|
13943 | }
|
13944 |
|
13945 | function isCustomComponent(tagName, props) {
|
13946 | return tagName.indexOf('-') >= 0 || props.is != null;
|
13947 | }
|
13948 |
|
13949 | /**
|
13950 | * Creates a new React class that is idempotent and capable of containing other
|
13951 | * React components. It accepts event listeners and DOM properties that are
|
13952 | * valid according to `DOMProperty`.
|
13953 | *
|
13954 | * - Event listeners: `onClick`, `onMouseDown`, etc.
|
13955 | * - DOM properties: `className`, `name`, `title`, etc.
|
13956 | *
|
13957 | * The `style` property functions differently from the DOM API. It accepts an
|
13958 | * object mapping of style properties to values.
|
13959 | *
|
13960 | * @constructor ReactDOMComponent
|
13961 | * @extends ReactMultiChild
|
13962 | */
|
13963 | function ReactDOMComponent(tag) {
|
13964 | validateDangerousTag(tag);
|
13965 | this._tag = tag.toLowerCase();
|
13966 | this._renderedChildren = null;
|
13967 | this._previousStyle = null;
|
13968 | this._previousStyleCopy = null;
|
13969 | this._rootNodeID = null;
|
13970 | this._wrapperState = null;
|
13971 | this._topLevelWrapper = null;
|
13972 | this._nodeWithLegacyProperties = null;
|
13973 | if (process.env.NODE_ENV !== 'production') {
|
13974 | this._unprocessedContextDev = null;
|
13975 | this._processedContextDev = null;
|
13976 | }
|
13977 | }
|
13978 |
|
13979 | ReactDOMComponent.displayName = 'ReactDOMComponent';
|
13980 |
|
13981 | ReactDOMComponent.Mixin = {
|
13982 |
|
13983 | construct: function (element) {
|
13984 | this._currentElement = element;
|
13985 | },
|
13986 |
|
13987 | /**
|
13988 | * Generates root tag markup then recurses. This method has side effects and
|
13989 | * is not idempotent.
|
13990 | *
|
13991 | * @internal
|
13992 | * @param {string} rootID The root DOM ID for this node.
|
13993 | * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
13994 | * @param {object} context
|
13995 | * @return {string} The computed markup.
|
13996 | */
|
13997 | mountComponent: function (rootID, transaction, context) {
|
13998 | this._rootNodeID = rootID;
|
13999 |
|
14000 | var props = this._currentElement.props;
|
14001 |
|
14002 | switch (this._tag) {
|
14003 | case 'iframe':
|
14004 | case 'img':
|
14005 | case 'form':
|
14006 | case 'video':
|
14007 | case 'audio':
|
14008 | this._wrapperState = {
|
14009 | listeners: null
|
14010 | };
|
14011 | transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
14012 | break;
|
14013 | case 'button':
|
14014 | props = ReactDOMButton.getNativeProps(this, props, context);
|
14015 | break;
|
14016 | case 'input':
|
14017 | ReactDOMInput.mountWrapper(this, props, context);
|
14018 | props = ReactDOMInput.getNativeProps(this, props, context);
|
14019 | break;
|
14020 | case 'option':
|
14021 | ReactDOMOption.mountWrapper(this, props, context);
|
14022 | props = ReactDOMOption.getNativeProps(this, props, context);
|
14023 | break;
|
14024 | case 'select':
|
14025 | ReactDOMSelect.mountWrapper(this, props, context);
|
14026 | props = ReactDOMSelect.getNativeProps(this, props, context);
|
14027 | context = ReactDOMSelect.processChildContext(this, props, context);
|
14028 | break;
|
14029 | case 'textarea':
|
14030 | ReactDOMTextarea.mountWrapper(this, props, context);
|
14031 | props = ReactDOMTextarea.getNativeProps(this, props, context);
|
14032 | break;
|
14033 | }
|
14034 |
|
14035 | assertValidProps(this, props);
|
14036 | if (process.env.NODE_ENV !== 'production') {
|
14037 | if (context[validateDOMNesting.ancestorInfoContextKey]) {
|
14038 | validateDOMNesting(this._tag, this, context[validateDOMNesting.ancestorInfoContextKey]);
|
14039 | }
|
14040 | }
|
14041 |
|
14042 | if (process.env.NODE_ENV !== 'production') {
|
14043 | this._unprocessedContextDev = context;
|
14044 | this._processedContextDev = processChildContextDev(context, this);
|
14045 | context = this._processedContextDev;
|
14046 | }
|
14047 |
|
14048 | var mountImage;
|
14049 | if (transaction.useCreateElement) {
|
14050 | var ownerDocument = context[ReactMount.ownerDocumentContextKey];
|
14051 | var el = ownerDocument.createElement(this._currentElement.type);
|
14052 | DOMPropertyOperations.setAttributeForID(el, this._rootNodeID);
|
14053 | // Populate node cache
|
14054 | ReactMount.getID(el);
|
14055 | this._updateDOMProperties({}, props, transaction, el);
|
14056 | this._createInitialChildren(transaction, props, context, el);
|
14057 | mountImage = el;
|
14058 | } else {
|
14059 | var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
|
14060 | var tagContent = this._createContentMarkup(transaction, props, context);
|
14061 | if (!tagContent && omittedCloseTags[this._tag]) {
|
14062 | mountImage = tagOpen + '/>';
|
14063 | } else {
|
14064 | mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
|
14065 | }
|
14066 | }
|
14067 |
|
14068 | switch (this._tag) {
|
14069 | case 'input':
|
14070 | transaction.getReactMountReady().enqueue(mountReadyInputWrapper, this);
|
14071 | // falls through
|
14072 | case 'button':
|
14073 | case 'select':
|
14074 | case 'textarea':
|
14075 | if (props.autoFocus) {
|
14076 | transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
|
14077 | }
|
14078 | break;
|
14079 | }
|
14080 |
|
14081 | return mountImage;
|
14082 | },
|
14083 |
|
14084 | /**
|
14085 | * Creates markup for the open tag and all attributes.
|
14086 | *
|
14087 | * This method has side effects because events get registered.
|
14088 | *
|
14089 | * Iterating over object properties is faster than iterating over arrays.
|
14090 | * @see http://jsperf.com/obj-vs-arr-iteration
|
14091 | *
|
14092 | * @private
|
14093 | * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
14094 | * @param {object} props
|
14095 | * @return {string} Markup of opening tag.
|
14096 | */
|
14097 | _createOpenTagMarkupAndPutListeners: function (transaction, props) {
|
14098 | var ret = '<' + this._currentElement.type;
|
14099 |
|
14100 | for (var propKey in props) {
|
14101 | if (!props.hasOwnProperty(propKey)) {
|
14102 | continue;
|
14103 | }
|
14104 | var propValue = props[propKey];
|
14105 | if (propValue == null) {
|
14106 | continue;
|
14107 | }
|
14108 | if (registrationNameModules.hasOwnProperty(propKey)) {
|
14109 | if (propValue) {
|
14110 | enqueuePutListener(this._rootNodeID, propKey, propValue, transaction);
|
14111 | }
|
14112 | } else {
|
14113 | if (propKey === STYLE) {
|
14114 | if (propValue) {
|
14115 | if (process.env.NODE_ENV !== 'production') {
|
14116 | // See `_updateDOMProperties`. style block
|
14117 | this._previousStyle = propValue;
|
14118 | }
|
14119 | propValue = this._previousStyleCopy = assign({}, props.style);
|
14120 | }
|
14121 | propValue = CSSPropertyOperations.createMarkupForStyles(propValue);
|
14122 | }
|
14123 | var markup = null;
|
14124 | if (this._tag != null && isCustomComponent(this._tag, props)) {
|
14125 | if (propKey !== CHILDREN) {
|
14126 | markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
|
14127 | }
|
14128 | } else {
|
14129 | markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
|
14130 | }
|
14131 | if (markup) {
|
14132 | ret += ' ' + markup;
|
14133 | }
|
14134 | }
|
14135 | }
|
14136 |
|
14137 | // For static pages, no need to put React ID and checksum. Saves lots of
|
14138 | // bytes.
|
14139 | if (transaction.renderToStaticMarkup) {
|
14140 | return ret;
|
14141 | }
|
14142 |
|
14143 | var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID);
|
14144 | return ret + ' ' + markupForID;
|
14145 | },
|
14146 |
|
14147 | /**
|
14148 | * Creates markup for the content between the tags.
|
14149 | *
|
14150 | * @private
|
14151 | * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
14152 | * @param {object} props
|
14153 | * @param {object} context
|
14154 | * @return {string} Content markup.
|
14155 | */
|
14156 | _createContentMarkup: function (transaction, props, context) {
|
14157 | var ret = '';
|
14158 |
|
14159 | // Intentional use of != to avoid catching zero/false.
|
14160 | var innerHTML = props.dangerouslySetInnerHTML;
|
14161 | if (innerHTML != null) {
|
14162 | if (innerHTML.__html != null) {
|
14163 | ret = innerHTML.__html;
|
14164 | }
|
14165 | } else {
|
14166 | var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
14167 | var childrenToUse = contentToUse != null ? null : props.children;
|
14168 | if (contentToUse != null) {
|
14169 | // TODO: Validate that text is allowed as a child of this node
|
14170 | ret = escapeTextContentForBrowser(contentToUse);
|
14171 | } else if (childrenToUse != null) {
|
14172 | var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
14173 | ret = mountImages.join('');
|
14174 | }
|
14175 | }
|
14176 | if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
|
14177 | // text/html ignores the first character in these tags if it's a newline
|
14178 | // Prefer to break application/xml over text/html (for now) by adding
|
14179 | // a newline specifically to get eaten by the parser. (Alternately for
|
14180 | // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
|
14181 | // \r is normalized out by HTMLTextAreaElement#value.)
|
14182 | // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
|
14183 | // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
|
14184 | // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
|
14185 | // See: Parsing of "textarea" "listing" and "pre" elements
|
14186 | // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
|
14187 | return '\n' + ret;
|
14188 | } else {
|
14189 | return ret;
|
14190 | }
|
14191 | },
|
14192 |
|
14193 | _createInitialChildren: function (transaction, props, context, el) {
|
14194 | // Intentional use of != to avoid catching zero/false.
|
14195 | var innerHTML = props.dangerouslySetInnerHTML;
|
14196 | if (innerHTML != null) {
|
14197 | if (innerHTML.__html != null) {
|
14198 | setInnerHTML(el, innerHTML.__html);
|
14199 | }
|
14200 | } else {
|
14201 | var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
14202 | var childrenToUse = contentToUse != null ? null : props.children;
|
14203 | if (contentToUse != null) {
|
14204 | // TODO: Validate that text is allowed as a child of this node
|
14205 | setTextContent(el, contentToUse);
|
14206 | } else if (childrenToUse != null) {
|
14207 | var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
14208 | for (var i = 0; i < mountImages.length; i++) {
|
14209 | el.appendChild(mountImages[i]);
|
14210 | }
|
14211 | }
|
14212 | }
|
14213 | },
|
14214 |
|
14215 | /**
|
14216 | * Receives a next element and updates the component.
|
14217 | *
|
14218 | * @internal
|
14219 | * @param {ReactElement} nextElement
|
14220 | * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
14221 | * @param {object} context
|
14222 | */
|
14223 | receiveComponent: function (nextElement, transaction, context) {
|
14224 | var prevElement = this._currentElement;
|
14225 | this._currentElement = nextElement;
|
14226 | this.updateComponent(transaction, prevElement, nextElement, context);
|
14227 | },
|
14228 |
|
14229 | /**
|
14230 | * Updates a native DOM component after it has already been allocated and
|
14231 | * attached to the DOM. Reconciles the root DOM node, then recurses.
|
14232 | *
|
14233 | * @param {ReactReconcileTransaction} transaction
|
14234 | * @param {ReactElement} prevElement
|
14235 | * @param {ReactElement} nextElement
|
14236 | * @internal
|
14237 | * @overridable
|
14238 | */
|
14239 | updateComponent: function (transaction, prevElement, nextElement, context) {
|
14240 | var lastProps = prevElement.props;
|
14241 | var nextProps = this._currentElement.props;
|
14242 |
|
14243 | switch (this._tag) {
|
14244 | case 'button':
|
14245 | lastProps = ReactDOMButton.getNativeProps(this, lastProps);
|
14246 | nextProps = ReactDOMButton.getNativeProps(this, nextProps);
|
14247 | break;
|
14248 | case 'input':
|
14249 | ReactDOMInput.updateWrapper(this);
|
14250 | lastProps = ReactDOMInput.getNativeProps(this, lastProps);
|
14251 | nextProps = ReactDOMInput.getNativeProps(this, nextProps);
|
14252 | break;
|
14253 | case 'option':
|
14254 | lastProps = ReactDOMOption.getNativeProps(this, lastProps);
|
14255 | nextProps = ReactDOMOption.getNativeProps(this, nextProps);
|
14256 | break;
|
14257 | case 'select':
|
14258 | lastProps = ReactDOMSelect.getNativeProps(this, lastProps);
|
14259 | nextProps = ReactDOMSelect.getNativeProps(this, nextProps);
|
14260 | break;
|
14261 | case 'textarea':
|
14262 | ReactDOMTextarea.updateWrapper(this);
|
14263 | lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);
|
14264 | nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);
|
14265 | break;
|
14266 | }
|
14267 |
|
14268 | if (process.env.NODE_ENV !== 'production') {
|
14269 | // If the context is reference-equal to the old one, pass down the same
|
14270 | // processed object so the update bailout in ReactReconciler behaves
|
14271 | // correctly (and identically in dev and prod). See #5005.
|
14272 | if (this._unprocessedContextDev !== context) {
|
14273 | this._unprocessedContextDev = context;
|
14274 | this._processedContextDev = processChildContextDev(context, this);
|
14275 | }
|
14276 | context = this._processedContextDev;
|
14277 | }
|
14278 |
|
14279 | assertValidProps(this, nextProps);
|
14280 | this._updateDOMProperties(lastProps, nextProps, transaction, null);
|
14281 | this._updateDOMChildren(lastProps, nextProps, transaction, context);
|
14282 |
|
14283 | if (!canDefineProperty && this._nodeWithLegacyProperties) {
|
14284 | this._nodeWithLegacyProperties.props = nextProps;
|
14285 | }
|
14286 |
|
14287 | if (this._tag === 'select') {
|
14288 | // <select> value update needs to occur after <option> children
|
14289 | // reconciliation
|
14290 | transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
|
14291 | }
|
14292 | },
|
14293 |
|
14294 | /**
|
14295 | * Reconciles the properties by detecting differences in property values and
|
14296 | * updating the DOM as necessary. This function is probably the single most
|
14297 | * critical path for performance optimization.
|
14298 | *
|
14299 | * TODO: Benchmark whether checking for changed values in memory actually
|
14300 | * improves performance (especially statically positioned elements).
|
14301 | * TODO: Benchmark the effects of putting this at the top since 99% of props
|
14302 | * do not change for a given reconciliation.
|
14303 | * TODO: Benchmark areas that can be improved with caching.
|
14304 | *
|
14305 | * @private
|
14306 | * @param {object} lastProps
|
14307 | * @param {object} nextProps
|
14308 | * @param {ReactReconcileTransaction} transaction
|
14309 | * @param {?DOMElement} node
|
14310 | */
|
14311 | _updateDOMProperties: function (lastProps, nextProps, transaction, node) {
|
14312 | var propKey;
|
14313 | var styleName;
|
14314 | var styleUpdates;
|
14315 | for (propKey in lastProps) {
|
14316 | if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey)) {
|
14317 | continue;
|
14318 | }
|
14319 | if (propKey === STYLE) {
|
14320 | var lastStyle = this._previousStyleCopy;
|
14321 | for (styleName in lastStyle) {
|
14322 | if (lastStyle.hasOwnProperty(styleName)) {
|
14323 | styleUpdates = styleUpdates || {};
|
14324 | styleUpdates[styleName] = '';
|
14325 | }
|
14326 | }
|
14327 | this._previousStyleCopy = null;
|
14328 | } else if (registrationNameModules.hasOwnProperty(propKey)) {
|
14329 | if (lastProps[propKey]) {
|
14330 | // Only call deleteListener if there was a listener previously or
|
14331 | // else willDeleteListener gets called when there wasn't actually a
|
14332 | // listener (e.g., onClick={null})
|
14333 | deleteListener(this._rootNodeID, propKey);
|
14334 | }
|
14335 | } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
|
14336 | if (!node) {
|
14337 | node = ReactMount.getNode(this._rootNodeID);
|
14338 | }
|
14339 | DOMPropertyOperations.deleteValueForProperty(node, propKey);
|
14340 | }
|
14341 | }
|
14342 | for (propKey in nextProps) {
|
14343 | var nextProp = nextProps[propKey];
|
14344 | var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps[propKey];
|
14345 | if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) {
|
14346 | continue;
|
14347 | }
|
14348 | if (propKey === STYLE) {
|
14349 | if (nextProp) {
|
14350 | if (process.env.NODE_ENV !== 'production') {
|
14351 | checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
|
14352 | this._previousStyle = nextProp;
|
14353 | }
|
14354 | nextProp = this._previousStyleCopy = assign({}, nextProp);
|
14355 | } else {
|
14356 | this._previousStyleCopy = null;
|
14357 | }
|
14358 | if (lastProp) {
|
14359 | // Unset styles on `lastProp` but not on `nextProp`.
|
14360 | for (styleName in lastProp) {
|
14361 | if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
|
14362 | styleUpdates = styleUpdates || {};
|
14363 | styleUpdates[styleName] = '';
|
14364 | }
|
14365 | }
|
14366 | // Update styles that changed since `lastProp`.
|
14367 | for (styleName in nextProp) {
|
14368 | if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
|
14369 | styleUpdates = styleUpdates || {};
|
14370 | styleUpdates[styleName] = nextProp[styleName];
|
14371 | }
|
14372 | }
|
14373 | } else {
|
14374 | // Relies on `updateStylesByID` not mutating `styleUpdates`.
|
14375 | styleUpdates = nextProp;
|
14376 | }
|
14377 | } else if (registrationNameModules.hasOwnProperty(propKey)) {
|
14378 | if (nextProp) {
|
14379 | enqueuePutListener(this._rootNodeID, propKey, nextProp, transaction);
|
14380 | } else if (lastProp) {
|
14381 | deleteListener(this._rootNodeID, propKey);
|
14382 | }
|
14383 | } else if (isCustomComponent(this._tag, nextProps)) {
|
14384 | if (!node) {
|
14385 | node = ReactMount.getNode(this._rootNodeID);
|
14386 | }
|
14387 | if (propKey === CHILDREN) {
|
14388 | nextProp = null;
|
14389 | }
|
14390 | DOMPropertyOperations.setValueForAttribute(node, propKey, nextProp);
|
14391 | } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
|
14392 | if (!node) {
|
14393 | node = ReactMount.getNode(this._rootNodeID);
|
14394 | }
|
14395 | // If we're updating to null or undefined, we should remove the property
|
14396 | // from the DOM node instead of inadvertantly setting to a string. This
|
14397 | // brings us in line with the same behavior we have on initial render.
|
14398 | if (nextProp != null) {
|
14399 | DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
|
14400 | } else {
|
14401 | DOMPropertyOperations.deleteValueForProperty(node, propKey);
|
14402 | }
|
14403 | }
|
14404 | }
|
14405 | if (styleUpdates) {
|
14406 | if (!node) {
|
14407 | node = ReactMount.getNode(this._rootNodeID);
|
14408 | }
|
14409 | CSSPropertyOperations.setValueForStyles(node, styleUpdates);
|
14410 | }
|
14411 | },
|
14412 |
|
14413 | /**
|
14414 | * Reconciles the children with the various properties that affect the
|
14415 | * children content.
|
14416 | *
|
14417 | * @param {object} lastProps
|
14418 | * @param {object} nextProps
|
14419 | * @param {ReactReconcileTransaction} transaction
|
14420 | * @param {object} context
|
14421 | */
|
14422 | _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
|
14423 | var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
|
14424 | var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
|
14425 |
|
14426 | var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
|
14427 | var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
|
14428 |
|
14429 | // Note the use of `!=` which checks for null or undefined.
|
14430 | var lastChildren = lastContent != null ? null : lastProps.children;
|
14431 | var nextChildren = nextContent != null ? null : nextProps.children;
|
14432 |
|
14433 | // If we're switching from children to content/html or vice versa, remove
|
14434 | // the old content
|
14435 | var lastHasContentOrHtml = lastContent != null || lastHtml != null;
|
14436 | var nextHasContentOrHtml = nextContent != null || nextHtml != null;
|
14437 | if (lastChildren != null && nextChildren == null) {
|
14438 | this.updateChildren(null, transaction, context);
|
14439 | } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
|
14440 | this.updateTextContent('');
|
14441 | }
|
14442 |
|
14443 | if (nextContent != null) {
|
14444 | if (lastContent !== nextContent) {
|
14445 | this.updateTextContent('' + nextContent);
|
14446 | }
|
14447 | } else if (nextHtml != null) {
|
14448 | if (lastHtml !== nextHtml) {
|
14449 | this.updateMarkup('' + nextHtml);
|
14450 | }
|
14451 | } else if (nextChildren != null) {
|
14452 | this.updateChildren(nextChildren, transaction, context);
|
14453 | }
|
14454 | },
|
14455 |
|
14456 | /**
|
14457 | * Destroys all event registrations for this instance. Does not remove from
|
14458 | * the DOM. That must be done by the parent.
|
14459 | *
|
14460 | * @internal
|
14461 | */
|
14462 | unmountComponent: function () {
|
14463 | switch (this._tag) {
|
14464 | case 'iframe':
|
14465 | case 'img':
|
14466 | case 'form':
|
14467 | case 'video':
|
14468 | case 'audio':
|
14469 | var listeners = this._wrapperState.listeners;
|
14470 | if (listeners) {
|
14471 | for (var i = 0; i < listeners.length; i++) {
|
14472 | listeners[i].remove();
|
14473 | }
|
14474 | }
|
14475 | break;
|
14476 | case 'input':
|
14477 | ReactDOMInput.unmountWrapper(this);
|
14478 | break;
|
14479 | case 'html':
|
14480 | case 'head':
|
14481 | case 'body':
|
14482 | /**
|
14483 | * Components like <html> <head> and <body> can't be removed or added
|
14484 | * easily in a cross-browser way, however it's valuable to be able to
|
14485 | * take advantage of React's reconciliation for styling and <title>
|
14486 | * management. So we just document it and throw in dangerous cases.
|
14487 | */
|
14488 | true ? process.env.NODE_ENV !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is ' + 'impossible to unmount some top-level components (eg <html>, ' + '<head>, and <body>) reliably and efficiently. To fix this, have a ' + 'single top-level component that never unmounts render these ' + 'elements.', this._tag) : invariant(false) : undefined;
|
14489 | break;
|
14490 | }
|
14491 |
|
14492 | this.unmountChildren();
|
14493 | ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID);
|
14494 | ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
|
14495 | this._rootNodeID = null;
|
14496 | this._wrapperState = null;
|
14497 | if (this._nodeWithLegacyProperties) {
|
14498 | var node = this._nodeWithLegacyProperties;
|
14499 | node._reactInternalComponent = null;
|
14500 | this._nodeWithLegacyProperties = null;
|
14501 | }
|
14502 | },
|
14503 |
|
14504 | getPublicInstance: function () {
|
14505 | if (!this._nodeWithLegacyProperties) {
|
14506 | var node = ReactMount.getNode(this._rootNodeID);
|
14507 |
|
14508 | node._reactInternalComponent = this;
|
14509 | node.getDOMNode = legacyGetDOMNode;
|
14510 | node.isMounted = legacyIsMounted;
|
14511 | node.setState = legacySetStateEtc;
|
14512 | node.replaceState = legacySetStateEtc;
|
14513 | node.forceUpdate = legacySetStateEtc;
|
14514 | node.setProps = legacySetProps;
|
14515 | node.replaceProps = legacyReplaceProps;
|
14516 |
|
14517 | if (process.env.NODE_ENV !== 'production') {
|
14518 | if (canDefineProperty) {
|
14519 | Object.defineProperties(node, legacyPropsDescriptor);
|
14520 | } else {
|
14521 | // updateComponent will update this property on subsequent renders
|
14522 | node.props = this._currentElement.props;
|
14523 | }
|
14524 | } else {
|
14525 | // updateComponent will update this property on subsequent renders
|
14526 | node.props = this._currentElement.props;
|
14527 | }
|
14528 |
|
14529 | this._nodeWithLegacyProperties = node;
|
14530 | }
|
14531 | return this._nodeWithLegacyProperties;
|
14532 | }
|
14533 |
|
14534 | };
|
14535 |
|
14536 | ReactPerf.measureMethods(ReactDOMComponent, 'ReactDOMComponent', {
|
14537 | mountComponent: 'mountComponent',
|
14538 | updateComponent: 'updateComponent'
|
14539 | });
|
14540 |
|
14541 | assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
|
14542 |
|
14543 | module.exports = ReactDOMComponent;
|
14544 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
14545 |
|
14546 | /***/ }),
|
14547 | /* 179 */
|
14548 | /***/ (function(module, exports, __webpack_require__) {
|
14549 |
|
14550 | /**
|
14551 | * Copyright 2013-2015, Facebook, Inc.
|
14552 | * All rights reserved.
|
14553 | *
|
14554 | * This source code is licensed under the BSD-style license found in the
|
14555 | * LICENSE file in the root directory of this source tree. An additional grant
|
14556 | * of patent rights can be found in the PATENTS file in the same directory.
|
14557 | *
|
14558 | * @providesModule AutoFocusUtils
|
14559 | * @typechecks static-only
|
14560 | */
|
14561 |
|
14562 | 'use strict';
|
14563 |
|
14564 | var ReactMount = __webpack_require__(113);
|
14565 |
|
14566 | var findDOMNode = __webpack_require__(176);
|
14567 | var focusNode = __webpack_require__(180);
|
14568 |
|
14569 | var Mixin = {
|
14570 | componentDidMount: function () {
|
14571 | if (this.props.autoFocus) {
|
14572 | focusNode(findDOMNode(this));
|
14573 | }
|
14574 | }
|
14575 | };
|
14576 |
|
14577 | var AutoFocusUtils = {
|
14578 | Mixin: Mixin,
|
14579 |
|
14580 | focusDOMComponent: function () {
|
14581 | focusNode(ReactMount.getNode(this._rootNodeID));
|
14582 | }
|
14583 | };
|
14584 |
|
14585 | module.exports = AutoFocusUtils;
|
14586 |
|
14587 | /***/ }),
|
14588 | /* 180 */
|
14589 | /***/ (function(module, exports) {
|
14590 |
|
14591 | /**
|
14592 | * Copyright 2013-2015, Facebook, Inc.
|
14593 | * All rights reserved.
|
14594 | *
|
14595 | * This source code is licensed under the BSD-style license found in the
|
14596 | * LICENSE file in the root directory of this source tree. An additional grant
|
14597 | * of patent rights can be found in the PATENTS file in the same directory.
|
14598 | *
|
14599 | * @providesModule focusNode
|
14600 | */
|
14601 |
|
14602 | 'use strict';
|
14603 |
|
14604 | /**
|
14605 | * @param {DOMElement} node input/textarea to focus
|
14606 | */
|
14607 | function focusNode(node) {
|
14608 | // IE8 can throw "Can't move focus to the control because it is invisible,
|
14609 | // not enabled, or of a type that does not accept the focus." for all kinds of
|
14610 | // reasons that are too expensive and fragile to test.
|
14611 | try {
|
14612 | node.focus();
|
14613 | } catch (e) {}
|
14614 | }
|
14615 |
|
14616 | module.exports = focusNode;
|
14617 |
|
14618 | /***/ }),
|
14619 | /* 181 */
|
14620 | /***/ (function(module, exports, __webpack_require__) {
|
14621 |
|
14622 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
14623 | * Copyright 2013-2015, Facebook, Inc.
|
14624 | * All rights reserved.
|
14625 | *
|
14626 | * This source code is licensed under the BSD-style license found in the
|
14627 | * LICENSE file in the root directory of this source tree. An additional grant
|
14628 | * of patent rights can be found in the PATENTS file in the same directory.
|
14629 | *
|
14630 | * @providesModule CSSPropertyOperations
|
14631 | * @typechecks static-only
|
14632 | */
|
14633 |
|
14634 | 'use strict';
|
14635 |
|
14636 | var CSSProperty = __webpack_require__(182);
|
14637 | var ExecutionEnvironment = __webpack_require__(94);
|
14638 | var ReactPerf = __webpack_require__(103);
|
14639 |
|
14640 | var camelizeStyleName = __webpack_require__(183);
|
14641 | var dangerousStyleValue = __webpack_require__(185);
|
14642 | var hyphenateStyleName = __webpack_require__(186);
|
14643 | var memoizeStringOnly = __webpack_require__(188);
|
14644 | var warning = __webpack_require__(110);
|
14645 |
|
14646 | var processStyleName = memoizeStringOnly(function (styleName) {
|
14647 | return hyphenateStyleName(styleName);
|
14648 | });
|
14649 |
|
14650 | var hasShorthandPropertyBug = false;
|
14651 | var styleFloatAccessor = 'cssFloat';
|
14652 | if (ExecutionEnvironment.canUseDOM) {
|
14653 | var tempStyle = document.createElement('div').style;
|
14654 | try {
|
14655 | // IE8 throws "Invalid argument." if resetting shorthand style properties.
|
14656 | tempStyle.font = '';
|
14657 | } catch (e) {
|
14658 | hasShorthandPropertyBug = true;
|
14659 | }
|
14660 | // IE8 only supports accessing cssFloat (standard) as styleFloat
|
14661 | if (document.documentElement.style.cssFloat === undefined) {
|
14662 | styleFloatAccessor = 'styleFloat';
|
14663 | }
|
14664 | }
|
14665 |
|
14666 | if (process.env.NODE_ENV !== 'production') {
|
14667 | // 'msTransform' is correct, but the other prefixes should be capitalized
|
14668 | var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
14669 |
|
14670 | // style values shouldn't contain a semicolon
|
14671 | var badStyleValueWithSemicolonPattern = /;\s*$/;
|
14672 |
|
14673 | var warnedStyleNames = {};
|
14674 | var warnedStyleValues = {};
|
14675 |
|
14676 | var warnHyphenatedStyleName = function (name) {
|
14677 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
14678 | return;
|
14679 | }
|
14680 |
|
14681 | warnedStyleNames[name] = true;
|
14682 | process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?', name, camelizeStyleName(name)) : undefined;
|
14683 | };
|
14684 |
|
14685 | var warnBadVendoredStyleName = function (name) {
|
14686 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
14687 | return;
|
14688 | }
|
14689 |
|
14690 | warnedStyleNames[name] = true;
|
14691 | process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)) : undefined;
|
14692 | };
|
14693 |
|
14694 | var warnStyleValueWithSemicolon = function (name, value) {
|
14695 | if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
14696 | return;
|
14697 | }
|
14698 |
|
14699 | warnedStyleValues[value] = true;
|
14700 | process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon. ' + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')) : undefined;
|
14701 | };
|
14702 |
|
14703 | /**
|
14704 | * @param {string} name
|
14705 | * @param {*} value
|
14706 | */
|
14707 | var warnValidStyle = function (name, value) {
|
14708 | if (name.indexOf('-') > -1) {
|
14709 | warnHyphenatedStyleName(name);
|
14710 | } else if (badVendoredStyleNamePattern.test(name)) {
|
14711 | warnBadVendoredStyleName(name);
|
14712 | } else if (badStyleValueWithSemicolonPattern.test(value)) {
|
14713 | warnStyleValueWithSemicolon(name, value);
|
14714 | }
|
14715 | };
|
14716 | }
|
14717 |
|
14718 | /**
|
14719 | * Operations for dealing with CSS properties.
|
14720 | */
|
14721 | var CSSPropertyOperations = {
|
14722 |
|
14723 | /**
|
14724 | * Serializes a mapping of style properties for use as inline styles:
|
14725 | *
|
14726 | * > createMarkupForStyles({width: '200px', height: 0})
|
14727 | * "width:200px;height:0;"
|
14728 | *
|
14729 | * Undefined values are ignored so that declarative programming is easier.
|
14730 | * The result should be HTML-escaped before insertion into the DOM.
|
14731 | *
|
14732 | * @param {object} styles
|
14733 | * @return {?string}
|
14734 | */
|
14735 | createMarkupForStyles: function (styles) {
|
14736 | var serialized = '';
|
14737 | for (var styleName in styles) {
|
14738 | if (!styles.hasOwnProperty(styleName)) {
|
14739 | continue;
|
14740 | }
|
14741 | var styleValue = styles[styleName];
|
14742 | if (process.env.NODE_ENV !== 'production') {
|
14743 | warnValidStyle(styleName, styleValue);
|
14744 | }
|
14745 | if (styleValue != null) {
|
14746 | serialized += processStyleName(styleName) + ':';
|
14747 | serialized += dangerousStyleValue(styleName, styleValue) + ';';
|
14748 | }
|
14749 | }
|
14750 | return serialized || null;
|
14751 | },
|
14752 |
|
14753 | /**
|
14754 | * Sets the value for multiple styles on a node. If a value is specified as
|
14755 | * '' (empty string), the corresponding style property will be unset.
|
14756 | *
|
14757 | * @param {DOMElement} node
|
14758 | * @param {object} styles
|
14759 | */
|
14760 | setValueForStyles: function (node, styles) {
|
14761 | var style = node.style;
|
14762 | for (var styleName in styles) {
|
14763 | if (!styles.hasOwnProperty(styleName)) {
|
14764 | continue;
|
14765 | }
|
14766 | if (process.env.NODE_ENV !== 'production') {
|
14767 | warnValidStyle(styleName, styles[styleName]);
|
14768 | }
|
14769 | var styleValue = dangerousStyleValue(styleName, styles[styleName]);
|
14770 | if (styleName === 'float') {
|
14771 | styleName = styleFloatAccessor;
|
14772 | }
|
14773 | if (styleValue) {
|
14774 | style[styleName] = styleValue;
|
14775 | } else {
|
14776 | var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
|
14777 | if (expansion) {
|
14778 | // Shorthand property that IE8 won't like unsetting, so unset each
|
14779 | // component to placate it
|
14780 | for (var individualStyleName in expansion) {
|
14781 | style[individualStyleName] = '';
|
14782 | }
|
14783 | } else {
|
14784 | style[styleName] = '';
|
14785 | }
|
14786 | }
|
14787 | }
|
14788 | }
|
14789 |
|
14790 | };
|
14791 |
|
14792 | ReactPerf.measureMethods(CSSPropertyOperations, 'CSSPropertyOperations', {
|
14793 | setValueForStyles: 'setValueForStyles'
|
14794 | });
|
14795 |
|
14796 | module.exports = CSSPropertyOperations;
|
14797 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
14798 |
|
14799 | /***/ }),
|
14800 | /* 182 */
|
14801 | /***/ (function(module, exports) {
|
14802 |
|
14803 | /**
|
14804 | * Copyright 2013-2015, Facebook, Inc.
|
14805 | * All rights reserved.
|
14806 | *
|
14807 | * This source code is licensed under the BSD-style license found in the
|
14808 | * LICENSE file in the root directory of this source tree. An additional grant
|
14809 | * of patent rights can be found in the PATENTS file in the same directory.
|
14810 | *
|
14811 | * @providesModule CSSProperty
|
14812 | */
|
14813 |
|
14814 | 'use strict';
|
14815 |
|
14816 | /**
|
14817 | * CSS properties which accept numbers but are not in units of "px".
|
14818 | */
|
14819 | var isUnitlessNumber = {
|
14820 | animationIterationCount: true,
|
14821 | boxFlex: true,
|
14822 | boxFlexGroup: true,
|
14823 | boxOrdinalGroup: true,
|
14824 | columnCount: true,
|
14825 | flex: true,
|
14826 | flexGrow: true,
|
14827 | flexPositive: true,
|
14828 | flexShrink: true,
|
14829 | flexNegative: true,
|
14830 | flexOrder: true,
|
14831 | fontWeight: true,
|
14832 | lineClamp: true,
|
14833 | lineHeight: true,
|
14834 | opacity: true,
|
14835 | order: true,
|
14836 | orphans: true,
|
14837 | tabSize: true,
|
14838 | widows: true,
|
14839 | zIndex: true,
|
14840 | zoom: true,
|
14841 |
|
14842 | // SVG-related properties
|
14843 | fillOpacity: true,
|
14844 | stopOpacity: true,
|
14845 | strokeDashoffset: true,
|
14846 | strokeOpacity: true,
|
14847 | strokeWidth: true
|
14848 | };
|
14849 |
|
14850 | /**
|
14851 | * @param {string} prefix vendor-specific prefix, eg: Webkit
|
14852 | * @param {string} key style name, eg: transitionDuration
|
14853 | * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
|
14854 | * WebkitTransitionDuration
|
14855 | */
|
14856 | function prefixKey(prefix, key) {
|
14857 | return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
14858 | }
|
14859 |
|
14860 | /**
|
14861 | * Support style names that may come passed in prefixed by adding permutations
|
14862 | * of vendor prefixes.
|
14863 | */
|
14864 | var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
14865 |
|
14866 | // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
|
14867 | // infinite loop, because it iterates over the newly added props too.
|
14868 | Object.keys(isUnitlessNumber).forEach(function (prop) {
|
14869 | prefixes.forEach(function (prefix) {
|
14870 | isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
|
14871 | });
|
14872 | });
|
14873 |
|
14874 | /**
|
14875 | * Most style properties can be unset by doing .style[prop] = '' but IE8
|
14876 | * doesn't like doing that with shorthand properties so for the properties that
|
14877 | * IE8 breaks on, which are listed here, we instead unset each of the
|
14878 | * individual properties. See http://bugs.jquery.com/ticket/12385.
|
14879 | * The 4-value 'clock' properties like margin, padding, border-width seem to
|
14880 | * behave without any problems. Curiously, list-style works too without any
|
14881 | * special prodding.
|
14882 | */
|
14883 | var shorthandPropertyExpansions = {
|
14884 | background: {
|
14885 | backgroundAttachment: true,
|
14886 | backgroundColor: true,
|
14887 | backgroundImage: true,
|
14888 | backgroundPositionX: true,
|
14889 | backgroundPositionY: true,
|
14890 | backgroundRepeat: true
|
14891 | },
|
14892 | backgroundPosition: {
|
14893 | backgroundPositionX: true,
|
14894 | backgroundPositionY: true
|
14895 | },
|
14896 | border: {
|
14897 | borderWidth: true,
|
14898 | borderStyle: true,
|
14899 | borderColor: true
|
14900 | },
|
14901 | borderBottom: {
|
14902 | borderBottomWidth: true,
|
14903 | borderBottomStyle: true,
|
14904 | borderBottomColor: true
|
14905 | },
|
14906 | borderLeft: {
|
14907 | borderLeftWidth: true,
|
14908 | borderLeftStyle: true,
|
14909 | borderLeftColor: true
|
14910 | },
|
14911 | borderRight: {
|
14912 | borderRightWidth: true,
|
14913 | borderRightStyle: true,
|
14914 | borderRightColor: true
|
14915 | },
|
14916 | borderTop: {
|
14917 | borderTopWidth: true,
|
14918 | borderTopStyle: true,
|
14919 | borderTopColor: true
|
14920 | },
|
14921 | font: {
|
14922 | fontStyle: true,
|
14923 | fontVariant: true,
|
14924 | fontWeight: true,
|
14925 | fontSize: true,
|
14926 | lineHeight: true,
|
14927 | fontFamily: true
|
14928 | },
|
14929 | outline: {
|
14930 | outlineWidth: true,
|
14931 | outlineStyle: true,
|
14932 | outlineColor: true
|
14933 | }
|
14934 | };
|
14935 |
|
14936 | var CSSProperty = {
|
14937 | isUnitlessNumber: isUnitlessNumber,
|
14938 | shorthandPropertyExpansions: shorthandPropertyExpansions
|
14939 | };
|
14940 |
|
14941 | module.exports = CSSProperty;
|
14942 |
|
14943 | /***/ }),
|
14944 | /* 183 */
|
14945 | /***/ (function(module, exports, __webpack_require__) {
|
14946 |
|
14947 | /**
|
14948 | * Copyright 2013-2015, Facebook, Inc.
|
14949 | * All rights reserved.
|
14950 | *
|
14951 | * This source code is licensed under the BSD-style license found in the
|
14952 | * LICENSE file in the root directory of this source tree. An additional grant
|
14953 | * of patent rights can be found in the PATENTS file in the same directory.
|
14954 | *
|
14955 | * @providesModule camelizeStyleName
|
14956 | * @typechecks
|
14957 | */
|
14958 |
|
14959 | 'use strict';
|
14960 |
|
14961 | var camelize = __webpack_require__(184);
|
14962 |
|
14963 | var msPattern = /^-ms-/;
|
14964 |
|
14965 | /**
|
14966 | * Camelcases a hyphenated CSS property name, for example:
|
14967 | *
|
14968 | * > camelizeStyleName('background-color')
|
14969 | * < "backgroundColor"
|
14970 | * > camelizeStyleName('-moz-transition')
|
14971 | * < "MozTransition"
|
14972 | * > camelizeStyleName('-ms-transition')
|
14973 | * < "msTransition"
|
14974 | *
|
14975 | * As Andi Smith suggests
|
14976 | * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
|
14977 | * is converted to lowercase `ms`.
|
14978 | *
|
14979 | * @param {string} string
|
14980 | * @return {string}
|
14981 | */
|
14982 | function camelizeStyleName(string) {
|
14983 | return camelize(string.replace(msPattern, 'ms-'));
|
14984 | }
|
14985 |
|
14986 | module.exports = camelizeStyleName;
|
14987 |
|
14988 | /***/ }),
|
14989 | /* 184 */
|
14990 | /***/ (function(module, exports) {
|
14991 |
|
14992 | /**
|
14993 | * Copyright 2013-2015, Facebook, Inc.
|
14994 | * All rights reserved.
|
14995 | *
|
14996 | * This source code is licensed under the BSD-style license found in the
|
14997 | * LICENSE file in the root directory of this source tree. An additional grant
|
14998 | * of patent rights can be found in the PATENTS file in the same directory.
|
14999 | *
|
15000 | * @providesModule camelize
|
15001 | * @typechecks
|
15002 | */
|
15003 |
|
15004 | "use strict";
|
15005 |
|
15006 | var _hyphenPattern = /-(.)/g;
|
15007 |
|
15008 | /**
|
15009 | * Camelcases a hyphenated string, for example:
|
15010 | *
|
15011 | * > camelize('background-color')
|
15012 | * < "backgroundColor"
|
15013 | *
|
15014 | * @param {string} string
|
15015 | * @return {string}
|
15016 | */
|
15017 | function camelize(string) {
|
15018 | return string.replace(_hyphenPattern, function (_, character) {
|
15019 | return character.toUpperCase();
|
15020 | });
|
15021 | }
|
15022 |
|
15023 | module.exports = camelize;
|
15024 |
|
15025 | /***/ }),
|
15026 | /* 185 */
|
15027 | /***/ (function(module, exports, __webpack_require__) {
|
15028 |
|
15029 | /**
|
15030 | * Copyright 2013-2015, Facebook, Inc.
|
15031 | * All rights reserved.
|
15032 | *
|
15033 | * This source code is licensed under the BSD-style license found in the
|
15034 | * LICENSE file in the root directory of this source tree. An additional grant
|
15035 | * of patent rights can be found in the PATENTS file in the same directory.
|
15036 | *
|
15037 | * @providesModule dangerousStyleValue
|
15038 | * @typechecks static-only
|
15039 | */
|
15040 |
|
15041 | 'use strict';
|
15042 |
|
15043 | var CSSProperty = __webpack_require__(182);
|
15044 |
|
15045 | var isUnitlessNumber = CSSProperty.isUnitlessNumber;
|
15046 |
|
15047 | /**
|
15048 | * Convert a value into the proper css writable value. The style name `name`
|
15049 | * should be logical (no hyphens), as specified
|
15050 | * in `CSSProperty.isUnitlessNumber`.
|
15051 | *
|
15052 | * @param {string} name CSS property name such as `topMargin`.
|
15053 | * @param {*} value CSS property value such as `10px`.
|
15054 | * @return {string} Normalized style value with dimensions applied.
|
15055 | */
|
15056 | function dangerousStyleValue(name, value) {
|
15057 | // Note that we've removed escapeTextForBrowser() calls here since the
|
15058 | // whole string will be escaped when the attribute is injected into
|
15059 | // the markup. If you provide unsafe user data here they can inject
|
15060 | // arbitrary CSS which may be problematic (I couldn't repro this):
|
15061 | // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
|
15062 | // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
|
15063 | // This is not an XSS hole but instead a potential CSS injection issue
|
15064 | // which has lead to a greater discussion about how we're going to
|
15065 | // trust URLs moving forward. See #2115901
|
15066 |
|
15067 | var isEmpty = value == null || typeof value === 'boolean' || value === '';
|
15068 | if (isEmpty) {
|
15069 | return '';
|
15070 | }
|
15071 |
|
15072 | var isNonNumeric = isNaN(value);
|
15073 | if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
|
15074 | return '' + value; // cast to string
|
15075 | }
|
15076 |
|
15077 | if (typeof value === 'string') {
|
15078 | value = value.trim();
|
15079 | }
|
15080 | return value + 'px';
|
15081 | }
|
15082 |
|
15083 | module.exports = dangerousStyleValue;
|
15084 |
|
15085 | /***/ }),
|
15086 | /* 186 */
|
15087 | /***/ (function(module, exports, __webpack_require__) {
|
15088 |
|
15089 | /**
|
15090 | * Copyright 2013-2015, Facebook, Inc.
|
15091 | * All rights reserved.
|
15092 | *
|
15093 | * This source code is licensed under the BSD-style license found in the
|
15094 | * LICENSE file in the root directory of this source tree. An additional grant
|
15095 | * of patent rights can be found in the PATENTS file in the same directory.
|
15096 | *
|
15097 | * @providesModule hyphenateStyleName
|
15098 | * @typechecks
|
15099 | */
|
15100 |
|
15101 | 'use strict';
|
15102 |
|
15103 | var hyphenate = __webpack_require__(187);
|
15104 |
|
15105 | var msPattern = /^ms-/;
|
15106 |
|
15107 | /**
|
15108 | * Hyphenates a camelcased CSS property name, for example:
|
15109 | *
|
15110 | * > hyphenateStyleName('backgroundColor')
|
15111 | * < "background-color"
|
15112 | * > hyphenateStyleName('MozTransition')
|
15113 | * < "-moz-transition"
|
15114 | * > hyphenateStyleName('msTransition')
|
15115 | * < "-ms-transition"
|
15116 | *
|
15117 | * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
|
15118 | * is converted to `-ms-`.
|
15119 | *
|
15120 | * @param {string} string
|
15121 | * @return {string}
|
15122 | */
|
15123 | function hyphenateStyleName(string) {
|
15124 | return hyphenate(string).replace(msPattern, '-ms-');
|
15125 | }
|
15126 |
|
15127 | module.exports = hyphenateStyleName;
|
15128 |
|
15129 | /***/ }),
|
15130 | /* 187 */
|
15131 | /***/ (function(module, exports) {
|
15132 |
|
15133 | /**
|
15134 | * Copyright 2013-2015, Facebook, Inc.
|
15135 | * All rights reserved.
|
15136 | *
|
15137 | * This source code is licensed under the BSD-style license found in the
|
15138 | * LICENSE file in the root directory of this source tree. An additional grant
|
15139 | * of patent rights can be found in the PATENTS file in the same directory.
|
15140 | *
|
15141 | * @providesModule hyphenate
|
15142 | * @typechecks
|
15143 | */
|
15144 |
|
15145 | 'use strict';
|
15146 |
|
15147 | var _uppercasePattern = /([A-Z])/g;
|
15148 |
|
15149 | /**
|
15150 | * Hyphenates a camelcased string, for example:
|
15151 | *
|
15152 | * > hyphenate('backgroundColor')
|
15153 | * < "background-color"
|
15154 | *
|
15155 | * For CSS style names, use `hyphenateStyleName` instead which works properly
|
15156 | * with all vendor prefixes, including `ms`.
|
15157 | *
|
15158 | * @param {string} string
|
15159 | * @return {string}
|
15160 | */
|
15161 | function hyphenate(string) {
|
15162 | return string.replace(_uppercasePattern, '-$1').toLowerCase();
|
15163 | }
|
15164 |
|
15165 | module.exports = hyphenate;
|
15166 |
|
15167 | /***/ }),
|
15168 | /* 188 */
|
15169 | /***/ (function(module, exports) {
|
15170 |
|
15171 | /**
|
15172 | * Copyright 2013-2015, Facebook, Inc.
|
15173 | * All rights reserved.
|
15174 | *
|
15175 | * This source code is licensed under the BSD-style license found in the
|
15176 | * LICENSE file in the root directory of this source tree. An additional grant
|
15177 | * of patent rights can be found in the PATENTS file in the same directory.
|
15178 | *
|
15179 | * @providesModule memoizeStringOnly
|
15180 | * @typechecks static-only
|
15181 | */
|
15182 |
|
15183 | 'use strict';
|
15184 |
|
15185 | /**
|
15186 | * Memoizes the return value of a function that accepts one string argument.
|
15187 | *
|
15188 | * @param {function} callback
|
15189 | * @return {function}
|
15190 | */
|
15191 | function memoizeStringOnly(callback) {
|
15192 | var cache = {};
|
15193 | return function (string) {
|
15194 | if (!cache.hasOwnProperty(string)) {
|
15195 | cache[string] = callback.call(this, string);
|
15196 | }
|
15197 | return cache[string];
|
15198 | };
|
15199 | }
|
15200 |
|
15201 | module.exports = memoizeStringOnly;
|
15202 |
|
15203 | /***/ }),
|
15204 | /* 189 */
|
15205 | /***/ (function(module, exports) {
|
15206 |
|
15207 | /**
|
15208 | * Copyright 2013-2015, Facebook, Inc.
|
15209 | * All rights reserved.
|
15210 | *
|
15211 | * This source code is licensed under the BSD-style license found in the
|
15212 | * LICENSE file in the root directory of this source tree. An additional grant
|
15213 | * of patent rights can be found in the PATENTS file in the same directory.
|
15214 | *
|
15215 | * @providesModule ReactDOMButton
|
15216 | */
|
15217 |
|
15218 | 'use strict';
|
15219 |
|
15220 | var mouseListenerNames = {
|
15221 | onClick: true,
|
15222 | onDoubleClick: true,
|
15223 | onMouseDown: true,
|
15224 | onMouseMove: true,
|
15225 | onMouseUp: true,
|
15226 |
|
15227 | onClickCapture: true,
|
15228 | onDoubleClickCapture: true,
|
15229 | onMouseDownCapture: true,
|
15230 | onMouseMoveCapture: true,
|
15231 | onMouseUpCapture: true
|
15232 | };
|
15233 |
|
15234 | /**
|
15235 | * Implements a <button> native component that does not receive mouse events
|
15236 | * when `disabled` is set.
|
15237 | */
|
15238 | var ReactDOMButton = {
|
15239 | getNativeProps: function (inst, props, context) {
|
15240 | if (!props.disabled) {
|
15241 | return props;
|
15242 | }
|
15243 |
|
15244 | // Copy the props, except the mouse listeners
|
15245 | var nativeProps = {};
|
15246 | for (var key in props) {
|
15247 | if (props.hasOwnProperty(key) && !mouseListenerNames[key]) {
|
15248 | nativeProps[key] = props[key];
|
15249 | }
|
15250 | }
|
15251 |
|
15252 | return nativeProps;
|
15253 | }
|
15254 | };
|
15255 |
|
15256 | module.exports = ReactDOMButton;
|
15257 |
|
15258 | /***/ }),
|
15259 | /* 190 */
|
15260 | /***/ (function(module, exports, __webpack_require__) {
|
15261 |
|
15262 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
15263 | * Copyright 2013-2015, Facebook, Inc.
|
15264 | * All rights reserved.
|
15265 | *
|
15266 | * This source code is licensed under the BSD-style license found in the
|
15267 | * LICENSE file in the root directory of this source tree. An additional grant
|
15268 | * of patent rights can be found in the PATENTS file in the same directory.
|
15269 | *
|
15270 | * @providesModule ReactDOMInput
|
15271 | */
|
15272 |
|
15273 | 'use strict';
|
15274 |
|
15275 | var ReactDOMIDOperations = __webpack_require__(112);
|
15276 | var LinkedValueUtils = __webpack_require__(191);
|
15277 | var ReactMount = __webpack_require__(113);
|
15278 | var ReactUpdates = __webpack_require__(139);
|
15279 |
|
15280 | var assign = __webpack_require__(124);
|
15281 | var invariant = __webpack_require__(98);
|
15282 |
|
15283 | var instancesByReactID = {};
|
15284 |
|
15285 | function forceUpdateIfMounted() {
|
15286 | if (this._rootNodeID) {
|
15287 | // DOM component is still mounted; update
|
15288 | ReactDOMInput.updateWrapper(this);
|
15289 | }
|
15290 | }
|
15291 |
|
15292 | /**
|
15293 | * Implements an <input> native component that allows setting these optional
|
15294 | * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
|
15295 | *
|
15296 | * If `checked` or `value` are not supplied (or null/undefined), user actions
|
15297 | * that affect the checked state or value will trigger updates to the element.
|
15298 | *
|
15299 | * If they are supplied (and not null/undefined), the rendered element will not
|
15300 | * trigger updates to the element. Instead, the props must change in order for
|
15301 | * the rendered element to be updated.
|
15302 | *
|
15303 | * The rendered element will be initialized as unchecked (or `defaultChecked`)
|
15304 | * with an empty value (or `defaultValue`).
|
15305 | *
|
15306 | * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
|
15307 | */
|
15308 | var ReactDOMInput = {
|
15309 | getNativeProps: function (inst, props, context) {
|
15310 | var value = LinkedValueUtils.getValue(props);
|
15311 | var checked = LinkedValueUtils.getChecked(props);
|
15312 |
|
15313 | var nativeProps = assign({}, props, {
|
15314 | defaultChecked: undefined,
|
15315 | defaultValue: undefined,
|
15316 | value: value != null ? value : inst._wrapperState.initialValue,
|
15317 | checked: checked != null ? checked : inst._wrapperState.initialChecked,
|
15318 | onChange: inst._wrapperState.onChange
|
15319 | });
|
15320 |
|
15321 | return nativeProps;
|
15322 | },
|
15323 |
|
15324 | mountWrapper: function (inst, props) {
|
15325 | if (process.env.NODE_ENV !== 'production') {
|
15326 | LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
|
15327 | }
|
15328 |
|
15329 | var defaultValue = props.defaultValue;
|
15330 | inst._wrapperState = {
|
15331 | initialChecked: props.defaultChecked || false,
|
15332 | initialValue: defaultValue != null ? defaultValue : null,
|
15333 | onChange: _handleChange.bind(inst)
|
15334 | };
|
15335 | },
|
15336 |
|
15337 | mountReadyWrapper: function (inst) {
|
15338 | // Can't be in mountWrapper or else server rendering leaks.
|
15339 | instancesByReactID[inst._rootNodeID] = inst;
|
15340 | },
|
15341 |
|
15342 | unmountWrapper: function (inst) {
|
15343 | delete instancesByReactID[inst._rootNodeID];
|
15344 | },
|
15345 |
|
15346 | updateWrapper: function (inst) {
|
15347 | var props = inst._currentElement.props;
|
15348 |
|
15349 | // TODO: Shouldn't this be getChecked(props)?
|
15350 | var checked = props.checked;
|
15351 | if (checked != null) {
|
15352 | ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'checked', checked || false);
|
15353 | }
|
15354 |
|
15355 | var value = LinkedValueUtils.getValue(props);
|
15356 | if (value != null) {
|
15357 | // Cast `value` to a string to ensure the value is set correctly. While
|
15358 | // browsers typically do this as necessary, jsdom doesn't.
|
15359 | ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value);
|
15360 | }
|
15361 | }
|
15362 | };
|
15363 |
|
15364 | function _handleChange(event) {
|
15365 | var props = this._currentElement.props;
|
15366 |
|
15367 | var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
15368 |
|
15369 | // Here we use asap to wait until all updates have propagated, which
|
15370 | // is important when using controlled components within layers:
|
15371 | // https://github.com/facebook/react/issues/1698
|
15372 | ReactUpdates.asap(forceUpdateIfMounted, this);
|
15373 |
|
15374 | var name = props.name;
|
15375 | if (props.type === 'radio' && name != null) {
|
15376 | var rootNode = ReactMount.getNode(this._rootNodeID);
|
15377 | var queryRoot = rootNode;
|
15378 |
|
15379 | while (queryRoot.parentNode) {
|
15380 | queryRoot = queryRoot.parentNode;
|
15381 | }
|
15382 |
|
15383 | // If `rootNode.form` was non-null, then we could try `form.elements`,
|
15384 | // but that sometimes behaves strangely in IE8. We could also try using
|
15385 | // `form.getElementsByName`, but that will only return direct children
|
15386 | // and won't include inputs that use the HTML5 `form=` attribute. Since
|
15387 | // the input might not even be in a form, let's just use the global
|
15388 | // `querySelectorAll` to ensure we don't miss anything.
|
15389 | var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
|
15390 |
|
15391 | for (var i = 0; i < group.length; i++) {
|
15392 | var otherNode = group[i];
|
15393 | if (otherNode === rootNode || otherNode.form !== rootNode.form) {
|
15394 | continue;
|
15395 | }
|
15396 | // This will throw if radio buttons rendered by different copies of React
|
15397 | // and the same name are rendered into the same form (same as #1939).
|
15398 | // That's probably okay; we don't support it just as we don't support
|
15399 | // mixing React with non-React.
|
15400 | var otherID = ReactMount.getID(otherNode);
|
15401 | !otherID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : undefined;
|
15402 | var otherInstance = instancesByReactID[otherID];
|
15403 | !otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Unknown radio button ID %s.', otherID) : invariant(false) : undefined;
|
15404 | // If this is a controlled radio button group, forcing the input that
|
15405 | // was previously checked to update will cause it to be come re-checked
|
15406 | // as appropriate.
|
15407 | ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
|
15408 | }
|
15409 | }
|
15410 |
|
15411 | return returnValue;
|
15412 | }
|
15413 |
|
15414 | module.exports = ReactDOMInput;
|
15415 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
15416 |
|
15417 | /***/ }),
|
15418 | /* 191 */
|
15419 | /***/ (function(module, exports, __webpack_require__) {
|
15420 |
|
15421 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
15422 | * Copyright 2013-2015, Facebook, Inc.
|
15423 | * All rights reserved.
|
15424 | *
|
15425 | * This source code is licensed under the BSD-style license found in the
|
15426 | * LICENSE file in the root directory of this source tree. An additional grant
|
15427 | * of patent rights can be found in the PATENTS file in the same directory.
|
15428 | *
|
15429 | * @providesModule LinkedValueUtils
|
15430 | * @typechecks static-only
|
15431 | */
|
15432 |
|
15433 | 'use strict';
|
15434 |
|
15435 | var ReactPropTypes = __webpack_require__(192);
|
15436 | var ReactPropTypeLocations = __webpack_require__(150);
|
15437 |
|
15438 | var invariant = __webpack_require__(98);
|
15439 | var warning = __webpack_require__(110);
|
15440 |
|
15441 | var hasReadOnlyValue = {
|
15442 | 'button': true,
|
15443 | 'checkbox': true,
|
15444 | 'image': true,
|
15445 | 'hidden': true,
|
15446 | 'radio': true,
|
15447 | 'reset': true,
|
15448 | 'submit': true
|
15449 | };
|
15450 |
|
15451 | function _assertSingleLink(inputProps) {
|
15452 | !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : undefined;
|
15453 | }
|
15454 | function _assertValueLink(inputProps) {
|
15455 | _assertSingleLink(inputProps);
|
15456 | !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : undefined;
|
15457 | }
|
15458 |
|
15459 | function _assertCheckedLink(inputProps) {
|
15460 | _assertSingleLink(inputProps);
|
15461 | !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : undefined;
|
15462 | }
|
15463 |
|
15464 | var propTypes = {
|
15465 | value: function (props, propName, componentName) {
|
15466 | if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
|
15467 | return null;
|
15468 | }
|
15469 | return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
15470 | },
|
15471 | checked: function (props, propName, componentName) {
|
15472 | if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
|
15473 | return null;
|
15474 | }
|
15475 | return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
15476 | },
|
15477 | onChange: ReactPropTypes.func
|
15478 | };
|
15479 |
|
15480 | var loggedTypeFailures = {};
|
15481 | function getDeclarationErrorAddendum(owner) {
|
15482 | if (owner) {
|
15483 | var name = owner.getName();
|
15484 | if (name) {
|
15485 | return ' Check the render method of `' + name + '`.';
|
15486 | }
|
15487 | }
|
15488 | return '';
|
15489 | }
|
15490 |
|
15491 | /**
|
15492 | * Provide a linked `value` attribute for controlled forms. You should not use
|
15493 | * this outside of the ReactDOM controlled form components.
|
15494 | */
|
15495 | var LinkedValueUtils = {
|
15496 | checkPropTypes: function (tagName, props, owner) {
|
15497 | for (var propName in propTypes) {
|
15498 | if (propTypes.hasOwnProperty(propName)) {
|
15499 | var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
15500 | }
|
15501 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
15502 | // Only monitor this failure once because there tends to be a lot of the
|
15503 | // same error.
|
15504 | loggedTypeFailures[error.message] = true;
|
15505 |
|
15506 | var addendum = getDeclarationErrorAddendum(owner);
|
15507 | process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : undefined;
|
15508 | }
|
15509 | }
|
15510 | },
|
15511 |
|
15512 | /**
|
15513 | * @param {object} inputProps Props for form component
|
15514 | * @return {*} current value of the input either from value prop or link.
|
15515 | */
|
15516 | getValue: function (inputProps) {
|
15517 | if (inputProps.valueLink) {
|
15518 | _assertValueLink(inputProps);
|
15519 | return inputProps.valueLink.value;
|
15520 | }
|
15521 | return inputProps.value;
|
15522 | },
|
15523 |
|
15524 | /**
|
15525 | * @param {object} inputProps Props for form component
|
15526 | * @return {*} current checked status of the input either from checked prop
|
15527 | * or link.
|
15528 | */
|
15529 | getChecked: function (inputProps) {
|
15530 | if (inputProps.checkedLink) {
|
15531 | _assertCheckedLink(inputProps);
|
15532 | return inputProps.checkedLink.value;
|
15533 | }
|
15534 | return inputProps.checked;
|
15535 | },
|
15536 |
|
15537 | /**
|
15538 | * @param {object} inputProps Props for form component
|
15539 | * @param {SyntheticEvent} event change event to handle
|
15540 | */
|
15541 | executeOnChange: function (inputProps, event) {
|
15542 | if (inputProps.valueLink) {
|
15543 | _assertValueLink(inputProps);
|
15544 | return inputProps.valueLink.requestChange(event.target.value);
|
15545 | } else if (inputProps.checkedLink) {
|
15546 | _assertCheckedLink(inputProps);
|
15547 | return inputProps.checkedLink.requestChange(event.target.checked);
|
15548 | } else if (inputProps.onChange) {
|
15549 | return inputProps.onChange.call(undefined, event);
|
15550 | }
|
15551 | }
|
15552 | };
|
15553 |
|
15554 | module.exports = LinkedValueUtils;
|
15555 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
15556 |
|
15557 | /***/ }),
|
15558 | /* 192 */
|
15559 | /***/ (function(module, exports, __webpack_require__) {
|
15560 |
|
15561 | /**
|
15562 | * Copyright 2013-2015, Facebook, Inc.
|
15563 | * All rights reserved.
|
15564 | *
|
15565 | * This source code is licensed under the BSD-style license found in the
|
15566 | * LICENSE file in the root directory of this source tree. An additional grant
|
15567 | * of patent rights can be found in the PATENTS file in the same directory.
|
15568 | *
|
15569 | * @providesModule ReactPropTypes
|
15570 | */
|
15571 |
|
15572 | 'use strict';
|
15573 |
|
15574 | var ReactElement = __webpack_require__(127);
|
15575 | var ReactPropTypeLocationNames = __webpack_require__(151);
|
15576 |
|
15577 | var emptyFunction = __webpack_require__(100);
|
15578 | var getIteratorFn = __webpack_require__(193);
|
15579 |
|
15580 | /**
|
15581 | * Collection of methods that allow declaration and validation of props that are
|
15582 | * supplied to React components. Example usage:
|
15583 | *
|
15584 | * var Props = require('ReactPropTypes');
|
15585 | * var MyArticle = React.createClass({
|
15586 | * propTypes: {
|
15587 | * // An optional string prop named "description".
|
15588 | * description: Props.string,
|
15589 | *
|
15590 | * // A required enum prop named "category".
|
15591 | * category: Props.oneOf(['News','Photos']).isRequired,
|
15592 | *
|
15593 | * // A prop named "dialog" that requires an instance of Dialog.
|
15594 | * dialog: Props.instanceOf(Dialog).isRequired
|
15595 | * },
|
15596 | * render: function() { ... }
|
15597 | * });
|
15598 | *
|
15599 | * A more formal specification of how these methods are used:
|
15600 | *
|
15601 | * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
15602 | * decl := ReactPropTypes.{type}(.isRequired)?
|
15603 | *
|
15604 | * Each and every declaration produces a function with the same signature. This
|
15605 | * allows the creation of custom validation functions. For example:
|
15606 | *
|
15607 | * var MyLink = React.createClass({
|
15608 | * propTypes: {
|
15609 | * // An optional string or URI prop named "href".
|
15610 | * href: function(props, propName, componentName) {
|
15611 | * var propValue = props[propName];
|
15612 | * if (propValue != null && typeof propValue !== 'string' &&
|
15613 | * !(propValue instanceof URI)) {
|
15614 | * return new Error(
|
15615 | * 'Expected a string or an URI for ' + propName + ' in ' +
|
15616 | * componentName
|
15617 | * );
|
15618 | * }
|
15619 | * }
|
15620 | * },
|
15621 | * render: function() {...}
|
15622 | * });
|
15623 | *
|
15624 | * @internal
|
15625 | */
|
15626 |
|
15627 | var ANONYMOUS = '<<anonymous>>';
|
15628 |
|
15629 | var ReactPropTypes = {
|
15630 | array: createPrimitiveTypeChecker('array'),
|
15631 | bool: createPrimitiveTypeChecker('boolean'),
|
15632 | func: createPrimitiveTypeChecker('function'),
|
15633 | number: createPrimitiveTypeChecker('number'),
|
15634 | object: createPrimitiveTypeChecker('object'),
|
15635 | string: createPrimitiveTypeChecker('string'),
|
15636 |
|
15637 | any: createAnyTypeChecker(),
|
15638 | arrayOf: createArrayOfTypeChecker,
|
15639 | element: createElementTypeChecker(),
|
15640 | instanceOf: createInstanceTypeChecker,
|
15641 | node: createNodeChecker(),
|
15642 | objectOf: createObjectOfTypeChecker,
|
15643 | oneOf: createEnumTypeChecker,
|
15644 | oneOfType: createUnionTypeChecker,
|
15645 | shape: createShapeTypeChecker
|
15646 | };
|
15647 |
|
15648 | function createChainableTypeChecker(validate) {
|
15649 | function checkType(isRequired, props, propName, componentName, location, propFullName) {
|
15650 | componentName = componentName || ANONYMOUS;
|
15651 | propFullName = propFullName || propName;
|
15652 | if (props[propName] == null) {
|
15653 | var locationName = ReactPropTypeLocationNames[location];
|
15654 | if (isRequired) {
|
15655 | return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
|
15656 | }
|
15657 | return null;
|
15658 | } else {
|
15659 | return validate(props, propName, componentName, location, propFullName);
|
15660 | }
|
15661 | }
|
15662 |
|
15663 | var chainedCheckType = checkType.bind(null, false);
|
15664 | chainedCheckType.isRequired = checkType.bind(null, true);
|
15665 |
|
15666 | return chainedCheckType;
|
15667 | }
|
15668 |
|
15669 | function createPrimitiveTypeChecker(expectedType) {
|
15670 | function validate(props, propName, componentName, location, propFullName) {
|
15671 | var propValue = props[propName];
|
15672 | var propType = getPropType(propValue);
|
15673 | if (propType !== expectedType) {
|
15674 | var locationName = ReactPropTypeLocationNames[location];
|
15675 | // `propValue` being instance of, say, date/regexp, pass the 'object'
|
15676 | // check, but we can offer a more precise error message here rather than
|
15677 | // 'of type `object`'.
|
15678 | var preciseType = getPreciseType(propValue);
|
15679 |
|
15680 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
15681 | }
|
15682 | return null;
|
15683 | }
|
15684 | return createChainableTypeChecker(validate);
|
15685 | }
|
15686 |
|
15687 | function createAnyTypeChecker() {
|
15688 | return createChainableTypeChecker(emptyFunction.thatReturns(null));
|
15689 | }
|
15690 |
|
15691 | function createArrayOfTypeChecker(typeChecker) {
|
15692 | function validate(props, propName, componentName, location, propFullName) {
|
15693 | var propValue = props[propName];
|
15694 | if (!Array.isArray(propValue)) {
|
15695 | var locationName = ReactPropTypeLocationNames[location];
|
15696 | var propType = getPropType(propValue);
|
15697 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
15698 | }
|
15699 | for (var i = 0; i < propValue.length; i++) {
|
15700 | var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
15701 | if (error instanceof Error) {
|
15702 | return error;
|
15703 | }
|
15704 | }
|
15705 | return null;
|
15706 | }
|
15707 | return createChainableTypeChecker(validate);
|
15708 | }
|
15709 |
|
15710 | function createElementTypeChecker() {
|
15711 | function validate(props, propName, componentName, location, propFullName) {
|
15712 | if (!ReactElement.isValidElement(props[propName])) {
|
15713 | var locationName = ReactPropTypeLocationNames[location];
|
15714 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));
|
15715 | }
|
15716 | return null;
|
15717 | }
|
15718 | return createChainableTypeChecker(validate);
|
15719 | }
|
15720 |
|
15721 | function createInstanceTypeChecker(expectedClass) {
|
15722 | function validate(props, propName, componentName, location, propFullName) {
|
15723 | if (!(props[propName] instanceof expectedClass)) {
|
15724 | var locationName = ReactPropTypeLocationNames[location];
|
15725 | var expectedClassName = expectedClass.name || ANONYMOUS;
|
15726 | var actualClassName = getClassName(props[propName]);
|
15727 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
15728 | }
|
15729 | return null;
|
15730 | }
|
15731 | return createChainableTypeChecker(validate);
|
15732 | }
|
15733 |
|
15734 | function createEnumTypeChecker(expectedValues) {
|
15735 | if (!Array.isArray(expectedValues)) {
|
15736 | return createChainableTypeChecker(function () {
|
15737 | return new Error('Invalid argument supplied to oneOf, expected an instance of array.');
|
15738 | });
|
15739 | }
|
15740 |
|
15741 | function validate(props, propName, componentName, location, propFullName) {
|
15742 | var propValue = props[propName];
|
15743 | for (var i = 0; i < expectedValues.length; i++) {
|
15744 | if (propValue === expectedValues[i]) {
|
15745 | return null;
|
15746 | }
|
15747 | }
|
15748 |
|
15749 | var locationName = ReactPropTypeLocationNames[location];
|
15750 | var valuesString = JSON.stringify(expectedValues);
|
15751 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
15752 | }
|
15753 | return createChainableTypeChecker(validate);
|
15754 | }
|
15755 |
|
15756 | function createObjectOfTypeChecker(typeChecker) {
|
15757 | function validate(props, propName, componentName, location, propFullName) {
|
15758 | var propValue = props[propName];
|
15759 | var propType = getPropType(propValue);
|
15760 | if (propType !== 'object') {
|
15761 | var locationName = ReactPropTypeLocationNames[location];
|
15762 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
15763 | }
|
15764 | for (var key in propValue) {
|
15765 | if (propValue.hasOwnProperty(key)) {
|
15766 | var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
15767 | if (error instanceof Error) {
|
15768 | return error;
|
15769 | }
|
15770 | }
|
15771 | }
|
15772 | return null;
|
15773 | }
|
15774 | return createChainableTypeChecker(validate);
|
15775 | }
|
15776 |
|
15777 | function createUnionTypeChecker(arrayOfTypeCheckers) {
|
15778 | if (!Array.isArray(arrayOfTypeCheckers)) {
|
15779 | return createChainableTypeChecker(function () {
|
15780 | return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
|
15781 | });
|
15782 | }
|
15783 |
|
15784 | function validate(props, propName, componentName, location, propFullName) {
|
15785 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
15786 | var checker = arrayOfTypeCheckers[i];
|
15787 | if (checker(props, propName, componentName, location, propFullName, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED') == null) {
|
15788 | return null;
|
15789 | }
|
15790 | }
|
15791 |
|
15792 | var locationName = ReactPropTypeLocationNames[location];
|
15793 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
15794 | }
|
15795 | return createChainableTypeChecker(validate);
|
15796 | }
|
15797 |
|
15798 | function createNodeChecker() {
|
15799 | function validate(props, propName, componentName, location, propFullName) {
|
15800 | if (!isNode(props[propName])) {
|
15801 | var locationName = ReactPropTypeLocationNames[location];
|
15802 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
15803 | }
|
15804 | return null;
|
15805 | }
|
15806 | return createChainableTypeChecker(validate);
|
15807 | }
|
15808 |
|
15809 | function createShapeTypeChecker(shapeTypes) {
|
15810 | function validate(props, propName, componentName, location, propFullName) {
|
15811 | var propValue = props[propName];
|
15812 | var propType = getPropType(propValue);
|
15813 | if (propType !== 'object') {
|
15814 | var locationName = ReactPropTypeLocationNames[location];
|
15815 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
15816 | }
|
15817 | for (var key in shapeTypes) {
|
15818 | var checker = shapeTypes[key];
|
15819 | if (!checker) {
|
15820 | continue;
|
15821 | }
|
15822 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
15823 | if (error) {
|
15824 | return error;
|
15825 | }
|
15826 | }
|
15827 | return null;
|
15828 | }
|
15829 | return createChainableTypeChecker(validate);
|
15830 | }
|
15831 |
|
15832 | function isNode(propValue) {
|
15833 | switch (typeof propValue) {
|
15834 | case 'number':
|
15835 | case 'string':
|
15836 | case 'undefined':
|
15837 | return true;
|
15838 | case 'boolean':
|
15839 | return !propValue;
|
15840 | case 'object':
|
15841 | if (Array.isArray(propValue)) {
|
15842 | return propValue.every(isNode);
|
15843 | }
|
15844 | if (propValue === null || ReactElement.isValidElement(propValue)) {
|
15845 | return true;
|
15846 | }
|
15847 |
|
15848 | var iteratorFn = getIteratorFn(propValue);
|
15849 | if (iteratorFn) {
|
15850 | var iterator = iteratorFn.call(propValue);
|
15851 | var step;
|
15852 | if (iteratorFn !== propValue.entries) {
|
15853 | while (!(step = iterator.next()).done) {
|
15854 | if (!isNode(step.value)) {
|
15855 | return false;
|
15856 | }
|
15857 | }
|
15858 | } else {
|
15859 | // Iterator will provide entry [k,v] tuples rather than values.
|
15860 | while (!(step = iterator.next()).done) {
|
15861 | var entry = step.value;
|
15862 | if (entry) {
|
15863 | if (!isNode(entry[1])) {
|
15864 | return false;
|
15865 | }
|
15866 | }
|
15867 | }
|
15868 | }
|
15869 | } else {
|
15870 | return false;
|
15871 | }
|
15872 |
|
15873 | return true;
|
15874 | default:
|
15875 | return false;
|
15876 | }
|
15877 | }
|
15878 |
|
15879 | // Equivalent of `typeof` but with special handling for array and regexp.
|
15880 | function getPropType(propValue) {
|
15881 | var propType = typeof propValue;
|
15882 | if (Array.isArray(propValue)) {
|
15883 | return 'array';
|
15884 | }
|
15885 | if (propValue instanceof RegExp) {
|
15886 | // Old webkits (at least until Android 4.0) return 'function' rather than
|
15887 | // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
15888 | // passes PropTypes.object.
|
15889 | return 'object';
|
15890 | }
|
15891 | return propType;
|
15892 | }
|
15893 |
|
15894 | // This handles more types than `getPropType`. Only used for error messages.
|
15895 | // See `createPrimitiveTypeChecker`.
|
15896 | function getPreciseType(propValue) {
|
15897 | var propType = getPropType(propValue);
|
15898 | if (propType === 'object') {
|
15899 | if (propValue instanceof Date) {
|
15900 | return 'date';
|
15901 | } else if (propValue instanceof RegExp) {
|
15902 | return 'regexp';
|
15903 | }
|
15904 | }
|
15905 | return propType;
|
15906 | }
|
15907 |
|
15908 | // Returns class name of the object, if any.
|
15909 | function getClassName(propValue) {
|
15910 | if (!propValue.constructor || !propValue.constructor.name) {
|
15911 | return '<<anonymous>>';
|
15912 | }
|
15913 | return propValue.constructor.name;
|
15914 | }
|
15915 |
|
15916 | module.exports = ReactPropTypes;
|
15917 |
|
15918 | /***/ }),
|
15919 | /* 193 */
|
15920 | /***/ (function(module, exports) {
|
15921 |
|
15922 | /**
|
15923 | * Copyright 2013-2015, Facebook, Inc.
|
15924 | * All rights reserved.
|
15925 | *
|
15926 | * This source code is licensed under the BSD-style license found in the
|
15927 | * LICENSE file in the root directory of this source tree. An additional grant
|
15928 | * of patent rights can be found in the PATENTS file in the same directory.
|
15929 | *
|
15930 | * @providesModule getIteratorFn
|
15931 | * @typechecks static-only
|
15932 | */
|
15933 |
|
15934 | 'use strict';
|
15935 |
|
15936 | /* global Symbol */
|
15937 | var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
15938 | var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
15939 |
|
15940 | /**
|
15941 | * Returns the iterator method function contained on the iterable object.
|
15942 | *
|
15943 | * Be sure to invoke the function with the iterable as context:
|
15944 | *
|
15945 | * var iteratorFn = getIteratorFn(myIterable);
|
15946 | * if (iteratorFn) {
|
15947 | * var iterator = iteratorFn.call(myIterable);
|
15948 | * ...
|
15949 | * }
|
15950 | *
|
15951 | * @param {?object} maybeIterable
|
15952 | * @return {?function}
|
15953 | */
|
15954 | function getIteratorFn(maybeIterable) {
|
15955 | var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
15956 | if (typeof iteratorFn === 'function') {
|
15957 | return iteratorFn;
|
15958 | }
|
15959 | }
|
15960 |
|
15961 | module.exports = getIteratorFn;
|
15962 |
|
15963 | /***/ }),
|
15964 | /* 194 */
|
15965 | /***/ (function(module, exports, __webpack_require__) {
|
15966 |
|
15967 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
15968 | * Copyright 2013-2015, Facebook, Inc.
|
15969 | * All rights reserved.
|
15970 | *
|
15971 | * This source code is licensed under the BSD-style license found in the
|
15972 | * LICENSE file in the root directory of this source tree. An additional grant
|
15973 | * of patent rights can be found in the PATENTS file in the same directory.
|
15974 | *
|
15975 | * @providesModule ReactDOMOption
|
15976 | */
|
15977 |
|
15978 | 'use strict';
|
15979 |
|
15980 | var ReactChildren = __webpack_require__(195);
|
15981 | var ReactDOMSelect = __webpack_require__(197);
|
15982 |
|
15983 | var assign = __webpack_require__(124);
|
15984 | var warning = __webpack_require__(110);
|
15985 |
|
15986 | var valueContextKey = ReactDOMSelect.valueContextKey;
|
15987 |
|
15988 | /**
|
15989 | * Implements an <option> native component that warns when `selected` is set.
|
15990 | */
|
15991 | var ReactDOMOption = {
|
15992 | mountWrapper: function (inst, props, context) {
|
15993 | // TODO (yungsters): Remove support for `selected` in <option>.
|
15994 | if (process.env.NODE_ENV !== 'production') {
|
15995 | process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : undefined;
|
15996 | }
|
15997 |
|
15998 | // Look up whether this option is 'selected' via context
|
15999 | var selectValue = context[valueContextKey];
|
16000 |
|
16001 | // If context key is null (e.g., no specified value or after initial mount)
|
16002 | // or missing (e.g., for <datalist>), we don't change props.selected
|
16003 | var selected = null;
|
16004 | if (selectValue != null) {
|
16005 | selected = false;
|
16006 | if (Array.isArray(selectValue)) {
|
16007 | // multiple
|
16008 | for (var i = 0; i < selectValue.length; i++) {
|
16009 | if ('' + selectValue[i] === '' + props.value) {
|
16010 | selected = true;
|
16011 | break;
|
16012 | }
|
16013 | }
|
16014 | } else {
|
16015 | selected = '' + selectValue === '' + props.value;
|
16016 | }
|
16017 | }
|
16018 |
|
16019 | inst._wrapperState = { selected: selected };
|
16020 | },
|
16021 |
|
16022 | getNativeProps: function (inst, props, context) {
|
16023 | var nativeProps = assign({ selected: undefined, children: undefined }, props);
|
16024 |
|
16025 | // Read state only from initial mount because <select> updates value
|
16026 | // manually; we need the initial state only for server rendering
|
16027 | if (inst._wrapperState.selected != null) {
|
16028 | nativeProps.selected = inst._wrapperState.selected;
|
16029 | }
|
16030 |
|
16031 | var content = '';
|
16032 |
|
16033 | // Flatten children and warn if they aren't strings or numbers;
|
16034 | // invalid types are ignored.
|
16035 | ReactChildren.forEach(props.children, function (child) {
|
16036 | if (child == null) {
|
16037 | return;
|
16038 | }
|
16039 | if (typeof child === 'string' || typeof child === 'number') {
|
16040 | content += child;
|
16041 | } else {
|
16042 | process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : undefined;
|
16043 | }
|
16044 | });
|
16045 |
|
16046 | if (content) {
|
16047 | nativeProps.children = content;
|
16048 | }
|
16049 |
|
16050 | return nativeProps;
|
16051 | }
|
16052 |
|
16053 | };
|
16054 |
|
16055 | module.exports = ReactDOMOption;
|
16056 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
16057 |
|
16058 | /***/ }),
|
16059 | /* 195 */
|
16060 | /***/ (function(module, exports, __webpack_require__) {
|
16061 |
|
16062 | /**
|
16063 | * Copyright 2013-2015, Facebook, Inc.
|
16064 | * All rights reserved.
|
16065 | *
|
16066 | * This source code is licensed under the BSD-style license found in the
|
16067 | * LICENSE file in the root directory of this source tree. An additional grant
|
16068 | * of patent rights can be found in the PATENTS file in the same directory.
|
16069 | *
|
16070 | * @providesModule ReactChildren
|
16071 | */
|
16072 |
|
16073 | 'use strict';
|
16074 |
|
16075 | var PooledClass = __webpack_require__(141);
|
16076 | var ReactElement = __webpack_require__(127);
|
16077 |
|
16078 | var emptyFunction = __webpack_require__(100);
|
16079 | var traverseAllChildren = __webpack_require__(196);
|
16080 |
|
16081 | var twoArgumentPooler = PooledClass.twoArgumentPooler;
|
16082 | var fourArgumentPooler = PooledClass.fourArgumentPooler;
|
16083 |
|
16084 | var userProvidedKeyEscapeRegex = /\/(?!\/)/g;
|
16085 | function escapeUserProvidedKey(text) {
|
16086 | return ('' + text).replace(userProvidedKeyEscapeRegex, '//');
|
16087 | }
|
16088 |
|
16089 | /**
|
16090 | * PooledClass representing the bookkeeping associated with performing a child
|
16091 | * traversal. Allows avoiding binding callbacks.
|
16092 | *
|
16093 | * @constructor ForEachBookKeeping
|
16094 | * @param {!function} forEachFunction Function to perform traversal with.
|
16095 | * @param {?*} forEachContext Context to perform context with.
|
16096 | */
|
16097 | function ForEachBookKeeping(forEachFunction, forEachContext) {
|
16098 | this.func = forEachFunction;
|
16099 | this.context = forEachContext;
|
16100 | this.count = 0;
|
16101 | }
|
16102 | ForEachBookKeeping.prototype.destructor = function () {
|
16103 | this.func = null;
|
16104 | this.context = null;
|
16105 | this.count = 0;
|
16106 | };
|
16107 | PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
|
16108 |
|
16109 | function forEachSingleChild(bookKeeping, child, name) {
|
16110 | var func = bookKeeping.func;
|
16111 | var context = bookKeeping.context;
|
16112 |
|
16113 | func.call(context, child, bookKeeping.count++);
|
16114 | }
|
16115 |
|
16116 | /**
|
16117 | * Iterates through children that are typically specified as `props.children`.
|
16118 | *
|
16119 | * The provided forEachFunc(child, index) will be called for each
|
16120 | * leaf child.
|
16121 | *
|
16122 | * @param {?*} children Children tree container.
|
16123 | * @param {function(*, int)} forEachFunc
|
16124 | * @param {*} forEachContext Context for forEachContext.
|
16125 | */
|
16126 | function forEachChildren(children, forEachFunc, forEachContext) {
|
16127 | if (children == null) {
|
16128 | return children;
|
16129 | }
|
16130 | var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
|
16131 | traverseAllChildren(children, forEachSingleChild, traverseContext);
|
16132 | ForEachBookKeeping.release(traverseContext);
|
16133 | }
|
16134 |
|
16135 | /**
|
16136 | * PooledClass representing the bookkeeping associated with performing a child
|
16137 | * mapping. Allows avoiding binding callbacks.
|
16138 | *
|
16139 | * @constructor MapBookKeeping
|
16140 | * @param {!*} mapResult Object containing the ordered map of results.
|
16141 | * @param {!function} mapFunction Function to perform mapping with.
|
16142 | * @param {?*} mapContext Context to perform mapping with.
|
16143 | */
|
16144 | function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
|
16145 | this.result = mapResult;
|
16146 | this.keyPrefix = keyPrefix;
|
16147 | this.func = mapFunction;
|
16148 | this.context = mapContext;
|
16149 | this.count = 0;
|
16150 | }
|
16151 | MapBookKeeping.prototype.destructor = function () {
|
16152 | this.result = null;
|
16153 | this.keyPrefix = null;
|
16154 | this.func = null;
|
16155 | this.context = null;
|
16156 | this.count = 0;
|
16157 | };
|
16158 | PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
|
16159 |
|
16160 | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
16161 | var result = bookKeeping.result;
|
16162 | var keyPrefix = bookKeeping.keyPrefix;
|
16163 | var func = bookKeeping.func;
|
16164 | var context = bookKeeping.context;
|
16165 |
|
16166 | var mappedChild = func.call(context, child, bookKeeping.count++);
|
16167 | if (Array.isArray(mappedChild)) {
|
16168 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
|
16169 | } else if (mappedChild != null) {
|
16170 | if (ReactElement.isValidElement(mappedChild)) {
|
16171 | mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
|
16172 | // Keep both the (mapped) and old keys if they differ, just as
|
16173 | // traverseAllChildren used to do for objects as children
|
16174 | keyPrefix + (mappedChild !== child ? escapeUserProvidedKey(mappedChild.key || '') + '/' : '') + childKey);
|
16175 | }
|
16176 | result.push(mappedChild);
|
16177 | }
|
16178 | }
|
16179 |
|
16180 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
16181 | var escapedPrefix = '';
|
16182 | if (prefix != null) {
|
16183 | escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
16184 | }
|
16185 | var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
|
16186 | traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
16187 | MapBookKeeping.release(traverseContext);
|
16188 | }
|
16189 |
|
16190 | /**
|
16191 | * Maps children that are typically specified as `props.children`.
|
16192 | *
|
16193 | * The provided mapFunction(child, key, index) will be called for each
|
16194 | * leaf child.
|
16195 | *
|
16196 | * @param {?*} children Children tree container.
|
16197 | * @param {function(*, int)} func The map function.
|
16198 | * @param {*} context Context for mapFunction.
|
16199 | * @return {object} Object containing the ordered map of results.
|
16200 | */
|
16201 | function mapChildren(children, func, context) {
|
16202 | if (children == null) {
|
16203 | return children;
|
16204 | }
|
16205 | var result = [];
|
16206 | mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
16207 | return result;
|
16208 | }
|
16209 |
|
16210 | function forEachSingleChildDummy(traverseContext, child, name) {
|
16211 | return null;
|
16212 | }
|
16213 |
|
16214 | /**
|
16215 | * Count the number of children that are typically specified as
|
16216 | * `props.children`.
|
16217 | *
|
16218 | * @param {?*} children Children tree container.
|
16219 | * @return {number} The number of children.
|
16220 | */
|
16221 | function countChildren(children, context) {
|
16222 | return traverseAllChildren(children, forEachSingleChildDummy, null);
|
16223 | }
|
16224 |
|
16225 | /**
|
16226 | * Flatten a children object (typically specified as `props.children`) and
|
16227 | * return an array with appropriately re-keyed children.
|
16228 | */
|
16229 | function toArray(children) {
|
16230 | var result = [];
|
16231 | mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
|
16232 | return result;
|
16233 | }
|
16234 |
|
16235 | var ReactChildren = {
|
16236 | forEach: forEachChildren,
|
16237 | map: mapChildren,
|
16238 | mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
|
16239 | count: countChildren,
|
16240 | toArray: toArray
|
16241 | };
|
16242 |
|
16243 | module.exports = ReactChildren;
|
16244 |
|
16245 | /***/ }),
|
16246 | /* 196 */
|
16247 | /***/ (function(module, exports, __webpack_require__) {
|
16248 |
|
16249 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
16250 | * Copyright 2013-2015, Facebook, Inc.
|
16251 | * All rights reserved.
|
16252 | *
|
16253 | * This source code is licensed under the BSD-style license found in the
|
16254 | * LICENSE file in the root directory of this source tree. An additional grant
|
16255 | * of patent rights can be found in the PATENTS file in the same directory.
|
16256 | *
|
16257 | * @providesModule traverseAllChildren
|
16258 | */
|
16259 |
|
16260 | 'use strict';
|
16261 |
|
16262 | var ReactCurrentOwner = __webpack_require__(90);
|
16263 | var ReactElement = __webpack_require__(127);
|
16264 | var ReactInstanceHandles = __webpack_require__(130);
|
16265 |
|
16266 | var getIteratorFn = __webpack_require__(193);
|
16267 | var invariant = __webpack_require__(98);
|
16268 | var warning = __webpack_require__(110);
|
16269 |
|
16270 | var SEPARATOR = ReactInstanceHandles.SEPARATOR;
|
16271 | var SUBSEPARATOR = ':';
|
16272 |
|
16273 | /**
|
16274 | * TODO: Test that a single child and an array with one item have the same key
|
16275 | * pattern.
|
16276 | */
|
16277 |
|
16278 | var userProvidedKeyEscaperLookup = {
|
16279 | '=': '=0',
|
16280 | '.': '=1',
|
16281 | ':': '=2'
|
16282 | };
|
16283 |
|
16284 | var userProvidedKeyEscapeRegex = /[=.:]/g;
|
16285 |
|
16286 | var didWarnAboutMaps = false;
|
16287 |
|
16288 | function userProvidedKeyEscaper(match) {
|
16289 | return userProvidedKeyEscaperLookup[match];
|
16290 | }
|
16291 |
|
16292 | /**
|
16293 | * Generate a key string that identifies a component within a set.
|
16294 | *
|
16295 | * @param {*} component A component that could contain a manual key.
|
16296 | * @param {number} index Index that is used if a manual key is not provided.
|
16297 | * @return {string}
|
16298 | */
|
16299 | function getComponentKey(component, index) {
|
16300 | if (component && component.key != null) {
|
16301 | // Explicit key
|
16302 | return wrapUserProvidedKey(component.key);
|
16303 | }
|
16304 | // Implicit key determined by the index in the set
|
16305 | return index.toString(36);
|
16306 | }
|
16307 |
|
16308 | /**
|
16309 | * Escape a component key so that it is safe to use in a reactid.
|
16310 | *
|
16311 | * @param {*} text Component key to be escaped.
|
16312 | * @return {string} An escaped string.
|
16313 | */
|
16314 | function escapeUserProvidedKey(text) {
|
16315 | return ('' + text).replace(userProvidedKeyEscapeRegex, userProvidedKeyEscaper);
|
16316 | }
|
16317 |
|
16318 | /**
|
16319 | * Wrap a `key` value explicitly provided by the user to distinguish it from
|
16320 | * implicitly-generated keys generated by a component's index in its parent.
|
16321 | *
|
16322 | * @param {string} key Value of a user-provided `key` attribute
|
16323 | * @return {string}
|
16324 | */
|
16325 | function wrapUserProvidedKey(key) {
|
16326 | return '$' + escapeUserProvidedKey(key);
|
16327 | }
|
16328 |
|
16329 | /**
|
16330 | * @param {?*} children Children tree container.
|
16331 | * @param {!string} nameSoFar Name of the key path so far.
|
16332 | * @param {!function} callback Callback to invoke with each child found.
|
16333 | * @param {?*} traverseContext Used to pass information throughout the traversal
|
16334 | * process.
|
16335 | * @return {!number} The number of children in this subtree.
|
16336 | */
|
16337 | function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
16338 | var type = typeof children;
|
16339 |
|
16340 | if (type === 'undefined' || type === 'boolean') {
|
16341 | // All of the above are perceived as null.
|
16342 | children = null;
|
16343 | }
|
16344 |
|
16345 | if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
|
16346 | callback(traverseContext, children,
|
16347 | // If it's the only child, treat the name as if it was wrapped in an array
|
16348 | // so that it's consistent if the number of children grows.
|
16349 | nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
16350 | return 1;
|
16351 | }
|
16352 |
|
16353 | var child;
|
16354 | var nextName;
|
16355 | var subtreeCount = 0; // Count of children found in the current subtree.
|
16356 | var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
16357 |
|
16358 | if (Array.isArray(children)) {
|
16359 | for (var i = 0; i < children.length; i++) {
|
16360 | child = children[i];
|
16361 | nextName = nextNamePrefix + getComponentKey(child, i);
|
16362 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
16363 | }
|
16364 | } else {
|
16365 | var iteratorFn = getIteratorFn(children);
|
16366 | if (iteratorFn) {
|
16367 | var iterator = iteratorFn.call(children);
|
16368 | var step;
|
16369 | if (iteratorFn !== children.entries) {
|
16370 | var ii = 0;
|
16371 | while (!(step = iterator.next()).done) {
|
16372 | child = step.value;
|
16373 | nextName = nextNamePrefix + getComponentKey(child, ii++);
|
16374 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
16375 | }
|
16376 | } else {
|
16377 | if (process.env.NODE_ENV !== 'production') {
|
16378 | process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : undefined;
|
16379 | didWarnAboutMaps = true;
|
16380 | }
|
16381 | // Iterator will provide entry [k,v] tuples rather than values.
|
16382 | while (!(step = iterator.next()).done) {
|
16383 | var entry = step.value;
|
16384 | if (entry) {
|
16385 | child = entry[1];
|
16386 | nextName = nextNamePrefix + wrapUserProvidedKey(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
|
16387 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
16388 | }
|
16389 | }
|
16390 | }
|
16391 | } else if (type === 'object') {
|
16392 | var addendum = '';
|
16393 | if (process.env.NODE_ENV !== 'production') {
|
16394 | addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
|
16395 | if (children._isReactElement) {
|
16396 | addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
|
16397 | }
|
16398 | if (ReactCurrentOwner.current) {
|
16399 | var name = ReactCurrentOwner.current.getName();
|
16400 | if (name) {
|
16401 | addendum += ' Check the render method of `' + name + '`.';
|
16402 | }
|
16403 | }
|
16404 | }
|
16405 | var childrenString = String(children);
|
16406 | true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : undefined;
|
16407 | }
|
16408 | }
|
16409 |
|
16410 | return subtreeCount;
|
16411 | }
|
16412 |
|
16413 | /**
|
16414 | * Traverses children that are typically specified as `props.children`, but
|
16415 | * might also be specified through attributes:
|
16416 | *
|
16417 | * - `traverseAllChildren(this.props.children, ...)`
|
16418 | * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
|
16419 | *
|
16420 | * The `traverseContext` is an optional argument that is passed through the
|
16421 | * entire traversal. It can be used to store accumulations or anything else that
|
16422 | * the callback might find relevant.
|
16423 | *
|
16424 | * @param {?*} children Children tree object.
|
16425 | * @param {!function} callback To invoke upon traversing each child.
|
16426 | * @param {?*} traverseContext Context for traversal.
|
16427 | * @return {!number} The number of children in this subtree.
|
16428 | */
|
16429 | function traverseAllChildren(children, callback, traverseContext) {
|
16430 | if (children == null) {
|
16431 | return 0;
|
16432 | }
|
16433 |
|
16434 | return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
16435 | }
|
16436 |
|
16437 | module.exports = traverseAllChildren;
|
16438 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
16439 |
|
16440 | /***/ }),
|
16441 | /* 197 */
|
16442 | /***/ (function(module, exports, __webpack_require__) {
|
16443 |
|
16444 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
16445 | * Copyright 2013-2015, Facebook, Inc.
|
16446 | * All rights reserved.
|
16447 | *
|
16448 | * This source code is licensed under the BSD-style license found in the
|
16449 | * LICENSE file in the root directory of this source tree. An additional grant
|
16450 | * of patent rights can be found in the PATENTS file in the same directory.
|
16451 | *
|
16452 | * @providesModule ReactDOMSelect
|
16453 | */
|
16454 |
|
16455 | 'use strict';
|
16456 |
|
16457 | var LinkedValueUtils = __webpack_require__(191);
|
16458 | var ReactMount = __webpack_require__(113);
|
16459 | var ReactUpdates = __webpack_require__(139);
|
16460 |
|
16461 | var assign = __webpack_require__(124);
|
16462 | var warning = __webpack_require__(110);
|
16463 |
|
16464 | var valueContextKey = '__ReactDOMSelect_value$' + Math.random().toString(36).slice(2);
|
16465 |
|
16466 | function updateOptionsIfPendingUpdateAndMounted() {
|
16467 | if (this._rootNodeID && this._wrapperState.pendingUpdate) {
|
16468 | this._wrapperState.pendingUpdate = false;
|
16469 |
|
16470 | var props = this._currentElement.props;
|
16471 | var value = LinkedValueUtils.getValue(props);
|
16472 |
|
16473 | if (value != null) {
|
16474 | updateOptions(this, Boolean(props.multiple), value);
|
16475 | }
|
16476 | }
|
16477 | }
|
16478 |
|
16479 | function getDeclarationErrorAddendum(owner) {
|
16480 | if (owner) {
|
16481 | var name = owner.getName();
|
16482 | if (name) {
|
16483 | return ' Check the render method of `' + name + '`.';
|
16484 | }
|
16485 | }
|
16486 | return '';
|
16487 | }
|
16488 |
|
16489 | var valuePropNames = ['value', 'defaultValue'];
|
16490 |
|
16491 | /**
|
16492 | * Validation function for `value` and `defaultValue`.
|
16493 | * @private
|
16494 | */
|
16495 | function checkSelectPropTypes(inst, props) {
|
16496 | var owner = inst._currentElement._owner;
|
16497 | LinkedValueUtils.checkPropTypes('select', props, owner);
|
16498 |
|
16499 | for (var i = 0; i < valuePropNames.length; i++) {
|
16500 | var propName = valuePropNames[i];
|
16501 | if (props[propName] == null) {
|
16502 | continue;
|
16503 | }
|
16504 | if (props.multiple) {
|
16505 | process.env.NODE_ENV !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
|
16506 | } else {
|
16507 | process.env.NODE_ENV !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
|
16508 | }
|
16509 | }
|
16510 | }
|
16511 |
|
16512 | /**
|
16513 | * @param {ReactDOMComponent} inst
|
16514 | * @param {boolean} multiple
|
16515 | * @param {*} propValue A stringable (with `multiple`, a list of stringables).
|
16516 | * @private
|
16517 | */
|
16518 | function updateOptions(inst, multiple, propValue) {
|
16519 | var selectedValue, i;
|
16520 | var options = ReactMount.getNode(inst._rootNodeID).options;
|
16521 |
|
16522 | if (multiple) {
|
16523 | selectedValue = {};
|
16524 | for (i = 0; i < propValue.length; i++) {
|
16525 | selectedValue['' + propValue[i]] = true;
|
16526 | }
|
16527 | for (i = 0; i < options.length; i++) {
|
16528 | var selected = selectedValue.hasOwnProperty(options[i].value);
|
16529 | if (options[i].selected !== selected) {
|
16530 | options[i].selected = selected;
|
16531 | }
|
16532 | }
|
16533 | } else {
|
16534 | // Do not set `select.value` as exact behavior isn't consistent across all
|
16535 | // browsers for all cases.
|
16536 | selectedValue = '' + propValue;
|
16537 | for (i = 0; i < options.length; i++) {
|
16538 | if (options[i].value === selectedValue) {
|
16539 | options[i].selected = true;
|
16540 | return;
|
16541 | }
|
16542 | }
|
16543 | if (options.length) {
|
16544 | options[0].selected = true;
|
16545 | }
|
16546 | }
|
16547 | }
|
16548 |
|
16549 | /**
|
16550 | * Implements a <select> native component that allows optionally setting the
|
16551 | * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
|
16552 | * stringable. If `multiple` is true, the prop must be an array of stringables.
|
16553 | *
|
16554 | * If `value` is not supplied (or null/undefined), user actions that change the
|
16555 | * selected option will trigger updates to the rendered options.
|
16556 | *
|
16557 | * If it is supplied (and not null/undefined), the rendered options will not
|
16558 | * update in response to user actions. Instead, the `value` prop must change in
|
16559 | * order for the rendered options to update.
|
16560 | *
|
16561 | * If `defaultValue` is provided, any options with the supplied values will be
|
16562 | * selected.
|
16563 | */
|
16564 | var ReactDOMSelect = {
|
16565 | valueContextKey: valueContextKey,
|
16566 |
|
16567 | getNativeProps: function (inst, props, context) {
|
16568 | return assign({}, props, {
|
16569 | onChange: inst._wrapperState.onChange,
|
16570 | value: undefined
|
16571 | });
|
16572 | },
|
16573 |
|
16574 | mountWrapper: function (inst, props) {
|
16575 | if (process.env.NODE_ENV !== 'production') {
|
16576 | checkSelectPropTypes(inst, props);
|
16577 | }
|
16578 |
|
16579 | var value = LinkedValueUtils.getValue(props);
|
16580 | inst._wrapperState = {
|
16581 | pendingUpdate: false,
|
16582 | initialValue: value != null ? value : props.defaultValue,
|
16583 | onChange: _handleChange.bind(inst),
|
16584 | wasMultiple: Boolean(props.multiple)
|
16585 | };
|
16586 | },
|
16587 |
|
16588 | processChildContext: function (inst, props, context) {
|
16589 | // Pass down initial value so initial generated markup has correct
|
16590 | // `selected` attributes
|
16591 | var childContext = assign({}, context);
|
16592 | childContext[valueContextKey] = inst._wrapperState.initialValue;
|
16593 | return childContext;
|
16594 | },
|
16595 |
|
16596 | postUpdateWrapper: function (inst) {
|
16597 | var props = inst._currentElement.props;
|
16598 |
|
16599 | // After the initial mount, we control selected-ness manually so don't pass
|
16600 | // the context value down
|
16601 | inst._wrapperState.initialValue = undefined;
|
16602 |
|
16603 | var wasMultiple = inst._wrapperState.wasMultiple;
|
16604 | inst._wrapperState.wasMultiple = Boolean(props.multiple);
|
16605 |
|
16606 | var value = LinkedValueUtils.getValue(props);
|
16607 | if (value != null) {
|
16608 | inst._wrapperState.pendingUpdate = false;
|
16609 | updateOptions(inst, Boolean(props.multiple), value);
|
16610 | } else if (wasMultiple !== Boolean(props.multiple)) {
|
16611 | // For simplicity, reapply `defaultValue` if `multiple` is toggled.
|
16612 | if (props.defaultValue != null) {
|
16613 | updateOptions(inst, Boolean(props.multiple), props.defaultValue);
|
16614 | } else {
|
16615 | // Revert the select back to its default unselected state.
|
16616 | updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
|
16617 | }
|
16618 | }
|
16619 | }
|
16620 | };
|
16621 |
|
16622 | function _handleChange(event) {
|
16623 | var props = this._currentElement.props;
|
16624 | var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
16625 |
|
16626 | this._wrapperState.pendingUpdate = true;
|
16627 | ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
|
16628 | return returnValue;
|
16629 | }
|
16630 |
|
16631 | module.exports = ReactDOMSelect;
|
16632 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
16633 |
|
16634 | /***/ }),
|
16635 | /* 198 */
|
16636 | /***/ (function(module, exports, __webpack_require__) {
|
16637 |
|
16638 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
16639 | * Copyright 2013-2015, Facebook, Inc.
|
16640 | * All rights reserved.
|
16641 | *
|
16642 | * This source code is licensed under the BSD-style license found in the
|
16643 | * LICENSE file in the root directory of this source tree. An additional grant
|
16644 | * of patent rights can be found in the PATENTS file in the same directory.
|
16645 | *
|
16646 | * @providesModule ReactDOMTextarea
|
16647 | */
|
16648 |
|
16649 | 'use strict';
|
16650 |
|
16651 | var LinkedValueUtils = __webpack_require__(191);
|
16652 | var ReactDOMIDOperations = __webpack_require__(112);
|
16653 | var ReactUpdates = __webpack_require__(139);
|
16654 |
|
16655 | var assign = __webpack_require__(124);
|
16656 | var invariant = __webpack_require__(98);
|
16657 | var warning = __webpack_require__(110);
|
16658 |
|
16659 | function forceUpdateIfMounted() {
|
16660 | if (this._rootNodeID) {
|
16661 | // DOM component is still mounted; update
|
16662 | ReactDOMTextarea.updateWrapper(this);
|
16663 | }
|
16664 | }
|
16665 |
|
16666 | /**
|
16667 | * Implements a <textarea> native component that allows setting `value`, and
|
16668 | * `defaultValue`. This differs from the traditional DOM API because value is
|
16669 | * usually set as PCDATA children.
|
16670 | *
|
16671 | * If `value` is not supplied (or null/undefined), user actions that affect the
|
16672 | * value will trigger updates to the element.
|
16673 | *
|
16674 | * If `value` is supplied (and not null/undefined), the rendered element will
|
16675 | * not trigger updates to the element. Instead, the `value` prop must change in
|
16676 | * order for the rendered element to be updated.
|
16677 | *
|
16678 | * The rendered element will be initialized with an empty value, the prop
|
16679 | * `defaultValue` if specified, or the children content (deprecated).
|
16680 | */
|
16681 | var ReactDOMTextarea = {
|
16682 | getNativeProps: function (inst, props, context) {
|
16683 | !(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : undefined;
|
16684 |
|
16685 | // Always set children to the same thing. In IE9, the selection range will
|
16686 | // get reset if `textContent` is mutated.
|
16687 | var nativeProps = assign({}, props, {
|
16688 | defaultValue: undefined,
|
16689 | value: undefined,
|
16690 | children: inst._wrapperState.initialValue,
|
16691 | onChange: inst._wrapperState.onChange
|
16692 | });
|
16693 |
|
16694 | return nativeProps;
|
16695 | },
|
16696 |
|
16697 | mountWrapper: function (inst, props) {
|
16698 | if (process.env.NODE_ENV !== 'production') {
|
16699 | LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
|
16700 | }
|
16701 |
|
16702 | var defaultValue = props.defaultValue;
|
16703 | // TODO (yungsters): Remove support for children content in <textarea>.
|
16704 | var children = props.children;
|
16705 | if (children != null) {
|
16706 | if (process.env.NODE_ENV !== 'production') {
|
16707 | process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : undefined;
|
16708 | }
|
16709 | !(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : undefined;
|
16710 | if (Array.isArray(children)) {
|
16711 | !(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : undefined;
|
16712 | children = children[0];
|
16713 | }
|
16714 |
|
16715 | defaultValue = '' + children;
|
16716 | }
|
16717 | if (defaultValue == null) {
|
16718 | defaultValue = '';
|
16719 | }
|
16720 | var value = LinkedValueUtils.getValue(props);
|
16721 |
|
16722 | inst._wrapperState = {
|
16723 | // We save the initial value so that `ReactDOMComponent` doesn't update
|
16724 | // `textContent` (unnecessary since we update value).
|
16725 | // The initial value can be a boolean or object so that's why it's
|
16726 | // forced to be a string.
|
16727 | initialValue: '' + (value != null ? value : defaultValue),
|
16728 | onChange: _handleChange.bind(inst)
|
16729 | };
|
16730 | },
|
16731 |
|
16732 | updateWrapper: function (inst) {
|
16733 | var props = inst._currentElement.props;
|
16734 | var value = LinkedValueUtils.getValue(props);
|
16735 | if (value != null) {
|
16736 | // Cast `value` to a string to ensure the value is set correctly. While
|
16737 | // browsers typically do this as necessary, jsdom doesn't.
|
16738 | ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value);
|
16739 | }
|
16740 | }
|
16741 | };
|
16742 |
|
16743 | function _handleChange(event) {
|
16744 | var props = this._currentElement.props;
|
16745 | var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
16746 | ReactUpdates.asap(forceUpdateIfMounted, this);
|
16747 | return returnValue;
|
16748 | }
|
16749 |
|
16750 | module.exports = ReactDOMTextarea;
|
16751 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
16752 |
|
16753 | /***/ }),
|
16754 | /* 199 */
|
16755 | /***/ (function(module, exports, __webpack_require__) {
|
16756 |
|
16757 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
16758 | * Copyright 2013-2015, Facebook, Inc.
|
16759 | * All rights reserved.
|
16760 | *
|
16761 | * This source code is licensed under the BSD-style license found in the
|
16762 | * LICENSE file in the root directory of this source tree. An additional grant
|
16763 | * of patent rights can be found in the PATENTS file in the same directory.
|
16764 | *
|
16765 | * @providesModule ReactMultiChild
|
16766 | * @typechecks static-only
|
16767 | */
|
16768 |
|
16769 | 'use strict';
|
16770 |
|
16771 | var ReactComponentEnvironment = __webpack_require__(149);
|
16772 | var ReactMultiChildUpdateTypes = __webpack_require__(101);
|
16773 |
|
16774 | var ReactCurrentOwner = __webpack_require__(90);
|
16775 | var ReactReconciler = __webpack_require__(135);
|
16776 | var ReactChildReconciler = __webpack_require__(200);
|
16777 |
|
16778 | var flattenChildren = __webpack_require__(201);
|
16779 |
|
16780 | /**
|
16781 | * Updating children of a component may trigger recursive updates. The depth is
|
16782 | * used to batch recursive updates to render markup more efficiently.
|
16783 | *
|
16784 | * @type {number}
|
16785 | * @private
|
16786 | */
|
16787 | var updateDepth = 0;
|
16788 |
|
16789 | /**
|
16790 | * Queue of update configuration objects.
|
16791 | *
|
16792 | * Each object has a `type` property that is in `ReactMultiChildUpdateTypes`.
|
16793 | *
|
16794 | * @type {array<object>}
|
16795 | * @private
|
16796 | */
|
16797 | var updateQueue = [];
|
16798 |
|
16799 | /**
|
16800 | * Queue of markup to be rendered.
|
16801 | *
|
16802 | * @type {array<string>}
|
16803 | * @private
|
16804 | */
|
16805 | var markupQueue = [];
|
16806 |
|
16807 | /**
|
16808 | * Enqueues markup to be rendered and inserted at a supplied index.
|
16809 | *
|
16810 | * @param {string} parentID ID of the parent component.
|
16811 | * @param {string} markup Markup that renders into an element.
|
16812 | * @param {number} toIndex Destination index.
|
16813 | * @private
|
16814 | */
|
16815 | function enqueueInsertMarkup(parentID, markup, toIndex) {
|
16816 | // NOTE: Null values reduce hidden classes.
|
16817 | updateQueue.push({
|
16818 | parentID: parentID,
|
16819 | parentNode: null,
|
16820 | type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
|
16821 | markupIndex: markupQueue.push(markup) - 1,
|
16822 | content: null,
|
16823 | fromIndex: null,
|
16824 | toIndex: toIndex
|
16825 | });
|
16826 | }
|
16827 |
|
16828 | /**
|
16829 | * Enqueues moving an existing element to another index.
|
16830 | *
|
16831 | * @param {string} parentID ID of the parent component.
|
16832 | * @param {number} fromIndex Source index of the existing element.
|
16833 | * @param {number} toIndex Destination index of the element.
|
16834 | * @private
|
16835 | */
|
16836 | function enqueueMove(parentID, fromIndex, toIndex) {
|
16837 | // NOTE: Null values reduce hidden classes.
|
16838 | updateQueue.push({
|
16839 | parentID: parentID,
|
16840 | parentNode: null,
|
16841 | type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
|
16842 | markupIndex: null,
|
16843 | content: null,
|
16844 | fromIndex: fromIndex,
|
16845 | toIndex: toIndex
|
16846 | });
|
16847 | }
|
16848 |
|
16849 | /**
|
16850 | * Enqueues removing an element at an index.
|
16851 | *
|
16852 | * @param {string} parentID ID of the parent component.
|
16853 | * @param {number} fromIndex Index of the element to remove.
|
16854 | * @private
|
16855 | */
|
16856 | function enqueueRemove(parentID, fromIndex) {
|
16857 | // NOTE: Null values reduce hidden classes.
|
16858 | updateQueue.push({
|
16859 | parentID: parentID,
|
16860 | parentNode: null,
|
16861 | type: ReactMultiChildUpdateTypes.REMOVE_NODE,
|
16862 | markupIndex: null,
|
16863 | content: null,
|
16864 | fromIndex: fromIndex,
|
16865 | toIndex: null
|
16866 | });
|
16867 | }
|
16868 |
|
16869 | /**
|
16870 | * Enqueues setting the markup of a node.
|
16871 | *
|
16872 | * @param {string} parentID ID of the parent component.
|
16873 | * @param {string} markup Markup that renders into an element.
|
16874 | * @private
|
16875 | */
|
16876 | function enqueueSetMarkup(parentID, markup) {
|
16877 | // NOTE: Null values reduce hidden classes.
|
16878 | updateQueue.push({
|
16879 | parentID: parentID,
|
16880 | parentNode: null,
|
16881 | type: ReactMultiChildUpdateTypes.SET_MARKUP,
|
16882 | markupIndex: null,
|
16883 | content: markup,
|
16884 | fromIndex: null,
|
16885 | toIndex: null
|
16886 | });
|
16887 | }
|
16888 |
|
16889 | /**
|
16890 | * Enqueues setting the text content.
|
16891 | *
|
16892 | * @param {string} parentID ID of the parent component.
|
16893 | * @param {string} textContent Text content to set.
|
16894 | * @private
|
16895 | */
|
16896 | function enqueueTextContent(parentID, textContent) {
|
16897 | // NOTE: Null values reduce hidden classes.
|
16898 | updateQueue.push({
|
16899 | parentID: parentID,
|
16900 | parentNode: null,
|
16901 | type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
|
16902 | markupIndex: null,
|
16903 | content: textContent,
|
16904 | fromIndex: null,
|
16905 | toIndex: null
|
16906 | });
|
16907 | }
|
16908 |
|
16909 | /**
|
16910 | * Processes any enqueued updates.
|
16911 | *
|
16912 | * @private
|
16913 | */
|
16914 | function processQueue() {
|
16915 | if (updateQueue.length) {
|
16916 | ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);
|
16917 | clearQueue();
|
16918 | }
|
16919 | }
|
16920 |
|
16921 | /**
|
16922 | * Clears any enqueued updates.
|
16923 | *
|
16924 | * @private
|
16925 | */
|
16926 | function clearQueue() {
|
16927 | updateQueue.length = 0;
|
16928 | markupQueue.length = 0;
|
16929 | }
|
16930 |
|
16931 | /**
|
16932 | * ReactMultiChild are capable of reconciling multiple children.
|
16933 | *
|
16934 | * @class ReactMultiChild
|
16935 | * @internal
|
16936 | */
|
16937 | var ReactMultiChild = {
|
16938 |
|
16939 | /**
|
16940 | * Provides common functionality for components that must reconcile multiple
|
16941 | * children. This is used by `ReactDOMComponent` to mount, update, and
|
16942 | * unmount child components.
|
16943 | *
|
16944 | * @lends {ReactMultiChild.prototype}
|
16945 | */
|
16946 | Mixin: {
|
16947 |
|
16948 | _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
|
16949 | if (process.env.NODE_ENV !== 'production') {
|
16950 | if (this._currentElement) {
|
16951 | try {
|
16952 | ReactCurrentOwner.current = this._currentElement._owner;
|
16953 | return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
|
16954 | } finally {
|
16955 | ReactCurrentOwner.current = null;
|
16956 | }
|
16957 | }
|
16958 | }
|
16959 | return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
|
16960 | },
|
16961 |
|
16962 | _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, transaction, context) {
|
16963 | var nextChildren;
|
16964 | if (process.env.NODE_ENV !== 'production') {
|
16965 | if (this._currentElement) {
|
16966 | try {
|
16967 | ReactCurrentOwner.current = this._currentElement._owner;
|
16968 | nextChildren = flattenChildren(nextNestedChildrenElements);
|
16969 | } finally {
|
16970 | ReactCurrentOwner.current = null;
|
16971 | }
|
16972 | return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context);
|
16973 | }
|
16974 | }
|
16975 | nextChildren = flattenChildren(nextNestedChildrenElements);
|
16976 | return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context);
|
16977 | },
|
16978 |
|
16979 | /**
|
16980 | * Generates a "mount image" for each of the supplied children. In the case
|
16981 | * of `ReactDOMComponent`, a mount image is a string of markup.
|
16982 | *
|
16983 | * @param {?object} nestedChildren Nested child maps.
|
16984 | * @return {array} An array of mounted representations.
|
16985 | * @internal
|
16986 | */
|
16987 | mountChildren: function (nestedChildren, transaction, context) {
|
16988 | var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
|
16989 | this._renderedChildren = children;
|
16990 | var mountImages = [];
|
16991 | var index = 0;
|
16992 | for (var name in children) {
|
16993 | if (children.hasOwnProperty(name)) {
|
16994 | var child = children[name];
|
16995 | // Inlined for performance, see `ReactInstanceHandles.createReactID`.
|
16996 | var rootID = this._rootNodeID + name;
|
16997 | var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context);
|
16998 | child._mountIndex = index++;
|
16999 | mountImages.push(mountImage);
|
17000 | }
|
17001 | }
|
17002 | return mountImages;
|
17003 | },
|
17004 |
|
17005 | /**
|
17006 | * Replaces any rendered children with a text content string.
|
17007 | *
|
17008 | * @param {string} nextContent String of content.
|
17009 | * @internal
|
17010 | */
|
17011 | updateTextContent: function (nextContent) {
|
17012 | updateDepth++;
|
17013 | var errorThrown = true;
|
17014 | try {
|
17015 | var prevChildren = this._renderedChildren;
|
17016 | // Remove any rendered children.
|
17017 | ReactChildReconciler.unmountChildren(prevChildren);
|
17018 | // TODO: The setTextContent operation should be enough
|
17019 | for (var name in prevChildren) {
|
17020 | if (prevChildren.hasOwnProperty(name)) {
|
17021 | this._unmountChild(prevChildren[name]);
|
17022 | }
|
17023 | }
|
17024 | // Set new text content.
|
17025 | this.setTextContent(nextContent);
|
17026 | errorThrown = false;
|
17027 | } finally {
|
17028 | updateDepth--;
|
17029 | if (!updateDepth) {
|
17030 | if (errorThrown) {
|
17031 | clearQueue();
|
17032 | } else {
|
17033 | processQueue();
|
17034 | }
|
17035 | }
|
17036 | }
|
17037 | },
|
17038 |
|
17039 | /**
|
17040 | * Replaces any rendered children with a markup string.
|
17041 | *
|
17042 | * @param {string} nextMarkup String of markup.
|
17043 | * @internal
|
17044 | */
|
17045 | updateMarkup: function (nextMarkup) {
|
17046 | updateDepth++;
|
17047 | var errorThrown = true;
|
17048 | try {
|
17049 | var prevChildren = this._renderedChildren;
|
17050 | // Remove any rendered children.
|
17051 | ReactChildReconciler.unmountChildren(prevChildren);
|
17052 | for (var name in prevChildren) {
|
17053 | if (prevChildren.hasOwnProperty(name)) {
|
17054 | this._unmountChildByName(prevChildren[name], name);
|
17055 | }
|
17056 | }
|
17057 | this.setMarkup(nextMarkup);
|
17058 | errorThrown = false;
|
17059 | } finally {
|
17060 | updateDepth--;
|
17061 | if (!updateDepth) {
|
17062 | if (errorThrown) {
|
17063 | clearQueue();
|
17064 | } else {
|
17065 | processQueue();
|
17066 | }
|
17067 | }
|
17068 | }
|
17069 | },
|
17070 |
|
17071 | /**
|
17072 | * Updates the rendered children with new children.
|
17073 | *
|
17074 | * @param {?object} nextNestedChildrenElements Nested child element maps.
|
17075 | * @param {ReactReconcileTransaction} transaction
|
17076 | * @internal
|
17077 | */
|
17078 | updateChildren: function (nextNestedChildrenElements, transaction, context) {
|
17079 | updateDepth++;
|
17080 | var errorThrown = true;
|
17081 | try {
|
17082 | this._updateChildren(nextNestedChildrenElements, transaction, context);
|
17083 | errorThrown = false;
|
17084 | } finally {
|
17085 | updateDepth--;
|
17086 | if (!updateDepth) {
|
17087 | if (errorThrown) {
|
17088 | clearQueue();
|
17089 | } else {
|
17090 | processQueue();
|
17091 | }
|
17092 | }
|
17093 | }
|
17094 | },
|
17095 |
|
17096 | /**
|
17097 | * Improve performance by isolating this hot code path from the try/catch
|
17098 | * block in `updateChildren`.
|
17099 | *
|
17100 | * @param {?object} nextNestedChildrenElements Nested child element maps.
|
17101 | * @param {ReactReconcileTransaction} transaction
|
17102 | * @final
|
17103 | * @protected
|
17104 | */
|
17105 | _updateChildren: function (nextNestedChildrenElements, transaction, context) {
|
17106 | var prevChildren = this._renderedChildren;
|
17107 | var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, transaction, context);
|
17108 | this._renderedChildren = nextChildren;
|
17109 | if (!nextChildren && !prevChildren) {
|
17110 | return;
|
17111 | }
|
17112 | var name;
|
17113 | // `nextIndex` will increment for each child in `nextChildren`, but
|
17114 | // `lastIndex` will be the last index visited in `prevChildren`.
|
17115 | var lastIndex = 0;
|
17116 | var nextIndex = 0;
|
17117 | for (name in nextChildren) {
|
17118 | if (!nextChildren.hasOwnProperty(name)) {
|
17119 | continue;
|
17120 | }
|
17121 | var prevChild = prevChildren && prevChildren[name];
|
17122 | var nextChild = nextChildren[name];
|
17123 | if (prevChild === nextChild) {
|
17124 | this.moveChild(prevChild, nextIndex, lastIndex);
|
17125 | lastIndex = Math.max(prevChild._mountIndex, lastIndex);
|
17126 | prevChild._mountIndex = nextIndex;
|
17127 | } else {
|
17128 | if (prevChild) {
|
17129 | // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
|
17130 | lastIndex = Math.max(prevChild._mountIndex, lastIndex);
|
17131 | this._unmountChild(prevChild);
|
17132 | }
|
17133 | // The child must be instantiated before it's mounted.
|
17134 | this._mountChildByNameAtIndex(nextChild, name, nextIndex, transaction, context);
|
17135 | }
|
17136 | nextIndex++;
|
17137 | }
|
17138 | // Remove children that are no longer present.
|
17139 | for (name in prevChildren) {
|
17140 | if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
|
17141 | this._unmountChild(prevChildren[name]);
|
17142 | }
|
17143 | }
|
17144 | },
|
17145 |
|
17146 | /**
|
17147 | * Unmounts all rendered children. This should be used to clean up children
|
17148 | * when this component is unmounted.
|
17149 | *
|
17150 | * @internal
|
17151 | */
|
17152 | unmountChildren: function () {
|
17153 | var renderedChildren = this._renderedChildren;
|
17154 | ReactChildReconciler.unmountChildren(renderedChildren);
|
17155 | this._renderedChildren = null;
|
17156 | },
|
17157 |
|
17158 | /**
|
17159 | * Moves a child component to the supplied index.
|
17160 | *
|
17161 | * @param {ReactComponent} child Component to move.
|
17162 | * @param {number} toIndex Destination index of the element.
|
17163 | * @param {number} lastIndex Last index visited of the siblings of `child`.
|
17164 | * @protected
|
17165 | */
|
17166 | moveChild: function (child, toIndex, lastIndex) {
|
17167 | // If the index of `child` is less than `lastIndex`, then it needs to
|
17168 | // be moved. Otherwise, we do not need to move it because a child will be
|
17169 | // inserted or moved before `child`.
|
17170 | if (child._mountIndex < lastIndex) {
|
17171 | enqueueMove(this._rootNodeID, child._mountIndex, toIndex);
|
17172 | }
|
17173 | },
|
17174 |
|
17175 | /**
|
17176 | * Creates a child component.
|
17177 | *
|
17178 | * @param {ReactComponent} child Component to create.
|
17179 | * @param {string} mountImage Markup to insert.
|
17180 | * @protected
|
17181 | */
|
17182 | createChild: function (child, mountImage) {
|
17183 | enqueueInsertMarkup(this._rootNodeID, mountImage, child._mountIndex);
|
17184 | },
|
17185 |
|
17186 | /**
|
17187 | * Removes a child component.
|
17188 | *
|
17189 | * @param {ReactComponent} child Child to remove.
|
17190 | * @protected
|
17191 | */
|
17192 | removeChild: function (child) {
|
17193 | enqueueRemove(this._rootNodeID, child._mountIndex);
|
17194 | },
|
17195 |
|
17196 | /**
|
17197 | * Sets this text content string.
|
17198 | *
|
17199 | * @param {string} textContent Text content to set.
|
17200 | * @protected
|
17201 | */
|
17202 | setTextContent: function (textContent) {
|
17203 | enqueueTextContent(this._rootNodeID, textContent);
|
17204 | },
|
17205 |
|
17206 | /**
|
17207 | * Sets this markup string.
|
17208 | *
|
17209 | * @param {string} markup Markup to set.
|
17210 | * @protected
|
17211 | */
|
17212 | setMarkup: function (markup) {
|
17213 | enqueueSetMarkup(this._rootNodeID, markup);
|
17214 | },
|
17215 |
|
17216 | /**
|
17217 | * Mounts a child with the supplied name.
|
17218 | *
|
17219 | * NOTE: This is part of `updateChildren` and is here for readability.
|
17220 | *
|
17221 | * @param {ReactComponent} child Component to mount.
|
17222 | * @param {string} name Name of the child.
|
17223 | * @param {number} index Index at which to insert the child.
|
17224 | * @param {ReactReconcileTransaction} transaction
|
17225 | * @private
|
17226 | */
|
17227 | _mountChildByNameAtIndex: function (child, name, index, transaction, context) {
|
17228 | // Inlined for performance, see `ReactInstanceHandles.createReactID`.
|
17229 | var rootID = this._rootNodeID + name;
|
17230 | var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context);
|
17231 | child._mountIndex = index;
|
17232 | this.createChild(child, mountImage);
|
17233 | },
|
17234 |
|
17235 | /**
|
17236 | * Unmounts a rendered child.
|
17237 | *
|
17238 | * NOTE: This is part of `updateChildren` and is here for readability.
|
17239 | *
|
17240 | * @param {ReactComponent} child Component to unmount.
|
17241 | * @private
|
17242 | */
|
17243 | _unmountChild: function (child) {
|
17244 | this.removeChild(child);
|
17245 | child._mountIndex = null;
|
17246 | }
|
17247 |
|
17248 | }
|
17249 |
|
17250 | };
|
17251 |
|
17252 | module.exports = ReactMultiChild;
|
17253 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
17254 |
|
17255 | /***/ }),
|
17256 | /* 200 */
|
17257 | /***/ (function(module, exports, __webpack_require__) {
|
17258 |
|
17259 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
17260 | * Copyright 2014-2015, Facebook, Inc.
|
17261 | * All rights reserved.
|
17262 | *
|
17263 | * This source code is licensed under the BSD-style license found in the
|
17264 | * LICENSE file in the root directory of this source tree. An additional grant
|
17265 | * of patent rights can be found in the PATENTS file in the same directory.
|
17266 | *
|
17267 | * @providesModule ReactChildReconciler
|
17268 | * @typechecks static-only
|
17269 | */
|
17270 |
|
17271 | 'use strict';
|
17272 |
|
17273 | var ReactReconciler = __webpack_require__(135);
|
17274 |
|
17275 | var instantiateReactComponent = __webpack_require__(147);
|
17276 | var shouldUpdateReactComponent = __webpack_require__(152);
|
17277 | var traverseAllChildren = __webpack_require__(196);
|
17278 | var warning = __webpack_require__(110);
|
17279 |
|
17280 | function instantiateChild(childInstances, child, name) {
|
17281 | // We found a component instance.
|
17282 | var keyUnique = childInstances[name] === undefined;
|
17283 | if (process.env.NODE_ENV !== 'production') {
|
17284 | process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined;
|
17285 | }
|
17286 | if (child != null && keyUnique) {
|
17287 | childInstances[name] = instantiateReactComponent(child, null);
|
17288 | }
|
17289 | }
|
17290 |
|
17291 | /**
|
17292 | * ReactChildReconciler provides helpers for initializing or updating a set of
|
17293 | * children. Its output is suitable for passing it onto ReactMultiChild which
|
17294 | * does diffed reordering and insertion.
|
17295 | */
|
17296 | var ReactChildReconciler = {
|
17297 | /**
|
17298 | * Generates a "mount image" for each of the supplied children. In the case
|
17299 | * of `ReactDOMComponent`, a mount image is a string of markup.
|
17300 | *
|
17301 | * @param {?object} nestedChildNodes Nested child maps.
|
17302 | * @return {?object} A set of child instances.
|
17303 | * @internal
|
17304 | */
|
17305 | instantiateChildren: function (nestedChildNodes, transaction, context) {
|
17306 | if (nestedChildNodes == null) {
|
17307 | return null;
|
17308 | }
|
17309 | var childInstances = {};
|
17310 | traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
|
17311 | return childInstances;
|
17312 | },
|
17313 |
|
17314 | /**
|
17315 | * Updates the rendered children and returns a new set of children.
|
17316 | *
|
17317 | * @param {?object} prevChildren Previously initialized set of children.
|
17318 | * @param {?object} nextChildren Flat child element maps.
|
17319 | * @param {ReactReconcileTransaction} transaction
|
17320 | * @param {object} context
|
17321 | * @return {?object} A new set of child instances.
|
17322 | * @internal
|
17323 | */
|
17324 | updateChildren: function (prevChildren, nextChildren, transaction, context) {
|
17325 | // We currently don't have a way to track moves here but if we use iterators
|
17326 | // instead of for..in we can zip the iterators and check if an item has
|
17327 | // moved.
|
17328 | // TODO: If nothing has changed, return the prevChildren object so that we
|
17329 | // can quickly bailout if nothing has changed.
|
17330 | if (!nextChildren && !prevChildren) {
|
17331 | return null;
|
17332 | }
|
17333 | var name;
|
17334 | for (name in nextChildren) {
|
17335 | if (!nextChildren.hasOwnProperty(name)) {
|
17336 | continue;
|
17337 | }
|
17338 | var prevChild = prevChildren && prevChildren[name];
|
17339 | var prevElement = prevChild && prevChild._currentElement;
|
17340 | var nextElement = nextChildren[name];
|
17341 | if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
|
17342 | ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
|
17343 | nextChildren[name] = prevChild;
|
17344 | } else {
|
17345 | if (prevChild) {
|
17346 | ReactReconciler.unmountComponent(prevChild, name);
|
17347 | }
|
17348 | // The child must be instantiated before it's mounted.
|
17349 | var nextChildInstance = instantiateReactComponent(nextElement, null);
|
17350 | nextChildren[name] = nextChildInstance;
|
17351 | }
|
17352 | }
|
17353 | // Unmount children that are no longer present.
|
17354 | for (name in prevChildren) {
|
17355 | if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
|
17356 | ReactReconciler.unmountComponent(prevChildren[name]);
|
17357 | }
|
17358 | }
|
17359 | return nextChildren;
|
17360 | },
|
17361 |
|
17362 | /**
|
17363 | * Unmounts all rendered children. This should be used to clean up children
|
17364 | * when this component is unmounted.
|
17365 | *
|
17366 | * @param {?object} renderedChildren Previously initialized set of children.
|
17367 | * @internal
|
17368 | */
|
17369 | unmountChildren: function (renderedChildren) {
|
17370 | for (var name in renderedChildren) {
|
17371 | if (renderedChildren.hasOwnProperty(name)) {
|
17372 | var renderedChild = renderedChildren[name];
|
17373 | ReactReconciler.unmountComponent(renderedChild);
|
17374 | }
|
17375 | }
|
17376 | }
|
17377 |
|
17378 | };
|
17379 |
|
17380 | module.exports = ReactChildReconciler;
|
17381 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
17382 |
|
17383 | /***/ }),
|
17384 | /* 201 */
|
17385 | /***/ (function(module, exports, __webpack_require__) {
|
17386 |
|
17387 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
17388 | * Copyright 2013-2015, Facebook, Inc.
|
17389 | * All rights reserved.
|
17390 | *
|
17391 | * This source code is licensed under the BSD-style license found in the
|
17392 | * LICENSE file in the root directory of this source tree. An additional grant
|
17393 | * of patent rights can be found in the PATENTS file in the same directory.
|
17394 | *
|
17395 | * @providesModule flattenChildren
|
17396 | */
|
17397 |
|
17398 | 'use strict';
|
17399 |
|
17400 | var traverseAllChildren = __webpack_require__(196);
|
17401 | var warning = __webpack_require__(110);
|
17402 |
|
17403 | /**
|
17404 | * @param {function} traverseContext Context passed through traversal.
|
17405 | * @param {?ReactComponent} child React child component.
|
17406 | * @param {!string} name String name of key path to child.
|
17407 | */
|
17408 | function flattenSingleChildIntoContext(traverseContext, child, name) {
|
17409 | // We found a component instance.
|
17410 | var result = traverseContext;
|
17411 | var keyUnique = result[name] === undefined;
|
17412 | if (process.env.NODE_ENV !== 'production') {
|
17413 | process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined;
|
17414 | }
|
17415 | if (keyUnique && child != null) {
|
17416 | result[name] = child;
|
17417 | }
|
17418 | }
|
17419 |
|
17420 | /**
|
17421 | * Flattens children that are typically specified as `props.children`. Any null
|
17422 | * children will not be included in the resulting object.
|
17423 | * @return {!object} flattened children keyed by name.
|
17424 | */
|
17425 | function flattenChildren(children) {
|
17426 | if (children == null) {
|
17427 | return children;
|
17428 | }
|
17429 | var result = {};
|
17430 | traverseAllChildren(children, flattenSingleChildIntoContext, result);
|
17431 | return result;
|
17432 | }
|
17433 |
|
17434 | module.exports = flattenChildren;
|
17435 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
17436 |
|
17437 | /***/ }),
|
17438 | /* 202 */
|
17439 | /***/ (function(module, exports) {
|
17440 |
|
17441 | /**
|
17442 | * Copyright 2013-2015, Facebook, Inc.
|
17443 | * All rights reserved.
|
17444 | *
|
17445 | * This source code is licensed under the BSD-style license found in the
|
17446 | * LICENSE file in the root directory of this source tree. An additional grant
|
17447 | * of patent rights can be found in the PATENTS file in the same directory.
|
17448 | *
|
17449 | * @providesModule shallowEqual
|
17450 | * @typechecks
|
17451 | *
|
17452 | */
|
17453 |
|
17454 | 'use strict';
|
17455 |
|
17456 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
17457 |
|
17458 | /**
|
17459 | * Performs equality by iterating through keys on an object and returning false
|
17460 | * when any key has values which are not strictly equal between the arguments.
|
17461 | * Returns true when the values of all keys are strictly equal.
|
17462 | */
|
17463 | function shallowEqual(objA, objB) {
|
17464 | if (objA === objB) {
|
17465 | return true;
|
17466 | }
|
17467 |
|
17468 | if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
17469 | return false;
|
17470 | }
|
17471 |
|
17472 | var keysA = Object.keys(objA);
|
17473 | var keysB = Object.keys(objB);
|
17474 |
|
17475 | if (keysA.length !== keysB.length) {
|
17476 | return false;
|
17477 | }
|
17478 |
|
17479 | // Test for A's keys different from B.
|
17480 | var bHasOwnProperty = hasOwnProperty.bind(objB);
|
17481 | for (var i = 0; i < keysA.length; i++) {
|
17482 | if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
|
17483 | return false;
|
17484 | }
|
17485 | }
|
17486 |
|
17487 | return true;
|
17488 | }
|
17489 |
|
17490 | module.exports = shallowEqual;
|
17491 |
|
17492 | /***/ }),
|
17493 | /* 203 */
|
17494 | /***/ (function(module, exports, __webpack_require__) {
|
17495 |
|
17496 | /**
|
17497 | * Copyright 2013-2015, Facebook, Inc.
|
17498 | * All rights reserved.
|
17499 | *
|
17500 | * This source code is licensed under the BSD-style license found in the
|
17501 | * LICENSE file in the root directory of this source tree. An additional grant
|
17502 | * of patent rights can be found in the PATENTS file in the same directory.
|
17503 | *
|
17504 | * @providesModule ReactEventListener
|
17505 | * @typechecks static-only
|
17506 | */
|
17507 |
|
17508 | 'use strict';
|
17509 |
|
17510 | var EventListener = __webpack_require__(204);
|
17511 | var ExecutionEnvironment = __webpack_require__(94);
|
17512 | var PooledClass = __webpack_require__(141);
|
17513 | var ReactInstanceHandles = __webpack_require__(130);
|
17514 | var ReactMount = __webpack_require__(113);
|
17515 | var ReactUpdates = __webpack_require__(139);
|
17516 |
|
17517 | var assign = __webpack_require__(124);
|
17518 | var getEventTarget = __webpack_require__(166);
|
17519 | var getUnboundedScrollPosition = __webpack_require__(205);
|
17520 |
|
17521 | var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
|
17522 |
|
17523 | /**
|
17524 | * Finds the parent React component of `node`.
|
17525 | *
|
17526 | * @param {*} node
|
17527 | * @return {?DOMEventTarget} Parent container, or `null` if the specified node
|
17528 | * is not nested.
|
17529 | */
|
17530 | function findParent(node) {
|
17531 | // TODO: It may be a good idea to cache this to prevent unnecessary DOM
|
17532 | // traversal, but caching is difficult to do correctly without using a
|
17533 | // mutation observer to listen for all DOM changes.
|
17534 | var nodeID = ReactMount.getID(node);
|
17535 | var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
|
17536 | var container = ReactMount.findReactContainerForID(rootID);
|
17537 | var parent = ReactMount.getFirstReactDOM(container);
|
17538 | return parent;
|
17539 | }
|
17540 |
|
17541 | // Used to store ancestor hierarchy in top level callback
|
17542 | function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
|
17543 | this.topLevelType = topLevelType;
|
17544 | this.nativeEvent = nativeEvent;
|
17545 | this.ancestors = [];
|
17546 | }
|
17547 | assign(TopLevelCallbackBookKeeping.prototype, {
|
17548 | destructor: function () {
|
17549 | this.topLevelType = null;
|
17550 | this.nativeEvent = null;
|
17551 | this.ancestors.length = 0;
|
17552 | }
|
17553 | });
|
17554 | PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
|
17555 |
|
17556 | function handleTopLevelImpl(bookKeeping) {
|
17557 | // TODO: Re-enable event.path handling
|
17558 | //
|
17559 | // if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) {
|
17560 | // // New browsers have a path attribute on native events
|
17561 | // handleTopLevelWithPath(bookKeeping);
|
17562 | // } else {
|
17563 | // // Legacy browsers don't have a path attribute on native events
|
17564 | // handleTopLevelWithoutPath(bookKeeping);
|
17565 | // }
|
17566 |
|
17567 | void handleTopLevelWithPath; // temporarily unused
|
17568 | handleTopLevelWithoutPath(bookKeeping);
|
17569 | }
|
17570 |
|
17571 | // Legacy browsers don't have a path attribute on native events
|
17572 | function handleTopLevelWithoutPath(bookKeeping) {
|
17573 | var topLevelTarget = ReactMount.getFirstReactDOM(getEventTarget(bookKeeping.nativeEvent)) || window;
|
17574 |
|
17575 | // Loop through the hierarchy, in case there's any nested components.
|
17576 | // It's important that we build the array of ancestors before calling any
|
17577 | // event handlers, because event handlers can modify the DOM, leading to
|
17578 | // inconsistencies with ReactMount's node cache. See #1105.
|
17579 | var ancestor = topLevelTarget;
|
17580 | while (ancestor) {
|
17581 | bookKeeping.ancestors.push(ancestor);
|
17582 | ancestor = findParent(ancestor);
|
17583 | }
|
17584 |
|
17585 | for (var i = 0; i < bookKeeping.ancestors.length; i++) {
|
17586 | topLevelTarget = bookKeeping.ancestors[i];
|
17587 | var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';
|
17588 | ReactEventListener._handleTopLevel(bookKeeping.topLevelType, topLevelTarget, topLevelTargetID, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
|
17589 | }
|
17590 | }
|
17591 |
|
17592 | // New browsers have a path attribute on native events
|
17593 | function handleTopLevelWithPath(bookKeeping) {
|
17594 | var path = bookKeeping.nativeEvent.path;
|
17595 | var currentNativeTarget = path[0];
|
17596 | var eventsFired = 0;
|
17597 | for (var i = 0; i < path.length; i++) {
|
17598 | var currentPathElement = path[i];
|
17599 | if (currentPathElement.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE) {
|
17600 | currentNativeTarget = path[i + 1];
|
17601 | }
|
17602 | // TODO: slow
|
17603 | var reactParent = ReactMount.getFirstReactDOM(currentPathElement);
|
17604 | if (reactParent === currentPathElement) {
|
17605 | var currentPathElementID = ReactMount.getID(currentPathElement);
|
17606 | var newRootID = ReactInstanceHandles.getReactRootIDFromNodeID(currentPathElementID);
|
17607 | bookKeeping.ancestors.push(currentPathElement);
|
17608 |
|
17609 | var topLevelTargetID = ReactMount.getID(currentPathElement) || '';
|
17610 | eventsFired++;
|
17611 | ReactEventListener._handleTopLevel(bookKeeping.topLevelType, currentPathElement, topLevelTargetID, bookKeeping.nativeEvent, currentNativeTarget);
|
17612 |
|
17613 | // Jump to the root of this React render tree
|
17614 | while (currentPathElementID !== newRootID) {
|
17615 | i++;
|
17616 | currentPathElement = path[i];
|
17617 | currentPathElementID = ReactMount.getID(currentPathElement);
|
17618 | }
|
17619 | }
|
17620 | }
|
17621 | if (eventsFired === 0) {
|
17622 | ReactEventListener._handleTopLevel(bookKeeping.topLevelType, window, '', bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
|
17623 | }
|
17624 | }
|
17625 |
|
17626 | function scrollValueMonitor(cb) {
|
17627 | var scrollPosition = getUnboundedScrollPosition(window);
|
17628 | cb(scrollPosition);
|
17629 | }
|
17630 |
|
17631 | var ReactEventListener = {
|
17632 | _enabled: true,
|
17633 | _handleTopLevel: null,
|
17634 |
|
17635 | WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
|
17636 |
|
17637 | setHandleTopLevel: function (handleTopLevel) {
|
17638 | ReactEventListener._handleTopLevel = handleTopLevel;
|
17639 | },
|
17640 |
|
17641 | setEnabled: function (enabled) {
|
17642 | ReactEventListener._enabled = !!enabled;
|
17643 | },
|
17644 |
|
17645 | isEnabled: function () {
|
17646 | return ReactEventListener._enabled;
|
17647 | },
|
17648 |
|
17649 | /**
|
17650 | * Traps top-level events by using event bubbling.
|
17651 | *
|
17652 | * @param {string} topLevelType Record from `EventConstants`.
|
17653 | * @param {string} handlerBaseName Event name (e.g. "click").
|
17654 | * @param {object} handle Element on which to attach listener.
|
17655 | * @return {?object} An object with a remove function which will forcefully
|
17656 | * remove the listener.
|
17657 | * @internal
|
17658 | */
|
17659 | trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
|
17660 | var element = handle;
|
17661 | if (!element) {
|
17662 | return null;
|
17663 | }
|
17664 | return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
|
17665 | },
|
17666 |
|
17667 | /**
|
17668 | * Traps a top-level event by using event capturing.
|
17669 | *
|
17670 | * @param {string} topLevelType Record from `EventConstants`.
|
17671 | * @param {string} handlerBaseName Event name (e.g. "click").
|
17672 | * @param {object} handle Element on which to attach listener.
|
17673 | * @return {?object} An object with a remove function which will forcefully
|
17674 | * remove the listener.
|
17675 | * @internal
|
17676 | */
|
17677 | trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
|
17678 | var element = handle;
|
17679 | if (!element) {
|
17680 | return null;
|
17681 | }
|
17682 | return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
|
17683 | },
|
17684 |
|
17685 | monitorScrollValue: function (refresh) {
|
17686 | var callback = scrollValueMonitor.bind(null, refresh);
|
17687 | EventListener.listen(window, 'scroll', callback);
|
17688 | },
|
17689 |
|
17690 | dispatchEvent: function (topLevelType, nativeEvent) {
|
17691 | if (!ReactEventListener._enabled) {
|
17692 | return;
|
17693 | }
|
17694 |
|
17695 | var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
|
17696 | try {
|
17697 | // Event queue being processed in the same cycle allows
|
17698 | // `preventDefault`.
|
17699 | ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
|
17700 | } finally {
|
17701 | TopLevelCallbackBookKeeping.release(bookKeeping);
|
17702 | }
|
17703 | }
|
17704 | };
|
17705 |
|
17706 | module.exports = ReactEventListener;
|
17707 |
|
17708 | /***/ }),
|
17709 | /* 204 */
|
17710 | /***/ (function(module, exports, __webpack_require__) {
|
17711 |
|
17712 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
17713 | * Copyright 2013-2015, Facebook, Inc.
|
17714 | *
|
17715 | * Licensed under the Apache License, Version 2.0 (the "License");
|
17716 | * you may not use this file except in compliance with the License.
|
17717 | * You may obtain a copy of the License at
|
17718 | *
|
17719 | * http://www.apache.org/licenses/LICENSE-2.0
|
17720 | *
|
17721 | * Unless required by applicable law or agreed to in writing, software
|
17722 | * distributed under the License is distributed on an "AS IS" BASIS,
|
17723 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17724 | * See the License for the specific language governing permissions and
|
17725 | * limitations under the License.
|
17726 | *
|
17727 | * @providesModule EventListener
|
17728 | * @typechecks
|
17729 | */
|
17730 |
|
17731 | 'use strict';
|
17732 |
|
17733 | var emptyFunction = __webpack_require__(100);
|
17734 |
|
17735 | /**
|
17736 | * Upstream version of event listener. Does not take into account specific
|
17737 | * nature of platform.
|
17738 | */
|
17739 | var EventListener = {
|
17740 | /**
|
17741 | * Listen to DOM events during the bubble phase.
|
17742 | *
|
17743 | * @param {DOMEventTarget} target DOM element to register listener on.
|
17744 | * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
|
17745 | * @param {function} callback Callback function.
|
17746 | * @return {object} Object with a `remove` method.
|
17747 | */
|
17748 | listen: function (target, eventType, callback) {
|
17749 | if (target.addEventListener) {
|
17750 | target.addEventListener(eventType, callback, false);
|
17751 | return {
|
17752 | remove: function () {
|
17753 | target.removeEventListener(eventType, callback, false);
|
17754 | }
|
17755 | };
|
17756 | } else if (target.attachEvent) {
|
17757 | target.attachEvent('on' + eventType, callback);
|
17758 | return {
|
17759 | remove: function () {
|
17760 | target.detachEvent('on' + eventType, callback);
|
17761 | }
|
17762 | };
|
17763 | }
|
17764 | },
|
17765 |
|
17766 | /**
|
17767 | * Listen to DOM events during the capture phase.
|
17768 | *
|
17769 | * @param {DOMEventTarget} target DOM element to register listener on.
|
17770 | * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
|
17771 | * @param {function} callback Callback function.
|
17772 | * @return {object} Object with a `remove` method.
|
17773 | */
|
17774 | capture: function (target, eventType, callback) {
|
17775 | if (target.addEventListener) {
|
17776 | target.addEventListener(eventType, callback, true);
|
17777 | return {
|
17778 | remove: function () {
|
17779 | target.removeEventListener(eventType, callback, true);
|
17780 | }
|
17781 | };
|
17782 | } else {
|
17783 | if (process.env.NODE_ENV !== 'production') {
|
17784 | console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
|
17785 | }
|
17786 | return {
|
17787 | remove: emptyFunction
|
17788 | };
|
17789 | }
|
17790 | },
|
17791 |
|
17792 | registerDefault: function () {}
|
17793 | };
|
17794 |
|
17795 | module.exports = EventListener;
|
17796 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
17797 |
|
17798 | /***/ }),
|
17799 | /* 205 */
|
17800 | /***/ (function(module, exports) {
|
17801 |
|
17802 | /**
|
17803 | * Copyright 2013-2015, Facebook, Inc.
|
17804 | * All rights reserved.
|
17805 | *
|
17806 | * This source code is licensed under the BSD-style license found in the
|
17807 | * LICENSE file in the root directory of this source tree. An additional grant
|
17808 | * of patent rights can be found in the PATENTS file in the same directory.
|
17809 | *
|
17810 | * @providesModule getUnboundedScrollPosition
|
17811 | * @typechecks
|
17812 | */
|
17813 |
|
17814 | 'use strict';
|
17815 |
|
17816 | /**
|
17817 | * Gets the scroll position of the supplied element or window.
|
17818 | *
|
17819 | * The return values are unbounded, unlike `getScrollPosition`. This means they
|
17820 | * may be negative or exceed the element boundaries (which is possible using
|
17821 | * inertial scrolling).
|
17822 | *
|
17823 | * @param {DOMWindow|DOMElement} scrollable
|
17824 | * @return {object} Map with `x` and `y` keys.
|
17825 | */
|
17826 | function getUnboundedScrollPosition(scrollable) {
|
17827 | if (scrollable === window) {
|
17828 | return {
|
17829 | x: window.pageXOffset || document.documentElement.scrollLeft,
|
17830 | y: window.pageYOffset || document.documentElement.scrollTop
|
17831 | };
|
17832 | }
|
17833 | return {
|
17834 | x: scrollable.scrollLeft,
|
17835 | y: scrollable.scrollTop
|
17836 | };
|
17837 | }
|
17838 |
|
17839 | module.exports = getUnboundedScrollPosition;
|
17840 |
|
17841 | /***/ }),
|
17842 | /* 206 */
|
17843 | /***/ (function(module, exports, __webpack_require__) {
|
17844 |
|
17845 | /**
|
17846 | * Copyright 2013-2015, Facebook, Inc.
|
17847 | * All rights reserved.
|
17848 | *
|
17849 | * This source code is licensed under the BSD-style license found in the
|
17850 | * LICENSE file in the root directory of this source tree. An additional grant
|
17851 | * of patent rights can be found in the PATENTS file in the same directory.
|
17852 | *
|
17853 | * @providesModule ReactInjection
|
17854 | */
|
17855 |
|
17856 | 'use strict';
|
17857 |
|
17858 | var DOMProperty = __webpack_require__(108);
|
17859 | var EventPluginHub = __webpack_require__(116);
|
17860 | var ReactComponentEnvironment = __webpack_require__(149);
|
17861 | var ReactClass = __webpack_require__(207);
|
17862 | var ReactEmptyComponent = __webpack_require__(153);
|
17863 | var ReactBrowserEventEmitter = __webpack_require__(114);
|
17864 | var ReactNativeComponent = __webpack_require__(154);
|
17865 | var ReactPerf = __webpack_require__(103);
|
17866 | var ReactRootIndex = __webpack_require__(131);
|
17867 | var ReactUpdates = __webpack_require__(139);
|
17868 |
|
17869 | var ReactInjection = {
|
17870 | Component: ReactComponentEnvironment.injection,
|
17871 | Class: ReactClass.injection,
|
17872 | DOMProperty: DOMProperty.injection,
|
17873 | EmptyComponent: ReactEmptyComponent.injection,
|
17874 | EventPluginHub: EventPluginHub.injection,
|
17875 | EventEmitter: ReactBrowserEventEmitter.injection,
|
17876 | NativeComponent: ReactNativeComponent.injection,
|
17877 | Perf: ReactPerf.injection,
|
17878 | RootIndex: ReactRootIndex.injection,
|
17879 | Updates: ReactUpdates.injection
|
17880 | };
|
17881 |
|
17882 | module.exports = ReactInjection;
|
17883 |
|
17884 | /***/ }),
|
17885 | /* 207 */
|
17886 | /***/ (function(module, exports, __webpack_require__) {
|
17887 |
|
17888 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
17889 | * Copyright 2013-2015, Facebook, Inc.
|
17890 | * All rights reserved.
|
17891 | *
|
17892 | * This source code is licensed under the BSD-style license found in the
|
17893 | * LICENSE file in the root directory of this source tree. An additional grant
|
17894 | * of patent rights can be found in the PATENTS file in the same directory.
|
17895 | *
|
17896 | * @providesModule ReactClass
|
17897 | */
|
17898 |
|
17899 | 'use strict';
|
17900 |
|
17901 | var ReactComponent = __webpack_require__(208);
|
17902 | var ReactElement = __webpack_require__(127);
|
17903 | var ReactPropTypeLocations = __webpack_require__(150);
|
17904 | var ReactPropTypeLocationNames = __webpack_require__(151);
|
17905 | var ReactNoopUpdateQueue = __webpack_require__(209);
|
17906 |
|
17907 | var assign = __webpack_require__(124);
|
17908 | var emptyObject = __webpack_require__(143);
|
17909 | var invariant = __webpack_require__(98);
|
17910 | var keyMirror = __webpack_require__(102);
|
17911 | var keyOf = __webpack_require__(164);
|
17912 | var warning = __webpack_require__(110);
|
17913 |
|
17914 | var MIXINS_KEY = keyOf({ mixins: null });
|
17915 |
|
17916 | /**
|
17917 | * Policies that describe methods in `ReactClassInterface`.
|
17918 | */
|
17919 | var SpecPolicy = keyMirror({
|
17920 | /**
|
17921 | * These methods may be defined only once by the class specification or mixin.
|
17922 | */
|
17923 | DEFINE_ONCE: null,
|
17924 | /**
|
17925 | * These methods may be defined by both the class specification and mixins.
|
17926 | * Subsequent definitions will be chained. These methods must return void.
|
17927 | */
|
17928 | DEFINE_MANY: null,
|
17929 | /**
|
17930 | * These methods are overriding the base class.
|
17931 | */
|
17932 | OVERRIDE_BASE: null,
|
17933 | /**
|
17934 | * These methods are similar to DEFINE_MANY, except we assume they return
|
17935 | * objects. We try to merge the keys of the return values of all the mixed in
|
17936 | * functions. If there is a key conflict we throw.
|
17937 | */
|
17938 | DEFINE_MANY_MERGED: null
|
17939 | });
|
17940 |
|
17941 | var injectedMixins = [];
|
17942 |
|
17943 | var warnedSetProps = false;
|
17944 | function warnSetProps() {
|
17945 | if (!warnedSetProps) {
|
17946 | warnedSetProps = true;
|
17947 | process.env.NODE_ENV !== 'production' ? warning(false, 'setProps(...) and replaceProps(...) are deprecated. ' + 'Instead, call render again at the top level.') : undefined;
|
17948 | }
|
17949 | }
|
17950 |
|
17951 | /**
|
17952 | * Composite components are higher-level components that compose other composite
|
17953 | * or native components.
|
17954 | *
|
17955 | * To create a new type of `ReactClass`, pass a specification of
|
17956 | * your new class to `React.createClass`. The only requirement of your class
|
17957 | * specification is that you implement a `render` method.
|
17958 | *
|
17959 | * var MyComponent = React.createClass({
|
17960 | * render: function() {
|
17961 | * return <div>Hello World</div>;
|
17962 | * }
|
17963 | * });
|
17964 | *
|
17965 | * The class specification supports a specific protocol of methods that have
|
17966 | * special meaning (e.g. `render`). See `ReactClassInterface` for
|
17967 | * more the comprehensive protocol. Any other properties and methods in the
|
17968 | * class specification will be available on the prototype.
|
17969 | *
|
17970 | * @interface ReactClassInterface
|
17971 | * @internal
|
17972 | */
|
17973 | var ReactClassInterface = {
|
17974 |
|
17975 | /**
|
17976 | * An array of Mixin objects to include when defining your component.
|
17977 | *
|
17978 | * @type {array}
|
17979 | * @optional
|
17980 | */
|
17981 | mixins: SpecPolicy.DEFINE_MANY,
|
17982 |
|
17983 | /**
|
17984 | * An object containing properties and methods that should be defined on
|
17985 | * the component's constructor instead of its prototype (static methods).
|
17986 | *
|
17987 | * @type {object}
|
17988 | * @optional
|
17989 | */
|
17990 | statics: SpecPolicy.DEFINE_MANY,
|
17991 |
|
17992 | /**
|
17993 | * Definition of prop types for this component.
|
17994 | *
|
17995 | * @type {object}
|
17996 | * @optional
|
17997 | */
|
17998 | propTypes: SpecPolicy.DEFINE_MANY,
|
17999 |
|
18000 | /**
|
18001 | * Definition of context types for this component.
|
18002 | *
|
18003 | * @type {object}
|
18004 | * @optional
|
18005 | */
|
18006 | contextTypes: SpecPolicy.DEFINE_MANY,
|
18007 |
|
18008 | /**
|
18009 | * Definition of context types this component sets for its children.
|
18010 | *
|
18011 | * @type {object}
|
18012 | * @optional
|
18013 | */
|
18014 | childContextTypes: SpecPolicy.DEFINE_MANY,
|
18015 |
|
18016 | // ==== Definition methods ====
|
18017 |
|
18018 | /**
|
18019 | * Invoked when the component is mounted. Values in the mapping will be set on
|
18020 | * `this.props` if that prop is not specified (i.e. using an `in` check).
|
18021 | *
|
18022 | * This method is invoked before `getInitialState` and therefore cannot rely
|
18023 | * on `this.state` or use `this.setState`.
|
18024 | *
|
18025 | * @return {object}
|
18026 | * @optional
|
18027 | */
|
18028 | getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
|
18029 |
|
18030 | /**
|
18031 | * Invoked once before the component is mounted. The return value will be used
|
18032 | * as the initial value of `this.state`.
|
18033 | *
|
18034 | * getInitialState: function() {
|
18035 | * return {
|
18036 | * isOn: false,
|
18037 | * fooBaz: new BazFoo()
|
18038 | * }
|
18039 | * }
|
18040 | *
|
18041 | * @return {object}
|
18042 | * @optional
|
18043 | */
|
18044 | getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
|
18045 |
|
18046 | /**
|
18047 | * @return {object}
|
18048 | * @optional
|
18049 | */
|
18050 | getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
|
18051 |
|
18052 | /**
|
18053 | * Uses props from `this.props` and state from `this.state` to render the
|
18054 | * structure of the component.
|
18055 | *
|
18056 | * No guarantees are made about when or how often this method is invoked, so
|
18057 | * it must not have side effects.
|
18058 | *
|
18059 | * render: function() {
|
18060 | * var name = this.props.name;
|
18061 | * return <div>Hello, {name}!</div>;
|
18062 | * }
|
18063 | *
|
18064 | * @return {ReactComponent}
|
18065 | * @nosideeffects
|
18066 | * @required
|
18067 | */
|
18068 | render: SpecPolicy.DEFINE_ONCE,
|
18069 |
|
18070 | // ==== Delegate methods ====
|
18071 |
|
18072 | /**
|
18073 | * Invoked when the component is initially created and about to be mounted.
|
18074 | * This may have side effects, but any external subscriptions or data created
|
18075 | * by this method must be cleaned up in `componentWillUnmount`.
|
18076 | *
|
18077 | * @optional
|
18078 | */
|
18079 | componentWillMount: SpecPolicy.DEFINE_MANY,
|
18080 |
|
18081 | /**
|
18082 | * Invoked when the component has been mounted and has a DOM representation.
|
18083 | * However, there is no guarantee that the DOM node is in the document.
|
18084 | *
|
18085 | * Use this as an opportunity to operate on the DOM when the component has
|
18086 | * been mounted (initialized and rendered) for the first time.
|
18087 | *
|
18088 | * @param {DOMElement} rootNode DOM element representing the component.
|
18089 | * @optional
|
18090 | */
|
18091 | componentDidMount: SpecPolicy.DEFINE_MANY,
|
18092 |
|
18093 | /**
|
18094 | * Invoked before the component receives new props.
|
18095 | *
|
18096 | * Use this as an opportunity to react to a prop transition by updating the
|
18097 | * state using `this.setState`. Current props are accessed via `this.props`.
|
18098 | *
|
18099 | * componentWillReceiveProps: function(nextProps, nextContext) {
|
18100 | * this.setState({
|
18101 | * likesIncreasing: nextProps.likeCount > this.props.likeCount
|
18102 | * });
|
18103 | * }
|
18104 | *
|
18105 | * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
|
18106 | * transition may cause a state change, but the opposite is not true. If you
|
18107 | * need it, you are probably looking for `componentWillUpdate`.
|
18108 | *
|
18109 | * @param {object} nextProps
|
18110 | * @optional
|
18111 | */
|
18112 | componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
|
18113 |
|
18114 | /**
|
18115 | * Invoked while deciding if the component should be updated as a result of
|
18116 | * receiving new props, state and/or context.
|
18117 | *
|
18118 | * Use this as an opportunity to `return false` when you're certain that the
|
18119 | * transition to the new props/state/context will not require a component
|
18120 | * update.
|
18121 | *
|
18122 | * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
|
18123 | * return !equal(nextProps, this.props) ||
|
18124 | * !equal(nextState, this.state) ||
|
18125 | * !equal(nextContext, this.context);
|
18126 | * }
|
18127 | *
|
18128 | * @param {object} nextProps
|
18129 | * @param {?object} nextState
|
18130 | * @param {?object} nextContext
|
18131 | * @return {boolean} True if the component should update.
|
18132 | * @optional
|
18133 | */
|
18134 | shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
|
18135 |
|
18136 | /**
|
18137 | * Invoked when the component is about to update due to a transition from
|
18138 | * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
|
18139 | * and `nextContext`.
|
18140 | *
|
18141 | * Use this as an opportunity to perform preparation before an update occurs.
|
18142 | *
|
18143 | * NOTE: You **cannot** use `this.setState()` in this method.
|
18144 | *
|
18145 | * @param {object} nextProps
|
18146 | * @param {?object} nextState
|
18147 | * @param {?object} nextContext
|
18148 | * @param {ReactReconcileTransaction} transaction
|
18149 | * @optional
|
18150 | */
|
18151 | componentWillUpdate: SpecPolicy.DEFINE_MANY,
|
18152 |
|
18153 | /**
|
18154 | * Invoked when the component's DOM representation has been updated.
|
18155 | *
|
18156 | * Use this as an opportunity to operate on the DOM when the component has
|
18157 | * been updated.
|
18158 | *
|
18159 | * @param {object} prevProps
|
18160 | * @param {?object} prevState
|
18161 | * @param {?object} prevContext
|
18162 | * @param {DOMElement} rootNode DOM element representing the component.
|
18163 | * @optional
|
18164 | */
|
18165 | componentDidUpdate: SpecPolicy.DEFINE_MANY,
|
18166 |
|
18167 | /**
|
18168 | * Invoked when the component is about to be removed from its parent and have
|
18169 | * its DOM representation destroyed.
|
18170 | *
|
18171 | * Use this as an opportunity to deallocate any external resources.
|
18172 | *
|
18173 | * NOTE: There is no `componentDidUnmount` since your component will have been
|
18174 | * destroyed by that point.
|
18175 | *
|
18176 | * @optional
|
18177 | */
|
18178 | componentWillUnmount: SpecPolicy.DEFINE_MANY,
|
18179 |
|
18180 | // ==== Advanced methods ====
|
18181 |
|
18182 | /**
|
18183 | * Updates the component's currently mounted DOM representation.
|
18184 | *
|
18185 | * By default, this implements React's rendering and reconciliation algorithm.
|
18186 | * Sophisticated clients may wish to override this.
|
18187 | *
|
18188 | * @param {ReactReconcileTransaction} transaction
|
18189 | * @internal
|
18190 | * @overridable
|
18191 | */
|
18192 | updateComponent: SpecPolicy.OVERRIDE_BASE
|
18193 |
|
18194 | };
|
18195 |
|
18196 | /**
|
18197 | * Mapping from class specification keys to special processing functions.
|
18198 | *
|
18199 | * Although these are declared like instance properties in the specification
|
18200 | * when defining classes using `React.createClass`, they are actually static
|
18201 | * and are accessible on the constructor instead of the prototype. Despite
|
18202 | * being static, they must be defined outside of the "statics" key under
|
18203 | * which all other static methods are defined.
|
18204 | */
|
18205 | var RESERVED_SPEC_KEYS = {
|
18206 | displayName: function (Constructor, displayName) {
|
18207 | Constructor.displayName = displayName;
|
18208 | },
|
18209 | mixins: function (Constructor, mixins) {
|
18210 | if (mixins) {
|
18211 | for (var i = 0; i < mixins.length; i++) {
|
18212 | mixSpecIntoComponent(Constructor, mixins[i]);
|
18213 | }
|
18214 | }
|
18215 | },
|
18216 | childContextTypes: function (Constructor, childContextTypes) {
|
18217 | if (process.env.NODE_ENV !== 'production') {
|
18218 | validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
|
18219 | }
|
18220 | Constructor.childContextTypes = assign({}, Constructor.childContextTypes, childContextTypes);
|
18221 | },
|
18222 | contextTypes: function (Constructor, contextTypes) {
|
18223 | if (process.env.NODE_ENV !== 'production') {
|
18224 | validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
|
18225 | }
|
18226 | Constructor.contextTypes = assign({}, Constructor.contextTypes, contextTypes);
|
18227 | },
|
18228 | /**
|
18229 | * Special case getDefaultProps which should move into statics but requires
|
18230 | * automatic merging.
|
18231 | */
|
18232 | getDefaultProps: function (Constructor, getDefaultProps) {
|
18233 | if (Constructor.getDefaultProps) {
|
18234 | Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
|
18235 | } else {
|
18236 | Constructor.getDefaultProps = getDefaultProps;
|
18237 | }
|
18238 | },
|
18239 | propTypes: function (Constructor, propTypes) {
|
18240 | if (process.env.NODE_ENV !== 'production') {
|
18241 | validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
|
18242 | }
|
18243 | Constructor.propTypes = assign({}, Constructor.propTypes, propTypes);
|
18244 | },
|
18245 | statics: function (Constructor, statics) {
|
18246 | mixStaticSpecIntoComponent(Constructor, statics);
|
18247 | },
|
18248 | autobind: function () {} };
|
18249 |
|
18250 | // noop
|
18251 | function validateTypeDef(Constructor, typeDef, location) {
|
18252 | for (var propName in typeDef) {
|
18253 | if (typeDef.hasOwnProperty(propName)) {
|
18254 | // use a warning instead of an invariant so components
|
18255 | // don't show up in prod but not in __DEV__
|
18256 | process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : undefined;
|
18257 | }
|
18258 | }
|
18259 | }
|
18260 |
|
18261 | function validateMethodOverride(proto, name) {
|
18262 | var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
|
18263 |
|
18264 | // Disallow overriding of base class methods unless explicitly allowed.
|
18265 | if (ReactClassMixin.hasOwnProperty(name)) {
|
18266 | !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : undefined;
|
18267 | }
|
18268 |
|
18269 | // Disallow defining methods more than once unless explicitly allowed.
|
18270 | if (proto.hasOwnProperty(name)) {
|
18271 | !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : undefined;
|
18272 | }
|
18273 | }
|
18274 |
|
18275 | /**
|
18276 | * Mixin helper which handles policy validation and reserved
|
18277 | * specification keys when building React classses.
|
18278 | */
|
18279 | function mixSpecIntoComponent(Constructor, spec) {
|
18280 | if (!spec) {
|
18281 | return;
|
18282 | }
|
18283 |
|
18284 | !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
|
18285 | !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
|
18286 |
|
18287 | var proto = Constructor.prototype;
|
18288 |
|
18289 | // By handling mixins before any other properties, we ensure the same
|
18290 | // chaining order is applied to methods with DEFINE_MANY policy, whether
|
18291 | // mixins are listed before or after these methods in the spec.
|
18292 | if (spec.hasOwnProperty(MIXINS_KEY)) {
|
18293 | RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
|
18294 | }
|
18295 |
|
18296 | for (var name in spec) {
|
18297 | if (!spec.hasOwnProperty(name)) {
|
18298 | continue;
|
18299 | }
|
18300 |
|
18301 | if (name === MIXINS_KEY) {
|
18302 | // We have already handled mixins in a special case above.
|
18303 | continue;
|
18304 | }
|
18305 |
|
18306 | var property = spec[name];
|
18307 | validateMethodOverride(proto, name);
|
18308 |
|
18309 | if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
|
18310 | RESERVED_SPEC_KEYS[name](Constructor, property);
|
18311 | } else {
|
18312 | // Setup methods on prototype:
|
18313 | // The following member methods should not be automatically bound:
|
18314 | // 1. Expected ReactClass methods (in the "interface").
|
18315 | // 2. Overridden methods (that were mixed in).
|
18316 | var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
|
18317 | var isAlreadyDefined = proto.hasOwnProperty(name);
|
18318 | var isFunction = typeof property === 'function';
|
18319 | var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
|
18320 |
|
18321 | if (shouldAutoBind) {
|
18322 | if (!proto.__reactAutoBindMap) {
|
18323 | proto.__reactAutoBindMap = {};
|
18324 | }
|
18325 | proto.__reactAutoBindMap[name] = property;
|
18326 | proto[name] = property;
|
18327 | } else {
|
18328 | if (isAlreadyDefined) {
|
18329 | var specPolicy = ReactClassInterface[name];
|
18330 |
|
18331 | // These cases should already be caught by validateMethodOverride.
|
18332 | !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : undefined;
|
18333 |
|
18334 | // For methods which are defined more than once, call the existing
|
18335 | // methods before calling the new property, merging if appropriate.
|
18336 | if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
|
18337 | proto[name] = createMergedResultFunction(proto[name], property);
|
18338 | } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
|
18339 | proto[name] = createChainedFunction(proto[name], property);
|
18340 | }
|
18341 | } else {
|
18342 | proto[name] = property;
|
18343 | if (process.env.NODE_ENV !== 'production') {
|
18344 | // Add verbose displayName to the function, which helps when looking
|
18345 | // at profiling tools.
|
18346 | if (typeof property === 'function' && spec.displayName) {
|
18347 | proto[name].displayName = spec.displayName + '_' + name;
|
18348 | }
|
18349 | }
|
18350 | }
|
18351 | }
|
18352 | }
|
18353 | }
|
18354 | }
|
18355 |
|
18356 | function mixStaticSpecIntoComponent(Constructor, statics) {
|
18357 | if (!statics) {
|
18358 | return;
|
18359 | }
|
18360 | for (var name in statics) {
|
18361 | var property = statics[name];
|
18362 | if (!statics.hasOwnProperty(name)) {
|
18363 | continue;
|
18364 | }
|
18365 |
|
18366 | var isReserved = (name in RESERVED_SPEC_KEYS);
|
18367 | !!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(false) : undefined;
|
18368 |
|
18369 | var isInherited = (name in Constructor);
|
18370 | !!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : undefined;
|
18371 | Constructor[name] = property;
|
18372 | }
|
18373 | }
|
18374 |
|
18375 | /**
|
18376 | * Merge two objects, but throw if both contain the same key.
|
18377 | *
|
18378 | * @param {object} one The first object, which is mutated.
|
18379 | * @param {object} two The second object
|
18380 | * @return {object} one after it has been mutated to contain everything in two.
|
18381 | */
|
18382 | function mergeIntoWithNoDuplicateKeys(one, two) {
|
18383 | !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : undefined;
|
18384 |
|
18385 | for (var key in two) {
|
18386 | if (two.hasOwnProperty(key)) {
|
18387 | !(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(false) : undefined;
|
18388 | one[key] = two[key];
|
18389 | }
|
18390 | }
|
18391 | return one;
|
18392 | }
|
18393 |
|
18394 | /**
|
18395 | * Creates a function that invokes two functions and merges their return values.
|
18396 | *
|
18397 | * @param {function} one Function to invoke first.
|
18398 | * @param {function} two Function to invoke second.
|
18399 | * @return {function} Function that invokes the two argument functions.
|
18400 | * @private
|
18401 | */
|
18402 | function createMergedResultFunction(one, two) {
|
18403 | return function mergedResult() {
|
18404 | var a = one.apply(this, arguments);
|
18405 | var b = two.apply(this, arguments);
|
18406 | if (a == null) {
|
18407 | return b;
|
18408 | } else if (b == null) {
|
18409 | return a;
|
18410 | }
|
18411 | var c = {};
|
18412 | mergeIntoWithNoDuplicateKeys(c, a);
|
18413 | mergeIntoWithNoDuplicateKeys(c, b);
|
18414 | return c;
|
18415 | };
|
18416 | }
|
18417 |
|
18418 | /**
|
18419 | * Creates a function that invokes two functions and ignores their return vales.
|
18420 | *
|
18421 | * @param {function} one Function to invoke first.
|
18422 | * @param {function} two Function to invoke second.
|
18423 | * @return {function} Function that invokes the two argument functions.
|
18424 | * @private
|
18425 | */
|
18426 | function createChainedFunction(one, two) {
|
18427 | return function chainedFunction() {
|
18428 | one.apply(this, arguments);
|
18429 | two.apply(this, arguments);
|
18430 | };
|
18431 | }
|
18432 |
|
18433 | /**
|
18434 | * Binds a method to the component.
|
18435 | *
|
18436 | * @param {object} component Component whose method is going to be bound.
|
18437 | * @param {function} method Method to be bound.
|
18438 | * @return {function} The bound method.
|
18439 | */
|
18440 | function bindAutoBindMethod(component, method) {
|
18441 | var boundMethod = method.bind(component);
|
18442 | if (process.env.NODE_ENV !== 'production') {
|
18443 | boundMethod.__reactBoundContext = component;
|
18444 | boundMethod.__reactBoundMethod = method;
|
18445 | boundMethod.__reactBoundArguments = null;
|
18446 | var componentName = component.constructor.displayName;
|
18447 | var _bind = boundMethod.bind;
|
18448 | /* eslint-disable block-scoped-var, no-undef */
|
18449 | boundMethod.bind = function (newThis) {
|
18450 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
18451 | args[_key - 1] = arguments[_key];
|
18452 | }
|
18453 |
|
18454 | // User is trying to bind() an autobound method; we effectively will
|
18455 | // ignore the value of "this" that the user is trying to use, so
|
18456 | // let's warn.
|
18457 | if (newThis !== component && newThis !== null) {
|
18458 | process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : undefined;
|
18459 | } else if (!args.length) {
|
18460 | process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : undefined;
|
18461 | return boundMethod;
|
18462 | }
|
18463 | var reboundMethod = _bind.apply(boundMethod, arguments);
|
18464 | reboundMethod.__reactBoundContext = component;
|
18465 | reboundMethod.__reactBoundMethod = method;
|
18466 | reboundMethod.__reactBoundArguments = args;
|
18467 | return reboundMethod;
|
18468 | /* eslint-enable */
|
18469 | };
|
18470 | }
|
18471 | return boundMethod;
|
18472 | }
|
18473 |
|
18474 | /**
|
18475 | * Binds all auto-bound methods in a component.
|
18476 | *
|
18477 | * @param {object} component Component whose method is going to be bound.
|
18478 | */
|
18479 | function bindAutoBindMethods(component) {
|
18480 | for (var autoBindKey in component.__reactAutoBindMap) {
|
18481 | if (component.__reactAutoBindMap.hasOwnProperty(autoBindKey)) {
|
18482 | var method = component.__reactAutoBindMap[autoBindKey];
|
18483 | component[autoBindKey] = bindAutoBindMethod(component, method);
|
18484 | }
|
18485 | }
|
18486 | }
|
18487 |
|
18488 | /**
|
18489 | * Add more to the ReactClass base class. These are all legacy features and
|
18490 | * therefore not already part of the modern ReactComponent.
|
18491 | */
|
18492 | var ReactClassMixin = {
|
18493 |
|
18494 | /**
|
18495 | * TODO: This will be deprecated because state should always keep a consistent
|
18496 | * type signature and the only use case for this, is to avoid that.
|
18497 | */
|
18498 | replaceState: function (newState, callback) {
|
18499 | this.updater.enqueueReplaceState(this, newState);
|
18500 | if (callback) {
|
18501 | this.updater.enqueueCallback(this, callback);
|
18502 | }
|
18503 | },
|
18504 |
|
18505 | /**
|
18506 | * Checks whether or not this composite component is mounted.
|
18507 | * @return {boolean} True if mounted, false otherwise.
|
18508 | * @protected
|
18509 | * @final
|
18510 | */
|
18511 | isMounted: function () {
|
18512 | return this.updater.isMounted(this);
|
18513 | },
|
18514 |
|
18515 | /**
|
18516 | * Sets a subset of the props.
|
18517 | *
|
18518 | * @param {object} partialProps Subset of the next props.
|
18519 | * @param {?function} callback Called after props are updated.
|
18520 | * @final
|
18521 | * @public
|
18522 | * @deprecated
|
18523 | */
|
18524 | setProps: function (partialProps, callback) {
|
18525 | if (process.env.NODE_ENV !== 'production') {
|
18526 | warnSetProps();
|
18527 | }
|
18528 | this.updater.enqueueSetProps(this, partialProps);
|
18529 | if (callback) {
|
18530 | this.updater.enqueueCallback(this, callback);
|
18531 | }
|
18532 | },
|
18533 |
|
18534 | /**
|
18535 | * Replace all the props.
|
18536 | *
|
18537 | * @param {object} newProps Subset of the next props.
|
18538 | * @param {?function} callback Called after props are updated.
|
18539 | * @final
|
18540 | * @public
|
18541 | * @deprecated
|
18542 | */
|
18543 | replaceProps: function (newProps, callback) {
|
18544 | if (process.env.NODE_ENV !== 'production') {
|
18545 | warnSetProps();
|
18546 | }
|
18547 | this.updater.enqueueReplaceProps(this, newProps);
|
18548 | if (callback) {
|
18549 | this.updater.enqueueCallback(this, callback);
|
18550 | }
|
18551 | }
|
18552 | };
|
18553 |
|
18554 | var ReactClassComponent = function () {};
|
18555 | assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
|
18556 |
|
18557 | /**
|
18558 | * Module for creating composite components.
|
18559 | *
|
18560 | * @class ReactClass
|
18561 | */
|
18562 | var ReactClass = {
|
18563 |
|
18564 | /**
|
18565 | * Creates a composite component class given a class specification.
|
18566 | *
|
18567 | * @param {object} spec Class specification (which must define `render`).
|
18568 | * @return {function} Component constructor function.
|
18569 | * @public
|
18570 | */
|
18571 | createClass: function (spec) {
|
18572 | var Constructor = function (props, context, updater) {
|
18573 | // This constructor is overridden by mocks. The argument is used
|
18574 | // by mocks to assert on what gets mounted.
|
18575 |
|
18576 | if (process.env.NODE_ENV !== 'production') {
|
18577 | process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : undefined;
|
18578 | }
|
18579 |
|
18580 | // Wire up auto-binding
|
18581 | if (this.__reactAutoBindMap) {
|
18582 | bindAutoBindMethods(this);
|
18583 | }
|
18584 |
|
18585 | this.props = props;
|
18586 | this.context = context;
|
18587 | this.refs = emptyObject;
|
18588 | this.updater = updater || ReactNoopUpdateQueue;
|
18589 |
|
18590 | this.state = null;
|
18591 |
|
18592 | // ReactClasses doesn't have constructors. Instead, they use the
|
18593 | // getInitialState and componentWillMount methods for initialization.
|
18594 |
|
18595 | var initialState = this.getInitialState ? this.getInitialState() : null;
|
18596 | if (process.env.NODE_ENV !== 'production') {
|
18597 | // We allow auto-mocks to proceed as if they're returning null.
|
18598 | if (typeof initialState === 'undefined' && this.getInitialState._isMockFunction) {
|
18599 | // This is probably bad practice. Consider warning here and
|
18600 | // deprecating this convenience.
|
18601 | initialState = null;
|
18602 | }
|
18603 | }
|
18604 | !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : undefined;
|
18605 |
|
18606 | this.state = initialState;
|
18607 | };
|
18608 | Constructor.prototype = new ReactClassComponent();
|
18609 | Constructor.prototype.constructor = Constructor;
|
18610 |
|
18611 | injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
|
18612 |
|
18613 | mixSpecIntoComponent(Constructor, spec);
|
18614 |
|
18615 | // Initialize the defaultProps property after all mixins have been merged.
|
18616 | if (Constructor.getDefaultProps) {
|
18617 | Constructor.defaultProps = Constructor.getDefaultProps();
|
18618 | }
|
18619 |
|
18620 | if (process.env.NODE_ENV !== 'production') {
|
18621 | // This is a tag to indicate that the use of these method names is ok,
|
18622 | // since it's used with createClass. If it's not, then it's likely a
|
18623 | // mistake so we'll warn you to use the static property, property
|
18624 | // initializer or constructor respectively.
|
18625 | if (Constructor.getDefaultProps) {
|
18626 | Constructor.getDefaultProps.isReactClassApproved = {};
|
18627 | }
|
18628 | if (Constructor.prototype.getInitialState) {
|
18629 | Constructor.prototype.getInitialState.isReactClassApproved = {};
|
18630 | }
|
18631 | }
|
18632 |
|
18633 | !Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : undefined;
|
18634 |
|
18635 | if (process.env.NODE_ENV !== 'production') {
|
18636 | process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : undefined;
|
18637 | process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : undefined;
|
18638 | }
|
18639 |
|
18640 | // Reduce time spent doing lookups by setting these on the prototype.
|
18641 | for (var methodName in ReactClassInterface) {
|
18642 | if (!Constructor.prototype[methodName]) {
|
18643 | Constructor.prototype[methodName] = null;
|
18644 | }
|
18645 | }
|
18646 |
|
18647 | return Constructor;
|
18648 | },
|
18649 |
|
18650 | injection: {
|
18651 | injectMixin: function (mixin) {
|
18652 | injectedMixins.push(mixin);
|
18653 | }
|
18654 | }
|
18655 |
|
18656 | };
|
18657 |
|
18658 | module.exports = ReactClass;
|
18659 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
18660 |
|
18661 | /***/ }),
|
18662 | /* 208 */
|
18663 | /***/ (function(module, exports, __webpack_require__) {
|
18664 |
|
18665 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
18666 | * Copyright 2013-2015, Facebook, Inc.
|
18667 | * All rights reserved.
|
18668 | *
|
18669 | * This source code is licensed under the BSD-style license found in the
|
18670 | * LICENSE file in the root directory of this source tree. An additional grant
|
18671 | * of patent rights can be found in the PATENTS file in the same directory.
|
18672 | *
|
18673 | * @providesModule ReactComponent
|
18674 | */
|
18675 |
|
18676 | 'use strict';
|
18677 |
|
18678 | var ReactNoopUpdateQueue = __webpack_require__(209);
|
18679 |
|
18680 | var canDefineProperty = __webpack_require__(128);
|
18681 | var emptyObject = __webpack_require__(143);
|
18682 | var invariant = __webpack_require__(98);
|
18683 | var warning = __webpack_require__(110);
|
18684 |
|
18685 | /**
|
18686 | * Base class helpers for the updating state of a component.
|
18687 | */
|
18688 | function ReactComponent(props, context, updater) {
|
18689 | this.props = props;
|
18690 | this.context = context;
|
18691 | this.refs = emptyObject;
|
18692 | // We initialize the default updater but the real one gets injected by the
|
18693 | // renderer.
|
18694 | this.updater = updater || ReactNoopUpdateQueue;
|
18695 | }
|
18696 |
|
18697 | ReactComponent.prototype.isReactComponent = {};
|
18698 |
|
18699 | /**
|
18700 | * Sets a subset of the state. Always use this to mutate
|
18701 | * state. You should treat `this.state` as immutable.
|
18702 | *
|
18703 | * There is no guarantee that `this.state` will be immediately updated, so
|
18704 | * accessing `this.state` after calling this method may return the old value.
|
18705 | *
|
18706 | * There is no guarantee that calls to `setState` will run synchronously,
|
18707 | * as they may eventually be batched together. You can provide an optional
|
18708 | * callback that will be executed when the call to setState is actually
|
18709 | * completed.
|
18710 | *
|
18711 | * When a function is provided to setState, it will be called at some point in
|
18712 | * the future (not synchronously). It will be called with the up to date
|
18713 | * component arguments (state, props, context). These values can be different
|
18714 | * from this.* because your function may be called after receiveProps but before
|
18715 | * shouldComponentUpdate, and this new state, props, and context will not yet be
|
18716 | * assigned to this.
|
18717 | *
|
18718 | * @param {object|function} partialState Next partial state or function to
|
18719 | * produce next partial state to be merged with current state.
|
18720 | * @param {?function} callback Called after state is updated.
|
18721 | * @final
|
18722 | * @protected
|
18723 | */
|
18724 | ReactComponent.prototype.setState = function (partialState, callback) {
|
18725 | !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : undefined;
|
18726 | if (process.env.NODE_ENV !== 'production') {
|
18727 | process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : undefined;
|
18728 | }
|
18729 | this.updater.enqueueSetState(this, partialState);
|
18730 | if (callback) {
|
18731 | this.updater.enqueueCallback(this, callback);
|
18732 | }
|
18733 | };
|
18734 |
|
18735 | /**
|
18736 | * Forces an update. This should only be invoked when it is known with
|
18737 | * certainty that we are **not** in a DOM transaction.
|
18738 | *
|
18739 | * You may want to call this when you know that some deeper aspect of the
|
18740 | * component's state has changed but `setState` was not called.
|
18741 | *
|
18742 | * This will not invoke `shouldComponentUpdate`, but it will invoke
|
18743 | * `componentWillUpdate` and `componentDidUpdate`.
|
18744 | *
|
18745 | * @param {?function} callback Called after update is complete.
|
18746 | * @final
|
18747 | * @protected
|
18748 | */
|
18749 | ReactComponent.prototype.forceUpdate = function (callback) {
|
18750 | this.updater.enqueueForceUpdate(this);
|
18751 | if (callback) {
|
18752 | this.updater.enqueueCallback(this, callback);
|
18753 | }
|
18754 | };
|
18755 |
|
18756 | /**
|
18757 | * Deprecated APIs. These APIs used to exist on classic React classes but since
|
18758 | * we would like to deprecate them, we're not going to move them over to this
|
18759 | * modern base class. Instead, we define a getter that warns if it's accessed.
|
18760 | */
|
18761 | if (process.env.NODE_ENV !== 'production') {
|
18762 | var deprecatedAPIs = {
|
18763 | getDOMNode: ['getDOMNode', 'Use ReactDOM.findDOMNode(component) instead.'],
|
18764 | isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
18765 | replaceProps: ['replaceProps', 'Instead, call render again at the top level.'],
|
18766 | replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'],
|
18767 | setProps: ['setProps', 'Instead, call render again at the top level.']
|
18768 | };
|
18769 | var defineDeprecationWarning = function (methodName, info) {
|
18770 | if (canDefineProperty) {
|
18771 | Object.defineProperty(ReactComponent.prototype, methodName, {
|
18772 | get: function () {
|
18773 | process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : undefined;
|
18774 | return undefined;
|
18775 | }
|
18776 | });
|
18777 | }
|
18778 | };
|
18779 | for (var fnName in deprecatedAPIs) {
|
18780 | if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
18781 | defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
18782 | }
|
18783 | }
|
18784 | }
|
18785 |
|
18786 | module.exports = ReactComponent;
|
18787 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
18788 |
|
18789 | /***/ }),
|
18790 | /* 209 */
|
18791 | /***/ (function(module, exports, __webpack_require__) {
|
18792 |
|
18793 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
18794 | * Copyright 2015, Facebook, Inc.
|
18795 | * All rights reserved.
|
18796 | *
|
18797 | * This source code is licensed under the BSD-style license found in the
|
18798 | * LICENSE file in the root directory of this source tree. An additional grant
|
18799 | * of patent rights can be found in the PATENTS file in the same directory.
|
18800 | *
|
18801 | * @providesModule ReactNoopUpdateQueue
|
18802 | */
|
18803 |
|
18804 | 'use strict';
|
18805 |
|
18806 | var warning = __webpack_require__(110);
|
18807 |
|
18808 | function warnTDZ(publicInstance, callerName) {
|
18809 | if (process.env.NODE_ENV !== 'production') {
|
18810 | process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor && publicInstance.constructor.displayName || '') : undefined;
|
18811 | }
|
18812 | }
|
18813 |
|
18814 | /**
|
18815 | * This is the abstract API for an update queue.
|
18816 | */
|
18817 | var ReactNoopUpdateQueue = {
|
18818 |
|
18819 | /**
|
18820 | * Checks whether or not this composite component is mounted.
|
18821 | * @param {ReactClass} publicInstance The instance we want to test.
|
18822 | * @return {boolean} True if mounted, false otherwise.
|
18823 | * @protected
|
18824 | * @final
|
18825 | */
|
18826 | isMounted: function (publicInstance) {
|
18827 | return false;
|
18828 | },
|
18829 |
|
18830 | /**
|
18831 | * Enqueue a callback that will be executed after all the pending updates
|
18832 | * have processed.
|
18833 | *
|
18834 | * @param {ReactClass} publicInstance The instance to use as `this` context.
|
18835 | * @param {?function} callback Called after state is updated.
|
18836 | * @internal
|
18837 | */
|
18838 | enqueueCallback: function (publicInstance, callback) {},
|
18839 |
|
18840 | /**
|
18841 | * Forces an update. This should only be invoked when it is known with
|
18842 | * certainty that we are **not** in a DOM transaction.
|
18843 | *
|
18844 | * You may want to call this when you know that some deeper aspect of the
|
18845 | * component's state has changed but `setState` was not called.
|
18846 | *
|
18847 | * This will not invoke `shouldComponentUpdate`, but it will invoke
|
18848 | * `componentWillUpdate` and `componentDidUpdate`.
|
18849 | *
|
18850 | * @param {ReactClass} publicInstance The instance that should rerender.
|
18851 | * @internal
|
18852 | */
|
18853 | enqueueForceUpdate: function (publicInstance) {
|
18854 | warnTDZ(publicInstance, 'forceUpdate');
|
18855 | },
|
18856 |
|
18857 | /**
|
18858 | * Replaces all of the state. Always use this or `setState` to mutate state.
|
18859 | * You should treat `this.state` as immutable.
|
18860 | *
|
18861 | * There is no guarantee that `this.state` will be immediately updated, so
|
18862 | * accessing `this.state` after calling this method may return the old value.
|
18863 | *
|
18864 | * @param {ReactClass} publicInstance The instance that should rerender.
|
18865 | * @param {object} completeState Next state.
|
18866 | * @internal
|
18867 | */
|
18868 | enqueueReplaceState: function (publicInstance, completeState) {
|
18869 | warnTDZ(publicInstance, 'replaceState');
|
18870 | },
|
18871 |
|
18872 | /**
|
18873 | * Sets a subset of the state. This only exists because _pendingState is
|
18874 | * internal. This provides a merging strategy that is not available to deep
|
18875 | * properties which is confusing. TODO: Expose pendingState or don't use it
|
18876 | * during the merge.
|
18877 | *
|
18878 | * @param {ReactClass} publicInstance The instance that should rerender.
|
18879 | * @param {object} partialState Next partial state to be merged with state.
|
18880 | * @internal
|
18881 | */
|
18882 | enqueueSetState: function (publicInstance, partialState) {
|
18883 | warnTDZ(publicInstance, 'setState');
|
18884 | },
|
18885 |
|
18886 | /**
|
18887 | * Sets a subset of the props.
|
18888 | *
|
18889 | * @param {ReactClass} publicInstance The instance that should rerender.
|
18890 | * @param {object} partialProps Subset of the next props.
|
18891 | * @internal
|
18892 | */
|
18893 | enqueueSetProps: function (publicInstance, partialProps) {
|
18894 | warnTDZ(publicInstance, 'setProps');
|
18895 | },
|
18896 |
|
18897 | /**
|
18898 | * Replaces all of the props.
|
18899 | *
|
18900 | * @param {ReactClass} publicInstance The instance that should rerender.
|
18901 | * @param {object} props New props.
|
18902 | * @internal
|
18903 | */
|
18904 | enqueueReplaceProps: function (publicInstance, props) {
|
18905 | warnTDZ(publicInstance, 'replaceProps');
|
18906 | }
|
18907 |
|
18908 | };
|
18909 |
|
18910 | module.exports = ReactNoopUpdateQueue;
|
18911 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
18912 |
|
18913 | /***/ }),
|
18914 | /* 210 */
|
18915 | /***/ (function(module, exports, __webpack_require__) {
|
18916 |
|
18917 | /**
|
18918 | * Copyright 2013-2015, Facebook, Inc.
|
18919 | * All rights reserved.
|
18920 | *
|
18921 | * This source code is licensed under the BSD-style license found in the
|
18922 | * LICENSE file in the root directory of this source tree. An additional grant
|
18923 | * of patent rights can be found in the PATENTS file in the same directory.
|
18924 | *
|
18925 | * @providesModule ReactReconcileTransaction
|
18926 | * @typechecks static-only
|
18927 | */
|
18928 |
|
18929 | 'use strict';
|
18930 |
|
18931 | var CallbackQueue = __webpack_require__(140);
|
18932 | var PooledClass = __webpack_require__(141);
|
18933 | var ReactBrowserEventEmitter = __webpack_require__(114);
|
18934 | var ReactDOMFeatureFlags = __webpack_require__(126);
|
18935 | var ReactInputSelection = __webpack_require__(211);
|
18936 | var Transaction = __webpack_require__(142);
|
18937 |
|
18938 | var assign = __webpack_require__(124);
|
18939 |
|
18940 | /**
|
18941 | * Ensures that, when possible, the selection range (currently selected text
|
18942 | * input) is not disturbed by performing the transaction.
|
18943 | */
|
18944 | var SELECTION_RESTORATION = {
|
18945 | /**
|
18946 | * @return {Selection} Selection information.
|
18947 | */
|
18948 | initialize: ReactInputSelection.getSelectionInformation,
|
18949 | /**
|
18950 | * @param {Selection} sel Selection information returned from `initialize`.
|
18951 | */
|
18952 | close: ReactInputSelection.restoreSelection
|
18953 | };
|
18954 |
|
18955 | /**
|
18956 | * Suppresses events (blur/focus) that could be inadvertently dispatched due to
|
18957 | * high level DOM manipulations (like temporarily removing a text input from the
|
18958 | * DOM).
|
18959 | */
|
18960 | var EVENT_SUPPRESSION = {
|
18961 | /**
|
18962 | * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
|
18963 | * the reconciliation.
|
18964 | */
|
18965 | initialize: function () {
|
18966 | var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
|
18967 | ReactBrowserEventEmitter.setEnabled(false);
|
18968 | return currentlyEnabled;
|
18969 | },
|
18970 |
|
18971 | /**
|
18972 | * @param {boolean} previouslyEnabled Enabled status of
|
18973 | * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
|
18974 | * restores the previous value.
|
18975 | */
|
18976 | close: function (previouslyEnabled) {
|
18977 | ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
|
18978 | }
|
18979 | };
|
18980 |
|
18981 | /**
|
18982 | * Provides a queue for collecting `componentDidMount` and
|
18983 | * `componentDidUpdate` callbacks during the the transaction.
|
18984 | */
|
18985 | var ON_DOM_READY_QUEUEING = {
|
18986 | /**
|
18987 | * Initializes the internal `onDOMReady` queue.
|
18988 | */
|
18989 | initialize: function () {
|
18990 | this.reactMountReady.reset();
|
18991 | },
|
18992 |
|
18993 | /**
|
18994 | * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
|
18995 | */
|
18996 | close: function () {
|
18997 | this.reactMountReady.notifyAll();
|
18998 | }
|
18999 | };
|
19000 |
|
19001 | /**
|
19002 | * Executed within the scope of the `Transaction` instance. Consider these as
|
19003 | * being member methods, but with an implied ordering while being isolated from
|
19004 | * each other.
|
19005 | */
|
19006 | var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
|
19007 |
|
19008 | /**
|
19009 | * Currently:
|
19010 | * - The order that these are listed in the transaction is critical:
|
19011 | * - Suppresses events.
|
19012 | * - Restores selection range.
|
19013 | *
|
19014 | * Future:
|
19015 | * - Restore document/overflow scroll positions that were unintentionally
|
19016 | * modified via DOM insertions above the top viewport boundary.
|
19017 | * - Implement/integrate with customized constraint based layout system and keep
|
19018 | * track of which dimensions must be remeasured.
|
19019 | *
|
19020 | * @class ReactReconcileTransaction
|
19021 | */
|
19022 | function ReactReconcileTransaction(forceHTML) {
|
19023 | this.reinitializeTransaction();
|
19024 | // Only server-side rendering really needs this option (see
|
19025 | // `ReactServerRendering`), but server-side uses
|
19026 | // `ReactServerRenderingTransaction` instead. This option is here so that it's
|
19027 | // accessible and defaults to false when `ReactDOMComponent` and
|
19028 | // `ReactTextComponent` checks it in `mountComponent`.`
|
19029 | this.renderToStaticMarkup = false;
|
19030 | this.reactMountReady = CallbackQueue.getPooled(null);
|
19031 | this.useCreateElement = !forceHTML && ReactDOMFeatureFlags.useCreateElement;
|
19032 | }
|
19033 |
|
19034 | var Mixin = {
|
19035 | /**
|
19036 | * @see Transaction
|
19037 | * @abstract
|
19038 | * @final
|
19039 | * @return {array<object>} List of operation wrap procedures.
|
19040 | * TODO: convert to array<TransactionWrapper>
|
19041 | */
|
19042 | getTransactionWrappers: function () {
|
19043 | return TRANSACTION_WRAPPERS;
|
19044 | },
|
19045 |
|
19046 | /**
|
19047 | * @return {object} The queue to collect `onDOMReady` callbacks with.
|
19048 | */
|
19049 | getReactMountReady: function () {
|
19050 | return this.reactMountReady;
|
19051 | },
|
19052 |
|
19053 | /**
|
19054 | * `PooledClass` looks for this, and will invoke this before allowing this
|
19055 | * instance to be reused.
|
19056 | */
|
19057 | destructor: function () {
|
19058 | CallbackQueue.release(this.reactMountReady);
|
19059 | this.reactMountReady = null;
|
19060 | }
|
19061 | };
|
19062 |
|
19063 | assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
|
19064 |
|
19065 | PooledClass.addPoolingTo(ReactReconcileTransaction);
|
19066 |
|
19067 | module.exports = ReactReconcileTransaction;
|
19068 |
|
19069 | /***/ }),
|
19070 | /* 211 */
|
19071 | /***/ (function(module, exports, __webpack_require__) {
|
19072 |
|
19073 | /**
|
19074 | * Copyright 2013-2015, Facebook, Inc.
|
19075 | * All rights reserved.
|
19076 | *
|
19077 | * This source code is licensed under the BSD-style license found in the
|
19078 | * LICENSE file in the root directory of this source tree. An additional grant
|
19079 | * of patent rights can be found in the PATENTS file in the same directory.
|
19080 | *
|
19081 | * @providesModule ReactInputSelection
|
19082 | */
|
19083 |
|
19084 | 'use strict';
|
19085 |
|
19086 | var ReactDOMSelection = __webpack_require__(212);
|
19087 |
|
19088 | var containsNode = __webpack_require__(144);
|
19089 | var focusNode = __webpack_require__(180);
|
19090 | var getActiveElement = __webpack_require__(214);
|
19091 |
|
19092 | function isInDocument(node) {
|
19093 | return containsNode(document.documentElement, node);
|
19094 | }
|
19095 |
|
19096 | /**
|
19097 | * @ReactInputSelection: React input selection module. Based on Selection.js,
|
19098 | * but modified to be suitable for react and has a couple of bug fixes (doesn't
|
19099 | * assume buttons have range selections allowed).
|
19100 | * Input selection module for React.
|
19101 | */
|
19102 | var ReactInputSelection = {
|
19103 |
|
19104 | hasSelectionCapabilities: function (elem) {
|
19105 | var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
19106 | return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
|
19107 | },
|
19108 |
|
19109 | getSelectionInformation: function () {
|
19110 | var focusedElem = getActiveElement();
|
19111 | return {
|
19112 | focusedElem: focusedElem,
|
19113 | selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
|
19114 | };
|
19115 | },
|
19116 |
|
19117 | /**
|
19118 | * @restoreSelection: If any selection information was potentially lost,
|
19119 | * restore it. This is useful when performing operations that could remove dom
|
19120 | * nodes and place them back in, resulting in focus being lost.
|
19121 | */
|
19122 | restoreSelection: function (priorSelectionInformation) {
|
19123 | var curFocusedElem = getActiveElement();
|
19124 | var priorFocusedElem = priorSelectionInformation.focusedElem;
|
19125 | var priorSelectionRange = priorSelectionInformation.selectionRange;
|
19126 | if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
|
19127 | if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
|
19128 | ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
|
19129 | }
|
19130 | focusNode(priorFocusedElem);
|
19131 | }
|
19132 | },
|
19133 |
|
19134 | /**
|
19135 | * @getSelection: Gets the selection bounds of a focused textarea, input or
|
19136 | * contentEditable node.
|
19137 | * -@input: Look up selection bounds of this input
|
19138 | * -@return {start: selectionStart, end: selectionEnd}
|
19139 | */
|
19140 | getSelection: function (input) {
|
19141 | var selection;
|
19142 |
|
19143 | if ('selectionStart' in input) {
|
19144 | // Modern browser with input or textarea.
|
19145 | selection = {
|
19146 | start: input.selectionStart,
|
19147 | end: input.selectionEnd
|
19148 | };
|
19149 | } else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
|
19150 | // IE8 input.
|
19151 | var range = document.selection.createRange();
|
19152 | // There can only be one selection per document in IE, so it must
|
19153 | // be in our element.
|
19154 | if (range.parentElement() === input) {
|
19155 | selection = {
|
19156 | start: -range.moveStart('character', -input.value.length),
|
19157 | end: -range.moveEnd('character', -input.value.length)
|
19158 | };
|
19159 | }
|
19160 | } else {
|
19161 | // Content editable or old IE textarea.
|
19162 | selection = ReactDOMSelection.getOffsets(input);
|
19163 | }
|
19164 |
|
19165 | return selection || { start: 0, end: 0 };
|
19166 | },
|
19167 |
|
19168 | /**
|
19169 | * @setSelection: Sets the selection bounds of a textarea or input and focuses
|
19170 | * the input.
|
19171 | * -@input Set selection bounds of this input or textarea
|
19172 | * -@offsets Object of same form that is returned from get*
|
19173 | */
|
19174 | setSelection: function (input, offsets) {
|
19175 | var start = offsets.start;
|
19176 | var end = offsets.end;
|
19177 | if (typeof end === 'undefined') {
|
19178 | end = start;
|
19179 | }
|
19180 |
|
19181 | if ('selectionStart' in input) {
|
19182 | input.selectionStart = start;
|
19183 | input.selectionEnd = Math.min(end, input.value.length);
|
19184 | } else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
|
19185 | var range = input.createTextRange();
|
19186 | range.collapse(true);
|
19187 | range.moveStart('character', start);
|
19188 | range.moveEnd('character', end - start);
|
19189 | range.select();
|
19190 | } else {
|
19191 | ReactDOMSelection.setOffsets(input, offsets);
|
19192 | }
|
19193 | }
|
19194 | };
|
19195 |
|
19196 | module.exports = ReactInputSelection;
|
19197 |
|
19198 | /***/ }),
|
19199 | /* 212 */
|
19200 | /***/ (function(module, exports, __webpack_require__) {
|
19201 |
|
19202 | /**
|
19203 | * Copyright 2013-2015, Facebook, Inc.
|
19204 | * All rights reserved.
|
19205 | *
|
19206 | * This source code is licensed under the BSD-style license found in the
|
19207 | * LICENSE file in the root directory of this source tree. An additional grant
|
19208 | * of patent rights can be found in the PATENTS file in the same directory.
|
19209 | *
|
19210 | * @providesModule ReactDOMSelection
|
19211 | */
|
19212 |
|
19213 | 'use strict';
|
19214 |
|
19215 | var ExecutionEnvironment = __webpack_require__(94);
|
19216 |
|
19217 | var getNodeForCharacterOffset = __webpack_require__(213);
|
19218 | var getTextContentAccessor = __webpack_require__(160);
|
19219 |
|
19220 | /**
|
19221 | * While `isCollapsed` is available on the Selection object and `collapsed`
|
19222 | * is available on the Range object, IE11 sometimes gets them wrong.
|
19223 | * If the anchor/focus nodes and offsets are the same, the range is collapsed.
|
19224 | */
|
19225 | function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
|
19226 | return anchorNode === focusNode && anchorOffset === focusOffset;
|
19227 | }
|
19228 |
|
19229 | /**
|
19230 | * Get the appropriate anchor and focus node/offset pairs for IE.
|
19231 | *
|
19232 | * The catch here is that IE's selection API doesn't provide information
|
19233 | * about whether the selection is forward or backward, so we have to
|
19234 | * behave as though it's always forward.
|
19235 | *
|
19236 | * IE text differs from modern selection in that it behaves as though
|
19237 | * block elements end with a new line. This means character offsets will
|
19238 | * differ between the two APIs.
|
19239 | *
|
19240 | * @param {DOMElement} node
|
19241 | * @return {object}
|
19242 | */
|
19243 | function getIEOffsets(node) {
|
19244 | var selection = document.selection;
|
19245 | var selectedRange = selection.createRange();
|
19246 | var selectedLength = selectedRange.text.length;
|
19247 |
|
19248 | // Duplicate selection so we can move range without breaking user selection.
|
19249 | var fromStart = selectedRange.duplicate();
|
19250 | fromStart.moveToElementText(node);
|
19251 | fromStart.setEndPoint('EndToStart', selectedRange);
|
19252 |
|
19253 | var startOffset = fromStart.text.length;
|
19254 | var endOffset = startOffset + selectedLength;
|
19255 |
|
19256 | return {
|
19257 | start: startOffset,
|
19258 | end: endOffset
|
19259 | };
|
19260 | }
|
19261 |
|
19262 | /**
|
19263 | * @param {DOMElement} node
|
19264 | * @return {?object}
|
19265 | */
|
19266 | function getModernOffsets(node) {
|
19267 | var selection = window.getSelection && window.getSelection();
|
19268 |
|
19269 | if (!selection || selection.rangeCount === 0) {
|
19270 | return null;
|
19271 | }
|
19272 |
|
19273 | var anchorNode = selection.anchorNode;
|
19274 | var anchorOffset = selection.anchorOffset;
|
19275 | var focusNode = selection.focusNode;
|
19276 | var focusOffset = selection.focusOffset;
|
19277 |
|
19278 | var currentRange = selection.getRangeAt(0);
|
19279 |
|
19280 | // In Firefox, range.startContainer and range.endContainer can be "anonymous
|
19281 | // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
|
19282 | // divs do not seem to expose properties, triggering a "Permission denied
|
19283 | // error" if any of its properties are accessed. The only seemingly possible
|
19284 | // way to avoid erroring is to access a property that typically works for
|
19285 | // non-anonymous divs and catch any error that may otherwise arise. See
|
19286 | // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
|
19287 | try {
|
19288 | /* eslint-disable no-unused-expressions */
|
19289 | currentRange.startContainer.nodeType;
|
19290 | currentRange.endContainer.nodeType;
|
19291 | /* eslint-enable no-unused-expressions */
|
19292 | } catch (e) {
|
19293 | return null;
|
19294 | }
|
19295 |
|
19296 | // If the node and offset values are the same, the selection is collapsed.
|
19297 | // `Selection.isCollapsed` is available natively, but IE sometimes gets
|
19298 | // this value wrong.
|
19299 | var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
|
19300 |
|
19301 | var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
|
19302 |
|
19303 | var tempRange = currentRange.cloneRange();
|
19304 | tempRange.selectNodeContents(node);
|
19305 | tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
|
19306 |
|
19307 | var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
|
19308 |
|
19309 | var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
|
19310 | var end = start + rangeLength;
|
19311 |
|
19312 | // Detect whether the selection is backward.
|
19313 | var detectionRange = document.createRange();
|
19314 | detectionRange.setStart(anchorNode, anchorOffset);
|
19315 | detectionRange.setEnd(focusNode, focusOffset);
|
19316 | var isBackward = detectionRange.collapsed;
|
19317 |
|
19318 | return {
|
19319 | start: isBackward ? end : start,
|
19320 | end: isBackward ? start : end
|
19321 | };
|
19322 | }
|
19323 |
|
19324 | /**
|
19325 | * @param {DOMElement|DOMTextNode} node
|
19326 | * @param {object} offsets
|
19327 | */
|
19328 | function setIEOffsets(node, offsets) {
|
19329 | var range = document.selection.createRange().duplicate();
|
19330 | var start, end;
|
19331 |
|
19332 | if (typeof offsets.end === 'undefined') {
|
19333 | start = offsets.start;
|
19334 | end = start;
|
19335 | } else if (offsets.start > offsets.end) {
|
19336 | start = offsets.end;
|
19337 | end = offsets.start;
|
19338 | } else {
|
19339 | start = offsets.start;
|
19340 | end = offsets.end;
|
19341 | }
|
19342 |
|
19343 | range.moveToElementText(node);
|
19344 | range.moveStart('character', start);
|
19345 | range.setEndPoint('EndToStart', range);
|
19346 | range.moveEnd('character', end - start);
|
19347 | range.select();
|
19348 | }
|
19349 |
|
19350 | /**
|
19351 | * In modern non-IE browsers, we can support both forward and backward
|
19352 | * selections.
|
19353 | *
|
19354 | * Note: IE10+ supports the Selection object, but it does not support
|
19355 | * the `extend` method, which means that even in modern IE, it's not possible
|
19356 | * to programatically create a backward selection. Thus, for all IE
|
19357 | * versions, we use the old IE API to create our selections.
|
19358 | *
|
19359 | * @param {DOMElement|DOMTextNode} node
|
19360 | * @param {object} offsets
|
19361 | */
|
19362 | function setModernOffsets(node, offsets) {
|
19363 | if (!window.getSelection) {
|
19364 | return;
|
19365 | }
|
19366 |
|
19367 | var selection = window.getSelection();
|
19368 | var length = node[getTextContentAccessor()].length;
|
19369 | var start = Math.min(offsets.start, length);
|
19370 | var end = typeof offsets.end === 'undefined' ? start : Math.min(offsets.end, length);
|
19371 |
|
19372 | // IE 11 uses modern selection, but doesn't support the extend method.
|
19373 | // Flip backward selections, so we can set with a single range.
|
19374 | if (!selection.extend && start > end) {
|
19375 | var temp = end;
|
19376 | end = start;
|
19377 | start = temp;
|
19378 | }
|
19379 |
|
19380 | var startMarker = getNodeForCharacterOffset(node, start);
|
19381 | var endMarker = getNodeForCharacterOffset(node, end);
|
19382 |
|
19383 | if (startMarker && endMarker) {
|
19384 | var range = document.createRange();
|
19385 | range.setStart(startMarker.node, startMarker.offset);
|
19386 | selection.removeAllRanges();
|
19387 |
|
19388 | if (start > end) {
|
19389 | selection.addRange(range);
|
19390 | selection.extend(endMarker.node, endMarker.offset);
|
19391 | } else {
|
19392 | range.setEnd(endMarker.node, endMarker.offset);
|
19393 | selection.addRange(range);
|
19394 | }
|
19395 | }
|
19396 | }
|
19397 |
|
19398 | var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
|
19399 |
|
19400 | var ReactDOMSelection = {
|
19401 | /**
|
19402 | * @param {DOMElement} node
|
19403 | */
|
19404 | getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
|
19405 |
|
19406 | /**
|
19407 | * @param {DOMElement|DOMTextNode} node
|
19408 | * @param {object} offsets
|
19409 | */
|
19410 | setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
|
19411 | };
|
19412 |
|
19413 | module.exports = ReactDOMSelection;
|
19414 |
|
19415 | /***/ }),
|
19416 | /* 213 */
|
19417 | /***/ (function(module, exports) {
|
19418 |
|
19419 | /**
|
19420 | * Copyright 2013-2015, Facebook, Inc.
|
19421 | * All rights reserved.
|
19422 | *
|
19423 | * This source code is licensed under the BSD-style license found in the
|
19424 | * LICENSE file in the root directory of this source tree. An additional grant
|
19425 | * of patent rights can be found in the PATENTS file in the same directory.
|
19426 | *
|
19427 | * @providesModule getNodeForCharacterOffset
|
19428 | */
|
19429 |
|
19430 | 'use strict';
|
19431 |
|
19432 | /**
|
19433 | * Given any node return the first leaf node without children.
|
19434 | *
|
19435 | * @param {DOMElement|DOMTextNode} node
|
19436 | * @return {DOMElement|DOMTextNode}
|
19437 | */
|
19438 | function getLeafNode(node) {
|
19439 | while (node && node.firstChild) {
|
19440 | node = node.firstChild;
|
19441 | }
|
19442 | return node;
|
19443 | }
|
19444 |
|
19445 | /**
|
19446 | * Get the next sibling within a container. This will walk up the
|
19447 | * DOM if a node's siblings have been exhausted.
|
19448 | *
|
19449 | * @param {DOMElement|DOMTextNode} node
|
19450 | * @return {?DOMElement|DOMTextNode}
|
19451 | */
|
19452 | function getSiblingNode(node) {
|
19453 | while (node) {
|
19454 | if (node.nextSibling) {
|
19455 | return node.nextSibling;
|
19456 | }
|
19457 | node = node.parentNode;
|
19458 | }
|
19459 | }
|
19460 |
|
19461 | /**
|
19462 | * Get object describing the nodes which contain characters at offset.
|
19463 | *
|
19464 | * @param {DOMElement|DOMTextNode} root
|
19465 | * @param {number} offset
|
19466 | * @return {?object}
|
19467 | */
|
19468 | function getNodeForCharacterOffset(root, offset) {
|
19469 | var node = getLeafNode(root);
|
19470 | var nodeStart = 0;
|
19471 | var nodeEnd = 0;
|
19472 |
|
19473 | while (node) {
|
19474 | if (node.nodeType === 3) {
|
19475 | nodeEnd = nodeStart + node.textContent.length;
|
19476 |
|
19477 | if (nodeStart <= offset && nodeEnd >= offset) {
|
19478 | return {
|
19479 | node: node,
|
19480 | offset: offset - nodeStart
|
19481 | };
|
19482 | }
|
19483 |
|
19484 | nodeStart = nodeEnd;
|
19485 | }
|
19486 |
|
19487 | node = getLeafNode(getSiblingNode(node));
|
19488 | }
|
19489 | }
|
19490 |
|
19491 | module.exports = getNodeForCharacterOffset;
|
19492 |
|
19493 | /***/ }),
|
19494 | /* 214 */
|
19495 | /***/ (function(module, exports) {
|
19496 |
|
19497 | /**
|
19498 | * Copyright 2013-2015, Facebook, Inc.
|
19499 | * All rights reserved.
|
19500 | *
|
19501 | * This source code is licensed under the BSD-style license found in the
|
19502 | * LICENSE file in the root directory of this source tree. An additional grant
|
19503 | * of patent rights can be found in the PATENTS file in the same directory.
|
19504 | *
|
19505 | * @providesModule getActiveElement
|
19506 | * @typechecks
|
19507 | */
|
19508 |
|
19509 | /* eslint-disable fb-www/typeof-undefined */
|
19510 |
|
19511 | /**
|
19512 | * Same as document.activeElement but wraps in a try-catch block. In IE it is
|
19513 | * not safe to call document.activeElement if there is nothing focused.
|
19514 | *
|
19515 | * The activeElement will be null only if the document or document body is not
|
19516 | * yet defined.
|
19517 | */
|
19518 | 'use strict';
|
19519 |
|
19520 | function getActiveElement() /*?DOMElement*/{
|
19521 | if (typeof document === 'undefined') {
|
19522 | return null;
|
19523 | }
|
19524 | try {
|
19525 | return document.activeElement || document.body;
|
19526 | } catch (e) {
|
19527 | return document.body;
|
19528 | }
|
19529 | }
|
19530 |
|
19531 | module.exports = getActiveElement;
|
19532 |
|
19533 | /***/ }),
|
19534 | /* 215 */
|
19535 | /***/ (function(module, exports, __webpack_require__) {
|
19536 |
|
19537 | /**
|
19538 | * Copyright 2013-2015, Facebook, Inc.
|
19539 | * All rights reserved.
|
19540 | *
|
19541 | * This source code is licensed under the BSD-style license found in the
|
19542 | * LICENSE file in the root directory of this source tree. An additional grant
|
19543 | * of patent rights can be found in the PATENTS file in the same directory.
|
19544 | *
|
19545 | * @providesModule SelectEventPlugin
|
19546 | */
|
19547 |
|
19548 | 'use strict';
|
19549 |
|
19550 | var EventConstants = __webpack_require__(115);
|
19551 | var EventPropagators = __webpack_require__(158);
|
19552 | var ExecutionEnvironment = __webpack_require__(94);
|
19553 | var ReactInputSelection = __webpack_require__(211);
|
19554 | var SyntheticEvent = __webpack_require__(162);
|
19555 |
|
19556 | var getActiveElement = __webpack_require__(214);
|
19557 | var isTextInputElement = __webpack_require__(167);
|
19558 | var keyOf = __webpack_require__(164);
|
19559 | var shallowEqual = __webpack_require__(202);
|
19560 |
|
19561 | var topLevelTypes = EventConstants.topLevelTypes;
|
19562 |
|
19563 | var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
|
19564 |
|
19565 | var eventTypes = {
|
19566 | select: {
|
19567 | phasedRegistrationNames: {
|
19568 | bubbled: keyOf({ onSelect: null }),
|
19569 | captured: keyOf({ onSelectCapture: null })
|
19570 | },
|
19571 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
|
19572 | }
|
19573 | };
|
19574 |
|
19575 | var activeElement = null;
|
19576 | var activeElementID = null;
|
19577 | var lastSelection = null;
|
19578 | var mouseDown = false;
|
19579 |
|
19580 | // Track whether a listener exists for this plugin. If none exist, we do
|
19581 | // not extract events.
|
19582 | var hasListener = false;
|
19583 | var ON_SELECT_KEY = keyOf({ onSelect: null });
|
19584 |
|
19585 | /**
|
19586 | * Get an object which is a unique representation of the current selection.
|
19587 | *
|
19588 | * The return value will not be consistent across nodes or browsers, but
|
19589 | * two identical selections on the same node will return identical objects.
|
19590 | *
|
19591 | * @param {DOMElement} node
|
19592 | * @return {object}
|
19593 | */
|
19594 | function getSelection(node) {
|
19595 | if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
|
19596 | return {
|
19597 | start: node.selectionStart,
|
19598 | end: node.selectionEnd
|
19599 | };
|
19600 | } else if (window.getSelection) {
|
19601 | var selection = window.getSelection();
|
19602 | return {
|
19603 | anchorNode: selection.anchorNode,
|
19604 | anchorOffset: selection.anchorOffset,
|
19605 | focusNode: selection.focusNode,
|
19606 | focusOffset: selection.focusOffset
|
19607 | };
|
19608 | } else if (document.selection) {
|
19609 | var range = document.selection.createRange();
|
19610 | return {
|
19611 | parentElement: range.parentElement(),
|
19612 | text: range.text,
|
19613 | top: range.boundingTop,
|
19614 | left: range.boundingLeft
|
19615 | };
|
19616 | }
|
19617 | }
|
19618 |
|
19619 | /**
|
19620 | * Poll selection to see whether it's changed.
|
19621 | *
|
19622 | * @param {object} nativeEvent
|
19623 | * @return {?SyntheticEvent}
|
19624 | */
|
19625 | function constructSelectEvent(nativeEvent, nativeEventTarget) {
|
19626 | // Ensure we have the right element, and that the user is not dragging a
|
19627 | // selection (this matches native `select` event behavior). In HTML5, select
|
19628 | // fires only on input and textarea thus if there's no focused element we
|
19629 | // won't dispatch.
|
19630 | if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
|
19631 | return null;
|
19632 | }
|
19633 |
|
19634 | // Only fire when selection has actually changed.
|
19635 | var currentSelection = getSelection(activeElement);
|
19636 | if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
|
19637 | lastSelection = currentSelection;
|
19638 |
|
19639 | var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementID, nativeEvent, nativeEventTarget);
|
19640 |
|
19641 | syntheticEvent.type = 'select';
|
19642 | syntheticEvent.target = activeElement;
|
19643 |
|
19644 | EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
|
19645 |
|
19646 | return syntheticEvent;
|
19647 | }
|
19648 |
|
19649 | return null;
|
19650 | }
|
19651 |
|
19652 | /**
|
19653 | * This plugin creates an `onSelect` event that normalizes select events
|
19654 | * across form elements.
|
19655 | *
|
19656 | * Supported elements are:
|
19657 | * - input (see `isTextInputElement`)
|
19658 | * - textarea
|
19659 | * - contentEditable
|
19660 | *
|
19661 | * This differs from native browser implementations in the following ways:
|
19662 | * - Fires on contentEditable fields as well as inputs.
|
19663 | * - Fires for collapsed selection.
|
19664 | * - Fires after user input.
|
19665 | */
|
19666 | var SelectEventPlugin = {
|
19667 |
|
19668 | eventTypes: eventTypes,
|
19669 |
|
19670 | /**
|
19671 | * @param {string} topLevelType Record from `EventConstants`.
|
19672 | * @param {DOMEventTarget} topLevelTarget The listening component root node.
|
19673 | * @param {string} topLevelTargetID ID of `topLevelTarget`.
|
19674 | * @param {object} nativeEvent Native browser event.
|
19675 | * @return {*} An accumulation of synthetic events.
|
19676 | * @see {EventPluginHub.extractEvents}
|
19677 | */
|
19678 | extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
19679 | if (!hasListener) {
|
19680 | return null;
|
19681 | }
|
19682 |
|
19683 | switch (topLevelType) {
|
19684 | // Track the input node that has focus.
|
19685 | case topLevelTypes.topFocus:
|
19686 | if (isTextInputElement(topLevelTarget) || topLevelTarget.contentEditable === 'true') {
|
19687 | activeElement = topLevelTarget;
|
19688 | activeElementID = topLevelTargetID;
|
19689 | lastSelection = null;
|
19690 | }
|
19691 | break;
|
19692 | case topLevelTypes.topBlur:
|
19693 | activeElement = null;
|
19694 | activeElementID = null;
|
19695 | lastSelection = null;
|
19696 | break;
|
19697 |
|
19698 | // Don't fire the event while the user is dragging. This matches the
|
19699 | // semantics of the native select event.
|
19700 | case topLevelTypes.topMouseDown:
|
19701 | mouseDown = true;
|
19702 | break;
|
19703 | case topLevelTypes.topContextMenu:
|
19704 | case topLevelTypes.topMouseUp:
|
19705 | mouseDown = false;
|
19706 | return constructSelectEvent(nativeEvent, nativeEventTarget);
|
19707 |
|
19708 | // Chrome and IE fire non-standard event when selection is changed (and
|
19709 | // sometimes when it hasn't). IE's event fires out of order with respect
|
19710 | // to key and input events on deletion, so we discard it.
|
19711 | //
|
19712 | // Firefox doesn't support selectionchange, so check selection status
|
19713 | // after each key entry. The selection changes after keydown and before
|
19714 | // keyup, but we check on keydown as well in the case of holding down a
|
19715 | // key, when multiple keydown events are fired but only one keyup is.
|
19716 | // This is also our approach for IE handling, for the reason above.
|
19717 | case topLevelTypes.topSelectionChange:
|
19718 | if (skipSelectionChangeEvent) {
|
19719 | break;
|
19720 | }
|
19721 | // falls through
|
19722 | case topLevelTypes.topKeyDown:
|
19723 | case topLevelTypes.topKeyUp:
|
19724 | return constructSelectEvent(nativeEvent, nativeEventTarget);
|
19725 | }
|
19726 |
|
19727 | return null;
|
19728 | },
|
19729 |
|
19730 | didPutListener: function (id, registrationName, listener) {
|
19731 | if (registrationName === ON_SELECT_KEY) {
|
19732 | hasListener = true;
|
19733 | }
|
19734 | }
|
19735 | };
|
19736 |
|
19737 | module.exports = SelectEventPlugin;
|
19738 |
|
19739 | /***/ }),
|
19740 | /* 216 */
|
19741 | /***/ (function(module, exports) {
|
19742 |
|
19743 | /**
|
19744 | * Copyright 2013-2015, Facebook, Inc.
|
19745 | * All rights reserved.
|
19746 | *
|
19747 | * This source code is licensed under the BSD-style license found in the
|
19748 | * LICENSE file in the root directory of this source tree. An additional grant
|
19749 | * of patent rights can be found in the PATENTS file in the same directory.
|
19750 | *
|
19751 | * @providesModule ServerReactRootIndex
|
19752 | * @typechecks
|
19753 | */
|
19754 |
|
19755 | 'use strict';
|
19756 |
|
19757 | /**
|
19758 | * Size of the reactRoot ID space. We generate random numbers for React root
|
19759 | * IDs and if there's a collision the events and DOM update system will
|
19760 | * get confused. In the future we need a way to generate GUIDs but for
|
19761 | * now this will work on a smaller scale.
|
19762 | */
|
19763 | var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53);
|
19764 |
|
19765 | var ServerReactRootIndex = {
|
19766 | createReactRootIndex: function () {
|
19767 | return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX);
|
19768 | }
|
19769 | };
|
19770 |
|
19771 | module.exports = ServerReactRootIndex;
|
19772 |
|
19773 | /***/ }),
|
19774 | /* 217 */
|
19775 | /***/ (function(module, exports, __webpack_require__) {
|
19776 |
|
19777 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
19778 | * Copyright 2013-2015, Facebook, Inc.
|
19779 | * All rights reserved.
|
19780 | *
|
19781 | * This source code is licensed under the BSD-style license found in the
|
19782 | * LICENSE file in the root directory of this source tree. An additional grant
|
19783 | * of patent rights can be found in the PATENTS file in the same directory.
|
19784 | *
|
19785 | * @providesModule SimpleEventPlugin
|
19786 | */
|
19787 |
|
19788 | 'use strict';
|
19789 |
|
19790 | var EventConstants = __webpack_require__(115);
|
19791 | var EventListener = __webpack_require__(204);
|
19792 | var EventPropagators = __webpack_require__(158);
|
19793 | var ReactMount = __webpack_require__(113);
|
19794 | var SyntheticClipboardEvent = __webpack_require__(218);
|
19795 | var SyntheticEvent = __webpack_require__(162);
|
19796 | var SyntheticFocusEvent = __webpack_require__(219);
|
19797 | var SyntheticKeyboardEvent = __webpack_require__(220);
|
19798 | var SyntheticMouseEvent = __webpack_require__(171);
|
19799 | var SyntheticDragEvent = __webpack_require__(223);
|
19800 | var SyntheticTouchEvent = __webpack_require__(224);
|
19801 | var SyntheticUIEvent = __webpack_require__(172);
|
19802 | var SyntheticWheelEvent = __webpack_require__(225);
|
19803 |
|
19804 | var emptyFunction = __webpack_require__(100);
|
19805 | var getEventCharCode = __webpack_require__(221);
|
19806 | var invariant = __webpack_require__(98);
|
19807 | var keyOf = __webpack_require__(164);
|
19808 |
|
19809 | var topLevelTypes = EventConstants.topLevelTypes;
|
19810 |
|
19811 | var eventTypes = {
|
19812 | abort: {
|
19813 | phasedRegistrationNames: {
|
19814 | bubbled: keyOf({ onAbort: true }),
|
19815 | captured: keyOf({ onAbortCapture: true })
|
19816 | }
|
19817 | },
|
19818 | blur: {
|
19819 | phasedRegistrationNames: {
|
19820 | bubbled: keyOf({ onBlur: true }),
|
19821 | captured: keyOf({ onBlurCapture: true })
|
19822 | }
|
19823 | },
|
19824 | canPlay: {
|
19825 | phasedRegistrationNames: {
|
19826 | bubbled: keyOf({ onCanPlay: true }),
|
19827 | captured: keyOf({ onCanPlayCapture: true })
|
19828 | }
|
19829 | },
|
19830 | canPlayThrough: {
|
19831 | phasedRegistrationNames: {
|
19832 | bubbled: keyOf({ onCanPlayThrough: true }),
|
19833 | captured: keyOf({ onCanPlayThroughCapture: true })
|
19834 | }
|
19835 | },
|
19836 | click: {
|
19837 | phasedRegistrationNames: {
|
19838 | bubbled: keyOf({ onClick: true }),
|
19839 | captured: keyOf({ onClickCapture: true })
|
19840 | }
|
19841 | },
|
19842 | contextMenu: {
|
19843 | phasedRegistrationNames: {
|
19844 | bubbled: keyOf({ onContextMenu: true }),
|
19845 | captured: keyOf({ onContextMenuCapture: true })
|
19846 | }
|
19847 | },
|
19848 | copy: {
|
19849 | phasedRegistrationNames: {
|
19850 | bubbled: keyOf({ onCopy: true }),
|
19851 | captured: keyOf({ onCopyCapture: true })
|
19852 | }
|
19853 | },
|
19854 | cut: {
|
19855 | phasedRegistrationNames: {
|
19856 | bubbled: keyOf({ onCut: true }),
|
19857 | captured: keyOf({ onCutCapture: true })
|
19858 | }
|
19859 | },
|
19860 | doubleClick: {
|
19861 | phasedRegistrationNames: {
|
19862 | bubbled: keyOf({ onDoubleClick: true }),
|
19863 | captured: keyOf({ onDoubleClickCapture: true })
|
19864 | }
|
19865 | },
|
19866 | drag: {
|
19867 | phasedRegistrationNames: {
|
19868 | bubbled: keyOf({ onDrag: true }),
|
19869 | captured: keyOf({ onDragCapture: true })
|
19870 | }
|
19871 | },
|
19872 | dragEnd: {
|
19873 | phasedRegistrationNames: {
|
19874 | bubbled: keyOf({ onDragEnd: true }),
|
19875 | captured: keyOf({ onDragEndCapture: true })
|
19876 | }
|
19877 | },
|
19878 | dragEnter: {
|
19879 | phasedRegistrationNames: {
|
19880 | bubbled: keyOf({ onDragEnter: true }),
|
19881 | captured: keyOf({ onDragEnterCapture: true })
|
19882 | }
|
19883 | },
|
19884 | dragExit: {
|
19885 | phasedRegistrationNames: {
|
19886 | bubbled: keyOf({ onDragExit: true }),
|
19887 | captured: keyOf({ onDragExitCapture: true })
|
19888 | }
|
19889 | },
|
19890 | dragLeave: {
|
19891 | phasedRegistrationNames: {
|
19892 | bubbled: keyOf({ onDragLeave: true }),
|
19893 | captured: keyOf({ onDragLeaveCapture: true })
|
19894 | }
|
19895 | },
|
19896 | dragOver: {
|
19897 | phasedRegistrationNames: {
|
19898 | bubbled: keyOf({ onDragOver: true }),
|
19899 | captured: keyOf({ onDragOverCapture: true })
|
19900 | }
|
19901 | },
|
19902 | dragStart: {
|
19903 | phasedRegistrationNames: {
|
19904 | bubbled: keyOf({ onDragStart: true }),
|
19905 | captured: keyOf({ onDragStartCapture: true })
|
19906 | }
|
19907 | },
|
19908 | drop: {
|
19909 | phasedRegistrationNames: {
|
19910 | bubbled: keyOf({ onDrop: true }),
|
19911 | captured: keyOf({ onDropCapture: true })
|
19912 | }
|
19913 | },
|
19914 | durationChange: {
|
19915 | phasedRegistrationNames: {
|
19916 | bubbled: keyOf({ onDurationChange: true }),
|
19917 | captured: keyOf({ onDurationChangeCapture: true })
|
19918 | }
|
19919 | },
|
19920 | emptied: {
|
19921 | phasedRegistrationNames: {
|
19922 | bubbled: keyOf({ onEmptied: true }),
|
19923 | captured: keyOf({ onEmptiedCapture: true })
|
19924 | }
|
19925 | },
|
19926 | encrypted: {
|
19927 | phasedRegistrationNames: {
|
19928 | bubbled: keyOf({ onEncrypted: true }),
|
19929 | captured: keyOf({ onEncryptedCapture: true })
|
19930 | }
|
19931 | },
|
19932 | ended: {
|
19933 | phasedRegistrationNames: {
|
19934 | bubbled: keyOf({ onEnded: true }),
|
19935 | captured: keyOf({ onEndedCapture: true })
|
19936 | }
|
19937 | },
|
19938 | error: {
|
19939 | phasedRegistrationNames: {
|
19940 | bubbled: keyOf({ onError: true }),
|
19941 | captured: keyOf({ onErrorCapture: true })
|
19942 | }
|
19943 | },
|
19944 | focus: {
|
19945 | phasedRegistrationNames: {
|
19946 | bubbled: keyOf({ onFocus: true }),
|
19947 | captured: keyOf({ onFocusCapture: true })
|
19948 | }
|
19949 | },
|
19950 | input: {
|
19951 | phasedRegistrationNames: {
|
19952 | bubbled: keyOf({ onInput: true }),
|
19953 | captured: keyOf({ onInputCapture: true })
|
19954 | }
|
19955 | },
|
19956 | keyDown: {
|
19957 | phasedRegistrationNames: {
|
19958 | bubbled: keyOf({ onKeyDown: true }),
|
19959 | captured: keyOf({ onKeyDownCapture: true })
|
19960 | }
|
19961 | },
|
19962 | keyPress: {
|
19963 | phasedRegistrationNames: {
|
19964 | bubbled: keyOf({ onKeyPress: true }),
|
19965 | captured: keyOf({ onKeyPressCapture: true })
|
19966 | }
|
19967 | },
|
19968 | keyUp: {
|
19969 | phasedRegistrationNames: {
|
19970 | bubbled: keyOf({ onKeyUp: true }),
|
19971 | captured: keyOf({ onKeyUpCapture: true })
|
19972 | }
|
19973 | },
|
19974 | load: {
|
19975 | phasedRegistrationNames: {
|
19976 | bubbled: keyOf({ onLoad: true }),
|
19977 | captured: keyOf({ onLoadCapture: true })
|
19978 | }
|
19979 | },
|
19980 | loadedData: {
|
19981 | phasedRegistrationNames: {
|
19982 | bubbled: keyOf({ onLoadedData: true }),
|
19983 | captured: keyOf({ onLoadedDataCapture: true })
|
19984 | }
|
19985 | },
|
19986 | loadedMetadata: {
|
19987 | phasedRegistrationNames: {
|
19988 | bubbled: keyOf({ onLoadedMetadata: true }),
|
19989 | captured: keyOf({ onLoadedMetadataCapture: true })
|
19990 | }
|
19991 | },
|
19992 | loadStart: {
|
19993 | phasedRegistrationNames: {
|
19994 | bubbled: keyOf({ onLoadStart: true }),
|
19995 | captured: keyOf({ onLoadStartCapture: true })
|
19996 | }
|
19997 | },
|
19998 | // Note: We do not allow listening to mouseOver events. Instead, use the
|
19999 | // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
|
20000 | mouseDown: {
|
20001 | phasedRegistrationNames: {
|
20002 | bubbled: keyOf({ onMouseDown: true }),
|
20003 | captured: keyOf({ onMouseDownCapture: true })
|
20004 | }
|
20005 | },
|
20006 | mouseMove: {
|
20007 | phasedRegistrationNames: {
|
20008 | bubbled: keyOf({ onMouseMove: true }),
|
20009 | captured: keyOf({ onMouseMoveCapture: true })
|
20010 | }
|
20011 | },
|
20012 | mouseOut: {
|
20013 | phasedRegistrationNames: {
|
20014 | bubbled: keyOf({ onMouseOut: true }),
|
20015 | captured: keyOf({ onMouseOutCapture: true })
|
20016 | }
|
20017 | },
|
20018 | mouseOver: {
|
20019 | phasedRegistrationNames: {
|
20020 | bubbled: keyOf({ onMouseOver: true }),
|
20021 | captured: keyOf({ onMouseOverCapture: true })
|
20022 | }
|
20023 | },
|
20024 | mouseUp: {
|
20025 | phasedRegistrationNames: {
|
20026 | bubbled: keyOf({ onMouseUp: true }),
|
20027 | captured: keyOf({ onMouseUpCapture: true })
|
20028 | }
|
20029 | },
|
20030 | paste: {
|
20031 | phasedRegistrationNames: {
|
20032 | bubbled: keyOf({ onPaste: true }),
|
20033 | captured: keyOf({ onPasteCapture: true })
|
20034 | }
|
20035 | },
|
20036 | pause: {
|
20037 | phasedRegistrationNames: {
|
20038 | bubbled: keyOf({ onPause: true }),
|
20039 | captured: keyOf({ onPauseCapture: true })
|
20040 | }
|
20041 | },
|
20042 | play: {
|
20043 | phasedRegistrationNames: {
|
20044 | bubbled: keyOf({ onPlay: true }),
|
20045 | captured: keyOf({ onPlayCapture: true })
|
20046 | }
|
20047 | },
|
20048 | playing: {
|
20049 | phasedRegistrationNames: {
|
20050 | bubbled: keyOf({ onPlaying: true }),
|
20051 | captured: keyOf({ onPlayingCapture: true })
|
20052 | }
|
20053 | },
|
20054 | progress: {
|
20055 | phasedRegistrationNames: {
|
20056 | bubbled: keyOf({ onProgress: true }),
|
20057 | captured: keyOf({ onProgressCapture: true })
|
20058 | }
|
20059 | },
|
20060 | rateChange: {
|
20061 | phasedRegistrationNames: {
|
20062 | bubbled: keyOf({ onRateChange: true }),
|
20063 | captured: keyOf({ onRateChangeCapture: true })
|
20064 | }
|
20065 | },
|
20066 | reset: {
|
20067 | phasedRegistrationNames: {
|
20068 | bubbled: keyOf({ onReset: true }),
|
20069 | captured: keyOf({ onResetCapture: true })
|
20070 | }
|
20071 | },
|
20072 | scroll: {
|
20073 | phasedRegistrationNames: {
|
20074 | bubbled: keyOf({ onScroll: true }),
|
20075 | captured: keyOf({ onScrollCapture: true })
|
20076 | }
|
20077 | },
|
20078 | seeked: {
|
20079 | phasedRegistrationNames: {
|
20080 | bubbled: keyOf({ onSeeked: true }),
|
20081 | captured: keyOf({ onSeekedCapture: true })
|
20082 | }
|
20083 | },
|
20084 | seeking: {
|
20085 | phasedRegistrationNames: {
|
20086 | bubbled: keyOf({ onSeeking: true }),
|
20087 | captured: keyOf({ onSeekingCapture: true })
|
20088 | }
|
20089 | },
|
20090 | stalled: {
|
20091 | phasedRegistrationNames: {
|
20092 | bubbled: keyOf({ onStalled: true }),
|
20093 | captured: keyOf({ onStalledCapture: true })
|
20094 | }
|
20095 | },
|
20096 | submit: {
|
20097 | phasedRegistrationNames: {
|
20098 | bubbled: keyOf({ onSubmit: true }),
|
20099 | captured: keyOf({ onSubmitCapture: true })
|
20100 | }
|
20101 | },
|
20102 | suspend: {
|
20103 | phasedRegistrationNames: {
|
20104 | bubbled: keyOf({ onSuspend: true }),
|
20105 | captured: keyOf({ onSuspendCapture: true })
|
20106 | }
|
20107 | },
|
20108 | timeUpdate: {
|
20109 | phasedRegistrationNames: {
|
20110 | bubbled: keyOf({ onTimeUpdate: true }),
|
20111 | captured: keyOf({ onTimeUpdateCapture: true })
|
20112 | }
|
20113 | },
|
20114 | touchCancel: {
|
20115 | phasedRegistrationNames: {
|
20116 | bubbled: keyOf({ onTouchCancel: true }),
|
20117 | captured: keyOf({ onTouchCancelCapture: true })
|
20118 | }
|
20119 | },
|
20120 | touchEnd: {
|
20121 | phasedRegistrationNames: {
|
20122 | bubbled: keyOf({ onTouchEnd: true }),
|
20123 | captured: keyOf({ onTouchEndCapture: true })
|
20124 | }
|
20125 | },
|
20126 | touchMove: {
|
20127 | phasedRegistrationNames: {
|
20128 | bubbled: keyOf({ onTouchMove: true }),
|
20129 | captured: keyOf({ onTouchMoveCapture: true })
|
20130 | }
|
20131 | },
|
20132 | touchStart: {
|
20133 | phasedRegistrationNames: {
|
20134 | bubbled: keyOf({ onTouchStart: true }),
|
20135 | captured: keyOf({ onTouchStartCapture: true })
|
20136 | }
|
20137 | },
|
20138 | volumeChange: {
|
20139 | phasedRegistrationNames: {
|
20140 | bubbled: keyOf({ onVolumeChange: true }),
|
20141 | captured: keyOf({ onVolumeChangeCapture: true })
|
20142 | }
|
20143 | },
|
20144 | waiting: {
|
20145 | phasedRegistrationNames: {
|
20146 | bubbled: keyOf({ onWaiting: true }),
|
20147 | captured: keyOf({ onWaitingCapture: true })
|
20148 | }
|
20149 | },
|
20150 | wheel: {
|
20151 | phasedRegistrationNames: {
|
20152 | bubbled: keyOf({ onWheel: true }),
|
20153 | captured: keyOf({ onWheelCapture: true })
|
20154 | }
|
20155 | }
|
20156 | };
|
20157 |
|
20158 | var topLevelEventsToDispatchConfig = {
|
20159 | topAbort: eventTypes.abort,
|
20160 | topBlur: eventTypes.blur,
|
20161 | topCanPlay: eventTypes.canPlay,
|
20162 | topCanPlayThrough: eventTypes.canPlayThrough,
|
20163 | topClick: eventTypes.click,
|
20164 | topContextMenu: eventTypes.contextMenu,
|
20165 | topCopy: eventTypes.copy,
|
20166 | topCut: eventTypes.cut,
|
20167 | topDoubleClick: eventTypes.doubleClick,
|
20168 | topDrag: eventTypes.drag,
|
20169 | topDragEnd: eventTypes.dragEnd,
|
20170 | topDragEnter: eventTypes.dragEnter,
|
20171 | topDragExit: eventTypes.dragExit,
|
20172 | topDragLeave: eventTypes.dragLeave,
|
20173 | topDragOver: eventTypes.dragOver,
|
20174 | topDragStart: eventTypes.dragStart,
|
20175 | topDrop: eventTypes.drop,
|
20176 | topDurationChange: eventTypes.durationChange,
|
20177 | topEmptied: eventTypes.emptied,
|
20178 | topEncrypted: eventTypes.encrypted,
|
20179 | topEnded: eventTypes.ended,
|
20180 | topError: eventTypes.error,
|
20181 | topFocus: eventTypes.focus,
|
20182 | topInput: eventTypes.input,
|
20183 | topKeyDown: eventTypes.keyDown,
|
20184 | topKeyPress: eventTypes.keyPress,
|
20185 | topKeyUp: eventTypes.keyUp,
|
20186 | topLoad: eventTypes.load,
|
20187 | topLoadedData: eventTypes.loadedData,
|
20188 | topLoadedMetadata: eventTypes.loadedMetadata,
|
20189 | topLoadStart: eventTypes.loadStart,
|
20190 | topMouseDown: eventTypes.mouseDown,
|
20191 | topMouseMove: eventTypes.mouseMove,
|
20192 | topMouseOut: eventTypes.mouseOut,
|
20193 | topMouseOver: eventTypes.mouseOver,
|
20194 | topMouseUp: eventTypes.mouseUp,
|
20195 | topPaste: eventTypes.paste,
|
20196 | topPause: eventTypes.pause,
|
20197 | topPlay: eventTypes.play,
|
20198 | topPlaying: eventTypes.playing,
|
20199 | topProgress: eventTypes.progress,
|
20200 | topRateChange: eventTypes.rateChange,
|
20201 | topReset: eventTypes.reset,
|
20202 | topScroll: eventTypes.scroll,
|
20203 | topSeeked: eventTypes.seeked,
|
20204 | topSeeking: eventTypes.seeking,
|
20205 | topStalled: eventTypes.stalled,
|
20206 | topSubmit: eventTypes.submit,
|
20207 | topSuspend: eventTypes.suspend,
|
20208 | topTimeUpdate: eventTypes.timeUpdate,
|
20209 | topTouchCancel: eventTypes.touchCancel,
|
20210 | topTouchEnd: eventTypes.touchEnd,
|
20211 | topTouchMove: eventTypes.touchMove,
|
20212 | topTouchStart: eventTypes.touchStart,
|
20213 | topVolumeChange: eventTypes.volumeChange,
|
20214 | topWaiting: eventTypes.waiting,
|
20215 | topWheel: eventTypes.wheel
|
20216 | };
|
20217 |
|
20218 | for (var type in topLevelEventsToDispatchConfig) {
|
20219 | topLevelEventsToDispatchConfig[type].dependencies = [type];
|
20220 | }
|
20221 |
|
20222 | var ON_CLICK_KEY = keyOf({ onClick: null });
|
20223 | var onClickListeners = {};
|
20224 |
|
20225 | var SimpleEventPlugin = {
|
20226 |
|
20227 | eventTypes: eventTypes,
|
20228 |
|
20229 | /**
|
20230 | * @param {string} topLevelType Record from `EventConstants`.
|
20231 | * @param {DOMEventTarget} topLevelTarget The listening component root node.
|
20232 | * @param {string} topLevelTargetID ID of `topLevelTarget`.
|
20233 | * @param {object} nativeEvent Native browser event.
|
20234 | * @return {*} An accumulation of synthetic events.
|
20235 | * @see {EventPluginHub.extractEvents}
|
20236 | */
|
20237 | extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
20238 | var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
|
20239 | if (!dispatchConfig) {
|
20240 | return null;
|
20241 | }
|
20242 | var EventConstructor;
|
20243 | switch (topLevelType) {
|
20244 | case topLevelTypes.topAbort:
|
20245 | case topLevelTypes.topCanPlay:
|
20246 | case topLevelTypes.topCanPlayThrough:
|
20247 | case topLevelTypes.topDurationChange:
|
20248 | case topLevelTypes.topEmptied:
|
20249 | case topLevelTypes.topEncrypted:
|
20250 | case topLevelTypes.topEnded:
|
20251 | case topLevelTypes.topError:
|
20252 | case topLevelTypes.topInput:
|
20253 | case topLevelTypes.topLoad:
|
20254 | case topLevelTypes.topLoadedData:
|
20255 | case topLevelTypes.topLoadedMetadata:
|
20256 | case topLevelTypes.topLoadStart:
|
20257 | case topLevelTypes.topPause:
|
20258 | case topLevelTypes.topPlay:
|
20259 | case topLevelTypes.topPlaying:
|
20260 | case topLevelTypes.topProgress:
|
20261 | case topLevelTypes.topRateChange:
|
20262 | case topLevelTypes.topReset:
|
20263 | case topLevelTypes.topSeeked:
|
20264 | case topLevelTypes.topSeeking:
|
20265 | case topLevelTypes.topStalled:
|
20266 | case topLevelTypes.topSubmit:
|
20267 | case topLevelTypes.topSuspend:
|
20268 | case topLevelTypes.topTimeUpdate:
|
20269 | case topLevelTypes.topVolumeChange:
|
20270 | case topLevelTypes.topWaiting:
|
20271 | // HTML Events
|
20272 | // @see http://www.w3.org/TR/html5/index.html#events-0
|
20273 | EventConstructor = SyntheticEvent;
|
20274 | break;
|
20275 | case topLevelTypes.topKeyPress:
|
20276 | // FireFox creates a keypress event for function keys too. This removes
|
20277 | // the unwanted keypress events. Enter is however both printable and
|
20278 | // non-printable. One would expect Tab to be as well (but it isn't).
|
20279 | if (getEventCharCode(nativeEvent) === 0) {
|
20280 | return null;
|
20281 | }
|
20282 | /* falls through */
|
20283 | case topLevelTypes.topKeyDown:
|
20284 | case topLevelTypes.topKeyUp:
|
20285 | EventConstructor = SyntheticKeyboardEvent;
|
20286 | break;
|
20287 | case topLevelTypes.topBlur:
|
20288 | case topLevelTypes.topFocus:
|
20289 | EventConstructor = SyntheticFocusEvent;
|
20290 | break;
|
20291 | case topLevelTypes.topClick:
|
20292 | // Firefox creates a click event on right mouse clicks. This removes the
|
20293 | // unwanted click events.
|
20294 | if (nativeEvent.button === 2) {
|
20295 | return null;
|
20296 | }
|
20297 | /* falls through */
|
20298 | case topLevelTypes.topContextMenu:
|
20299 | case topLevelTypes.topDoubleClick:
|
20300 | case topLevelTypes.topMouseDown:
|
20301 | case topLevelTypes.topMouseMove:
|
20302 | case topLevelTypes.topMouseOut:
|
20303 | case topLevelTypes.topMouseOver:
|
20304 | case topLevelTypes.topMouseUp:
|
20305 | EventConstructor = SyntheticMouseEvent;
|
20306 | break;
|
20307 | case topLevelTypes.topDrag:
|
20308 | case topLevelTypes.topDragEnd:
|
20309 | case topLevelTypes.topDragEnter:
|
20310 | case topLevelTypes.topDragExit:
|
20311 | case topLevelTypes.topDragLeave:
|
20312 | case topLevelTypes.topDragOver:
|
20313 | case topLevelTypes.topDragStart:
|
20314 | case topLevelTypes.topDrop:
|
20315 | EventConstructor = SyntheticDragEvent;
|
20316 | break;
|
20317 | case topLevelTypes.topTouchCancel:
|
20318 | case topLevelTypes.topTouchEnd:
|
20319 | case topLevelTypes.topTouchMove:
|
20320 | case topLevelTypes.topTouchStart:
|
20321 | EventConstructor = SyntheticTouchEvent;
|
20322 | break;
|
20323 | case topLevelTypes.topScroll:
|
20324 | EventConstructor = SyntheticUIEvent;
|
20325 | break;
|
20326 | case topLevelTypes.topWheel:
|
20327 | EventConstructor = SyntheticWheelEvent;
|
20328 | break;
|
20329 | case topLevelTypes.topCopy:
|
20330 | case topLevelTypes.topCut:
|
20331 | case topLevelTypes.topPaste:
|
20332 | EventConstructor = SyntheticClipboardEvent;
|
20333 | break;
|
20334 | }
|
20335 | !EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : undefined;
|
20336 | var event = EventConstructor.getPooled(dispatchConfig, topLevelTargetID, nativeEvent, nativeEventTarget);
|
20337 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
20338 | return event;
|
20339 | },
|
20340 |
|
20341 | didPutListener: function (id, registrationName, listener) {
|
20342 | // Mobile Safari does not fire properly bubble click events on
|
20343 | // non-interactive elements, which means delegated click listeners do not
|
20344 | // fire. The workaround for this bug involves attaching an empty click
|
20345 | // listener on the target node.
|
20346 | if (registrationName === ON_CLICK_KEY) {
|
20347 | var node = ReactMount.getNode(id);
|
20348 | if (!onClickListeners[id]) {
|
20349 | onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
|
20350 | }
|
20351 | }
|
20352 | },
|
20353 |
|
20354 | willDeleteListener: function (id, registrationName) {
|
20355 | if (registrationName === ON_CLICK_KEY) {
|
20356 | onClickListeners[id].remove();
|
20357 | delete onClickListeners[id];
|
20358 | }
|
20359 | }
|
20360 |
|
20361 | };
|
20362 |
|
20363 | module.exports = SimpleEventPlugin;
|
20364 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
20365 |
|
20366 | /***/ }),
|
20367 | /* 218 */
|
20368 | /***/ (function(module, exports, __webpack_require__) {
|
20369 |
|
20370 | /**
|
20371 | * Copyright 2013-2015, Facebook, Inc.
|
20372 | * All rights reserved.
|
20373 | *
|
20374 | * This source code is licensed under the BSD-style license found in the
|
20375 | * LICENSE file in the root directory of this source tree. An additional grant
|
20376 | * of patent rights can be found in the PATENTS file in the same directory.
|
20377 | *
|
20378 | * @providesModule SyntheticClipboardEvent
|
20379 | * @typechecks static-only
|
20380 | */
|
20381 |
|
20382 | 'use strict';
|
20383 |
|
20384 | var SyntheticEvent = __webpack_require__(162);
|
20385 |
|
20386 | /**
|
20387 | * @interface Event
|
20388 | * @see http://www.w3.org/TR/clipboard-apis/
|
20389 | */
|
20390 | var ClipboardEventInterface = {
|
20391 | clipboardData: function (event) {
|
20392 | return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
|
20393 | }
|
20394 | };
|
20395 |
|
20396 | /**
|
20397 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
20398 | * @param {string} dispatchMarker Marker identifying the event target.
|
20399 | * @param {object} nativeEvent Native browser event.
|
20400 | * @extends {SyntheticUIEvent}
|
20401 | */
|
20402 | function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
20403 | SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
20404 | }
|
20405 |
|
20406 | SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
|
20407 |
|
20408 | module.exports = SyntheticClipboardEvent;
|
20409 |
|
20410 | /***/ }),
|
20411 | /* 219 */
|
20412 | /***/ (function(module, exports, __webpack_require__) {
|
20413 |
|
20414 | /**
|
20415 | * Copyright 2013-2015, Facebook, Inc.
|
20416 | * All rights reserved.
|
20417 | *
|
20418 | * This source code is licensed under the BSD-style license found in the
|
20419 | * LICENSE file in the root directory of this source tree. An additional grant
|
20420 | * of patent rights can be found in the PATENTS file in the same directory.
|
20421 | *
|
20422 | * @providesModule SyntheticFocusEvent
|
20423 | * @typechecks static-only
|
20424 | */
|
20425 |
|
20426 | 'use strict';
|
20427 |
|
20428 | var SyntheticUIEvent = __webpack_require__(172);
|
20429 |
|
20430 | /**
|
20431 | * @interface FocusEvent
|
20432 | * @see http://www.w3.org/TR/DOM-Level-3-Events/
|
20433 | */
|
20434 | var FocusEventInterface = {
|
20435 | relatedTarget: null
|
20436 | };
|
20437 |
|
20438 | /**
|
20439 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
20440 | * @param {string} dispatchMarker Marker identifying the event target.
|
20441 | * @param {object} nativeEvent Native browser event.
|
20442 | * @extends {SyntheticUIEvent}
|
20443 | */
|
20444 | function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
20445 | SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
20446 | }
|
20447 |
|
20448 | SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
|
20449 |
|
20450 | module.exports = SyntheticFocusEvent;
|
20451 |
|
20452 | /***/ }),
|
20453 | /* 220 */
|
20454 | /***/ (function(module, exports, __webpack_require__) {
|
20455 |
|
20456 | /**
|
20457 | * Copyright 2013-2015, Facebook, Inc.
|
20458 | * All rights reserved.
|
20459 | *
|
20460 | * This source code is licensed under the BSD-style license found in the
|
20461 | * LICENSE file in the root directory of this source tree. An additional grant
|
20462 | * of patent rights can be found in the PATENTS file in the same directory.
|
20463 | *
|
20464 | * @providesModule SyntheticKeyboardEvent
|
20465 | * @typechecks static-only
|
20466 | */
|
20467 |
|
20468 | 'use strict';
|
20469 |
|
20470 | var SyntheticUIEvent = __webpack_require__(172);
|
20471 |
|
20472 | var getEventCharCode = __webpack_require__(221);
|
20473 | var getEventKey = __webpack_require__(222);
|
20474 | var getEventModifierState = __webpack_require__(173);
|
20475 |
|
20476 | /**
|
20477 | * @interface KeyboardEvent
|
20478 | * @see http://www.w3.org/TR/DOM-Level-3-Events/
|
20479 | */
|
20480 | var KeyboardEventInterface = {
|
20481 | key: getEventKey,
|
20482 | location: null,
|
20483 | ctrlKey: null,
|
20484 | shiftKey: null,
|
20485 | altKey: null,
|
20486 | metaKey: null,
|
20487 | repeat: null,
|
20488 | locale: null,
|
20489 | getModifierState: getEventModifierState,
|
20490 | // Legacy Interface
|
20491 | charCode: function (event) {
|
20492 | // `charCode` is the result of a KeyPress event and represents the value of
|
20493 | // the actual printable character.
|
20494 |
|
20495 | // KeyPress is deprecated, but its replacement is not yet final and not
|
20496 | // implemented in any major browser. Only KeyPress has charCode.
|
20497 | if (event.type === 'keypress') {
|
20498 | return getEventCharCode(event);
|
20499 | }
|
20500 | return 0;
|
20501 | },
|
20502 | keyCode: function (event) {
|
20503 | // `keyCode` is the result of a KeyDown/Up event and represents the value of
|
20504 | // physical keyboard key.
|
20505 |
|
20506 | // The actual meaning of the value depends on the users' keyboard layout
|
20507 | // which cannot be detected. Assuming that it is a US keyboard layout
|
20508 | // provides a surprisingly accurate mapping for US and European users.
|
20509 | // Due to this, it is left to the user to implement at this time.
|
20510 | if (event.type === 'keydown' || event.type === 'keyup') {
|
20511 | return event.keyCode;
|
20512 | }
|
20513 | return 0;
|
20514 | },
|
20515 | which: function (event) {
|
20516 | // `which` is an alias for either `keyCode` or `charCode` depending on the
|
20517 | // type of the event.
|
20518 | if (event.type === 'keypress') {
|
20519 | return getEventCharCode(event);
|
20520 | }
|
20521 | if (event.type === 'keydown' || event.type === 'keyup') {
|
20522 | return event.keyCode;
|
20523 | }
|
20524 | return 0;
|
20525 | }
|
20526 | };
|
20527 |
|
20528 | /**
|
20529 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
20530 | * @param {string} dispatchMarker Marker identifying the event target.
|
20531 | * @param {object} nativeEvent Native browser event.
|
20532 | * @extends {SyntheticUIEvent}
|
20533 | */
|
20534 | function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
20535 | SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
20536 | }
|
20537 |
|
20538 | SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
|
20539 |
|
20540 | module.exports = SyntheticKeyboardEvent;
|
20541 |
|
20542 | /***/ }),
|
20543 | /* 221 */
|
20544 | /***/ (function(module, exports) {
|
20545 |
|
20546 | /**
|
20547 | * Copyright 2013-2015, Facebook, Inc.
|
20548 | * All rights reserved.
|
20549 | *
|
20550 | * This source code is licensed under the BSD-style license found in the
|
20551 | * LICENSE file in the root directory of this source tree. An additional grant
|
20552 | * of patent rights can be found in the PATENTS file in the same directory.
|
20553 | *
|
20554 | * @providesModule getEventCharCode
|
20555 | * @typechecks static-only
|
20556 | */
|
20557 |
|
20558 | 'use strict';
|
20559 |
|
20560 | /**
|
20561 | * `charCode` represents the actual "character code" and is safe to use with
|
20562 | * `String.fromCharCode`. As such, only keys that correspond to printable
|
20563 | * characters produce a valid `charCode`, the only exception to this is Enter.
|
20564 | * The Tab-key is considered non-printable and does not have a `charCode`,
|
20565 | * presumably because it does not produce a tab-character in browsers.
|
20566 | *
|
20567 | * @param {object} nativeEvent Native browser event.
|
20568 | * @return {number} Normalized `charCode` property.
|
20569 | */
|
20570 | function getEventCharCode(nativeEvent) {
|
20571 | var charCode;
|
20572 | var keyCode = nativeEvent.keyCode;
|
20573 |
|
20574 | if ('charCode' in nativeEvent) {
|
20575 | charCode = nativeEvent.charCode;
|
20576 |
|
20577 | // FF does not set `charCode` for the Enter-key, check against `keyCode`.
|
20578 | if (charCode === 0 && keyCode === 13) {
|
20579 | charCode = 13;
|
20580 | }
|
20581 | } else {
|
20582 | // IE8 does not implement `charCode`, but `keyCode` has the correct value.
|
20583 | charCode = keyCode;
|
20584 | }
|
20585 |
|
20586 | // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
|
20587 | // Must not discard the (non-)printable Enter-key.
|
20588 | if (charCode >= 32 || charCode === 13) {
|
20589 | return charCode;
|
20590 | }
|
20591 |
|
20592 | return 0;
|
20593 | }
|
20594 |
|
20595 | module.exports = getEventCharCode;
|
20596 |
|
20597 | /***/ }),
|
20598 | /* 222 */
|
20599 | /***/ (function(module, exports, __webpack_require__) {
|
20600 |
|
20601 | /**
|
20602 | * Copyright 2013-2015, Facebook, Inc.
|
20603 | * All rights reserved.
|
20604 | *
|
20605 | * This source code is licensed under the BSD-style license found in the
|
20606 | * LICENSE file in the root directory of this source tree. An additional grant
|
20607 | * of patent rights can be found in the PATENTS file in the same directory.
|
20608 | *
|
20609 | * @providesModule getEventKey
|
20610 | * @typechecks static-only
|
20611 | */
|
20612 |
|
20613 | 'use strict';
|
20614 |
|
20615 | var getEventCharCode = __webpack_require__(221);
|
20616 |
|
20617 | /**
|
20618 | * Normalization of deprecated HTML5 `key` values
|
20619 | * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
|
20620 | */
|
20621 | var normalizeKey = {
|
20622 | 'Esc': 'Escape',
|
20623 | 'Spacebar': ' ',
|
20624 | 'Left': 'ArrowLeft',
|
20625 | 'Up': 'ArrowUp',
|
20626 | 'Right': 'ArrowRight',
|
20627 | 'Down': 'ArrowDown',
|
20628 | 'Del': 'Delete',
|
20629 | 'Win': 'OS',
|
20630 | 'Menu': 'ContextMenu',
|
20631 | 'Apps': 'ContextMenu',
|
20632 | 'Scroll': 'ScrollLock',
|
20633 | 'MozPrintableKey': 'Unidentified'
|
20634 | };
|
20635 |
|
20636 | /**
|
20637 | * Translation from legacy `keyCode` to HTML5 `key`
|
20638 | * Only special keys supported, all others depend on keyboard layout or browser
|
20639 | * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
|
20640 | */
|
20641 | var translateToKey = {
|
20642 | 8: 'Backspace',
|
20643 | 9: 'Tab',
|
20644 | 12: 'Clear',
|
20645 | 13: 'Enter',
|
20646 | 16: 'Shift',
|
20647 | 17: 'Control',
|
20648 | 18: 'Alt',
|
20649 | 19: 'Pause',
|
20650 | 20: 'CapsLock',
|
20651 | 27: 'Escape',
|
20652 | 32: ' ',
|
20653 | 33: 'PageUp',
|
20654 | 34: 'PageDown',
|
20655 | 35: 'End',
|
20656 | 36: 'Home',
|
20657 | 37: 'ArrowLeft',
|
20658 | 38: 'ArrowUp',
|
20659 | 39: 'ArrowRight',
|
20660 | 40: 'ArrowDown',
|
20661 | 45: 'Insert',
|
20662 | 46: 'Delete',
|
20663 | 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
|
20664 | 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
|
20665 | 144: 'NumLock',
|
20666 | 145: 'ScrollLock',
|
20667 | 224: 'Meta'
|
20668 | };
|
20669 |
|
20670 | /**
|
20671 | * @param {object} nativeEvent Native browser event.
|
20672 | * @return {string} Normalized `key` property.
|
20673 | */
|
20674 | function getEventKey(nativeEvent) {
|
20675 | if (nativeEvent.key) {
|
20676 | // Normalize inconsistent values reported by browsers due to
|
20677 | // implementations of a working draft specification.
|
20678 |
|
20679 | // FireFox implements `key` but returns `MozPrintableKey` for all
|
20680 | // printable characters (normalized to `Unidentified`), ignore it.
|
20681 | var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
|
20682 | if (key !== 'Unidentified') {
|
20683 | return key;
|
20684 | }
|
20685 | }
|
20686 |
|
20687 | // Browser does not implement `key`, polyfill as much of it as we can.
|
20688 | if (nativeEvent.type === 'keypress') {
|
20689 | var charCode = getEventCharCode(nativeEvent);
|
20690 |
|
20691 | // The enter-key is technically both printable and non-printable and can
|
20692 | // thus be captured by `keypress`, no other non-printable key should.
|
20693 | return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
|
20694 | }
|
20695 | if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
|
20696 | // While user keyboard layout determines the actual meaning of each
|
20697 | // `keyCode` value, almost all function keys have a universal value.
|
20698 | return translateToKey[nativeEvent.keyCode] || 'Unidentified';
|
20699 | }
|
20700 | return '';
|
20701 | }
|
20702 |
|
20703 | module.exports = getEventKey;
|
20704 |
|
20705 | /***/ }),
|
20706 | /* 223 */
|
20707 | /***/ (function(module, exports, __webpack_require__) {
|
20708 |
|
20709 | /**
|
20710 | * Copyright 2013-2015, Facebook, Inc.
|
20711 | * All rights reserved.
|
20712 | *
|
20713 | * This source code is licensed under the BSD-style license found in the
|
20714 | * LICENSE file in the root directory of this source tree. An additional grant
|
20715 | * of patent rights can be found in the PATENTS file in the same directory.
|
20716 | *
|
20717 | * @providesModule SyntheticDragEvent
|
20718 | * @typechecks static-only
|
20719 | */
|
20720 |
|
20721 | 'use strict';
|
20722 |
|
20723 | var SyntheticMouseEvent = __webpack_require__(171);
|
20724 |
|
20725 | /**
|
20726 | * @interface DragEvent
|
20727 | * @see http://www.w3.org/TR/DOM-Level-3-Events/
|
20728 | */
|
20729 | var DragEventInterface = {
|
20730 | dataTransfer: null
|
20731 | };
|
20732 |
|
20733 | /**
|
20734 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
20735 | * @param {string} dispatchMarker Marker identifying the event target.
|
20736 | * @param {object} nativeEvent Native browser event.
|
20737 | * @extends {SyntheticUIEvent}
|
20738 | */
|
20739 | function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
20740 | SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
20741 | }
|
20742 |
|
20743 | SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
|
20744 |
|
20745 | module.exports = SyntheticDragEvent;
|
20746 |
|
20747 | /***/ }),
|
20748 | /* 224 */
|
20749 | /***/ (function(module, exports, __webpack_require__) {
|
20750 |
|
20751 | /**
|
20752 | * Copyright 2013-2015, Facebook, Inc.
|
20753 | * All rights reserved.
|
20754 | *
|
20755 | * This source code is licensed under the BSD-style license found in the
|
20756 | * LICENSE file in the root directory of this source tree. An additional grant
|
20757 | * of patent rights can be found in the PATENTS file in the same directory.
|
20758 | *
|
20759 | * @providesModule SyntheticTouchEvent
|
20760 | * @typechecks static-only
|
20761 | */
|
20762 |
|
20763 | 'use strict';
|
20764 |
|
20765 | var SyntheticUIEvent = __webpack_require__(172);
|
20766 |
|
20767 | var getEventModifierState = __webpack_require__(173);
|
20768 |
|
20769 | /**
|
20770 | * @interface TouchEvent
|
20771 | * @see http://www.w3.org/TR/touch-events/
|
20772 | */
|
20773 | var TouchEventInterface = {
|
20774 | touches: null,
|
20775 | targetTouches: null,
|
20776 | changedTouches: null,
|
20777 | altKey: null,
|
20778 | metaKey: null,
|
20779 | ctrlKey: null,
|
20780 | shiftKey: null,
|
20781 | getModifierState: getEventModifierState
|
20782 | };
|
20783 |
|
20784 | /**
|
20785 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
20786 | * @param {string} dispatchMarker Marker identifying the event target.
|
20787 | * @param {object} nativeEvent Native browser event.
|
20788 | * @extends {SyntheticUIEvent}
|
20789 | */
|
20790 | function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
20791 | SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
20792 | }
|
20793 |
|
20794 | SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
|
20795 |
|
20796 | module.exports = SyntheticTouchEvent;
|
20797 |
|
20798 | /***/ }),
|
20799 | /* 225 */
|
20800 | /***/ (function(module, exports, __webpack_require__) {
|
20801 |
|
20802 | /**
|
20803 | * Copyright 2013-2015, Facebook, Inc.
|
20804 | * All rights reserved.
|
20805 | *
|
20806 | * This source code is licensed under the BSD-style license found in the
|
20807 | * LICENSE file in the root directory of this source tree. An additional grant
|
20808 | * of patent rights can be found in the PATENTS file in the same directory.
|
20809 | *
|
20810 | * @providesModule SyntheticWheelEvent
|
20811 | * @typechecks static-only
|
20812 | */
|
20813 |
|
20814 | 'use strict';
|
20815 |
|
20816 | var SyntheticMouseEvent = __webpack_require__(171);
|
20817 |
|
20818 | /**
|
20819 | * @interface WheelEvent
|
20820 | * @see http://www.w3.org/TR/DOM-Level-3-Events/
|
20821 | */
|
20822 | var WheelEventInterface = {
|
20823 | deltaX: function (event) {
|
20824 | return 'deltaX' in event ? event.deltaX :
|
20825 | // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
|
20826 | 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
|
20827 | },
|
20828 | deltaY: function (event) {
|
20829 | return 'deltaY' in event ? event.deltaY :
|
20830 | // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
|
20831 | 'wheelDeltaY' in event ? -event.wheelDeltaY :
|
20832 | // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
|
20833 | 'wheelDelta' in event ? -event.wheelDelta : 0;
|
20834 | },
|
20835 | deltaZ: null,
|
20836 |
|
20837 | // Browsers without "deltaMode" is reporting in raw wheel delta where one
|
20838 | // notch on the scroll is always +/- 120, roughly equivalent to pixels.
|
20839 | // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
|
20840 | // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
|
20841 | deltaMode: null
|
20842 | };
|
20843 |
|
20844 | /**
|
20845 | * @param {object} dispatchConfig Configuration used to dispatch this event.
|
20846 | * @param {string} dispatchMarker Marker identifying the event target.
|
20847 | * @param {object} nativeEvent Native browser event.
|
20848 | * @extends {SyntheticMouseEvent}
|
20849 | */
|
20850 | function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
20851 | SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
20852 | }
|
20853 |
|
20854 | SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
|
20855 |
|
20856 | module.exports = SyntheticWheelEvent;
|
20857 |
|
20858 | /***/ }),
|
20859 | /* 226 */
|
20860 | /***/ (function(module, exports, __webpack_require__) {
|
20861 |
|
20862 | /**
|
20863 | * Copyright 2013-2015, Facebook, Inc.
|
20864 | * All rights reserved.
|
20865 | *
|
20866 | * This source code is licensed under the BSD-style license found in the
|
20867 | * LICENSE file in the root directory of this source tree. An additional grant
|
20868 | * of patent rights can be found in the PATENTS file in the same directory.
|
20869 | *
|
20870 | * @providesModule SVGDOMPropertyConfig
|
20871 | */
|
20872 |
|
20873 | 'use strict';
|
20874 |
|
20875 | var DOMProperty = __webpack_require__(108);
|
20876 |
|
20877 | var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
|
20878 |
|
20879 | var NS = {
|
20880 | xlink: 'http://www.w3.org/1999/xlink',
|
20881 | xml: 'http://www.w3.org/XML/1998/namespace'
|
20882 | };
|
20883 |
|
20884 | var SVGDOMPropertyConfig = {
|
20885 | Properties: {
|
20886 | clipPath: MUST_USE_ATTRIBUTE,
|
20887 | cx: MUST_USE_ATTRIBUTE,
|
20888 | cy: MUST_USE_ATTRIBUTE,
|
20889 | d: MUST_USE_ATTRIBUTE,
|
20890 | dx: MUST_USE_ATTRIBUTE,
|
20891 | dy: MUST_USE_ATTRIBUTE,
|
20892 | fill: MUST_USE_ATTRIBUTE,
|
20893 | fillOpacity: MUST_USE_ATTRIBUTE,
|
20894 | fontFamily: MUST_USE_ATTRIBUTE,
|
20895 | fontSize: MUST_USE_ATTRIBUTE,
|
20896 | fx: MUST_USE_ATTRIBUTE,
|
20897 | fy: MUST_USE_ATTRIBUTE,
|
20898 | gradientTransform: MUST_USE_ATTRIBUTE,
|
20899 | gradientUnits: MUST_USE_ATTRIBUTE,
|
20900 | markerEnd: MUST_USE_ATTRIBUTE,
|
20901 | markerMid: MUST_USE_ATTRIBUTE,
|
20902 | markerStart: MUST_USE_ATTRIBUTE,
|
20903 | offset: MUST_USE_ATTRIBUTE,
|
20904 | opacity: MUST_USE_ATTRIBUTE,
|
20905 | patternContentUnits: MUST_USE_ATTRIBUTE,
|
20906 | patternUnits: MUST_USE_ATTRIBUTE,
|
20907 | points: MUST_USE_ATTRIBUTE,
|
20908 | preserveAspectRatio: MUST_USE_ATTRIBUTE,
|
20909 | r: MUST_USE_ATTRIBUTE,
|
20910 | rx: MUST_USE_ATTRIBUTE,
|
20911 | ry: MUST_USE_ATTRIBUTE,
|
20912 | spreadMethod: MUST_USE_ATTRIBUTE,
|
20913 | stopColor: MUST_USE_ATTRIBUTE,
|
20914 | stopOpacity: MUST_USE_ATTRIBUTE,
|
20915 | stroke: MUST_USE_ATTRIBUTE,
|
20916 | strokeDasharray: MUST_USE_ATTRIBUTE,
|
20917 | strokeLinecap: MUST_USE_ATTRIBUTE,
|
20918 | strokeOpacity: MUST_USE_ATTRIBUTE,
|
20919 | strokeWidth: MUST_USE_ATTRIBUTE,
|
20920 | textAnchor: MUST_USE_ATTRIBUTE,
|
20921 | transform: MUST_USE_ATTRIBUTE,
|
20922 | version: MUST_USE_ATTRIBUTE,
|
20923 | viewBox: MUST_USE_ATTRIBUTE,
|
20924 | x1: MUST_USE_ATTRIBUTE,
|
20925 | x2: MUST_USE_ATTRIBUTE,
|
20926 | x: MUST_USE_ATTRIBUTE,
|
20927 | xlinkActuate: MUST_USE_ATTRIBUTE,
|
20928 | xlinkArcrole: MUST_USE_ATTRIBUTE,
|
20929 | xlinkHref: MUST_USE_ATTRIBUTE,
|
20930 | xlinkRole: MUST_USE_ATTRIBUTE,
|
20931 | xlinkShow: MUST_USE_ATTRIBUTE,
|
20932 | xlinkTitle: MUST_USE_ATTRIBUTE,
|
20933 | xlinkType: MUST_USE_ATTRIBUTE,
|
20934 | xmlBase: MUST_USE_ATTRIBUTE,
|
20935 | xmlLang: MUST_USE_ATTRIBUTE,
|
20936 | xmlSpace: MUST_USE_ATTRIBUTE,
|
20937 | y1: MUST_USE_ATTRIBUTE,
|
20938 | y2: MUST_USE_ATTRIBUTE,
|
20939 | y: MUST_USE_ATTRIBUTE
|
20940 | },
|
20941 | DOMAttributeNamespaces: {
|
20942 | xlinkActuate: NS.xlink,
|
20943 | xlinkArcrole: NS.xlink,
|
20944 | xlinkHref: NS.xlink,
|
20945 | xlinkRole: NS.xlink,
|
20946 | xlinkShow: NS.xlink,
|
20947 | xlinkTitle: NS.xlink,
|
20948 | xlinkType: NS.xlink,
|
20949 | xmlBase: NS.xml,
|
20950 | xmlLang: NS.xml,
|
20951 | xmlSpace: NS.xml
|
20952 | },
|
20953 | DOMAttributeNames: {
|
20954 | clipPath: 'clip-path',
|
20955 | fillOpacity: 'fill-opacity',
|
20956 | fontFamily: 'font-family',
|
20957 | fontSize: 'font-size',
|
20958 | gradientTransform: 'gradientTransform',
|
20959 | gradientUnits: 'gradientUnits',
|
20960 | markerEnd: 'marker-end',
|
20961 | markerMid: 'marker-mid',
|
20962 | markerStart: 'marker-start',
|
20963 | patternContentUnits: 'patternContentUnits',
|
20964 | patternUnits: 'patternUnits',
|
20965 | preserveAspectRatio: 'preserveAspectRatio',
|
20966 | spreadMethod: 'spreadMethod',
|
20967 | stopColor: 'stop-color',
|
20968 | stopOpacity: 'stop-opacity',
|
20969 | strokeDasharray: 'stroke-dasharray',
|
20970 | strokeLinecap: 'stroke-linecap',
|
20971 | strokeOpacity: 'stroke-opacity',
|
20972 | strokeWidth: 'stroke-width',
|
20973 | textAnchor: 'text-anchor',
|
20974 | viewBox: 'viewBox',
|
20975 | xlinkActuate: 'xlink:actuate',
|
20976 | xlinkArcrole: 'xlink:arcrole',
|
20977 | xlinkHref: 'xlink:href',
|
20978 | xlinkRole: 'xlink:role',
|
20979 | xlinkShow: 'xlink:show',
|
20980 | xlinkTitle: 'xlink:title',
|
20981 | xlinkType: 'xlink:type',
|
20982 | xmlBase: 'xml:base',
|
20983 | xmlLang: 'xml:lang',
|
20984 | xmlSpace: 'xml:space'
|
20985 | }
|
20986 | };
|
20987 |
|
20988 | module.exports = SVGDOMPropertyConfig;
|
20989 |
|
20990 | /***/ }),
|
20991 | /* 227 */
|
20992 | /***/ (function(module, exports, __webpack_require__) {
|
20993 |
|
20994 | /**
|
20995 | * Copyright 2013-2015, Facebook, Inc.
|
20996 | * All rights reserved.
|
20997 | *
|
20998 | * This source code is licensed under the BSD-style license found in the
|
20999 | * LICENSE file in the root directory of this source tree. An additional grant
|
21000 | * of patent rights can be found in the PATENTS file in the same directory.
|
21001 | *
|
21002 | * @providesModule ReactDefaultPerf
|
21003 | * @typechecks static-only
|
21004 | */
|
21005 |
|
21006 | 'use strict';
|
21007 |
|
21008 | var DOMProperty = __webpack_require__(108);
|
21009 | var ReactDefaultPerfAnalysis = __webpack_require__(228);
|
21010 | var ReactMount = __webpack_require__(113);
|
21011 | var ReactPerf = __webpack_require__(103);
|
21012 |
|
21013 | var performanceNow = __webpack_require__(229);
|
21014 |
|
21015 | function roundFloat(val) {
|
21016 | return Math.floor(val * 100) / 100;
|
21017 | }
|
21018 |
|
21019 | function addValue(obj, key, val) {
|
21020 | obj[key] = (obj[key] || 0) + val;
|
21021 | }
|
21022 |
|
21023 | var ReactDefaultPerf = {
|
21024 | _allMeasurements: [], // last item in the list is the current one
|
21025 | _mountStack: [0],
|
21026 | _injected: false,
|
21027 |
|
21028 | start: function () {
|
21029 | if (!ReactDefaultPerf._injected) {
|
21030 | ReactPerf.injection.injectMeasure(ReactDefaultPerf.measure);
|
21031 | }
|
21032 |
|
21033 | ReactDefaultPerf._allMeasurements.length = 0;
|
21034 | ReactPerf.enableMeasure = true;
|
21035 | },
|
21036 |
|
21037 | stop: function () {
|
21038 | ReactPerf.enableMeasure = false;
|
21039 | },
|
21040 |
|
21041 | getLastMeasurements: function () {
|
21042 | return ReactDefaultPerf._allMeasurements;
|
21043 | },
|
21044 |
|
21045 | printExclusive: function (measurements) {
|
21046 | measurements = measurements || ReactDefaultPerf._allMeasurements;
|
21047 | var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measurements);
|
21048 | console.table(summary.map(function (item) {
|
21049 | return {
|
21050 | 'Component class name': item.componentName,
|
21051 | 'Total inclusive time (ms)': roundFloat(item.inclusive),
|
21052 | 'Exclusive mount time (ms)': roundFloat(item.exclusive),
|
21053 | 'Exclusive render time (ms)': roundFloat(item.render),
|
21054 | 'Mount time per instance (ms)': roundFloat(item.exclusive / item.count),
|
21055 | 'Render time per instance (ms)': roundFloat(item.render / item.count),
|
21056 | 'Instances': item.count
|
21057 | };
|
21058 | }));
|
21059 | // TODO: ReactDefaultPerfAnalysis.getTotalTime() does not return the correct
|
21060 | // number.
|
21061 | },
|
21062 |
|
21063 | printInclusive: function (measurements) {
|
21064 | measurements = measurements || ReactDefaultPerf._allMeasurements;
|
21065 | var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements);
|
21066 | console.table(summary.map(function (item) {
|
21067 | return {
|
21068 | 'Owner > component': item.componentName,
|
21069 | 'Inclusive time (ms)': roundFloat(item.time),
|
21070 | 'Instances': item.count
|
21071 | };
|
21072 | }));
|
21073 | console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
|
21074 | },
|
21075 |
|
21076 | getMeasurementsSummaryMap: function (measurements) {
|
21077 | var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements, true);
|
21078 | return summary.map(function (item) {
|
21079 | return {
|
21080 | 'Owner > component': item.componentName,
|
21081 | 'Wasted time (ms)': item.time,
|
21082 | 'Instances': item.count
|
21083 | };
|
21084 | });
|
21085 | },
|
21086 |
|
21087 | printWasted: function (measurements) {
|
21088 | measurements = measurements || ReactDefaultPerf._allMeasurements;
|
21089 | console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements));
|
21090 | console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
|
21091 | },
|
21092 |
|
21093 | printDOM: function (measurements) {
|
21094 | measurements = measurements || ReactDefaultPerf._allMeasurements;
|
21095 | var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
|
21096 | console.table(summary.map(function (item) {
|
21097 | var result = {};
|
21098 | result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id;
|
21099 | result.type = item.type;
|
21100 | result.args = JSON.stringify(item.args);
|
21101 | return result;
|
21102 | }));
|
21103 | console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
|
21104 | },
|
21105 |
|
21106 | _recordWrite: function (id, fnName, totalTime, args) {
|
21107 | // TODO: totalTime isn't that useful since it doesn't count paints/reflows
|
21108 | var writes = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].writes;
|
21109 | writes[id] = writes[id] || [];
|
21110 | writes[id].push({
|
21111 | type: fnName,
|
21112 | time: totalTime,
|
21113 | args: args
|
21114 | });
|
21115 | },
|
21116 |
|
21117 | measure: function (moduleName, fnName, func) {
|
21118 | return function () {
|
21119 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
21120 | args[_key] = arguments[_key];
|
21121 | }
|
21122 |
|
21123 | var totalTime;
|
21124 | var rv;
|
21125 | var start;
|
21126 |
|
21127 | if (fnName === '_renderNewRootComponent' || fnName === 'flushBatchedUpdates') {
|
21128 | // A "measurement" is a set of metrics recorded for each flush. We want
|
21129 | // to group the metrics for a given flush together so we can look at the
|
21130 | // components that rendered and the DOM operations that actually
|
21131 | // happened to determine the amount of "wasted work" performed.
|
21132 | ReactDefaultPerf._allMeasurements.push({
|
21133 | exclusive: {},
|
21134 | inclusive: {},
|
21135 | render: {},
|
21136 | counts: {},
|
21137 | writes: {},
|
21138 | displayNames: {},
|
21139 | totalTime: 0,
|
21140 | created: {}
|
21141 | });
|
21142 | start = performanceNow();
|
21143 | rv = func.apply(this, args);
|
21144 | ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].totalTime = performanceNow() - start;
|
21145 | return rv;
|
21146 | } else if (fnName === '_mountImageIntoNode' || moduleName === 'ReactBrowserEventEmitter' || moduleName === 'ReactDOMIDOperations' || moduleName === 'CSSPropertyOperations' || moduleName === 'DOMChildrenOperations' || moduleName === 'DOMPropertyOperations') {
|
21147 | start = performanceNow();
|
21148 | rv = func.apply(this, args);
|
21149 | totalTime = performanceNow() - start;
|
21150 |
|
21151 | if (fnName === '_mountImageIntoNode') {
|
21152 | var mountID = ReactMount.getID(args[1]);
|
21153 | ReactDefaultPerf._recordWrite(mountID, fnName, totalTime, args[0]);
|
21154 | } else if (fnName === 'dangerouslyProcessChildrenUpdates') {
|
21155 | // special format
|
21156 | args[0].forEach(function (update) {
|
21157 | var writeArgs = {};
|
21158 | if (update.fromIndex !== null) {
|
21159 | writeArgs.fromIndex = update.fromIndex;
|
21160 | }
|
21161 | if (update.toIndex !== null) {
|
21162 | writeArgs.toIndex = update.toIndex;
|
21163 | }
|
21164 | if (update.textContent !== null) {
|
21165 | writeArgs.textContent = update.textContent;
|
21166 | }
|
21167 | if (update.markupIndex !== null) {
|
21168 | writeArgs.markup = args[1][update.markupIndex];
|
21169 | }
|
21170 | ReactDefaultPerf._recordWrite(update.parentID, update.type, totalTime, writeArgs);
|
21171 | });
|
21172 | } else {
|
21173 | // basic format
|
21174 | var id = args[0];
|
21175 | if (typeof id === 'object') {
|
21176 | id = ReactMount.getID(args[0]);
|
21177 | }
|
21178 | ReactDefaultPerf._recordWrite(id, fnName, totalTime, Array.prototype.slice.call(args, 1));
|
21179 | }
|
21180 | return rv;
|
21181 | } else if (moduleName === 'ReactCompositeComponent' && (fnName === 'mountComponent' || fnName === 'updateComponent' || // TODO: receiveComponent()?
|
21182 | fnName === '_renderValidatedComponent')) {
|
21183 |
|
21184 | if (this._currentElement.type === ReactMount.TopLevelWrapper) {
|
21185 | return func.apply(this, args);
|
21186 | }
|
21187 |
|
21188 | var rootNodeID = fnName === 'mountComponent' ? args[0] : this._rootNodeID;
|
21189 | var isRender = fnName === '_renderValidatedComponent';
|
21190 | var isMount = fnName === 'mountComponent';
|
21191 |
|
21192 | var mountStack = ReactDefaultPerf._mountStack;
|
21193 | var entry = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1];
|
21194 |
|
21195 | if (isRender) {
|
21196 | addValue(entry.counts, rootNodeID, 1);
|
21197 | } else if (isMount) {
|
21198 | entry.created[rootNodeID] = true;
|
21199 | mountStack.push(0);
|
21200 | }
|
21201 |
|
21202 | start = performanceNow();
|
21203 | rv = func.apply(this, args);
|
21204 | totalTime = performanceNow() - start;
|
21205 |
|
21206 | if (isRender) {
|
21207 | addValue(entry.render, rootNodeID, totalTime);
|
21208 | } else if (isMount) {
|
21209 | var subMountTime = mountStack.pop();
|
21210 | mountStack[mountStack.length - 1] += totalTime;
|
21211 | addValue(entry.exclusive, rootNodeID, totalTime - subMountTime);
|
21212 | addValue(entry.inclusive, rootNodeID, totalTime);
|
21213 | } else {
|
21214 | addValue(entry.inclusive, rootNodeID, totalTime);
|
21215 | }
|
21216 |
|
21217 | entry.displayNames[rootNodeID] = {
|
21218 | current: this.getName(),
|
21219 | owner: this._currentElement._owner ? this._currentElement._owner.getName() : '<root>'
|
21220 | };
|
21221 |
|
21222 | return rv;
|
21223 | } else {
|
21224 | return func.apply(this, args);
|
21225 | }
|
21226 | };
|
21227 | }
|
21228 | };
|
21229 |
|
21230 | module.exports = ReactDefaultPerf;
|
21231 |
|
21232 | /***/ }),
|
21233 | /* 228 */
|
21234 | /***/ (function(module, exports, __webpack_require__) {
|
21235 |
|
21236 | /**
|
21237 | * Copyright 2013-2015, Facebook, Inc.
|
21238 | * All rights reserved.
|
21239 | *
|
21240 | * This source code is licensed under the BSD-style license found in the
|
21241 | * LICENSE file in the root directory of this source tree. An additional grant
|
21242 | * of patent rights can be found in the PATENTS file in the same directory.
|
21243 | *
|
21244 | * @providesModule ReactDefaultPerfAnalysis
|
21245 | */
|
21246 |
|
21247 | 'use strict';
|
21248 |
|
21249 | var assign = __webpack_require__(124);
|
21250 |
|
21251 | // Don't try to save users less than 1.2ms (a number I made up)
|
21252 | var DONT_CARE_THRESHOLD = 1.2;
|
21253 | var DOM_OPERATION_TYPES = {
|
21254 | '_mountImageIntoNode': 'set innerHTML',
|
21255 | INSERT_MARKUP: 'set innerHTML',
|
21256 | MOVE_EXISTING: 'move',
|
21257 | REMOVE_NODE: 'remove',
|
21258 | SET_MARKUP: 'set innerHTML',
|
21259 | TEXT_CONTENT: 'set textContent',
|
21260 | 'setValueForProperty': 'update attribute',
|
21261 | 'setValueForAttribute': 'update attribute',
|
21262 | 'deleteValueForProperty': 'remove attribute',
|
21263 | 'setValueForStyles': 'update styles',
|
21264 | 'replaceNodeWithMarkup': 'replace',
|
21265 | 'updateTextContent': 'set textContent'
|
21266 | };
|
21267 |
|
21268 | function getTotalTime(measurements) {
|
21269 | // TODO: return number of DOM ops? could be misleading.
|
21270 | // TODO: measure dropped frames after reconcile?
|
21271 | // TODO: log total time of each reconcile and the top-level component
|
21272 | // class that triggered it.
|
21273 | var totalTime = 0;
|
21274 | for (var i = 0; i < measurements.length; i++) {
|
21275 | var measurement = measurements[i];
|
21276 | totalTime += measurement.totalTime;
|
21277 | }
|
21278 | return totalTime;
|
21279 | }
|
21280 |
|
21281 | function getDOMSummary(measurements) {
|
21282 | var items = [];
|
21283 | measurements.forEach(function (measurement) {
|
21284 | Object.keys(measurement.writes).forEach(function (id) {
|
21285 | measurement.writes[id].forEach(function (write) {
|
21286 | items.push({
|
21287 | id: id,
|
21288 | type: DOM_OPERATION_TYPES[write.type] || write.type,
|
21289 | args: write.args
|
21290 | });
|
21291 | });
|
21292 | });
|
21293 | });
|
21294 | return items;
|
21295 | }
|
21296 |
|
21297 | function getExclusiveSummary(measurements) {
|
21298 | var candidates = {};
|
21299 | var displayName;
|
21300 |
|
21301 | for (var i = 0; i < measurements.length; i++) {
|
21302 | var measurement = measurements[i];
|
21303 | var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
|
21304 |
|
21305 | for (var id in allIDs) {
|
21306 | displayName = measurement.displayNames[id].current;
|
21307 |
|
21308 | candidates[displayName] = candidates[displayName] || {
|
21309 | componentName: displayName,
|
21310 | inclusive: 0,
|
21311 | exclusive: 0,
|
21312 | render: 0,
|
21313 | count: 0
|
21314 | };
|
21315 | if (measurement.render[id]) {
|
21316 | candidates[displayName].render += measurement.render[id];
|
21317 | }
|
21318 | if (measurement.exclusive[id]) {
|
21319 | candidates[displayName].exclusive += measurement.exclusive[id];
|
21320 | }
|
21321 | if (measurement.inclusive[id]) {
|
21322 | candidates[displayName].inclusive += measurement.inclusive[id];
|
21323 | }
|
21324 | if (measurement.counts[id]) {
|
21325 | candidates[displayName].count += measurement.counts[id];
|
21326 | }
|
21327 | }
|
21328 | }
|
21329 |
|
21330 | // Now make a sorted array with the results.
|
21331 | var arr = [];
|
21332 | for (displayName in candidates) {
|
21333 | if (candidates[displayName].exclusive >= DONT_CARE_THRESHOLD) {
|
21334 | arr.push(candidates[displayName]);
|
21335 | }
|
21336 | }
|
21337 |
|
21338 | arr.sort(function (a, b) {
|
21339 | return b.exclusive - a.exclusive;
|
21340 | });
|
21341 |
|
21342 | return arr;
|
21343 | }
|
21344 |
|
21345 | function getInclusiveSummary(measurements, onlyClean) {
|
21346 | var candidates = {};
|
21347 | var inclusiveKey;
|
21348 |
|
21349 | for (var i = 0; i < measurements.length; i++) {
|
21350 | var measurement = measurements[i];
|
21351 | var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
|
21352 | var cleanComponents;
|
21353 |
|
21354 | if (onlyClean) {
|
21355 | cleanComponents = getUnchangedComponents(measurement);
|
21356 | }
|
21357 |
|
21358 | for (var id in allIDs) {
|
21359 | if (onlyClean && !cleanComponents[id]) {
|
21360 | continue;
|
21361 | }
|
21362 |
|
21363 | var displayName = measurement.displayNames[id];
|
21364 |
|
21365 | // Inclusive time is not useful for many components without knowing where
|
21366 | // they are instantiated. So we aggregate inclusive time with both the
|
21367 | // owner and current displayName as the key.
|
21368 | inclusiveKey = displayName.owner + ' > ' + displayName.current;
|
21369 |
|
21370 | candidates[inclusiveKey] = candidates[inclusiveKey] || {
|
21371 | componentName: inclusiveKey,
|
21372 | time: 0,
|
21373 | count: 0
|
21374 | };
|
21375 |
|
21376 | if (measurement.inclusive[id]) {
|
21377 | candidates[inclusiveKey].time += measurement.inclusive[id];
|
21378 | }
|
21379 | if (measurement.counts[id]) {
|
21380 | candidates[inclusiveKey].count += measurement.counts[id];
|
21381 | }
|
21382 | }
|
21383 | }
|
21384 |
|
21385 | // Now make a sorted array with the results.
|
21386 | var arr = [];
|
21387 | for (inclusiveKey in candidates) {
|
21388 | if (candidates[inclusiveKey].time >= DONT_CARE_THRESHOLD) {
|
21389 | arr.push(candidates[inclusiveKey]);
|
21390 | }
|
21391 | }
|
21392 |
|
21393 | arr.sort(function (a, b) {
|
21394 | return b.time - a.time;
|
21395 | });
|
21396 |
|
21397 | return arr;
|
21398 | }
|
21399 |
|
21400 | function getUnchangedComponents(measurement) {
|
21401 | // For a given reconcile, look at which components did not actually
|
21402 | // render anything to the DOM and return a mapping of their ID to
|
21403 | // the amount of time it took to render the entire subtree.
|
21404 | var cleanComponents = {};
|
21405 | var dirtyLeafIDs = Object.keys(measurement.writes);
|
21406 | var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
|
21407 |
|
21408 | for (var id in allIDs) {
|
21409 | var isDirty = false;
|
21410 | // For each component that rendered, see if a component that triggered
|
21411 | // a DOM op is in its subtree.
|
21412 | for (var i = 0; i < dirtyLeafIDs.length; i++) {
|
21413 | if (dirtyLeafIDs[i].indexOf(id) === 0) {
|
21414 | isDirty = true;
|
21415 | break;
|
21416 | }
|
21417 | }
|
21418 | // check if component newly created
|
21419 | if (measurement.created[id]) {
|
21420 | isDirty = true;
|
21421 | }
|
21422 | if (!isDirty && measurement.counts[id] > 0) {
|
21423 | cleanComponents[id] = true;
|
21424 | }
|
21425 | }
|
21426 | return cleanComponents;
|
21427 | }
|
21428 |
|
21429 | var ReactDefaultPerfAnalysis = {
|
21430 | getExclusiveSummary: getExclusiveSummary,
|
21431 | getInclusiveSummary: getInclusiveSummary,
|
21432 | getDOMSummary: getDOMSummary,
|
21433 | getTotalTime: getTotalTime
|
21434 | };
|
21435 |
|
21436 | module.exports = ReactDefaultPerfAnalysis;
|
21437 |
|
21438 | /***/ }),
|
21439 | /* 229 */
|
21440 | /***/ (function(module, exports, __webpack_require__) {
|
21441 |
|
21442 | /**
|
21443 | * Copyright 2013-2015, Facebook, Inc.
|
21444 | * All rights reserved.
|
21445 | *
|
21446 | * This source code is licensed under the BSD-style license found in the
|
21447 | * LICENSE file in the root directory of this source tree. An additional grant
|
21448 | * of patent rights can be found in the PATENTS file in the same directory.
|
21449 | *
|
21450 | * @providesModule performanceNow
|
21451 | * @typechecks
|
21452 | */
|
21453 |
|
21454 | 'use strict';
|
21455 |
|
21456 | var performance = __webpack_require__(230);
|
21457 |
|
21458 | var performanceNow;
|
21459 |
|
21460 | /**
|
21461 | * Detect if we can use `window.performance.now()` and gracefully fallback to
|
21462 | * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
|
21463 | * because of Facebook's testing infrastructure.
|
21464 | */
|
21465 | if (performance.now) {
|
21466 | performanceNow = function () {
|
21467 | return performance.now();
|
21468 | };
|
21469 | } else {
|
21470 | performanceNow = function () {
|
21471 | return Date.now();
|
21472 | };
|
21473 | }
|
21474 |
|
21475 | module.exports = performanceNow;
|
21476 |
|
21477 | /***/ }),
|
21478 | /* 230 */
|
21479 | /***/ (function(module, exports, __webpack_require__) {
|
21480 |
|
21481 | /**
|
21482 | * Copyright 2013-2015, Facebook, Inc.
|
21483 | * All rights reserved.
|
21484 | *
|
21485 | * This source code is licensed under the BSD-style license found in the
|
21486 | * LICENSE file in the root directory of this source tree. An additional grant
|
21487 | * of patent rights can be found in the PATENTS file in the same directory.
|
21488 | *
|
21489 | * @providesModule performance
|
21490 | * @typechecks
|
21491 | */
|
21492 |
|
21493 | 'use strict';
|
21494 |
|
21495 | var ExecutionEnvironment = __webpack_require__(94);
|
21496 |
|
21497 | var performance;
|
21498 |
|
21499 | if (ExecutionEnvironment.canUseDOM) {
|
21500 | performance = window.performance || window.msPerformance || window.webkitPerformance;
|
21501 | }
|
21502 |
|
21503 | module.exports = performance || {};
|
21504 |
|
21505 | /***/ }),
|
21506 | /* 231 */
|
21507 | /***/ (function(module, exports) {
|
21508 |
|
21509 | /**
|
21510 | * Copyright 2013-2015, Facebook, Inc.
|
21511 | * All rights reserved.
|
21512 | *
|
21513 | * This source code is licensed under the BSD-style license found in the
|
21514 | * LICENSE file in the root directory of this source tree. An additional grant
|
21515 | * of patent rights can be found in the PATENTS file in the same directory.
|
21516 | *
|
21517 | * @providesModule ReactVersion
|
21518 | */
|
21519 |
|
21520 | 'use strict';
|
21521 |
|
21522 | module.exports = '0.14.9';
|
21523 |
|
21524 | /***/ }),
|
21525 | /* 232 */
|
21526 | /***/ (function(module, exports, __webpack_require__) {
|
21527 |
|
21528 | /**
|
21529 | * Copyright 2013-2015, Facebook, Inc.
|
21530 | * All rights reserved.
|
21531 | *
|
21532 | * This source code is licensed under the BSD-style license found in the
|
21533 | * LICENSE file in the root directory of this source tree. An additional grant
|
21534 | * of patent rights can be found in the PATENTS file in the same directory.
|
21535 | *
|
21536 | * @providesModule renderSubtreeIntoContainer
|
21537 | */
|
21538 |
|
21539 | 'use strict';
|
21540 |
|
21541 | var ReactMount = __webpack_require__(113);
|
21542 |
|
21543 | module.exports = ReactMount.renderSubtreeIntoContainer;
|
21544 |
|
21545 | /***/ }),
|
21546 | /* 233 */
|
21547 | /***/ (function(module, exports, __webpack_require__) {
|
21548 |
|
21549 | /**
|
21550 | * Copyright 2013-2015, Facebook, Inc.
|
21551 | * All rights reserved.
|
21552 | *
|
21553 | * This source code is licensed under the BSD-style license found in the
|
21554 | * LICENSE file in the root directory of this source tree. An additional grant
|
21555 | * of patent rights can be found in the PATENTS file in the same directory.
|
21556 | *
|
21557 | * @providesModule ReactDOMServer
|
21558 | */
|
21559 |
|
21560 | 'use strict';
|
21561 |
|
21562 | var ReactDefaultInjection = __webpack_require__(156);
|
21563 | var ReactServerRendering = __webpack_require__(234);
|
21564 | var ReactVersion = __webpack_require__(231);
|
21565 |
|
21566 | ReactDefaultInjection.inject();
|
21567 |
|
21568 | var ReactDOMServer = {
|
21569 | renderToString: ReactServerRendering.renderToString,
|
21570 | renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
|
21571 | version: ReactVersion
|
21572 | };
|
21573 |
|
21574 | module.exports = ReactDOMServer;
|
21575 |
|
21576 | /***/ }),
|
21577 | /* 234 */
|
21578 | /***/ (function(module, exports, __webpack_require__) {
|
21579 |
|
21580 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
21581 | * Copyright 2013-2015, Facebook, Inc.
|
21582 | * All rights reserved.
|
21583 | *
|
21584 | * This source code is licensed under the BSD-style license found in the
|
21585 | * LICENSE file in the root directory of this source tree. An additional grant
|
21586 | * of patent rights can be found in the PATENTS file in the same directory.
|
21587 | *
|
21588 | * @typechecks static-only
|
21589 | * @providesModule ReactServerRendering
|
21590 | */
|
21591 | 'use strict';
|
21592 |
|
21593 | var ReactDefaultBatchingStrategy = __webpack_require__(177);
|
21594 | var ReactElement = __webpack_require__(127);
|
21595 | var ReactInstanceHandles = __webpack_require__(130);
|
21596 | var ReactMarkupChecksum = __webpack_require__(133);
|
21597 | var ReactServerBatchingStrategy = __webpack_require__(235);
|
21598 | var ReactServerRenderingTransaction = __webpack_require__(236);
|
21599 | var ReactUpdates = __webpack_require__(139);
|
21600 |
|
21601 | var emptyObject = __webpack_require__(143);
|
21602 | var instantiateReactComponent = __webpack_require__(147);
|
21603 | var invariant = __webpack_require__(98);
|
21604 |
|
21605 | /**
|
21606 | * @param {ReactElement} element
|
21607 | * @return {string} the HTML markup
|
21608 | */
|
21609 | function renderToString(element) {
|
21610 | !ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : undefined;
|
21611 |
|
21612 | var transaction;
|
21613 | try {
|
21614 | ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
|
21615 |
|
21616 | var id = ReactInstanceHandles.createReactRootID();
|
21617 | transaction = ReactServerRenderingTransaction.getPooled(false);
|
21618 |
|
21619 | return transaction.perform(function () {
|
21620 | var componentInstance = instantiateReactComponent(element, null);
|
21621 | var markup = componentInstance.mountComponent(id, transaction, emptyObject);
|
21622 | return ReactMarkupChecksum.addChecksumToMarkup(markup);
|
21623 | }, null);
|
21624 | } finally {
|
21625 | ReactServerRenderingTransaction.release(transaction);
|
21626 | // Revert to the DOM batching strategy since these two renderers
|
21627 | // currently share these stateful modules.
|
21628 | ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
|
21629 | }
|
21630 | }
|
21631 |
|
21632 | /**
|
21633 | * @param {ReactElement} element
|
21634 | * @return {string} the HTML markup, without the extra React ID and checksum
|
21635 | * (for generating static pages)
|
21636 | */
|
21637 | function renderToStaticMarkup(element) {
|
21638 | !ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : undefined;
|
21639 |
|
21640 | var transaction;
|
21641 | try {
|
21642 | ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
|
21643 |
|
21644 | var id = ReactInstanceHandles.createReactRootID();
|
21645 | transaction = ReactServerRenderingTransaction.getPooled(true);
|
21646 |
|
21647 | return transaction.perform(function () {
|
21648 | var componentInstance = instantiateReactComponent(element, null);
|
21649 | return componentInstance.mountComponent(id, transaction, emptyObject);
|
21650 | }, null);
|
21651 | } finally {
|
21652 | ReactServerRenderingTransaction.release(transaction);
|
21653 | // Revert to the DOM batching strategy since these two renderers
|
21654 | // currently share these stateful modules.
|
21655 | ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
|
21656 | }
|
21657 | }
|
21658 |
|
21659 | module.exports = {
|
21660 | renderToString: renderToString,
|
21661 | renderToStaticMarkup: renderToStaticMarkup
|
21662 | };
|
21663 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
21664 |
|
21665 | /***/ }),
|
21666 | /* 235 */
|
21667 | /***/ (function(module, exports) {
|
21668 |
|
21669 | /**
|
21670 | * Copyright 2014-2015, Facebook, Inc.
|
21671 | * All rights reserved.
|
21672 | *
|
21673 | * This source code is licensed under the BSD-style license found in the
|
21674 | * LICENSE file in the root directory of this source tree. An additional grant
|
21675 | * of patent rights can be found in the PATENTS file in the same directory.
|
21676 | *
|
21677 | * @providesModule ReactServerBatchingStrategy
|
21678 | * @typechecks
|
21679 | */
|
21680 |
|
21681 | 'use strict';
|
21682 |
|
21683 | var ReactServerBatchingStrategy = {
|
21684 | isBatchingUpdates: false,
|
21685 | batchedUpdates: function (callback) {
|
21686 | // Don't do anything here. During the server rendering we don't want to
|
21687 | // schedule any updates. We will simply ignore them.
|
21688 | }
|
21689 | };
|
21690 |
|
21691 | module.exports = ReactServerBatchingStrategy;
|
21692 |
|
21693 | /***/ }),
|
21694 | /* 236 */
|
21695 | /***/ (function(module, exports, __webpack_require__) {
|
21696 |
|
21697 | /**
|
21698 | * Copyright 2014-2015, Facebook, Inc.
|
21699 | * All rights reserved.
|
21700 | *
|
21701 | * This source code is licensed under the BSD-style license found in the
|
21702 | * LICENSE file in the root directory of this source tree. An additional grant
|
21703 | * of patent rights can be found in the PATENTS file in the same directory.
|
21704 | *
|
21705 | * @providesModule ReactServerRenderingTransaction
|
21706 | * @typechecks
|
21707 | */
|
21708 |
|
21709 | 'use strict';
|
21710 |
|
21711 | var PooledClass = __webpack_require__(141);
|
21712 | var CallbackQueue = __webpack_require__(140);
|
21713 | var Transaction = __webpack_require__(142);
|
21714 |
|
21715 | var assign = __webpack_require__(124);
|
21716 | var emptyFunction = __webpack_require__(100);
|
21717 |
|
21718 | /**
|
21719 | * Provides a `CallbackQueue` queue for collecting `onDOMReady` callbacks
|
21720 | * during the performing of the transaction.
|
21721 | */
|
21722 | var ON_DOM_READY_QUEUEING = {
|
21723 | /**
|
21724 | * Initializes the internal `onDOMReady` queue.
|
21725 | */
|
21726 | initialize: function () {
|
21727 | this.reactMountReady.reset();
|
21728 | },
|
21729 |
|
21730 | close: emptyFunction
|
21731 | };
|
21732 |
|
21733 | /**
|
21734 | * Executed within the scope of the `Transaction` instance. Consider these as
|
21735 | * being member methods, but with an implied ordering while being isolated from
|
21736 | * each other.
|
21737 | */
|
21738 | var TRANSACTION_WRAPPERS = [ON_DOM_READY_QUEUEING];
|
21739 |
|
21740 | /**
|
21741 | * @class ReactServerRenderingTransaction
|
21742 | * @param {boolean} renderToStaticMarkup
|
21743 | */
|
21744 | function ReactServerRenderingTransaction(renderToStaticMarkup) {
|
21745 | this.reinitializeTransaction();
|
21746 | this.renderToStaticMarkup = renderToStaticMarkup;
|
21747 | this.reactMountReady = CallbackQueue.getPooled(null);
|
21748 | this.useCreateElement = false;
|
21749 | }
|
21750 |
|
21751 | var Mixin = {
|
21752 | /**
|
21753 | * @see Transaction
|
21754 | * @abstract
|
21755 | * @final
|
21756 | * @return {array} Empty list of operation wrap procedures.
|
21757 | */
|
21758 | getTransactionWrappers: function () {
|
21759 | return TRANSACTION_WRAPPERS;
|
21760 | },
|
21761 |
|
21762 | /**
|
21763 | * @return {object} The queue to collect `onDOMReady` callbacks with.
|
21764 | */
|
21765 | getReactMountReady: function () {
|
21766 | return this.reactMountReady;
|
21767 | },
|
21768 |
|
21769 | /**
|
21770 | * `PooledClass` looks for this, and will invoke this before allowing this
|
21771 | * instance to be reused.
|
21772 | */
|
21773 | destructor: function () {
|
21774 | CallbackQueue.release(this.reactMountReady);
|
21775 | this.reactMountReady = null;
|
21776 | }
|
21777 | };
|
21778 |
|
21779 | assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
|
21780 |
|
21781 | PooledClass.addPoolingTo(ReactServerRenderingTransaction);
|
21782 |
|
21783 | module.exports = ReactServerRenderingTransaction;
|
21784 |
|
21785 | /***/ }),
|
21786 | /* 237 */
|
21787 | /***/ (function(module, exports, __webpack_require__) {
|
21788 |
|
21789 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
21790 | * Copyright 2013-2015, Facebook, Inc.
|
21791 | * All rights reserved.
|
21792 | *
|
21793 | * This source code is licensed under the BSD-style license found in the
|
21794 | * LICENSE file in the root directory of this source tree. An additional grant
|
21795 | * of patent rights can be found in the PATENTS file in the same directory.
|
21796 | *
|
21797 | * @providesModule ReactIsomorphic
|
21798 | */
|
21799 |
|
21800 | 'use strict';
|
21801 |
|
21802 | var ReactChildren = __webpack_require__(195);
|
21803 | var ReactComponent = __webpack_require__(208);
|
21804 | var ReactClass = __webpack_require__(207);
|
21805 | var ReactDOMFactories = __webpack_require__(238);
|
21806 | var ReactElement = __webpack_require__(127);
|
21807 | var ReactElementValidator = __webpack_require__(239);
|
21808 | var ReactPropTypes = __webpack_require__(192);
|
21809 | var ReactVersion = __webpack_require__(231);
|
21810 |
|
21811 | var assign = __webpack_require__(124);
|
21812 | var onlyChild = __webpack_require__(241);
|
21813 |
|
21814 | var createElement = ReactElement.createElement;
|
21815 | var createFactory = ReactElement.createFactory;
|
21816 | var cloneElement = ReactElement.cloneElement;
|
21817 |
|
21818 | if (process.env.NODE_ENV !== 'production') {
|
21819 | createElement = ReactElementValidator.createElement;
|
21820 | createFactory = ReactElementValidator.createFactory;
|
21821 | cloneElement = ReactElementValidator.cloneElement;
|
21822 | }
|
21823 |
|
21824 | var React = {
|
21825 |
|
21826 | // Modern
|
21827 |
|
21828 | Children: {
|
21829 | map: ReactChildren.map,
|
21830 | forEach: ReactChildren.forEach,
|
21831 | count: ReactChildren.count,
|
21832 | toArray: ReactChildren.toArray,
|
21833 | only: onlyChild
|
21834 | },
|
21835 |
|
21836 | Component: ReactComponent,
|
21837 |
|
21838 | createElement: createElement,
|
21839 | cloneElement: cloneElement,
|
21840 | isValidElement: ReactElement.isValidElement,
|
21841 |
|
21842 | // Classic
|
21843 |
|
21844 | PropTypes: ReactPropTypes,
|
21845 | createClass: ReactClass.createClass,
|
21846 | createFactory: createFactory,
|
21847 | createMixin: function (mixin) {
|
21848 | // Currently a noop. Will be used to validate and trace mixins.
|
21849 | return mixin;
|
21850 | },
|
21851 |
|
21852 | // This looks DOM specific but these are actually isomorphic helpers
|
21853 | // since they are just generating DOM strings.
|
21854 | DOM: ReactDOMFactories,
|
21855 |
|
21856 | version: ReactVersion,
|
21857 |
|
21858 | // Hook for JSX spread, don't use this for anything else.
|
21859 | __spread: assign
|
21860 | };
|
21861 |
|
21862 | module.exports = React;
|
21863 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
21864 |
|
21865 | /***/ }),
|
21866 | /* 238 */
|
21867 | /***/ (function(module, exports, __webpack_require__) {
|
21868 |
|
21869 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
21870 | * Copyright 2013-2015, Facebook, Inc.
|
21871 | * All rights reserved.
|
21872 | *
|
21873 | * This source code is licensed under the BSD-style license found in the
|
21874 | * LICENSE file in the root directory of this source tree. An additional grant
|
21875 | * of patent rights can be found in the PATENTS file in the same directory.
|
21876 | *
|
21877 | * @providesModule ReactDOMFactories
|
21878 | * @typechecks static-only
|
21879 | */
|
21880 |
|
21881 | 'use strict';
|
21882 |
|
21883 | var ReactElement = __webpack_require__(127);
|
21884 | var ReactElementValidator = __webpack_require__(239);
|
21885 |
|
21886 | var mapObject = __webpack_require__(240);
|
21887 |
|
21888 | /**
|
21889 | * Create a factory that creates HTML tag elements.
|
21890 | *
|
21891 | * @param {string} tag Tag name (e.g. `div`).
|
21892 | * @private
|
21893 | */
|
21894 | function createDOMFactory(tag) {
|
21895 | if (process.env.NODE_ENV !== 'production') {
|
21896 | return ReactElementValidator.createFactory(tag);
|
21897 | }
|
21898 | return ReactElement.createFactory(tag);
|
21899 | }
|
21900 |
|
21901 | /**
|
21902 | * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
|
21903 | * This is also accessible via `React.DOM`.
|
21904 | *
|
21905 | * @public
|
21906 | */
|
21907 | var ReactDOMFactories = mapObject({
|
21908 | a: 'a',
|
21909 | abbr: 'abbr',
|
21910 | address: 'address',
|
21911 | area: 'area',
|
21912 | article: 'article',
|
21913 | aside: 'aside',
|
21914 | audio: 'audio',
|
21915 | b: 'b',
|
21916 | base: 'base',
|
21917 | bdi: 'bdi',
|
21918 | bdo: 'bdo',
|
21919 | big: 'big',
|
21920 | blockquote: 'blockquote',
|
21921 | body: 'body',
|
21922 | br: 'br',
|
21923 | button: 'button',
|
21924 | canvas: 'canvas',
|
21925 | caption: 'caption',
|
21926 | cite: 'cite',
|
21927 | code: 'code',
|
21928 | col: 'col',
|
21929 | colgroup: 'colgroup',
|
21930 | data: 'data',
|
21931 | datalist: 'datalist',
|
21932 | dd: 'dd',
|
21933 | del: 'del',
|
21934 | details: 'details',
|
21935 | dfn: 'dfn',
|
21936 | dialog: 'dialog',
|
21937 | div: 'div',
|
21938 | dl: 'dl',
|
21939 | dt: 'dt',
|
21940 | em: 'em',
|
21941 | embed: 'embed',
|
21942 | fieldset: 'fieldset',
|
21943 | figcaption: 'figcaption',
|
21944 | figure: 'figure',
|
21945 | footer: 'footer',
|
21946 | form: 'form',
|
21947 | h1: 'h1',
|
21948 | h2: 'h2',
|
21949 | h3: 'h3',
|
21950 | h4: 'h4',
|
21951 | h5: 'h5',
|
21952 | h6: 'h6',
|
21953 | head: 'head',
|
21954 | header: 'header',
|
21955 | hgroup: 'hgroup',
|
21956 | hr: 'hr',
|
21957 | html: 'html',
|
21958 | i: 'i',
|
21959 | iframe: 'iframe',
|
21960 | img: 'img',
|
21961 | input: 'input',
|
21962 | ins: 'ins',
|
21963 | kbd: 'kbd',
|
21964 | keygen: 'keygen',
|
21965 | label: 'label',
|
21966 | legend: 'legend',
|
21967 | li: 'li',
|
21968 | link: 'link',
|
21969 | main: 'main',
|
21970 | map: 'map',
|
21971 | mark: 'mark',
|
21972 | menu: 'menu',
|
21973 | menuitem: 'menuitem',
|
21974 | meta: 'meta',
|
21975 | meter: 'meter',
|
21976 | nav: 'nav',
|
21977 | noscript: 'noscript',
|
21978 | object: 'object',
|
21979 | ol: 'ol',
|
21980 | optgroup: 'optgroup',
|
21981 | option: 'option',
|
21982 | output: 'output',
|
21983 | p: 'p',
|
21984 | param: 'param',
|
21985 | picture: 'picture',
|
21986 | pre: 'pre',
|
21987 | progress: 'progress',
|
21988 | q: 'q',
|
21989 | rp: 'rp',
|
21990 | rt: 'rt',
|
21991 | ruby: 'ruby',
|
21992 | s: 's',
|
21993 | samp: 'samp',
|
21994 | script: 'script',
|
21995 | section: 'section',
|
21996 | select: 'select',
|
21997 | small: 'small',
|
21998 | source: 'source',
|
21999 | span: 'span',
|
22000 | strong: 'strong',
|
22001 | style: 'style',
|
22002 | sub: 'sub',
|
22003 | summary: 'summary',
|
22004 | sup: 'sup',
|
22005 | table: 'table',
|
22006 | tbody: 'tbody',
|
22007 | td: 'td',
|
22008 | textarea: 'textarea',
|
22009 | tfoot: 'tfoot',
|
22010 | th: 'th',
|
22011 | thead: 'thead',
|
22012 | time: 'time',
|
22013 | title: 'title',
|
22014 | tr: 'tr',
|
22015 | track: 'track',
|
22016 | u: 'u',
|
22017 | ul: 'ul',
|
22018 | 'var': 'var',
|
22019 | video: 'video',
|
22020 | wbr: 'wbr',
|
22021 |
|
22022 | // SVG
|
22023 | circle: 'circle',
|
22024 | clipPath: 'clipPath',
|
22025 | defs: 'defs',
|
22026 | ellipse: 'ellipse',
|
22027 | g: 'g',
|
22028 | image: 'image',
|
22029 | line: 'line',
|
22030 | linearGradient: 'linearGradient',
|
22031 | mask: 'mask',
|
22032 | path: 'path',
|
22033 | pattern: 'pattern',
|
22034 | polygon: 'polygon',
|
22035 | polyline: 'polyline',
|
22036 | radialGradient: 'radialGradient',
|
22037 | rect: 'rect',
|
22038 | stop: 'stop',
|
22039 | svg: 'svg',
|
22040 | text: 'text',
|
22041 | tspan: 'tspan'
|
22042 |
|
22043 | }, createDOMFactory);
|
22044 |
|
22045 | module.exports = ReactDOMFactories;
|
22046 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
22047 |
|
22048 | /***/ }),
|
22049 | /* 239 */
|
22050 | /***/ (function(module, exports, __webpack_require__) {
|
22051 |
|
22052 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
22053 | * Copyright 2014-2015, Facebook, Inc.
|
22054 | * All rights reserved.
|
22055 | *
|
22056 | * This source code is licensed under the BSD-style license found in the
|
22057 | * LICENSE file in the root directory of this source tree. An additional grant
|
22058 | * of patent rights can be found in the PATENTS file in the same directory.
|
22059 | *
|
22060 | * @providesModule ReactElementValidator
|
22061 | */
|
22062 |
|
22063 | /**
|
22064 | * ReactElementValidator provides a wrapper around a element factory
|
22065 | * which validates the props passed to the element. This is intended to be
|
22066 | * used only in DEV and could be replaced by a static type checker for languages
|
22067 | * that support it.
|
22068 | */
|
22069 |
|
22070 | 'use strict';
|
22071 |
|
22072 | var ReactElement = __webpack_require__(127);
|
22073 | var ReactPropTypeLocations = __webpack_require__(150);
|
22074 | var ReactPropTypeLocationNames = __webpack_require__(151);
|
22075 | var ReactCurrentOwner = __webpack_require__(90);
|
22076 |
|
22077 | var canDefineProperty = __webpack_require__(128);
|
22078 | var getIteratorFn = __webpack_require__(193);
|
22079 | var invariant = __webpack_require__(98);
|
22080 | var warning = __webpack_require__(110);
|
22081 |
|
22082 | function getDeclarationErrorAddendum() {
|
22083 | if (ReactCurrentOwner.current) {
|
22084 | var name = ReactCurrentOwner.current.getName();
|
22085 | if (name) {
|
22086 | return ' Check the render method of `' + name + '`.';
|
22087 | }
|
22088 | }
|
22089 | return '';
|
22090 | }
|
22091 |
|
22092 | /**
|
22093 | * Warn if there's no key explicitly set on dynamic arrays of children or
|
22094 | * object keys are not valid. This allows us to keep track of children between
|
22095 | * updates.
|
22096 | */
|
22097 | var ownerHasKeyUseWarning = {};
|
22098 |
|
22099 | var loggedTypeFailures = {};
|
22100 |
|
22101 | /**
|
22102 | * Warn if the element doesn't have an explicit key assigned to it.
|
22103 | * This element is in an array. The array could grow and shrink or be
|
22104 | * reordered. All children that haven't already been validated are required to
|
22105 | * have a "key" property assigned to it.
|
22106 | *
|
22107 | * @internal
|
22108 | * @param {ReactElement} element Element that requires a key.
|
22109 | * @param {*} parentType element's parent's type.
|
22110 | */
|
22111 | function validateExplicitKey(element, parentType) {
|
22112 | if (!element._store || element._store.validated || element.key != null) {
|
22113 | return;
|
22114 | }
|
22115 | element._store.validated = true;
|
22116 |
|
22117 | var addenda = getAddendaForKeyUse('uniqueKey', element, parentType);
|
22118 | if (addenda === null) {
|
22119 | // we already showed the warning
|
22120 | return;
|
22121 | }
|
22122 | process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : undefined;
|
22123 | }
|
22124 |
|
22125 | /**
|
22126 | * Shared warning and monitoring code for the key warnings.
|
22127 | *
|
22128 | * @internal
|
22129 | * @param {string} messageType A key used for de-duping warnings.
|
22130 | * @param {ReactElement} element Component that requires a key.
|
22131 | * @param {*} parentType element's parent's type.
|
22132 | * @returns {?object} A set of addenda to use in the warning message, or null
|
22133 | * if the warning has already been shown before (and shouldn't be shown again).
|
22134 | */
|
22135 | function getAddendaForKeyUse(messageType, element, parentType) {
|
22136 | var addendum = getDeclarationErrorAddendum();
|
22137 | if (!addendum) {
|
22138 | var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
22139 | if (parentName) {
|
22140 | addendum = ' Check the top-level render call using <' + parentName + '>.';
|
22141 | }
|
22142 | }
|
22143 |
|
22144 | var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {});
|
22145 | if (memoizer[addendum]) {
|
22146 | return null;
|
22147 | }
|
22148 | memoizer[addendum] = true;
|
22149 |
|
22150 | var addenda = {
|
22151 | parentOrOwner: addendum,
|
22152 | url: ' See https://fb.me/react-warning-keys for more information.',
|
22153 | childOwner: null
|
22154 | };
|
22155 |
|
22156 | // Usually the current owner is the offender, but if it accepts children as a
|
22157 | // property, it may be the creator of the child that's responsible for
|
22158 | // assigning it a key.
|
22159 | if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
22160 | // Give the component that originally created this child.
|
22161 | addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
|
22162 | }
|
22163 |
|
22164 | return addenda;
|
22165 | }
|
22166 |
|
22167 | /**
|
22168 | * Ensure that every element either is passed in a static location, in an
|
22169 | * array with an explicit keys property defined, or in an object literal
|
22170 | * with valid key property.
|
22171 | *
|
22172 | * @internal
|
22173 | * @param {ReactNode} node Statically passed child of any type.
|
22174 | * @param {*} parentType node's parent's type.
|
22175 | */
|
22176 | function validateChildKeys(node, parentType) {
|
22177 | if (typeof node !== 'object') {
|
22178 | return;
|
22179 | }
|
22180 | if (Array.isArray(node)) {
|
22181 | for (var i = 0; i < node.length; i++) {
|
22182 | var child = node[i];
|
22183 | if (ReactElement.isValidElement(child)) {
|
22184 | validateExplicitKey(child, parentType);
|
22185 | }
|
22186 | }
|
22187 | } else if (ReactElement.isValidElement(node)) {
|
22188 | // This element was passed in a valid location.
|
22189 | if (node._store) {
|
22190 | node._store.validated = true;
|
22191 | }
|
22192 | } else if (node) {
|
22193 | var iteratorFn = getIteratorFn(node);
|
22194 | // Entry iterators provide implicit keys.
|
22195 | if (iteratorFn) {
|
22196 | if (iteratorFn !== node.entries) {
|
22197 | var iterator = iteratorFn.call(node);
|
22198 | var step;
|
22199 | while (!(step = iterator.next()).done) {
|
22200 | if (ReactElement.isValidElement(step.value)) {
|
22201 | validateExplicitKey(step.value, parentType);
|
22202 | }
|
22203 | }
|
22204 | }
|
22205 | }
|
22206 | }
|
22207 | }
|
22208 |
|
22209 | /**
|
22210 | * Assert that the props are valid
|
22211 | *
|
22212 | * @param {string} componentName Name of the component for error messages.
|
22213 | * @param {object} propTypes Map of prop name to a ReactPropType
|
22214 | * @param {object} props
|
22215 | * @param {string} location e.g. "prop", "context", "child context"
|
22216 | * @private
|
22217 | */
|
22218 | function checkPropTypes(componentName, propTypes, props, location) {
|
22219 | for (var propName in propTypes) {
|
22220 | if (propTypes.hasOwnProperty(propName)) {
|
22221 | var error;
|
22222 | // Prop type validation may throw. In case they do, we don't want to
|
22223 | // fail the render phase where it didn't fail before. So we log it.
|
22224 | // After these have been cleaned up, we'll let them throw.
|
22225 | try {
|
22226 | // This is intentionally an invariant that gets caught. It's the same
|
22227 | // behavior as without this statement except with a better message.
|
22228 | !(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
|
22229 | error = propTypes[propName](props, propName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
22230 | } catch (ex) {
|
22231 | error = ex;
|
22232 | }
|
22233 | process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : undefined;
|
22234 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
22235 | // Only monitor this failure once because there tends to be a lot of the
|
22236 | // same error.
|
22237 | loggedTypeFailures[error.message] = true;
|
22238 |
|
22239 | var addendum = getDeclarationErrorAddendum();
|
22240 | process.env.NODE_ENV !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : undefined;
|
22241 | }
|
22242 | }
|
22243 | }
|
22244 | }
|
22245 |
|
22246 | /**
|
22247 | * Given an element, validate that its props follow the propTypes definition,
|
22248 | * provided by the type.
|
22249 | *
|
22250 | * @param {ReactElement} element
|
22251 | */
|
22252 | function validatePropTypes(element) {
|
22253 | var componentClass = element.type;
|
22254 | if (typeof componentClass !== 'function') {
|
22255 | return;
|
22256 | }
|
22257 | var name = componentClass.displayName || componentClass.name;
|
22258 | if (componentClass.propTypes) {
|
22259 | checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);
|
22260 | }
|
22261 | if (typeof componentClass.getDefaultProps === 'function') {
|
22262 | process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : undefined;
|
22263 | }
|
22264 | }
|
22265 |
|
22266 | var ReactElementValidator = {
|
22267 |
|
22268 | createElement: function (type, props, children) {
|
22269 | var validType = typeof type === 'string' || typeof type === 'function';
|
22270 | // We warn in this case but don't throw. We expect the element creation to
|
22271 | // succeed and there will likely be errors in render.
|
22272 | process.env.NODE_ENV !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : undefined;
|
22273 |
|
22274 | var element = ReactElement.createElement.apply(this, arguments);
|
22275 |
|
22276 | // The result can be nullish if a mock or a custom function is used.
|
22277 | // TODO: Drop this when these are no longer allowed as the type argument.
|
22278 | if (element == null) {
|
22279 | return element;
|
22280 | }
|
22281 |
|
22282 | // Skip key warning if the type isn't valid since our key validation logic
|
22283 | // doesn't expect a non-string/function type and can throw confusing errors.
|
22284 | // We don't want exception behavior to differ between dev and prod.
|
22285 | // (Rendering will throw with a helpful message and as soon as the type is
|
22286 | // fixed, the key warnings will appear.)
|
22287 | if (validType) {
|
22288 | for (var i = 2; i < arguments.length; i++) {
|
22289 | validateChildKeys(arguments[i], type);
|
22290 | }
|
22291 | }
|
22292 |
|
22293 | validatePropTypes(element);
|
22294 |
|
22295 | return element;
|
22296 | },
|
22297 |
|
22298 | createFactory: function (type) {
|
22299 | var validatedFactory = ReactElementValidator.createElement.bind(null, type);
|
22300 | // Legacy hook TODO: Warn if this is accessed
|
22301 | validatedFactory.type = type;
|
22302 |
|
22303 | if (process.env.NODE_ENV !== 'production') {
|
22304 | if (canDefineProperty) {
|
22305 | Object.defineProperty(validatedFactory, 'type', {
|
22306 | enumerable: false,
|
22307 | get: function () {
|
22308 | process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : undefined;
|
22309 | Object.defineProperty(this, 'type', {
|
22310 | value: type
|
22311 | });
|
22312 | return type;
|
22313 | }
|
22314 | });
|
22315 | }
|
22316 | }
|
22317 |
|
22318 | return validatedFactory;
|
22319 | },
|
22320 |
|
22321 | cloneElement: function (element, props, children) {
|
22322 | var newElement = ReactElement.cloneElement.apply(this, arguments);
|
22323 | for (var i = 2; i < arguments.length; i++) {
|
22324 | validateChildKeys(arguments[i], newElement.type);
|
22325 | }
|
22326 | validatePropTypes(newElement);
|
22327 | return newElement;
|
22328 | }
|
22329 |
|
22330 | };
|
22331 |
|
22332 | module.exports = ReactElementValidator;
|
22333 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
22334 |
|
22335 | /***/ }),
|
22336 | /* 240 */
|
22337 | /***/ (function(module, exports) {
|
22338 |
|
22339 | /**
|
22340 | * Copyright 2013-2015, Facebook, Inc.
|
22341 | * All rights reserved.
|
22342 | *
|
22343 | * This source code is licensed under the BSD-style license found in the
|
22344 | * LICENSE file in the root directory of this source tree. An additional grant
|
22345 | * of patent rights can be found in the PATENTS file in the same directory.
|
22346 | *
|
22347 | * @providesModule mapObject
|
22348 | */
|
22349 |
|
22350 | 'use strict';
|
22351 |
|
22352 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
22353 |
|
22354 | /**
|
22355 | * Executes the provided `callback` once for each enumerable own property in the
|
22356 | * object and constructs a new object from the results. The `callback` is
|
22357 | * invoked with three arguments:
|
22358 | *
|
22359 | * - the property value
|
22360 | * - the property name
|
22361 | * - the object being traversed
|
22362 | *
|
22363 | * Properties that are added after the call to `mapObject` will not be visited
|
22364 | * by `callback`. If the values of existing properties are changed, the value
|
22365 | * passed to `callback` will be the value at the time `mapObject` visits them.
|
22366 | * Properties that are deleted before being visited are not visited.
|
22367 | *
|
22368 | * @grep function objectMap()
|
22369 | * @grep function objMap()
|
22370 | *
|
22371 | * @param {?object} object
|
22372 | * @param {function} callback
|
22373 | * @param {*} context
|
22374 | * @return {?object}
|
22375 | */
|
22376 | function mapObject(object, callback, context) {
|
22377 | if (!object) {
|
22378 | return null;
|
22379 | }
|
22380 | var result = {};
|
22381 | for (var name in object) {
|
22382 | if (hasOwnProperty.call(object, name)) {
|
22383 | result[name] = callback.call(context, object[name], name, object);
|
22384 | }
|
22385 | }
|
22386 | return result;
|
22387 | }
|
22388 |
|
22389 | module.exports = mapObject;
|
22390 |
|
22391 | /***/ }),
|
22392 | /* 241 */
|
22393 | /***/ (function(module, exports, __webpack_require__) {
|
22394 |
|
22395 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
22396 | * Copyright 2013-2015, Facebook, Inc.
|
22397 | * All rights reserved.
|
22398 | *
|
22399 | * This source code is licensed under the BSD-style license found in the
|
22400 | * LICENSE file in the root directory of this source tree. An additional grant
|
22401 | * of patent rights can be found in the PATENTS file in the same directory.
|
22402 | *
|
22403 | * @providesModule onlyChild
|
22404 | */
|
22405 | 'use strict';
|
22406 |
|
22407 | var ReactElement = __webpack_require__(127);
|
22408 |
|
22409 | var invariant = __webpack_require__(98);
|
22410 |
|
22411 | /**
|
22412 | * Returns the first child in a collection of children and verifies that there
|
22413 | * is only one child in the collection. The current implementation of this
|
22414 | * function assumes that a single child gets passed without a wrapper, but the
|
22415 | * purpose of this helper function is to abstract away the particular structure
|
22416 | * of children.
|
22417 | *
|
22418 | * @param {?object} children Child collection structure.
|
22419 | * @return {ReactComponent} The first and only `ReactComponent` contained in the
|
22420 | * structure.
|
22421 | */
|
22422 | function onlyChild(children) {
|
22423 | !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : undefined;
|
22424 | return children;
|
22425 | }
|
22426 |
|
22427 | module.exports = onlyChild;
|
22428 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
22429 |
|
22430 | /***/ }),
|
22431 | /* 242 */
|
22432 | /***/ (function(module, exports, __webpack_require__) {
|
22433 |
|
22434 | /* WEBPACK VAR INJECTION */(function(process) {/**
|
22435 | * Copyright 2013-2015, Facebook, Inc.
|
22436 | * All rights reserved.
|
22437 | *
|
22438 | * This source code is licensed under the BSD-style license found in the
|
22439 | * LICENSE file in the root directory of this source tree. An additional grant
|
22440 | * of patent rights can be found in the PATENTS file in the same directory.
|
22441 | *
|
22442 | * @providesModule deprecated
|
22443 | */
|
22444 |
|
22445 | 'use strict';
|
22446 |
|
22447 | var assign = __webpack_require__(124);
|
22448 | var warning = __webpack_require__(110);
|
22449 |
|
22450 | /**
|
22451 | * This will log a single deprecation notice per function and forward the call
|
22452 | * on to the new API.
|
22453 | *
|
22454 | * @param {string} fnName The name of the function
|
22455 | * @param {string} newModule The module that fn will exist in
|
22456 | * @param {string} newPackage The module that fn will exist in
|
22457 | * @param {*} ctx The context this forwarded call should run in
|
22458 | * @param {function} fn The function to forward on to
|
22459 | * @return {function} The function that will warn once and then call fn
|
22460 | */
|
22461 | function deprecated(fnName, newModule, newPackage, ctx, fn) {
|
22462 | var warned = false;
|
22463 | if (process.env.NODE_ENV !== 'production') {
|
22464 | var newFn = function () {
|
22465 | process.env.NODE_ENV !== 'production' ? warning(warned,
|
22466 | // Require examples in this string must be split to prevent React's
|
22467 | // build tools from mistaking them for real requires.
|
22468 | // Otherwise the build tools will attempt to build a '%s' module.
|
22469 | 'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : undefined;
|
22470 | warned = true;
|
22471 | return fn.apply(ctx, arguments);
|
22472 | };
|
22473 | // We need to make sure all properties of the original fn are copied over.
|
22474 | // In particular, this is needed to support PropTypes
|
22475 | return assign(newFn, fn);
|
22476 | }
|
22477 |
|
22478 | return fn;
|
22479 | }
|
22480 |
|
22481 | module.exports = deprecated;
|
22482 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89)))
|
22483 |
|
22484 | /***/ }),
|
22485 | /* 243 */
|
22486 | /***/ (function(module, exports, __webpack_require__) {
|
22487 |
|
22488 | 'use strict';
|
22489 |
|
22490 | module.exports = __webpack_require__(88);
|
22491 |
|
22492 |
|
22493 | /***/ }),
|
22494 | /* 244 */
|
22495 | /***/ (function(module, exports, __webpack_require__) {
|
22496 |
|
22497 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
22498 |
|
22499 | // load the styles
|
22500 | var content = __webpack_require__(245);
|
22501 | if(typeof content === 'string') content = [[module.id, content, '']];
|
22502 | // add the styles to the DOM
|
22503 | var update = __webpack_require__(248)(content, {});
|
22504 | if(content.locals) module.exports = content.locals;
|
22505 | // Hot Module Replacement
|
22506 | if(false) {
|
22507 | // When the styles change, update the <style> tags
|
22508 | if(!content.locals) {
|
22509 | module.hot.accept("!!../node_modules/css-loader/index.js!../node_modules/sass-loader/index.js!./index.scss", function() {
|
22510 | var newContent = require("!!../node_modules/css-loader/index.js!../node_modules/sass-loader/index.js!./index.scss");
|
22511 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
22512 | update(newContent);
|
22513 | });
|
22514 | }
|
22515 | // When the module is disposed, remove the <style> tags
|
22516 | module.hot.dispose(function() { update(); });
|
22517 | }
|
22518 |
|
22519 | /***/ }),
|
22520 | /* 245 */
|
22521 | /***/ (function(module, exports, __webpack_require__) {
|
22522 |
|
22523 | exports = module.exports = __webpack_require__(246)();
|
22524 | // imports
|
22525 |
|
22526 |
|
22527 | // module
|
22528 | exports.push([module.id, ".autoTree_Search {\n position: absolute !important;\n z-index: 1000;\n background-color: #ffffff;\n width: 340px !important;\n border-radius: 5px; }\n .autoTree_Search .auto-tree__search-panel .base-tree-component {\n max-height: 325px !important;\n overflow: auto;\n margin-top: -15px; }\n .autoTree_Search .auto-tree__search-panel .error_page {\n height: 295px;\n display: block;\n width: 100%;\n background-image: url(" + __webpack_require__(247) + ");\n background-repeat: no-repeat;\n background-position: 50%; }\n .autoTree_Search .auto-tree__search-panel .base-search-component {\n padding: 15px 16px 20px 14px;\n margin: 0; }\n .autoTree_Search .auto-tree__search-panel .base-search-component input {\n text-indent: 8px;\n width: calc(100% - 2px);\n padding: 2px 0;\n font-size: 12px; }\n .autoTree_Search .auto-tree__search-panel .base-search-component .base-search-input-default {\n display: none; }\n .autoTree_Search .auto-tree__search-panel .base-search-component .base-search-input .sys-icon-close {\n top: 8px; }\n .autoTree_Search .auto-tree__search-panel .selectedComponent {\n bottom: inherit;\n left: inherit; }\n .autoTree_Search .auto-tree__search-panel .selectedComponent .base-button-component {\n vertical-align: middle;\n margin-bottom: 7px; }\n .autoTree_Search .auto-tree__search-panel .auto-result-container-search {\n margin-top: -15px; }\n .autoTree_Search .auto-tree__search-panel .auto-result-container-search,\n .autoTree_Search .auto-tree__search-panel .auto-result {\n max-height: 315px; }\n .autoTree_Search .writeInput .selectIcon {\n top: 16px; }\n .autoTree_Search .writeInputonBlur, .autoTree_Search .writeInputonClick {\n top: 9px;\n height: 31px; }\n .autoTree_Search .auto-tree__panel-bottom {\n border-top: 1px solid #e4ebf0; }\n .autoTree_Search .auto-tree__panel-bottom .selectedComponent {\n width: 340px;\n height: 50px; }\n .autoTree_Search .auto-tree__panel-bottom .selectedComponent .inputText {\n margin-left: 15px; }\n\n.auto-tree {\n width: 100%;\n position: relative; }\n .auto-tree .innerAutoTree {\n position: relative;\n margin: 5px 0 10px 0; }\n .auto-tree .form-item_is-hidden-tips {\n position: absolute;\n width: calc(100% - 40px);\n line-height: 28px;\n height: 28px;\n margin-left: 5px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: transparent;\n cursor: text;\n font-size: 12px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", SimSun, STHeitiSC, sans-serif; }\n .auto-tree .selectedComponent .submitBtn {\n position: absolute;\n bottom: 0;\n left: 275px; }\n .auto-tree .auto-input-edit {\n height: 30px;\n box-sizing: border-box; }\n .auto-tree .auto-input-edit_muit {\n box-sizing: border-box; }\n .auto-tree .closeBtn-search {\n margin-right: 68px; }\n .auto-tree .closeBtn-edit-showDropDown {\n margin-right: calc(50% + 30px); }\n .auto-tree .closeBtn-edit-notShowDropDown {\n margin-right: 16px; }\n .auto-tree .drop-down-list-component .oneLine-input .drop-list-label {\n width: 0;\n margin-right: 0; }\n .auto-tree .pop {\n display: block;\n width: 80%;\n background-color: #ffffff;\n z-index: 9999;\n margin: 0 auto;\n position: absolute;\n top: 0;\n box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.3); }\n .auto-tree .pop .closeBtn {\n position: absolute;\n right: 15px;\n bottom: -12px; }\n .auto-tree:after {\n content: '';\n overflow: hidden;\n display: block;\n height: 0;\n clear: both; }\n .auto-tree .field-left {\n height: 28px;\n text-indent: 5px;\n line-height: 28px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n color: #3d5566;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis; }\n .auto-tree .field-left .helpMsg_Style {\n font-size: 12px;\n opacity: 0.5;\n color: #005999; }\n .auto-tree .field-left .pc-sys-bitian-nomal-svg {\n display: inline-block;\n width: 8px;\n height: 10px;\n margin-right: 5px; }\n .auto-tree .auto-rightinput .dropDownList {\n float: left;\n box-sizing: border-box;\n margin-left: 30px;\n margin-top: -20px;\n width: calc(50% - 15px); }\n .auto-tree .auto-rightinput .dropDownList .form-item {\n min-width: 120px;\n margin-top: 0; }\n .auto-tree .auto-rightinput .dropdownMin {\n float: left;\n box-sizing: border-box;\n margin-left: 0px;\n width: 100%; }\n .auto-tree .auto-rightinput .date-time-close {\n margin-top: 10px\\9;\n position: absolute;\n right: 20px;\n margin-right: 0;\n top: 8px;\n top: -4px\\9;\n width: 14px;\n height: 14px;\n cursor: pointer !important;\n font-size: 14px;\n color: #BCC8D1; }\n .auto-tree .auto-rightinput .date-time-close:hover {\n color: #cc2929; }\n .auto-tree .auto-rightinput .date-time-close:hover::before {\n color: #cc2929; }\n .auto-tree .auto-rightinput .date-time-close-search {\n margin-top: 10px\\9;\n position: absolute;\n right: 0px;\n top: 15px;\n top: 5px\\9;\n width: 14px;\n height: 14px;\n cursor: pointer !important;\n font-size: 14px;\n color: #BCC8D1; }\n .auto-tree .auto-rightinput .date-time-close-search:hover {\n color: #cc2929; }\n .auto-tree .auto-rightinput .date-time-close-search:hover::before {\n color: #cc2929; }\n .auto-tree .auto-form-input {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n display: -ms-flexbox;\n -ms-flex-wrap: wrap;\n height: 100%; }\n .auto-tree .auto-form-input .autoTreeIcon-notShowDropDown {\n width: 11px;\n height: 6px;\n position: absolute;\n top: 12px;\n right: 6px;\n cursor: pointer; }\n .auto-tree .auto-form-input .autoTreeIcon-showDropDown {\n width: 11px;\n height: 6px;\n position: absolute;\n top: 12px;\n right: 5px;\n cursor: pointer; }\n .auto-tree .auto-form-input .leftInput-showDropDown {\n position: relative;\n float: left;\n position: relative;\n box-sizing: border-box; }\n .auto-tree .auto-form-input .isMinWidth {\n width: 100%; }\n .auto-tree .auto-form-input .notMin {\n width: calc(50% - 15px); }\n .auto-tree .auto-form-input .leftInput-notShowDropDown {\n width: 100%; }\n .auto-tree .auto-form-input .drop-down-button {\n position: absolute;\n right: 14px;\n top: 0; }\n .auto-tree .auto-form-input .drop-down-button .drop-down-btn-list {\n margin: 14px 0 10px 0; }\n .auto-tree .auto-form-input .disabled-icon {\n height: 13px;\n width: 11px;\n position: absolute;\n right: 5px;\n bottom: 9px; }\n .auto-tree .auto-form-input .autoTreeLeftInput {\n padding: 0px;\n line-height: 20px;\n text-indent: 5px;\n box-sizing: border-box;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin-top: 0;\n width: 100%;\n color: #0A1319;\n font-size: 12px;\n outline: 0;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n border-radius: 5px; }\n .auto-tree .auto-form-input .autoTreeLeftInput.autoTree-search-input {\n line-height: 40px;\n height: 40px;\n width: 310px;\n border-bottom: 1px solid #E4EBF0;\n margin: 0 15px 0 15px;\n padding-right: 72px; }\n .auto-tree .auto-form-input .autoTreeLeftInput:hover {\n border-color: #96d0fa; }\n .auto-tree .auto-form-input .autoTreeLeftInput:-moz-placeholder {\n font-size: 14px; }\n .auto-tree .auto-form-input .autoTreeLeftInput::-moz-placeholder {\n font-size: 14px; }\n .auto-tree .auto-form-input input::input-placeholder {\n text-align: left;\n font-size: 14px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n color: #BCC8D1; }\n .auto-tree .auto-form-input input::-moz-placeholder {\n text-align: left;\n font-size: 14px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n color: #BCC8D1; }\n .auto-tree .auto-form-input input:-ms-input-placeholder {\n text-align: left;\n font-size: 14px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n color: #BCC8D1; }\n .auto-tree .auto-form-input input::-webkit-input-placeholder {\n text-align: left;\n font-size: 14px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n color: #BCC8D1; }\n .auto-tree .auto-input-edit.auto-tree__input_not-dropdown:after {\n left: 50%; }\n .auto-tree .auto-input-edit .autoTreeLeftInput-single {\n height: 30px;\n border: 1px solid #E4EBF0; }\n .auto-tree .auto-input-search .findAll {\n cursor: pointer;\n position: absolute;\n top: 10px;\n right: 14px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n color: #005999; }\n .auto-tree .auto-input-search .findAll label {\n cursor: pointer; }\n .auto-tree .auto-input-search:after {\n display: block;\n position: absolute;\n content: \"\";\n left: 50%;\n width: 0;\n height: 2px;\n background-color: #1b85d6;\n transition: left ease-in-out .15s, width ease-in-out .15s; }\n .auto-tree .auto-form-input-active-notShowDropDown .autoTreeLeftInput {\n border: 1px solid #1687d9;\n box-shadow: 0 0 2px 1px #96d0fa;\n border-radius: 5px; }\n .auto-tree .auto-form-input-active-notShowDropDown .autoTreeLeftInput:hover {\n border-color: #1687d9; }\n .auto-tree .auto-form-input-active-notShowDropDown input::-ms-clear {\n display: none; }\n .auto-tree .auto-form-input-active-showDropDown .autoTreeLeftInput {\n border: 1px solid #1687d9;\n box-shadow: 0 0 2px 1px #96d0fa;\n border-radius: 5px; }\n .auto-tree .auto-form-input-active-showDropDown .autoTreeLeftInput:hover {\n border-color: #1687d9; }\n .auto-tree .auto-form-input-active-showDropDown input::-ms-clear {\n display: none; }\n .auto-tree .auto-form-input-active-showDropDownisMin:after {\n width: 100%;\n left: 0;\n top: 24px;\n transition-property: width,left;\n transition-duration: 0.35s,0.35s;\n transition-timing-function: cubic-bezier(0.66, 1.65, 0.23, 0.87), cubic-bezier(0.66, 1.65, 0.23, 0.87); }\n .auto-tree .auto-form-input-active-showDropDownisMin input::-ms-clear {\n display: none; }\n .auto-tree .auto-form-input-active-seach:after {\n width: 310px;\n left: 15px;\n transition-property: width,left;\n transition-duration: 0.35s,0.35s;\n transition-timing-function: cubic-bezier(0.66, 1.65, 0.23, 0.87), cubic-bezier(0.66, 1.65, 0.23, 0.87); }\n .auto-tree .auto-form-input-active-seach input::-ms-clear {\n display: none; }\n .auto-tree .auto-form-input-active-seach-drop:after {\n width: 310px;\n left: 15px;\n transition-property: width,left;\n transition-duration: 0.35s,0.35s;\n transition-timing-function: cubic-bezier(0.66, 1.65, 0.23, 0.87), cubic-bezier(0.66, 1.65, 0.23, 0.87); }\n .auto-tree .pop-auto-result {\n width: 70%;\n max-height: 85%;\n padding-top: 10px;\n border-radius: 5px;\n overflow: auto;\n margin-top: 2px; }\n .auto-tree .pop-auto-result #li-hold-on {\n background-color: #F5F8FA; }\n .auto-tree .pop-auto-result .auto-tree__item {\n padding: 0 15px;\n color: #0A1319;\n line-height: 24px;\n list-style: none;\n height: 24px;\n font-size: 12px;\n background-color: #ffffff;\n cursor: pointer; }\n .auto-tree .pop-auto-result .auto-tree__item:hover {\n background-color: #F5F8FA; }\n .auto-tree .pop-auto-result .auto-tree__item em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n .auto-tree .pop-auto-result .auto-tree__item_notShow {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0 15px;\n color: #0A1319;\n list-style: none;\n height: 30px;\n font-size: 12px;\n background-color: #ffffff;\n cursor: pointer; }\n .auto-tree .pop-auto-result .auto-tree__item_notShow:hover {\n background-color: #F5F8FA; }\n .auto-tree .pop-auto-result .auto-tree__item_notShow em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n .auto-tree .auto-result-container {\n background-color: #ffffff;\n width: 100%;\n padding-left: 0;\n border-radius: 5px;\n margin-top: 2px;\n z-index: 99999;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.3);\n display: flex;\n position: absolute; }\n .auto-tree .auto-result-container .findAll {\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n color: #005999;\n cursor: pointer; }\n .auto-tree .auto-result-container .findAll label {\n cursor: pointer; }\n .auto-tree .auto-result-container .searchContainer {\n width: 100%;\n height: 100%;\n padding-bottom: 50px;\n border-radius: 2px;\n background-color: #ffffff;\n box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.3); }\n .auto-tree .auto-result-container .searchContainer .base-search-component {\n width: calc(70% - 30px);\n margin: 0 15px 8px 15px; }\n .auto-tree .auto-result-container .closeBtn {\n position: absolute;\n right: 15px;\n bottom: 0px; }\n .auto-tree .auto-result-container .auto-result {\n width: 100%;\n padding-top: 10px;\n overflow: auto; }\n .auto-tree .auto-result-container .auto-result #li-hold-on {\n background-color: #F5F8FA; }\n .auto-tree .auto-result-container .auto-result .auto-tree__item {\n padding: 0 15px;\n color: #0A1319;\n list-style: none;\n height: 30px;\n font-size: 12px;\n background-color: #ffffff;\n cursor: pointer; }\n .auto-tree .auto-result-container .auto-result .auto-tree__item:hover {\n background-color: #F5F8FA; }\n .auto-tree .auto-result-container .auto-result .auto-tree__item em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n .auto-tree .auto-result-container .auto-result .auto-tree__item_notShow {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0 15px;\n color: #0A1319;\n list-style: none;\n height: 30px;\n font-size: 12px;\n background-color: #ffffff;\n cursor: pointer; }\n .auto-tree .auto-result-container .auto-result .auto-tree__item_notShow:hover {\n background-color: #F5F8FA; }\n .auto-tree .auto-result-container .auto-result .auto-tree__item_notShow em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n .auto-tree .auto-result-container .auto-result .findNothing {\n width: 112px;\n height: 141px;\n margin: 0 auto;\n margin-top: 39px; }\n .auto-tree .auto-result-container .auto-result .findAll {\n color: #005999;\n font-size: 12px;\n text-align: right;\n padding: 10px 15px 0px 0;\n cursor: pointer; }\n .auto-tree .auto-result-container .auto-result .findAll label {\n cursor: pointer; }\n .auto-tree .auto-result-container .auto-result .findAll-null {\n color: #005999;\n font-size: 14px;\n text-align: center;\n padding-top: 5px;\n margin-bottom: 50px;\n cursor: pointer; }\n .auto-tree .auto-result-container .auto-result .findAll-null label {\n cursor: pointer; }\n .auto-tree .auto-result-container-search {\n background-color: #ffffff;\n width: 100%;\n padding-left: 0;\n display: flex; }\n .auto-tree .auto-result-container-search .searchContainer {\n width: 100%;\n height: 100%;\n padding-bottom: 50px;\n border-radius: 2px;\n background-color: #ffffff;\n box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.3); }\n .auto-tree .auto-result-container-search .searchContainer .base-search-component {\n width: calc(70% - 30px);\n margin: 0 15px 8px 15px; }\n .auto-tree .auto-result-container-search .closeBtn {\n position: absolute;\n right: 15px;\n bottom: 0px; }\n .auto-tree .auto-result-container-search .auto-result {\n max-height: 315px;\n width: 100%;\n overflow: auto; }\n .auto-tree .auto-result-container-search .auto-result .autoTree_ItemName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 24px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.71;\n color: #03101a; }\n .auto-tree .auto-result-container-search .auto-result .autoTree_ItemName .auto-tree__item-pname {\n color: #acb7bf;\n padding-left: 5px; }\n .auto-tree .auto-result-container-search .auto-result .autoTree_ParentName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.67;\n color: #3d5566; }\n .auto-tree .auto-result-container-search .auto-result #li-hold-on {\n background-color: #F5F8FA; }\n .auto-tree .auto-result-container-search .auto-result .auto-tree__item {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 5px 15px 5px 20px;\n color: #0A1319;\n list-style: none;\n font-size: 14px;\n background-color: #ffffff;\n cursor: pointer; }\n .auto-tree .auto-result-container-search .auto-result .auto-tree__item:hover {\n background-color: #F5F8FA; }\n .auto-tree .auto-result-container-search .auto-result .auto-tree__item em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n .auto-tree .auto-result-container-search .auto-result .auto-tree__item_notShow {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 5px 15px;\n color: #0A1319;\n list-style: none;\n font-size: 14px;\n background-color: #ffffff;\n cursor: pointer; }\n .auto-tree .auto-result-container-search .auto-result .auto-tree__item_notShow:hover {\n background-color: #F5F8FA; }\n .auto-tree .auto-result-container-search .auto-result .auto-tree__item_notShow em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n .auto-tree .auto-result-container-search .auto-result .findNothing {\n width: 112px;\n height: 141px;\n margin: 0 auto;\n margin-top: 39px; }\n .auto-tree .auto-result-container-search .auto-result .findAll {\n color: #005999;\n font-size: 12px;\n text-align: right;\n padding: 10px 15px 0px 0;\n cursor: pointer; }\n .auto-tree .auto-result-container-search .auto-result .findAll label {\n cursor: pointer; }\n .auto-tree .auto-result-container-search .auto-result .findAll-null {\n color: #005999;\n font-size: 14px;\n text-align: center;\n padding-top: 5px;\n margin-bottom: 50px;\n cursor: pointer; }\n .auto-tree .auto-result-container-search .auto-result .findAll-null label {\n cursor: pointer; }\n .auto-tree .base-input-error-label .field-right input {\n background: rgba(204, 41, 41, 0.05);\n border: 1px solid #cc2929;\n border-radius: 5px; }\n .auto-tree .base-input-error-label .field-right .autoTreeLeftInput:hover {\n border-color: #cc2929; }\n .auto-tree .input-pBlur {\n transform: scale(1.5, 1.5);\n -moz-transform: scale(1.5, 1.5);\n -webkit-transform: scale(1.5, 1.5);\n -o-transform: scale(1.5, 1.5);\n transform-origin: 50% 0%;\n -webkit-transform-origin: 50% 0%;\n -moz-transform-origin: 50% 0%;\n -o-transform-origin: 50% 0%;\n -ms-transform-origin: 50% 0%;\n opacity: 0;\n font-size: 16px;\n transition: opacity .35s ease,font-size .35s ease,transform .35s ease; }\n .auto-tree .input-pFoucus {\n -moz-transform: none;\n -webkit-transform: none;\n -o-transform: none;\n transform: none;\n transform-origin: 50% 0%;\n -webkit-transform-origin: 50% 0%;\n -moz-transform-origin: 50% 0%;\n -o-transform-origin: 50% 0%;\n -ms-transform-origin: 50% 0%;\n opacity: 1;\n font-size: 12px;\n transition: opacity .35s ease,font-size .35s ease,transform .35s ease; }\n .auto-tree .base-input-normal-input {\n box-sizing: border-box;\n border-bottom: 2px solid #cc2929; }\n .auto-tree .input-pRight {\n color: #1687d9; }\n .auto-tree .input-pError {\n color: #cc2929 !important; }\n .auto-tree .base-input-show {\n padding-left: 5px;\n line-height: initial;\n z-index: -1; }\n .auto-tree .base-input-show-text {\n line-height: 20px;\n font-size: 12px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n#AutoTree_ul .auto-tree__panel-bottom.border-top-1px {\n border-top: 1px solid #e4ebf0; }\n\n#AutoTree_ul .auto-tree__panel-bottom .selectedComponent {\n width: 340px;\n height: 50px; }\n #AutoTree_ul .auto-tree__panel-bottom .selectedComponent .inputText {\n margin-left: 15px; }\n\n#AutoTree_ul .auto-tree__panel-bottom .submitBtn {\n position: absolute;\n bottom: 0;\n right: 15px; }\n\n#AutoTree_ul .auto-tree__panel-bottom .writeInput .selectIcon {\n top: 16px; }\n\n#AutoTree_ul .auto-tree__panel-bottom .writeInputonBlur, #AutoTree_ul .auto-tree__panel-bottom .writeInputonClick {\n top: 9px;\n height: 31px; }\n\n#AutoTree_ul .auto-tree__panel-bottom .base-button-component {\n margin-bottom: 7px; }\n\n#AutoTree_ul .empty-con {\n height: 310px; }\n\n#AutoTree_ul .base-tree-component .base-tree-view .us-no-data\n, #AutoTree_ul .autotree__tree-panel .error_page {\n height: 295px;\n display: block;\n width: 100%;\n background-image: url(" + __webpack_require__(247) + ");\n background-repeat: no-repeat;\n background-position: 50%; }\n\n#AutoTree_ul .autotree__tree-panel {\n background: #ffffff;\n box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.15);\n border-radius: 5px;\n min-width: 340px; }\n\n#AutoTree_ul .base-tree-component {\n max-height: 325px !important;\n overflow: auto; }\n\n#AutoTree_ul .auto-result-container {\n background-color: #ffffff;\n width: 100%;\n padding-left: 0;\n border-radius: 5px;\n margin-top: 2px;\n z-index: 99999;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.3);\n display: flex;\n position: absolute; }\n #AutoTree_ul .auto-result-container .findAll {\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n color: #005999;\n cursor: pointer; }\n #AutoTree_ul .auto-result-container .findAll label {\n cursor: pointer; }\n #AutoTree_ul .auto-result-container .searchContainer {\n width: 100%;\n height: 100%;\n padding-bottom: 50px;\n border-radius: 2px;\n background-color: #ffffff;\n box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.3); }\n #AutoTree_ul .auto-result-container .searchContainer .base-search-component {\n width: calc(70% - 30px);\n margin: 0 15px 8px 15px; }\n #AutoTree_ul .auto-result-container .closeBtn {\n position: absolute;\n right: 15px;\n bottom: -43px; }\n #AutoTree_ul .auto-result-container .findAll-null {\n color: #005999;\n font-size: 14px;\n position: absolute;\n left: calc(50% - 34px);\n bottom: 50px;\n padding-top: 5px;\n cursor: pointer; }\n #AutoTree_ul .auto-result-container .findAll-null label {\n cursor: pointer; }\n #AutoTree_ul .auto-result-container .auto-result {\n width: 100%;\n padding-top: 10px;\n overflow: auto; }\n #AutoTree_ul .auto-result-container .auto-result .autoTree_ItemName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 24px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.71;\n padding-top: 5px;\n color: #03101a; }\n #AutoTree_ul .auto-result-container .auto-result .autoTree_ParentName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.67;\n color: #3d5566; }\n #AutoTree_ul .auto-result-container .auto-result #li-hold-on {\n background-color: #F5F8FA; }\n #AutoTree_ul .auto-result-container .auto-result .auto-tree__item {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0 15px;\n color: #0A1319;\n list-style: none;\n height: 54px;\n font-size: 12px;\n background-color: #ffffff;\n cursor: pointer; }\n #AutoTree_ul .auto-result-container .auto-result .auto-tree__item:hover {\n background-color: #F5F8FA; }\n #AutoTree_ul .auto-result-container .auto-result .auto-tree__item em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n #AutoTree_ul .auto-result-container .auto-result .auto-tree__item_notShow {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0 15px;\n color: #0A1319;\n list-style: none;\n height: 30px;\n font-size: 12px;\n background-color: #ffffff;\n cursor: pointer; }\n #AutoTree_ul .auto-result-container .auto-result .auto-tree__item_notShow:hover {\n background-color: #F5F8FA; }\n #AutoTree_ul .auto-result-container .auto-result .auto-tree__item_notShow em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n #AutoTree_ul .auto-result-container .auto-result .findNothing {\n width: 112px;\n height: 141px;\n margin: 0 auto;\n margin-top: 39px;\n margin-bottom: 69px; }\n #AutoTree_ul .auto-result-container .auto-result .findAll {\n color: #005999;\n font-size: 12px;\n text-align: right;\n padding: 10px 15px 0px 0;\n cursor: pointer; }\n #AutoTree_ul .auto-result-container .auto-result .findAll label {\n cursor: pointer; }\n\n#AutoTree_ul .auto-result-container-search {\n background-color: #ffffff;\n width: 100%;\n padding-left: 0;\n min-height: 310px;\n display: flex; }\n #AutoTree_ul .auto-result-container-search .searchContainer {\n width: 100%;\n height: 100%;\n padding-bottom: 50px;\n border-radius: 2px;\n background-color: #ffffff;\n box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.3); }\n #AutoTree_ul .auto-result-container-search .searchContainer .base-search-component {\n width: calc(70% - 30px);\n margin: 0 15px 8px 15px; }\n #AutoTree_ul .auto-result-container-search .closeBtn {\n position: absolute;\n right: 15px;\n bottom: 0px; }\n #AutoTree_ul .auto-result-container-search .auto-result {\n max-height: 310px;\n width: 100%;\n overflow: auto; }\n #AutoTree_ul .auto-result-container-search .auto-result .autoTree_ItemName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 24px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.71;\n color: #03101a; }\n #AutoTree_ul .auto-result-container-search .auto-result .autoTree_ItemName .auto-tree__item-pname {\n color: #acb7bf;\n padding-left: 5px; }\n #AutoTree_ul .auto-result-container-search .auto-result .autoTree_ParentName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.67;\n color: #3d5566; }\n #AutoTree_ul .auto-result-container-search .auto-result #li-hold-on {\n background-color: #F5F8FA; }\n #AutoTree_ul .auto-result-container-search .auto-result .auto-tree__item {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 5px 15px 5px 20px;\n color: #0A1319;\n list-style: none;\n font-size: 14px;\n background-color: #ffffff;\n cursor: pointer; }\n #AutoTree_ul .auto-result-container-search .auto-result .auto-tree__item:hover {\n background-color: #F5F8FA; }\n #AutoTree_ul .auto-result-container-search .auto-result .auto-tree__item em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n #AutoTree_ul .auto-result-container-search .auto-result .auto-tree__item_notShow {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 5px 15px;\n color: #0A1319;\n list-style: none;\n font-size: 14px;\n background-color: #ffffff;\n cursor: pointer; }\n #AutoTree_ul .auto-result-container-search .auto-result .auto-tree__item_notShow:hover {\n background-color: #F5F8FA; }\n #AutoTree_ul .auto-result-container-search .auto-result .auto-tree__item_notShow em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n #AutoTree_ul .auto-result-container-search .auto-result .findNothing {\n width: 112px;\n height: 141px;\n margin: 0 auto;\n margin-top: 39px; }\n #AutoTree_ul .auto-result-container-search .auto-result .findAll {\n color: #005999;\n font-size: 12px;\n text-align: right;\n padding: 10px 15px 0px 0;\n cursor: pointer; }\n #AutoTree_ul .auto-result-container-search .auto-result .findAll label {\n cursor: pointer; }\n #AutoTree_ul .auto-result-container-search .auto-result .findAll-null {\n color: #005999;\n font-size: 14px;\n text-align: center;\n padding-top: 5px;\n margin-bottom: 50px;\n cursor: pointer; }\n #AutoTree_ul .auto-result-container-search .auto-result .findAll-null label {\n cursor: pointer; }\n\n#AutoTree_ul .pop-auto-result {\n width: 70%;\n max-height: 85%;\n padding-top: 10px;\n border-radius: 5px;\n overflow: auto;\n margin-top: 2px; }\n #AutoTree_ul .pop-auto-result .autoTree_ItemName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 24px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.71;\n padding-top: 5px;\n color: #03101a; }\n #AutoTree_ul .pop-auto-result .autoTree_ParentName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.67;\n color: #3d5566; }\n #AutoTree_ul .pop-auto-result #li-hold-on {\n background-color: #F5F8FA; }\n #AutoTree_ul .pop-auto-result .auto-tree__item {\n padding: 0 15px;\n color: #0A1319;\n list-style: none;\n height: 54px;\n font-size: 12px;\n background-color: #ffffff;\n cursor: pointer; }\n #AutoTree_ul .pop-auto-result .auto-tree__item:hover {\n background-color: #F5F8FA; }\n #AutoTree_ul .pop-auto-result .auto-tree__item em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n #AutoTree_ul .pop-auto-result .auto-tree__item_notShow {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0 15px;\n color: #0A1319;\n list-style: none;\n height: 30px;\n font-size: 12px;\n background-color: #ffffff;\n cursor: pointer; }\n #AutoTree_ul .pop-auto-result .auto-tree__item_notShow:hover {\n background-color: #F5F8FA; }\n #AutoTree_ul .pop-auto-result .auto-tree__item_notShow em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n\n.AutoTree-mask {\n background: #0A1319;\n top: 0;\n left: 0;\n opacity: 0.5;\n width: 100%;\n height: 2000px;\n position: fixed;\n z-index: 9999; }\n\n#AutoTree_Mask .searchContainer {\n width: 55%;\n height: 80%;\n min-width: 800px;\n max-width: 1000px;\n padding-bottom: 64px;\n border-radius: 2px;\n background-color: #ffffff;\n box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.3);\n position: fixed;\n z-index: 9999999; }\n #AutoTree_Mask .searchContainer .muti_select {\n width: 70%;\n height: 100%; }\n #AutoTree_Mask .searchContainer .single_select {\n width: 100%;\n height: 100%; }\n #AutoTree_Mask .searchContainer .autoTree__text {\n font-size: 12px;\n line-height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n #AutoTree_Mask .searchContainer .findAll_footer {\n height: 64px;\n width: 100%;\n position: absolute;\n bottom: 0;\n left: 0; }\n #AutoTree_Mask .searchContainer .base-search-component {\n width: calc(100% - 30px);\n margin: 10px 15px 10px 15px; }\n #AutoTree_Mask .searchContainer .Selected_List {\n width: 30%;\n height: calc(100% - 84px);\n border-left: 1px solid #E4EBF0;\n padding: 0 20px 0 20px;\n box-sizing: border-box;\n position: absolute;\n right: 0;\n top: 20px; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree__results-tip {\n display: inline-block;\n margin: 10px 0px;\n width: 100%; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree__results-tip .autoTree__text {\n color: #0A1319; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree__results-tip .autoTree__text:first-child {\n margin-right: 5px; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree__results-tip .autoTree__text:last-child {\n float: right;\n margin-top: 3px; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree__results-tip .autoTree__text_is-disabled {\n color: #BCC8D1;\n cursor: not-allowed; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree__results-tip .autoTree__text_is-active {\n color: #005999; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree-results-content {\n margin-top: 10px;\n height: calc(100% - 44px);\n overflow-y: auto; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree-results-content .autoTree__item {\n float: left;\n margin-right: 20px;\n margin-bottom: 10px;\n font-size: 12px;\n line-height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 0;\n cursor: pointer; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree-results-content .autoTree__item .autoTree__text {\n vertical-align: middle; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree-results-content .autoTree__item .parent_text {\n color: #66757F; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree-results-content .autoTree__item .sys-icon-close {\n margin-left: 5px;\n font-size: 14px;\n vertical-align: middle; }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree-results-content_null {\n color: #E4EBF0;\n font-size: 20px;\n line-height: calc(100% - 44px);\n height: calc(100% - 44px); }\n #AutoTree_Mask .searchContainer .Selected_List .autoTree-results-content_null .autoTree-results_nullText {\n width: 160px;\n position: absolute;\n top: calc(50% - 10px);\n left: calc(50% - 80px); }\n #AutoTree_Mask .searchContainer .pop-auto-result {\n width: 100%;\n max-height: 85%;\n padding-top: 10px;\n border-radius: 5px;\n overflow: auto;\n margin-top: 2px; }\n #AutoTree_Mask .searchContainer .pop-auto-result .autoTree_ItemName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 24px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.71;\n padding-top: 5px;\n color: #03101a; }\n #AutoTree_Mask .searchContainer .pop-auto-result .autoTree_ParentName {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.67;\n color: #3d5566; }\n #AutoTree_Mask .searchContainer .pop-auto-result #li-hold-on {\n background-color: #F5F8FA; }\n #AutoTree_Mask .searchContainer .pop-auto-result .auto-tree__item {\n padding: 0 15px;\n color: #0A1319;\n list-style: none;\n height: 54px;\n font-size: 12px;\n background-color: #ffffff;\n cursor: pointer; }\n #AutoTree_Mask .searchContainer .pop-auto-result .auto-tree__item:hover {\n background-color: #F5F8FA; }\n #AutoTree_Mask .searchContainer .pop-auto-result .auto-tree__item em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n #AutoTree_Mask .searchContainer .pop-auto-result .auto-tree__item_notShow {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0 15px;\n color: #0A1319;\n list-style: none;\n height: 30px;\n font-size: 12px;\n background-color: #ffffff;\n cursor: pointer; }\n #AutoTree_Mask .searchContainer .pop-auto-result .auto-tree__item_notShow:hover {\n background-color: #F5F8FA; }\n #AutoTree_Mask .searchContainer .pop-auto-result .auto-tree__item_notShow em {\n color: #0A1319;\n width: 12px;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n #AutoTree_Mask .searchContainer .closeBtn {\n position: absolute;\n right: 101px;\n bottom: 4px; }\n #AutoTree_Mask .searchContainer .closeBtn_single {\n position: absolute;\n right: 20px;\n bottom: 4px; }\n #AutoTree_Mask .searchContainer .submitBtn {\n position: absolute;\n right: 20px;\n bottom: 4px; }\n\n.auto-tree_pop-open {\n -webkit-animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);\n animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);\n -webkit-animation-duration: .2s;\n animation-duration: .2s;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n -webkit-animation-play-state: paused;\n animation-play-state: paused;\n -webkit-animation-name: antSlideUpIn;\n animation-name: antSlideUpIn;\n -webkit-animation-play-state: running;\n animation-play-state: running; }\n\n@-webkit-keyframes antSlideUpIn {\n 0% {\n opacity: 0;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: scaleY(0.8);\n transform: scaleY(0.8); }\n 100% {\n opacity: 1;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: scaleY(1);\n transform: scaleY(1); } }\n\n@keyframes antSlideUpIn {\n 0% {\n opacity: 0;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: scaleY(0.8);\n transform: scaleY(0.8); }\n 100% {\n opacity: 1;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: scaleY(1);\n transform: scaleY(1); } }\n", ""]);
|
22529 |
|
22530 | // exports
|
22531 |
|
22532 |
|
22533 | /***/ }),
|
22534 | /* 246 */
|
22535 | /***/ (function(module, exports) {
|
22536 |
|
22537 | /*
|
22538 | MIT License http://www.opensource.org/licenses/mit-license.php
|
22539 | Author Tobias Koppers @sokra
|
22540 | */
|
22541 | // css base code, injected by the css-loader
|
22542 | module.exports = function() {
|
22543 | var list = [];
|
22544 |
|
22545 | // return the list of modules as css string
|
22546 | list.toString = function toString() {
|
22547 | var result = [];
|
22548 | for(var i = 0; i < this.length; i++) {
|
22549 | var item = this[i];
|
22550 | if(item[2]) {
|
22551 | result.push("@media " + item[2] + "{" + item[1] + "}");
|
22552 | } else {
|
22553 | result.push(item[1]);
|
22554 | }
|
22555 | }
|
22556 | return result.join("");
|
22557 | };
|
22558 |
|
22559 | // import a list of modules into the list
|
22560 | list.i = function(modules, mediaQuery) {
|
22561 | if(typeof modules === "string")
|
22562 | modules = [[null, modules, ""]];
|
22563 | var alreadyImportedModules = {};
|
22564 | for(var i = 0; i < this.length; i++) {
|
22565 | var id = this[i][0];
|
22566 | if(typeof id === "number")
|
22567 | alreadyImportedModules[id] = true;
|
22568 | }
|
22569 | for(i = 0; i < modules.length; i++) {
|
22570 | var item = modules[i];
|
22571 | // skip already imported module
|
22572 | // this implementation is not 100% perfect for weird media query combinations
|
22573 | // when a module is imported multiple times with different media queries.
|
22574 | // I hope this will never occur (Hey this way we have smaller bundles)
|
22575 | if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
|
22576 | if(mediaQuery && !item[2]) {
|
22577 | item[2] = mediaQuery;
|
22578 | } else if(mediaQuery) {
|
22579 | item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
|
22580 | }
|
22581 | list.push(item);
|
22582 | }
|
22583 | }
|
22584 | };
|
22585 | return list;
|
22586 | };
|
22587 |
|
22588 |
|
22589 | /***/ }),
|
22590 | /* 247 */
|
22591 | /***/ (function(module, exports, __webpack_require__) {
|
22592 |
|
22593 | module.exports = __webpack_require__.p + "885c8195f76a3e75e80bef39eb38e58d.png";
|
22594 |
|
22595 | /***/ }),
|
22596 | /* 248 */
|
22597 | /***/ (function(module, exports, __webpack_require__) {
|
22598 |
|
22599 | /*
|
22600 | MIT License http://www.opensource.org/licenses/mit-license.php
|
22601 | Author Tobias Koppers @sokra
|
22602 | */
|
22603 | var stylesInDom = {},
|
22604 | memoize = function(fn) {
|
22605 | var memo;
|
22606 | return function () {
|
22607 | if (typeof memo === "undefined") memo = fn.apply(this, arguments);
|
22608 | return memo;
|
22609 | };
|
22610 | },
|
22611 | isOldIE = memoize(function() {
|
22612 | return /msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase());
|
22613 | }),
|
22614 | getHeadElement = memoize(function () {
|
22615 | return document.head || document.getElementsByTagName("head")[0];
|
22616 | }),
|
22617 | singletonElement = null,
|
22618 | singletonCounter = 0,
|
22619 | styleElementsInsertedAtTop = [];
|
22620 |
|
22621 | module.exports = function(list, options) {
|
22622 | if(false) {
|
22623 | if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
|
22624 | }
|
22625 |
|
22626 | options = options || {};
|
22627 | // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
22628 | // tags it will allow on a page
|
22629 | if (typeof options.singleton === "undefined") options.singleton = isOldIE();
|
22630 |
|
22631 | // By default, add <style> tags to the bottom of <head>.
|
22632 | if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
|
22633 |
|
22634 | var styles = listToStyles(list);
|
22635 | addStylesToDom(styles, options);
|
22636 |
|
22637 | return function update(newList) {
|
22638 | var mayRemove = [];
|
22639 | for(var i = 0; i < styles.length; i++) {
|
22640 | var item = styles[i];
|
22641 | var domStyle = stylesInDom[item.id];
|
22642 | domStyle.refs--;
|
22643 | mayRemove.push(domStyle);
|
22644 | }
|
22645 | if(newList) {
|
22646 | var newStyles = listToStyles(newList);
|
22647 | addStylesToDom(newStyles, options);
|
22648 | }
|
22649 | for(var i = 0; i < mayRemove.length; i++) {
|
22650 | var domStyle = mayRemove[i];
|
22651 | if(domStyle.refs === 0) {
|
22652 | for(var j = 0; j < domStyle.parts.length; j++)
|
22653 | domStyle.parts[j]();
|
22654 | delete stylesInDom[domStyle.id];
|
22655 | }
|
22656 | }
|
22657 | };
|
22658 | }
|
22659 |
|
22660 | function addStylesToDom(styles, options) {
|
22661 | for(var i = 0; i < styles.length; i++) {
|
22662 | var item = styles[i];
|
22663 | var domStyle = stylesInDom[item.id];
|
22664 | if(domStyle) {
|
22665 | domStyle.refs++;
|
22666 | for(var j = 0; j < domStyle.parts.length; j++) {
|
22667 | domStyle.parts[j](item.parts[j]);
|
22668 | }
|
22669 | for(; j < item.parts.length; j++) {
|
22670 | domStyle.parts.push(addStyle(item.parts[j], options));
|
22671 | }
|
22672 | } else {
|
22673 | var parts = [];
|
22674 | for(var j = 0; j < item.parts.length; j++) {
|
22675 | parts.push(addStyle(item.parts[j], options));
|
22676 | }
|
22677 | stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
|
22678 | }
|
22679 | }
|
22680 | }
|
22681 |
|
22682 | function listToStyles(list) {
|
22683 | var styles = [];
|
22684 | var newStyles = {};
|
22685 | for(var i = 0; i < list.length; i++) {
|
22686 | var item = list[i];
|
22687 | var id = item[0];
|
22688 | var css = item[1];
|
22689 | var media = item[2];
|
22690 | var sourceMap = item[3];
|
22691 | var part = {css: css, media: media, sourceMap: sourceMap};
|
22692 | if(!newStyles[id])
|
22693 | styles.push(newStyles[id] = {id: id, parts: [part]});
|
22694 | else
|
22695 | newStyles[id].parts.push(part);
|
22696 | }
|
22697 | return styles;
|
22698 | }
|
22699 |
|
22700 | function insertStyleElement(options, styleElement) {
|
22701 | var head = getHeadElement();
|
22702 | var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
|
22703 | if (options.insertAt === "top") {
|
22704 | if(!lastStyleElementInsertedAtTop) {
|
22705 | head.insertBefore(styleElement, head.firstChild);
|
22706 | } else if(lastStyleElementInsertedAtTop.nextSibling) {
|
22707 | head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
|
22708 | } else {
|
22709 | head.appendChild(styleElement);
|
22710 | }
|
22711 | styleElementsInsertedAtTop.push(styleElement);
|
22712 | } else if (options.insertAt === "bottom") {
|
22713 | head.appendChild(styleElement);
|
22714 | } else {
|
22715 | throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
|
22716 | }
|
22717 | }
|
22718 |
|
22719 | function removeStyleElement(styleElement) {
|
22720 | styleElement.parentNode.removeChild(styleElement);
|
22721 | var idx = styleElementsInsertedAtTop.indexOf(styleElement);
|
22722 | if(idx >= 0) {
|
22723 | styleElementsInsertedAtTop.splice(idx, 1);
|
22724 | }
|
22725 | }
|
22726 |
|
22727 | function createStyleElement(options) {
|
22728 | var styleElement = document.createElement("style");
|
22729 | styleElement.type = "text/css";
|
22730 | insertStyleElement(options, styleElement);
|
22731 | return styleElement;
|
22732 | }
|
22733 |
|
22734 | function createLinkElement(options) {
|
22735 | var linkElement = document.createElement("link");
|
22736 | linkElement.rel = "stylesheet";
|
22737 | insertStyleElement(options, linkElement);
|
22738 | return linkElement;
|
22739 | }
|
22740 |
|
22741 | function addStyle(obj, options) {
|
22742 | var styleElement, update, remove;
|
22743 |
|
22744 | if (options.singleton) {
|
22745 | var styleIndex = singletonCounter++;
|
22746 | styleElement = singletonElement || (singletonElement = createStyleElement(options));
|
22747 | update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
|
22748 | remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
|
22749 | } else if(obj.sourceMap &&
|
22750 | typeof URL === "function" &&
|
22751 | typeof URL.createObjectURL === "function" &&
|
22752 | typeof URL.revokeObjectURL === "function" &&
|
22753 | typeof Blob === "function" &&
|
22754 | typeof btoa === "function") {
|
22755 | styleElement = createLinkElement(options);
|
22756 | update = updateLink.bind(null, styleElement);
|
22757 | remove = function() {
|
22758 | removeStyleElement(styleElement);
|
22759 | if(styleElement.href)
|
22760 | URL.revokeObjectURL(styleElement.href);
|
22761 | };
|
22762 | } else {
|
22763 | styleElement = createStyleElement(options);
|
22764 | update = applyToTag.bind(null, styleElement);
|
22765 | remove = function() {
|
22766 | removeStyleElement(styleElement);
|
22767 | };
|
22768 | }
|
22769 |
|
22770 | update(obj);
|
22771 |
|
22772 | return function updateStyle(newObj) {
|
22773 | if(newObj) {
|
22774 | if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
|
22775 | return;
|
22776 | update(obj = newObj);
|
22777 | } else {
|
22778 | remove();
|
22779 | }
|
22780 | };
|
22781 | }
|
22782 |
|
22783 | var replaceText = (function () {
|
22784 | var textStore = [];
|
22785 |
|
22786 | return function (index, replacement) {
|
22787 | textStore[index] = replacement;
|
22788 | return textStore.filter(Boolean).join('\n');
|
22789 | };
|
22790 | })();
|
22791 |
|
22792 | function applyToSingletonTag(styleElement, index, remove, obj) {
|
22793 | var css = remove ? "" : obj.css;
|
22794 |
|
22795 | if (styleElement.styleSheet) {
|
22796 | styleElement.styleSheet.cssText = replaceText(index, css);
|
22797 | } else {
|
22798 | var cssNode = document.createTextNode(css);
|
22799 | var childNodes = styleElement.childNodes;
|
22800 | if (childNodes[index]) styleElement.removeChild(childNodes[index]);
|
22801 | if (childNodes.length) {
|
22802 | styleElement.insertBefore(cssNode, childNodes[index]);
|
22803 | } else {
|
22804 | styleElement.appendChild(cssNode);
|
22805 | }
|
22806 | }
|
22807 | }
|
22808 |
|
22809 | function applyToTag(styleElement, obj) {
|
22810 | var css = obj.css;
|
22811 | var media = obj.media;
|
22812 |
|
22813 | if(media) {
|
22814 | styleElement.setAttribute("media", media)
|
22815 | }
|
22816 |
|
22817 | if(styleElement.styleSheet) {
|
22818 | styleElement.styleSheet.cssText = css;
|
22819 | } else {
|
22820 | while(styleElement.firstChild) {
|
22821 | styleElement.removeChild(styleElement.firstChild);
|
22822 | }
|
22823 | styleElement.appendChild(document.createTextNode(css));
|
22824 | }
|
22825 | }
|
22826 |
|
22827 | function updateLink(linkElement, obj) {
|
22828 | var css = obj.css;
|
22829 | var sourceMap = obj.sourceMap;
|
22830 |
|
22831 | if(sourceMap) {
|
22832 | // http://stackoverflow.com/a/26603875
|
22833 | css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
|
22834 | }
|
22835 |
|
22836 | var blob = new Blob([css], { type: "text/css" });
|
22837 |
|
22838 | var oldSrc = linkElement.href;
|
22839 |
|
22840 | linkElement.href = URL.createObjectURL(blob);
|
22841 |
|
22842 | if(oldSrc)
|
22843 | URL.revokeObjectURL(oldSrc);
|
22844 | }
|
22845 |
|
22846 |
|
22847 | /***/ }),
|
22848 | /* 249 */
|
22849 | /***/ (function(module, exports, __webpack_require__) {
|
22850 |
|
22851 | 'use strict';
|
22852 |
|
22853 | Object.defineProperty(exports, "__esModule", {
|
22854 | value: true
|
22855 | });
|
22856 | exports.default = undefined;
|
22857 |
|
22858 | var _extends2 = __webpack_require__(5);
|
22859 |
|
22860 | var _extends3 = _interopRequireDefault(_extends2);
|
22861 |
|
22862 | var _classCallCheck2 = __webpack_require__(42);
|
22863 |
|
22864 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
22865 |
|
22866 | var _possibleConstructorReturn2 = __webpack_require__(43);
|
22867 |
|
22868 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
22869 |
|
22870 | var _inherits2 = __webpack_require__(78);
|
22871 |
|
22872 | var _inherits3 = _interopRequireDefault(_inherits2);
|
22873 |
|
22874 | var _class, _temp;
|
22875 |
|
22876 | var _react = __webpack_require__(86);
|
22877 |
|
22878 | var _react2 = _interopRequireDefault(_react);
|
22879 |
|
22880 | var _TreeItem = __webpack_require__(250);
|
22881 |
|
22882 | var _TreeItem2 = _interopRequireDefault(_TreeItem);
|
22883 |
|
22884 | __webpack_require__(256);
|
22885 |
|
22886 | var _loading = __webpack_require__(258);
|
22887 |
|
22888 | var _loading2 = _interopRequireDefault(_loading);
|
22889 |
|
22890 | var _commonFunc = __webpack_require__(252);
|
22891 |
|
22892 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
22893 |
|
22894 | if (!String.prototype.includes) {
|
22895 | String.prototype.includes = function () {
|
22896 | 'use strict';
|
22897 |
|
22898 | return String.prototype.indexOf.apply(this, arguments) !== -1;
|
22899 | };
|
22900 | };
|
22901 | var Tree = (_temp = _class = function (_Component) {
|
22902 | (0, _inherits3.default)(Tree, _Component);
|
22903 |
|
22904 | function Tree(props) {
|
22905 | (0, _classCallCheck3.default)(this, Tree);
|
22906 |
|
22907 | var _this = (0, _possibleConstructorReturn3.default)(this, _Component.call(this, props));
|
22908 |
|
22909 | _this.handleCheckBoxClick = function (e, dataPath) {
|
22910 | //修改dataId数据的checked
|
22911 | _this.props.treeData.map(function (data) {
|
22912 | if (data.path === dataPath) {
|
22913 | data.checked = data.checked ? false : true;
|
22914 | if (data.li && data.li.length > 0) {
|
22915 | data.li.map(function (item) {
|
22916 | item.checked = data.checked;
|
22917 | });
|
22918 | }
|
22919 | }
|
22920 | });
|
22921 | _this.setState(_this.state);
|
22922 | };
|
22923 |
|
22924 | _this.itemClick = function (val, e) {
|
22925 | var treeData = _this.state.treeData;
|
22926 |
|
22927 | var clickLiTop = _this.state.clickLiTop;
|
22928 | treeData.map(function (item) {
|
22929 | item.id == val.id ? item.is_checked = true : item.is_checked ? item.is_checked = false : item.is_checked = item.is_checked;
|
22930 | });
|
22931 | var tar = e.target;
|
22932 | var tarPosition = tar.className == 'title-tv ' ? tar.offsetTop : tar.parentNode.parentNode.offsetTop;
|
22933 | clickLiTop = tarPosition + 'px';
|
22934 | _this.setState({
|
22935 | clickLiTop: clickLiTop,
|
22936 | clickStatus: 'block',
|
22937 | clickId: val.id,
|
22938 | clickPId: val.pid
|
22939 | });
|
22940 | _this.props.onClick && _this.props.onClick(e, val);
|
22941 | };
|
22942 |
|
22943 | _this.hideLi = function () {
|
22944 | _this.setState({ clickStatus: 'none' });
|
22945 | };
|
22946 |
|
22947 | _this.showLi = function () {
|
22948 | _this.setState({ clickStatus: 'block' });
|
22949 | };
|
22950 |
|
22951 | _this.changeTop = function () {
|
22952 | var treeData = _this.props.treeData;
|
22953 | var findActive = treeData.filter(function (data) {
|
22954 | return data.is_checked == true;
|
22955 | });
|
22956 | var activeDom = document.getElementsByClassName("tree-li-active")[0];
|
22957 | if (findActive.length !== 0 && activeDom) {
|
22958 | _this.setState({ clickLiTop: activeDom.offsetTop + 'px' });
|
22959 | }
|
22960 | };
|
22961 |
|
22962 | _this.changeFetching = function () {
|
22963 | _this.setState({ isFetch: true });
|
22964 | };
|
22965 |
|
22966 | _this.handleMouseOver = function (e) {
|
22967 | var hoverLiTop = _this.state.hoverLiTop;
|
22968 | var baseTreeCom = document.getElementsByClassName('base-tree-component')[0];
|
22969 | var scrollWidth = baseTreeCom.scrollWidth + 'px';
|
22970 | var tar = e.target;
|
22971 | var tarNodePosition = tar.className.includes('title-tv') ? tar.offsetTop : tar.parentNode.parentNode.offsetTop;
|
22972 | if (tar.className.includes('icon-tv')) {
|
22973 | tarNodePosition = tar.offsetTop - 2;
|
22974 | }
|
22975 | hoverLiTop = tarNodePosition + 'px';
|
22976 | _this.setState({ hoverLiTop: hoverLiTop, hoverWidth: scrollWidth });
|
22977 | };
|
22978 |
|
22979 | _this.hoverMouseOut = function () {
|
22980 | _this.setState({ hoverLiTop: '-40px' });
|
22981 | };
|
22982 |
|
22983 | _this.transData = function (data1) {
|
22984 | var data = (0, _commonFunc.deepClone)(data1);
|
22985 | var filter = [],
|
22986 | getData = {};
|
22987 | for (var i in data) {
|
22988 | if (data[i] != undefined && data[i].id == (_this.state && _this.state.clickId)) data[i].is_checked = true;
|
22989 | if (data[i] != undefined) getData[data[i]["id"]] = data[i];
|
22990 | }
|
22991 | for (var j in data) {
|
22992 | if (data[j]) {
|
22993 | var item = data[j],
|
22994 | temp = getData[item["pid"]];
|
22995 | if (temp && temp.id !== temp.pid) {
|
22996 | !temp["li"] && (temp["li"] = []);
|
22997 | temp["li"].push(item);
|
22998 | } else {
|
22999 | filter.push(item);
|
23000 | }
|
23001 | }
|
23002 | }
|
23003 | return filter;
|
23004 | };
|
23005 |
|
23006 | _this.state = {
|
23007 | treeData: [],
|
23008 | hoverLiTop: '-40px',
|
23009 | clickStatus: 'none',
|
23010 | clickLiTop: '0px',
|
23011 | hoverWidth: '100%',
|
23012 | filterData: _this.transData(props.treeData),
|
23013 | isFetch: true
|
23014 | };
|
23015 | window["getTree"] = {};
|
23016 | return _this;
|
23017 | }
|
23018 |
|
23019 | Tree.prototype.componentWillUnmount = function componentWillUnmount() {
|
23020 | window["getTree"] = {};
|
23021 | };
|
23022 |
|
23023 | Tree.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
23024 | if (nextProps.treeData !== this.state.treeData) {
|
23025 | this.setState({ treeData: nextProps.treeData, filterData: this.transData(nextProps.treeData) });
|
23026 | }
|
23027 | if (!nextProps.isFetching) {
|
23028 | this.setState({ isFetch: false });
|
23029 | }
|
23030 | };
|
23031 |
|
23032 | Tree.prototype.componentDidMount = function componentDidMount() {
|
23033 | var _props = this.props,
|
23034 | treeData = _props.treeData,
|
23035 | getTreeData = _props.getTreeData,
|
23036 | id = _props.id,
|
23037 | async = _props.async,
|
23038 | getTreeDataAPI = _props.getTreeDataAPI,
|
23039 | initGetData = _props.initGetData,
|
23040 | postData = _props.postData,
|
23041 | methodType = _props.methodType;
|
23042 |
|
23043 | this.setState({ treeData: treeData });
|
23044 | if (initGetData) getTreeData && getTreeData(id, async, getTreeDataAPI, postData ? postData : {}, methodType ? methodType : 'GET');
|
23045 | };
|
23046 |
|
23047 | Tree.prototype.componentDidUpdate = function componentDidUpdate(nextProps) {
|
23048 | var _props2 = this.props,
|
23049 | getTreeSize = _props2.getTreeSize,
|
23050 | treeData = _props2.treeData;
|
23051 |
|
23052 | if (nextProps.treeData !== this.state.treeData) {
|
23053 | var findActive = treeData.filter(function (data) {
|
23054 | return data.is_checked == true;
|
23055 | });
|
23056 | if (findActive.length !== 0) {
|
23057 | this.setState({ clickStatus: 'block' });
|
23058 | var _defaultTop = document.getElementsByClassName("tree-li-active")[0].offsetTop + 'px';
|
23059 | if (_defaultTop !== undefined) {
|
23060 | this.setState({ clickLiTop: _defaultTop }, this.forceUpdate());
|
23061 | }
|
23062 | }
|
23063 | var treeH = document.getElementsByClassName('base-tree-component')[0].offsetHeight;
|
23064 | getTreeSize && getTreeSize(treeH);
|
23065 | }
|
23066 | };
|
23067 |
|
23068 | Tree.prototype.render = function render() {
|
23069 | var _this2 = this;
|
23070 |
|
23071 | var _state = this.state,
|
23072 | hoverWidth = _state.hoverWidth,
|
23073 | clickId = _state.clickId,
|
23074 | clickStatus = _state.clickStatus,
|
23075 | clickLiTop = _state.clickLiTop,
|
23076 | hoverLiTop = _state.hoverLiTop,
|
23077 | treeData = _state.treeData,
|
23078 | filterData = _state.filterData,
|
23079 | isFetch = _state.isFetch;
|
23080 | var _props3 = this.props,
|
23081 | style = _props3.style,
|
23082 | hidden = _props3.hidden,
|
23083 | hiddenTip = _props3.hiddenTip,
|
23084 | sideTip = _props3.sideTip;
|
23085 |
|
23086 | var Li = filterData.map(function (data, index) {
|
23087 | return _react2.default.createElement(_TreeItem2.default, (0, _extends3.default)({}, _this2.props, {
|
23088 | treeData: treeData,
|
23089 | hideLi: _this2.hideLi,
|
23090 | showLi: _this2.showLi,
|
23091 | handleCheckBoxClick: _this2.handleCheckBoxClick,
|
23092 | changeTop: _this2.changeTop,
|
23093 | handleMouseOver: _this2.handleMouseOver,
|
23094 | changeFetching: _this2.changeFetching,
|
23095 | isFetch: _this2.state.isFetch,
|
23096 | data: data,
|
23097 | itemClick: _this2.itemClick,
|
23098 | clickId: clickId,
|
23099 | key: index,
|
23100 | hiddenTip: hiddenTip,
|
23101 | sideTip: sideTip
|
23102 | }));
|
23103 | });
|
23104 | var component = treeData.length == 0 ? _react2.default.createElement('div', { className: 'us-no-data empty-con' }) : Li;
|
23105 | if (hidden) {
|
23106 | return _react2.default.createElement('div', null);
|
23107 | } else {
|
23108 | return _react2.default.createElement(
|
23109 | 'div',
|
23110 | { 'data-style-sys': 'ux-tree', 'data-style-extend': 'ux-tree', ref: 'BaseTree', className: 'base-tree-component', style: style, onMouseOut: this.hoverMouseOut },
|
23111 | _react2.default.createElement(
|
23112 | 'div',
|
23113 | { className: 'base-tree-view base-tree-style' },
|
23114 | _react2.default.createElement(
|
23115 | 'ul',
|
23116 | null,
|
23117 | isFetch ? _react2.default.createElement(
|
23118 | 'div',
|
23119 | { style: { backgroundColor: "#FFF", height: '295px' } },
|
23120 | _react2.default.createElement(_loading2.default, { type: 'small' })
|
23121 | ) : component
|
23122 | ),
|
23123 | _react2.default.createElement('li', { className: 'hover-style', style: { 'top': hoverLiTop } }),
|
23124 | _react2.default.createElement('li', { className: 'click-style', style: { "width": hoverWidth, "display": clickStatus, "top": clickLiTop } })
|
23125 | )
|
23126 | );
|
23127 | }
|
23128 | };
|
23129 |
|
23130 | return Tree;
|
23131 | }(_react.Component), _class.defaultProps = {
|
23132 | initGetData: true,
|
23133 | style: {}
|
23134 | }, _temp);
|
23135 | exports.default = Tree;
|
23136 |
|
23137 |
|
23138 | module.exports = Tree;
|
23139 | module.exports = exports['default'];
|
23140 |
|
23141 | /***/ }),
|
23142 | /* 250 */
|
23143 | /***/ (function(module, exports, __webpack_require__) {
|
23144 |
|
23145 | 'use strict';
|
23146 |
|
23147 | Object.defineProperty(exports, "__esModule", {
|
23148 | value: true
|
23149 | });
|
23150 | exports.default = undefined;
|
23151 |
|
23152 | var _extends2 = __webpack_require__(5);
|
23153 |
|
23154 | var _extends3 = _interopRequireDefault(_extends2);
|
23155 |
|
23156 | var _classCallCheck2 = __webpack_require__(42);
|
23157 |
|
23158 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
23159 |
|
23160 | var _possibleConstructorReturn2 = __webpack_require__(43);
|
23161 |
|
23162 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
23163 |
|
23164 | var _inherits2 = __webpack_require__(78);
|
23165 |
|
23166 | var _inherits3 = _interopRequireDefault(_inherits2);
|
23167 |
|
23168 | var _react = __webpack_require__(86);
|
23169 |
|
23170 | var _react2 = _interopRequireDefault(_react);
|
23171 |
|
23172 | var _toolTip = __webpack_require__(251);
|
23173 |
|
23174 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
23175 |
|
23176 | var _commonFunc = __webpack_require__(252);
|
23177 |
|
23178 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
23179 |
|
23180 | var TreeItem = function (_Component) {
|
23181 | (0, _inherits3.default)(TreeItem, _Component);
|
23182 |
|
23183 | function TreeItem(props) {
|
23184 | (0, _classCallCheck3.default)(this, TreeItem);
|
23185 |
|
23186 | var _this = (0, _possibleConstructorReturn3.default)(this, _Component.call(this, props));
|
23187 |
|
23188 | _this.defaultProps = {
|
23189 | hiddenTip: false,
|
23190 | sideTip: false
|
23191 | };
|
23192 |
|
23193 | _this.handleClick = function (e) {
|
23194 | (0, _commonFunc.clearToolTipDom)();
|
23195 | e.stopPropagation();
|
23196 | var _this$props = _this.props,
|
23197 | itemClick = _this$props.itemClick,
|
23198 | data = _this$props.data;
|
23199 |
|
23200 | if (data.clickable == false) return false;
|
23201 | itemClick && itemClick(data, e);
|
23202 | };
|
23203 |
|
23204 | _this.handletoggle = function (e) {
|
23205 | e.stopPropagation();
|
23206 | var _this$props2 = _this.props,
|
23207 | treeData = _this$props2.treeData,
|
23208 | clickId = _this$props2.clickId,
|
23209 | async = _this$props2.async,
|
23210 | data = _this$props2.data,
|
23211 | getTreeData = _this$props2.getTreeData,
|
23212 | getTreeDataAPI = _this$props2.getTreeDataAPI,
|
23213 | hideLi = _this$props2.hideLi,
|
23214 | showLi = _this$props2.showLi;
|
23215 | var toggle = _this.state.toggle;
|
23216 |
|
23217 | var findLi = data.li;
|
23218 | if (data.li) {
|
23219 | var liSon = findLi.filter(function (child) {
|
23220 | var childLi = child.li;
|
23221 | if (childLi) {
|
23222 | return childLi.length > 0;
|
23223 | }
|
23224 | });
|
23225 | var findfromAll = treeData.findIndex(function (value, index, arr) {
|
23226 | return value.id == clickId;
|
23227 | });
|
23228 | var findResult = findLi.findIndex(function (value, index, arr) {
|
23229 | return value.id == clickId;
|
23230 | });
|
23231 | if (toggle == false && findResult == -1 && findfromAll == -1 || toggle == false && findResult != -1 || toggle == true && findResult == -1 && findfromAll == -1 || toggle == false && liSon.length != 0) {
|
23232 | hideLi();
|
23233 | } else {
|
23234 | showLi();
|
23235 | }
|
23236 | }
|
23237 | _this.setState({ toggle: !toggle, flag: false, hasClick: true }, _this.forceUpdate()); //防止快速点击两次发送多次请求
|
23238 | if (!data.li && _this.state.flag) getTreeData(data.id, async, getTreeDataAPI); //如果无子数据则请求
|
23239 | };
|
23240 |
|
23241 | _this.state = {
|
23242 | toggle: true,
|
23243 | flag: true,
|
23244 | hasClick: false
|
23245 | };
|
23246 | return _this;
|
23247 | }
|
23248 |
|
23249 | TreeItem.prototype.componentWillMount = function componentWillMount() {
|
23250 | var _props = this.props,
|
23251 | async = _props.async,
|
23252 | data = _props.data,
|
23253 | getTreeData = _props.getTreeData,
|
23254 | getTreeDataAPI = _props.getTreeDataAPI,
|
23255 | changeFetching = _props.changeFetching;
|
23256 |
|
23257 | var toggle = data.is_open ? false : true;
|
23258 | var getData = data.is_open;
|
23259 | if (getData && !data.li && this.state.flag) {
|
23260 | if (!window["getTree"][data.id]) changeFetching();
|
23261 | if (!window["getTree"][data.id]) getTreeData(data.id, async, getTreeDataAPI); //如果无子数据则请求
|
23262 | window["getTree"][data.id] = true;
|
23263 | }
|
23264 | this.setState({ flag: true, toggle: toggle });
|
23265 | };
|
23266 |
|
23267 | TreeItem.prototype.componentDidUpdate = function componentDidUpdate() {
|
23268 | var _props2 = this.props,
|
23269 | data = _props2.data,
|
23270 | changeTop = _props2.changeTop;
|
23271 |
|
23272 | if (this.state.hasClick) {
|
23273 | if (data.li) {
|
23274 | changeTop();
|
23275 | this.setState({ hasClick: false });
|
23276 | }
|
23277 | }
|
23278 | };
|
23279 |
|
23280 | TreeItem.prototype.render = function render() {
|
23281 | var _this2 = this;
|
23282 |
|
23283 | var toggle = this.state.toggle;
|
23284 | var _props3 = this.props,
|
23285 | data = _props3.data,
|
23286 | handleMouseOver = _props3.handleMouseOver,
|
23287 | hiddenTip = _props3.hiddenTip,
|
23288 | sideTip = _props3.sideTip;
|
23289 |
|
23290 | var iconTv = void 0,
|
23291 | disableClick = void 0;
|
23292 | disableClick = data.clickable == undefined ? false : data.clickable ? false : true;
|
23293 |
|
23294 | var filterData = data.li && data.li.map(function (data, index) {
|
23295 | return _react2.default.createElement(TreeItem, (0, _extends3.default)({}, _this2.props, { data: data, key: index }));
|
23296 | });
|
23297 |
|
23298 | var paddingLeft = parseInt(data.level) > 2 ? (parseInt(data.level) - 2) * 7 + 'px' : '0px';
|
23299 | if (data.has_child) iconTv = _react2.default.createElement('span', { className: 'icon-tv ' + (toggle ? "sys-icon-foldup" : "sys-icon-spread") + (parseInt(data.level) >= 2 && data.has_child ? ' has-child-icon ' : ' '), onClick: this.handletoggle });
|
23300 | var isFirstLevel = parseInt(data.level) != 1 ? "empty-child-text" : "empty-child-text-first";
|
23301 | var showTitle = (0, _commonFunc.decode)(data.name);
|
23302 | return _react2.default.createElement(
|
23303 | 'li',
|
23304 | { id: data.id, className: toggle ? '' : 'unfold', parentId: data.parentId, onClick: this.handleClick },
|
23305 | _react2.default.createElement(
|
23306 | 'div',
|
23307 | { style: { "paddingLeft": paddingLeft }, className: "title-tv " + (data.is_checked ? ' tree-li-active ' : ' '), onMouseOver: handleMouseOver },
|
23308 | iconTv,
|
23309 | _react2.default.createElement(
|
23310 | 'div',
|
23311 | { className: 'text_tv_parent' },
|
23312 | _react2.default.createElement(
|
23313 | _toolTip2.default,
|
23314 | { title: showTitle, hidden: hiddenTip, side: sideTip },
|
23315 | _react2.default.createElement(
|
23316 | 'div',
|
23317 | { className: "text_tv text_width " + (data.has_child ? '' : isFirstLevel),
|
23318 | style: { 'cursor': disableClick ? 'not-allowed' : '' }
|
23319 | },
|
23320 | showTitle
|
23321 | )
|
23322 | )
|
23323 | )
|
23324 | ),
|
23325 | _react2.default.createElement(
|
23326 | 'ul',
|
23327 | null,
|
23328 | filterData
|
23329 | )
|
23330 | );
|
23331 | };
|
23332 |
|
23333 | return TreeItem;
|
23334 | }(_react.Component);
|
23335 |
|
23336 | exports.default = TreeItem;
|
23337 | module.exports = exports['default'];
|
23338 |
|
23339 | /***/ }),
|
23340 | /* 251 */
|
23341 | /***/ (function(module, exports, __webpack_require__) {
|
23342 |
|
23343 | 'use strict';
|
23344 |
|
23345 | 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; }; }();
|
23346 |
|
23347 | var _react = __webpack_require__(86);
|
23348 |
|
23349 | var _react2 = _interopRequireDefault(_react);
|
23350 |
|
23351 | var _reactDom = __webpack_require__(243);
|
23352 |
|
23353 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
23354 |
|
23355 | var _commonFunc = __webpack_require__(252);
|
23356 |
|
23357 | __webpack_require__(253);
|
23358 |
|
23359 | var _toolTipEl = __webpack_require__(255);
|
23360 |
|
23361 | var _toolTipEl2 = _interopRequireDefault(_toolTipEl);
|
23362 |
|
23363 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
23364 |
|
23365 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
23366 |
|
23367 | 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; }
|
23368 |
|
23369 | 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; } /**
|
23370 | * Created by xiangjian on 2016/7/11.
|
23371 | */
|
23372 |
|
23373 |
|
23374 | var ToolTip = function (_Component) {
|
23375 | _inherits(ToolTip, _Component);
|
23376 |
|
23377 | function ToolTip(props, context) {
|
23378 | _classCallCheck(this, ToolTip);
|
23379 |
|
23380 | var _this = _possibleConstructorReturn(this, (ToolTip.__proto__ || Object.getPrototypeOf(ToolTip)).call(this, props, context));
|
23381 |
|
23382 | _this.getToolELSize = function (width, height) {
|
23383 | _this._toolWidth = width;
|
23384 | _this._toolHeight = height;
|
23385 | };
|
23386 |
|
23387 | _this.renderDom = function (style, arrowStyle, single) {
|
23388 | var wrapper = document.querySelector(".tooltip__wrapper");
|
23389 | var ToolTipContent = wrapper && wrapper.querySelector(".tooltip-inner");
|
23390 | var length = _this.isHaveHTMLTag() ? _this._toolWidth : _this.getTitleLength(_this.props.title); //获取title中内容的长度
|
23391 | if (ToolTipContent && ToolTipContent.style) {
|
23392 | ToolTipContent.style.maxWidth = length > 210 ? '600px' : '300px';
|
23393 | }
|
23394 | _reactDom2.default.unstable_renderSubtreeIntoContainer(_this, _react2.default.createElement(_toolTipEl2.default, { length: length, hidden: true, title: _this.props.title, single: single, tipsDes: _this.props.tipsDes, tipsReason: _this.props.tipsReason, htmlTag: _this.props.htmlTag, getToolELSize: _this.getToolELSize, style: {}, arrowStyle: {}, position: _this.state.position }), _this.hidden);
|
23395 | _reactDom2.default.unstable_renderSubtreeIntoContainer(_this, _react2.default.createElement(_toolTipEl2.default, { title: _this.props.title, single: single, tipsDes: _this.props.tipsDes, tipsReason: _this.props.tipsReason, htmlTag: _this.props.htmlTag, getToolELSize: _this.getToolELSize, style: style, arrowStyle: arrowStyle, position: _this.state.position }), _this.wrapper);
|
23396 | };
|
23397 |
|
23398 | _this.isHaveHTMLTag = function () {
|
23399 | var pattern = /(<br\s*\/>)/im;
|
23400 | var tips = _this.props.title;
|
23401 | if (_this.props.tipsReason) {
|
23402 | tips = _this.props.title + "<br/>" + _this.props.tipsDes + _this.props.tipsReason;
|
23403 | tips = _this.single ? _this.props.tipsReason : tips;
|
23404 | }
|
23405 | return pattern.test(tips);
|
23406 | };
|
23407 |
|
23408 | _this.state = { position: 'top' };
|
23409 | _this.handleMouseMove = _this.handleMouseMove.bind(_this);
|
23410 | _this.handleMouseOut = _this.handleMouseOut.bind(_this);
|
23411 | _this.handleClick = _this.handleClick.bind(_this);
|
23412 | _this.getToolTipPosition = _this.getToolTipPosition.bind(_this);
|
23413 | _this.getToolTipOffset = _this.getToolTipOffset.bind(_this);
|
23414 | _this.getToolTipArrowOffSet = _this.getToolTipArrowOffSet.bind(_this);
|
23415 | _this.getTitleLength = _this.getTitleLength.bind(_this);
|
23416 | _this.resetTipPosition = _this.resetTipPosition.bind(_this);
|
23417 | return _this;
|
23418 | }
|
23419 |
|
23420 | _createClass(ToolTip, [{
|
23421 | key: 'componentDidMount',
|
23422 | value: function componentDidMount() {
|
23423 | this.container = document.body;
|
23424 | var _dom = document.getElementsByClassName('tooltip__wrapper');
|
23425 | if (!_dom.length) {
|
23426 | this.wrapper = document.createElement('div');
|
23427 | this.wrapper.className = 'tooltip__wrapper';
|
23428 | this.container.appendChild(this.wrapper);
|
23429 | } else {
|
23430 | this.wrapper = _dom[0];
|
23431 | }
|
23432 |
|
23433 | var hidden = document.getElementsByClassName('tooltip__hidden');
|
23434 | if (!hidden.length) {
|
23435 | this.hidden = document.createElement('div');
|
23436 | this.hidden.className = 'tooltip__hidden';
|
23437 | this.container.appendChild(this.hidden);
|
23438 | } else {
|
23439 | this.hidden = hidden[0];
|
23440 | }
|
23441 |
|
23442 | //获取包裹的DOM元素
|
23443 | this.componentEl = _reactDom2.default.findDOMNode(this);
|
23444 | //在元素上绑定事件
|
23445 | this.componentEl && this.componentEl.addEventListener('mouseenter', this.handleMouseMove);
|
23446 | this.componentEl && this.componentEl.addEventListener('mouseleave', this.handleMouseOut);
|
23447 | this.componentEl && this.componentEl.addEventListener('click', this.handleClick);
|
23448 | }
|
23449 | }, {
|
23450 | key: 'componentWillUnmount',
|
23451 | value: function componentWillUnmount() {
|
23452 | this.componentEl && this.componentEl.removeEventListener('mouseenter', this.handleMouseMove);
|
23453 | this.componentEl && this.componentEl.removeEventListener('mouseleave', this.handleMouseOut);
|
23454 | this.componentEl && this.componentEl.removeEventListener('click', this.handleClick);
|
23455 | // this.container.removeChild(this.ToolTipEl);
|
23456 | // this.container.removeChild(this.ToolTipArrow);
|
23457 | }
|
23458 | }, {
|
23459 | key: 'componentWillReceiveProps',
|
23460 | value: function componentWillReceiveProps(nextProps) {
|
23461 | if (nextProps.title == '' && nextProps.alwaysShowTips == 'true') {
|
23462 | var tooltip = document.getElementsByClassName("tooltip");
|
23463 | if (tooltip && tooltip.length > 0 && this.wrapper && this.ToolTipEl && this.ToolTipArrow) {
|
23464 | this.ToolTipEl ? this.wrapper.removeChild(this.ToolTipEl) : null;
|
23465 | this.ToolTipArrow ? this.wrapper.removeChild(this.ToolTipArrow) : null;
|
23466 | }
|
23467 | }
|
23468 | }
|
23469 | }, {
|
23470 | key: 'handleMouseMove',
|
23471 | value: function handleMouseMove(e) {
|
23472 | // 当前内容宽度没有达到容器宽度,不渲染 tooltip
|
23473 | // 仅当内容为文本时判定,防止类似图标展示提示的情况被误判
|
23474 | // alwaysShowTips 为强制展示开关,供特殊情况使用
|
23475 | // if (!this.props.alwaysShowTips && e.currentTarget && e.currentTarget.scrollWidth <= e.currentTarget.clientWidth && e.currentTarget.innerText.length > 0) {
|
23476 | // return;
|
23477 | // }
|
23478 | this.single = true;
|
23479 |
|
23480 | var isEdge = navigator.userAgent.indexOf('Edge') > 0 ? true : false;
|
23481 | var isIe = "ActiveXObject" in window;
|
23482 |
|
23483 | var tempW = isEdge || isIe ? 1 : 0;
|
23484 |
|
23485 | // 增加了在 IE 下加 1px 判断的逻辑,因为在 IE 下取 scrollWidth 会始终比在其他浏览器下大 1px
|
23486 | if (e.target.className.indexOf('form-item__text') >= 0 && e.target.offsetHeight < e.target.scrollHeight) {
|
23487 | this.single = false;
|
23488 | } else if (!this.props.tipsReason && !this.props.alwaysShowTips && e.currentTarget && e.currentTarget.scrollWidth <= e.currentTarget.clientWidth + tempW && e.currentTarget.innerText.length > 0) {
|
23489 | return;
|
23490 | } else if (e.currentTarget && e.currentTarget.scrollWidth > e.currentTarget.clientWidth + tempW && e.currentTarget.innerText.length > 0) {
|
23491 | this.single = false;
|
23492 | }
|
23493 |
|
23494 | var hidden = this.props.hidden; //如果组件设置为隐藏或者没有提示内容,默认不显示ToolTip
|
23495 |
|
23496 | if (this.props.title === '' || hidden) {
|
23497 | return;
|
23498 | }
|
23499 | this.renderDom({}, {}, this.single);
|
23500 | _reactDom2.default.unmountComponentAtNode(this.wrapper);
|
23501 | this.ToolTipEl = document.createElement('div'); //创建ToolTip显示区域
|
23502 | this.ToolTipArrow = document.createElement('div'); //创建显示区域指向箭头
|
23503 | this.ToolTipArrow.className = 'tooltip-arrow';
|
23504 | this.ToolTipArrow.id = 'tooltip-arrow';
|
23505 | var ToolTipContent = document.createElement('div'); //创建提示内容显示区域
|
23506 | ToolTipContent.className = 'tooltip-inner';
|
23507 | // if(true) { //若为side,则会接受后台数据
|
23508 | var showHtmlTag = this.filterString(this.props.title);
|
23509 | var propsTitle = showHtmlTag ? this.props.title : (0, _commonFunc.encode)(this.props.title);
|
23510 | ToolTipContent.innerHTML = propsTitle;
|
23511 | // } else {
|
23512 | // ToolTipContent.textContent = this.props.title;
|
23513 | // }
|
23514 | var length = this.isHaveHTMLTag() ? this._toolWidth : this.getTitleLength(this.props.title); //获取title中内容的长度
|
23515 | if (length > 210) {
|
23516 | ToolTipContent.style.maxWidth = '600px';
|
23517 | } else {
|
23518 | ToolTipContent.style.maxWidth = '300px';
|
23519 | }
|
23520 | this.ToolTipEl.appendChild(ToolTipContent);
|
23521 | this.wrapper.appendChild(this.ToolTipEl);
|
23522 | this.wrapper.appendChild(this.ToolTipArrow);
|
23523 | var ToolTipElPosition = this.getToolTipPosition(e); //获取ToolTipEl的位置
|
23524 | var ToolTipElOffset = this.getToolTipOffset(); //获取ToolTipEl的偏移量
|
23525 | var ToolTipArrowOffSet = this.getToolTipArrowOffSet();
|
23526 | var ToolTipELeft = ToolTipElPosition.x + ToolTipElOffset.x;
|
23527 |
|
23528 | this.ToolTipEl.style.left = ToolTipELeft > 0 ? ToolTipELeft + 'px' : 0; //当提示框left值小于0时,重置为0
|
23529 | this.ToolTipEl.style.top = ToolTipElPosition.y + ToolTipElOffset.y + 'px';
|
23530 | this.ToolTipArrow.style.left = ToolTipElPosition.x - ToolTipArrowOffSet.x + 'px';
|
23531 | this.ToolTipArrow.style.top = ToolTipElPosition.y + ToolTipArrowOffSet.y + 'px';
|
23532 | this.ToolTipEl.className = 'tooltip ' + this.state.position;
|
23533 | this.ToolTipArrow.className = 'tooltip-arrow ' + this.state.position;
|
23534 | var arrowRight = document.getElementById('tooltip-arrow').style.left;
|
23535 | var arrowToRight = window.innerWidth - parseInt(arrowRight.split('p')[0]) - 5;
|
23536 | if (arrowToRight < ToolTipContent.offsetWidth / 2) {
|
23537 | var react = this.ToolTipEl.getClientRects()[0];
|
23538 | this.ToolTipEl.style.top = ToolTipElPosition.y - react.height - 4 + 'px';
|
23539 | }
|
23540 |
|
23541 | // repeat ----
|
23542 | if (window.scrollX || window.pageXOffsetX) {
|
23543 | ToolTipElPosition = this.getToolTipPosition(e); //获取ToolTipEl的位置
|
23544 | ToolTipElOffset = this.getToolTipOffset(); //获取ToolTipEl的偏移量
|
23545 | ToolTipArrowOffSet = this.getToolTipArrowOffSet();
|
23546 | ToolTipELeft = ToolTipElPosition.x + ToolTipElOffset.x;
|
23547 | this.ToolTipEl.style.left = ToolTipELeft > 0 ? ToolTipELeft + 'px' : 0; //当提示框left值小于0时,重置为0
|
23548 | this.ToolTipEl.style.top = ToolTipElPosition.y + ToolTipElOffset.y + 'px';
|
23549 | this.ToolTipArrow.style.left = ToolTipElPosition.x - ToolTipArrowOffSet.x + 'px';
|
23550 | this.ToolTipArrow.style.top = ToolTipElPosition.y + ToolTipArrowOffSet.y + 'px';
|
23551 | }
|
23552 | // -----
|
23553 | var ToolTipElRect = this.ToolTipEl.getBoundingClientRect();
|
23554 |
|
23555 | var tmpHeight = 5;
|
23556 | if (this.props.tipsReason && !this.single) {
|
23557 | tmpHeight = 35;
|
23558 | }
|
23559 |
|
23560 | if (ToolTipElRect.top > tmpHeight && this.props.tipsPosition !== 'bottom') {
|
23561 | //如果Tip向上显示的时候没有超过页面上边界,则正常显示
|
23562 | this.ToolTipEl.style.opacity = 1;
|
23563 | this.ToolTipArrow.style.opacity = 1;
|
23564 | } else {
|
23565 | //根据ToolTip的位置,若无法向上显示,则重新定义ToolTip的位置
|
23566 | this.setState({ position: 'bottom' });
|
23567 | var resetTipPosition = this.resetTipPosition();
|
23568 | var resetTipPositionLeft = resetTipPosition.ToolTipX + resetTipPosition.ToolTipOffsetX;
|
23569 | this.ToolTipEl.style.left = resetTipPositionLeft > 0 ? resetTipPositionLeft + 'px' : 0; //当提示框left值小于0时,重置为0
|
23570 | this.ToolTipEl.style.top = resetTipPosition.ToolTipY + resetTipPosition.ToolTipOffsetY + 'px';
|
23571 | this.ToolTipArrow.style.left = resetTipPosition.ToolTipX - resetTipPosition.ArrowX + 'px';
|
23572 | this.ToolTipArrow.style.top = resetTipPosition.ToolTipY + resetTipPosition.ArrowY + 'px';
|
23573 | this.ToolTipEl.style.opacity = 1;
|
23574 | this.ToolTipArrow.style.opacity = 1;
|
23575 | var realWidth = 'auto';
|
23576 | var hiddenDom = document.getElementsByClassName("tooltip__hidden")[0];
|
23577 | if (hiddenDom && hiddenDom.querySelector(".tooltip")) {
|
23578 | var tempWidth = hiddenDom.querySelector(".tooltip").clientWidth;
|
23579 | var domWidth = 300;
|
23580 | if (length > 210) {
|
23581 | realWidth = (tempWidth > 600 ? 600 : tempWidth) + 'px';
|
23582 | domWidth = tempWidth > 600 ? 600 : tempWidth;
|
23583 | } else {
|
23584 | realWidth = (tempWidth > 300 ? 300 : tempWidth) + 'px';
|
23585 | domWidth = tempWidth > 300 ? 300 : tempWidth;
|
23586 | }
|
23587 | }
|
23588 | this.ToolTipEl.style.width = realWidth;
|
23589 | if (window.scrollX > 0 && resetTipPositionLeft + domWidth > window.innerWidth + window.scrollX) {
|
23590 | this.ToolTipEl.style.left = resetTipPositionLeft - (resetTipPositionLeft + domWidth - (window.innerWidth + window.scrollX) + 10) + 'px';
|
23591 | } else if (window.scrollX == 0 && resetTipPositionLeft + domWidth > window.innerWidth) {
|
23592 | this.ToolTipEl.style.left = resetTipPositionLeft - (resetTipPositionLeft + domWidth - (window.innerWidth + window.scrollX) + 10) + 'px';
|
23593 | }
|
23594 | }
|
23595 | if (this.isHaveHTMLTag()) {
|
23596 | // this.ToolTipEl.style.opacity = 0;
|
23597 |
|
23598 |
|
23599 | var _style = {
|
23600 | left: this.ToolTipEl.style.left,
|
23601 | top: this.ToolTipEl.style.top,
|
23602 | opacity: 1
|
23603 | };
|
23604 | var arrowStyle = {
|
23605 | left: this.ToolTipArrow.style.left,
|
23606 | top: this.ToolTipArrow.style.top
|
23607 | };
|
23608 | this.wrapper.removeChild(this.ToolTipEl);
|
23609 | this.renderDom(_style, arrowStyle, this.single);
|
23610 | }
|
23611 | if (this.state.position == 'top' && this.props.tipsReason) {
|
23612 | var tieEL = document.getElementsByClassName("tooltip")[0];
|
23613 | var tieArrowEL = document.getElementsByClassName("tooltip-arrow")[0];
|
23614 | if (tieEL && tieEL.style) {
|
23615 | tieEL.style.top = tieArrowEL.getBoundingClientRect().top + +window.scrollY - tieEL.getBoundingClientRect().height + 5 + 'px';
|
23616 | }
|
23617 | }
|
23618 | }
|
23619 | }, {
|
23620 | key: 'componentDidUpdate',
|
23621 | value: function componentDidUpdate() {
|
23622 | var _props = this.props,
|
23623 | hidden = _props.hidden,
|
23624 | side = _props.side;
|
23625 |
|
23626 | if (this.props.title === '' || hidden) {
|
23627 | return;
|
23628 | }
|
23629 | if (this.ToolTipEl) {
|
23630 | this.ToolTipEl.className = 'tooltip ' + this.state.position;
|
23631 | this.ToolTipArrow.className = 'tooltip-arrow ' + this.state.position;
|
23632 | var tips = this.props.title;
|
23633 | if (this.props.tipsReason) {
|
23634 | tips = this.props.title + "<br/>" + this.props.tipsDes + this.props.tipsReason;
|
23635 | tips = this.single ? this.props.tipsReason : tips;
|
23636 | }
|
23637 | if (side) {
|
23638 | //依照后台传来的数据显示
|
23639 | this.ToolTipEl.childNodes[0].innerHTML = tips;
|
23640 | } else {
|
23641 | this.ToolTipEl.childNodes[0].textContent = tips;
|
23642 | }
|
23643 | } else {
|
23644 | return;
|
23645 | }
|
23646 | }
|
23647 | }, {
|
23648 | key: 'filterString',
|
23649 | value: function filterString(title) {
|
23650 | var showHtmlTag = false;
|
23651 | var htmlTag = ["<span>", "<p>", "</br>", "<br />", "<br/>"];
|
23652 | var _iteratorNormalCompletion = true;
|
23653 | var _didIteratorError = false;
|
23654 | var _iteratorError = undefined;
|
23655 |
|
23656 | try {
|
23657 | for (var _iterator = htmlTag[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
23658 | var i = _step.value;
|
23659 |
|
23660 | if (title.indexOf(i) !== -1) showHtmlTag = true;
|
23661 | }
|
23662 | } catch (err) {
|
23663 | _didIteratorError = true;
|
23664 | _iteratorError = err;
|
23665 | } finally {
|
23666 | try {
|
23667 | if (!_iteratorNormalCompletion && _iterator.return) {
|
23668 | _iterator.return();
|
23669 | }
|
23670 | } finally {
|
23671 | if (_didIteratorError) {
|
23672 | throw _iteratorError;
|
23673 | }
|
23674 | }
|
23675 | }
|
23676 |
|
23677 | return showHtmlTag;
|
23678 | }
|
23679 | }, {
|
23680 | key: 'resetTipPosition',
|
23681 | value: function resetTipPosition() {
|
23682 | var pointX = void 0;
|
23683 | var pointY = void 0;
|
23684 | var space = 5; //箭头的间距
|
23685 | var offsetX = 5; //箭头的偏移量 (箭头宽度的一半)
|
23686 | var offsetY = space;
|
23687 | var componentElRect = this.componentEl.getBoundingClientRect(); //获得组件的矩形区域位置
|
23688 | var componentElOffsetX = componentElRect.left;
|
23689 | var componentElOffsetY = componentElRect.top;
|
23690 | var componentElWidth = this.componentEl.offsetWidth; //获得componentEl对象的可见宽度
|
23691 | var componentElHeight = this.componentEl.offsetHeight;
|
23692 | var x1 = window.innerWidth; //浏览器可视宽度
|
23693 | var v = componentElOffsetX + componentElWidth < x1 ? 0 : componentElOffsetX + componentElWidth - x1;
|
23694 | var cOffsetX = (componentElWidth - v) / 2;
|
23695 | var cOffsetY = componentElHeight;
|
23696 | pointX = componentElOffsetX + cOffsetX + (window.scrollX || window.pageXOffset);
|
23697 | pointY = componentElOffsetY + cOffsetY + (window.scrollY || window.pageYOffset);
|
23698 | var _isHTML = this.isHaveHTMLTag();
|
23699 | var ToolTipElWidth = _isHTML ? this._toolWidth : this.ToolTipEl.offsetWidth;
|
23700 | var TipoffsetX = -(ToolTipElWidth / 2);
|
23701 | var TipoffsetY = space;
|
23702 | return {
|
23703 | ToolTipX: pointX,
|
23704 | ToolTipY: pointY,
|
23705 | ToolTipOffsetX: TipoffsetX,
|
23706 | ToolTipOffsetY: TipoffsetY,
|
23707 | ArrowX: offsetX,
|
23708 | ArrowY: offsetY
|
23709 | };
|
23710 | }
|
23711 | }, {
|
23712 | key: 'handleClick',
|
23713 | value: function handleClick(e) {
|
23714 | if (e.target.nodeName == "A") {
|
23715 | this.handleMouseOut(e);
|
23716 | }
|
23717 | }
|
23718 | }, {
|
23719 | key: 'handleMouseOut',
|
23720 | value: function handleMouseOut(e) {
|
23721 | var hidden = this.props.hidden;
|
23722 |
|
23723 | if (this.props.title === '' || hidden) {
|
23724 | return;
|
23725 | }
|
23726 | if (this.isHaveHTMLTag()) {
|
23727 | _reactDom2.default.unmountComponentAtNode(this.hidden);
|
23728 | _reactDom2.default.unmountComponentAtNode(this.wrapper);
|
23729 | }
|
23730 | var tooltip = document.getElementsByClassName("tooltip");
|
23731 | if (tooltip && tooltip.length > 0 && this.wrapper) {
|
23732 | this.ToolTipEl ? this.wrapper.removeChild(this.ToolTipEl) : null;
|
23733 | this.ToolTipArrow ? this.wrapper.removeChild(this.ToolTipArrow) : null;
|
23734 | }
|
23735 | }
|
23736 | }, {
|
23737 | key: 'getToolTipPosition',
|
23738 | value: function getToolTipPosition(e) {
|
23739 | var sta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
|
23740 | var side = this.props.side;
|
23741 |
|
23742 | var pointX = void 0;
|
23743 | var pointY = void 0;
|
23744 | //获取componentEl矩形对象
|
23745 | var componentElRect = this.componentEl.getBoundingClientRect();
|
23746 | var componentElOffsetX = componentElRect.left;
|
23747 | var componentElOffsetY = componentElRect.top;
|
23748 | var componentElWidth = this.componentEl.offsetWidth; //获得componentEl对象的可见宽度
|
23749 | var componentElHeight = this.componentEl.offsetHeight;
|
23750 | var cOffsetX = 0;
|
23751 | var cOffsetY = 0;
|
23752 | var x = window.innerWidth; //浏览器可视宽度
|
23753 | var y = +componentElRect.left;
|
23754 | var v = componentElOffsetX + componentElWidth < x ? 0 : componentElOffsetX + componentElWidth - x;
|
23755 | //浏览器拉伸变换时,当遮挡元素时,用以重新计算OffsetX
|
23756 | this.setState({ position: sta });
|
23757 | if (side) {
|
23758 | if (x / 2 - y < 0) {
|
23759 | this.setState({ position: 'left' });
|
23760 | } else {
|
23761 | this.setState({ position: 'right' });
|
23762 | }
|
23763 | }
|
23764 | //当side为true时,判断元素在页面中的位置若在页面中间的右边,则toolTip显示在左,否则在右
|
23765 | if (side) {
|
23766 | //如果需要显示在两边
|
23767 | switch (this.state.position) {
|
23768 | case 'right':
|
23769 | cOffsetX = componentElWidth;
|
23770 | cOffsetY = componentElHeight / 2;
|
23771 | break;
|
23772 | case 'left':
|
23773 | cOffsetX = 0;
|
23774 | cOffsetY = componentElHeight / 2;
|
23775 | break;
|
23776 | default:
|
23777 | break;
|
23778 | }
|
23779 | } else {
|
23780 | switch (this.state.position) {
|
23781 | case 'top':
|
23782 | cOffsetX = (componentElWidth - v) / 2;
|
23783 | cOffsetY = 0;
|
23784 | break;
|
23785 | case 'bottom':
|
23786 | cOffsetX = (componentElWidth - v) / 2;
|
23787 | cOffsetY = componentElHeight;
|
23788 | break;
|
23789 | default:
|
23790 | break;
|
23791 | }
|
23792 | }
|
23793 | pointX = componentElOffsetX + cOffsetX + (window.scrollX || window.pageXOffset);
|
23794 | pointY = componentElOffsetY + cOffsetY + (window.scrollY || window.pageYOffset);
|
23795 | return {
|
23796 | x: pointX,
|
23797 | y: pointY
|
23798 | };
|
23799 | }
|
23800 | }, {
|
23801 | key: 'getToolTipArrowOffSet',
|
23802 | value: function getToolTipArrowOffSet() {
|
23803 | var offsetX = void 0;
|
23804 | var offsetY = void 0;
|
23805 | var space = 5;
|
23806 | var side = this.props.side;
|
23807 |
|
23808 | if (side) {
|
23809 | switch (this.state.position) {
|
23810 | case 'right':
|
23811 | offsetX = -space;
|
23812 | offsetY = -5;
|
23813 | break;
|
23814 | case 'left':
|
23815 | offsetX = space + 5;
|
23816 | offsetY = -5;
|
23817 | break;
|
23818 | default:
|
23819 | break;
|
23820 | }
|
23821 | } else {
|
23822 | switch (this.state.position) {
|
23823 | case 'top':
|
23824 | offsetX = 5; //箭头的宽度的一半
|
23825 | offsetY = -(space + 5); //space+箭头高度
|
23826 | break;
|
23827 | case 'bottom':
|
23828 | offsetX = 5;
|
23829 | offsetY = space;
|
23830 | break;
|
23831 | default:
|
23832 | break;
|
23833 | }
|
23834 | }
|
23835 | return {
|
23836 | x: offsetX,
|
23837 | y: offsetY
|
23838 | };
|
23839 | }
|
23840 | }, {
|
23841 | key: 'getToolTipOffset',
|
23842 | value: function getToolTipOffset() {
|
23843 | var offsetX = void 0;
|
23844 | var offsetY = void 0;
|
23845 | var _isHTML = this.isHaveHTMLTag();
|
23846 | var ToolTipElWidth = _isHTML ? this._toolWidth : this.ToolTipEl.offsetWidth;
|
23847 | var ToolTipElHeight = _isHTML ? this._toolHeight : this.ToolTipEl.offsetHeight;
|
23848 | var space = 5;
|
23849 | var side = this.props.side;
|
23850 |
|
23851 | if (side) {
|
23852 | //如果需要左右滑动
|
23853 | switch (this.state.position) {
|
23854 | case 'right':
|
23855 | offsetX = space;
|
23856 | offsetY = -(ToolTipElHeight / 2);
|
23857 | break;
|
23858 | case 'left':
|
23859 | offsetX = -(ToolTipElWidth + 5); //控制向左的偏移量
|
23860 | offsetY = -(ToolTipElHeight / 2);
|
23861 | break;
|
23862 | default:
|
23863 | break;
|
23864 | }
|
23865 | } else {
|
23866 | switch (this.state.position) {
|
23867 | case 'top':
|
23868 | offsetX = -(ToolTipElWidth / 2);
|
23869 | offsetY = -(ToolTipElHeight + space);
|
23870 | break;
|
23871 | case 'bottom':
|
23872 | offsetX = -(ToolTipElWidth / 2);
|
23873 | offsetY = space;
|
23874 | break;
|
23875 | default:
|
23876 | break;
|
23877 | }
|
23878 | }
|
23879 | return {
|
23880 | x: offsetX,
|
23881 | y: offsetY
|
23882 | };
|
23883 | }
|
23884 | }, {
|
23885 | key: 'getTitleLength',
|
23886 | value: function getTitleLength(str) {
|
23887 | var len = 0;
|
23888 | for (var i = 0; i < str.length; i++) {
|
23889 | var charCode = str.charCodeAt(i);
|
23890 | if (charCode >= 0 && charCode <= 128) len += 1;else len += 2;
|
23891 | }
|
23892 | return len;
|
23893 | }
|
23894 | }, {
|
23895 | key: '_isObj',
|
23896 | value: function _isObj(obj) {
|
23897 | return Object.prototype.toString.call(obj) === '[object Object]';
|
23898 | }
|
23899 | }, {
|
23900 | key: 'render',
|
23901 | value: function render() {
|
23902 | var content = this.props.children;
|
23903 | if (this._isObj(content)) {
|
23904 | return content;
|
23905 | } else {
|
23906 | return null;
|
23907 | }
|
23908 | }
|
23909 | }]);
|
23910 |
|
23911 | return ToolTip;
|
23912 | }(_react.Component);
|
23913 |
|
23914 | ToolTip.defaultProps = {
|
23915 | container: document.body,
|
23916 | space: 5, //提示箭头与文字内容热区的距离
|
23917 | tipsDes: "说明:"
|
23918 | };
|
23919 |
|
23920 | module.exports = ToolTip;
|
23921 |
|
23922 | /***/ }),
|
23923 | /* 252 */
|
23924 | /***/ (function(module, exports, __webpack_require__) {
|
23925 |
|
23926 | 'use strict';
|
23927 |
|
23928 | Object.defineProperty(exports, "__esModule", {
|
23929 | value: true
|
23930 | });
|
23931 | exports.removeResizeListener = exports.addResizeListener = undefined;
|
23932 |
|
23933 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* eslint-disable */
|
23934 |
|
23935 |
|
23936 | exports.clearToolTipDom = clearToolTipDom;
|
23937 | exports.uid = uid;
|
23938 | exports.judgeBrowser = judgeBrowser;
|
23939 | exports.judgeSys = judgeSys;
|
23940 | exports.contains = contains;
|
23941 | exports.createDom = createDom;
|
23942 | exports.getHeightLight = getHeightLight;
|
23943 | exports.deepClone = deepClone;
|
23944 | exports.transferData = transferData;
|
23945 | exports.encode = encode;
|
23946 | exports.decode = decode;
|
23947 |
|
23948 | var _react = __webpack_require__(86);
|
23949 |
|
23950 | var _react2 = _interopRequireDefault(_react);
|
23951 |
|
23952 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
23953 |
|
23954 | function clearToolTipDom() {
|
23955 | var dom_1 = document.getElementsByClassName('tooltip')[0];
|
23956 | var dom_2 = document.getElementsByClassName('tooltip-arrow')[0];
|
23957 | if (dom_1 && dom_2) {
|
23958 | var parNode = dom_1.parentNode;
|
23959 | parNode.removeChild(dom_1);
|
23960 | parNode.removeChild(dom_2);
|
23961 | }
|
23962 | }
|
23963 |
|
23964 | function uid(flag) {
|
23965 | var now = +new Date();
|
23966 | return flag + ('-' + now);
|
23967 | }
|
23968 |
|
23969 | function judgeBrowser() {
|
23970 | var userAgent = navigator.userAgent;
|
23971 | var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
|
23972 | reIE.test(userAgent);
|
23973 | var fIEVersion = parseFloat(RegExp["$1"]);
|
23974 | var browser = {
|
23975 | isEdge: /Edge/.test(userAgent),
|
23976 | isOpera: /Opera/.test(userAgent),
|
23977 | isFirefox: /Firefox/.test(userAgent),
|
23978 | isBaidu: /bidubrowser/.test(userAgent),
|
23979 | isSougo: /metasr/.test(userAgent),
|
23980 | is360: /360se/.test(userAgent),
|
23981 | isUc: /ucweb/.test(userAgent),
|
23982 | isLB: /lbbrowser/.test(userAgent),
|
23983 | isWX: /micromessenger/.test(userAgent),
|
23984 | isQQ: /qqbrowser/.test(userAgent),
|
23985 | isChrome: userAgent.indexOf("Chrome") > -1 && userAgent.indexOf("Safari") > -1,
|
23986 | isSafari: userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") == -1,
|
23987 | isIe: !!window.ActiveXObject || "ActiveXObject" in window,
|
23988 | isIe7: fIEVersion == 7,
|
23989 | isIe8: fIEVersion == 8,
|
23990 | isIe9: fIEVersion == 9,
|
23991 | isIe10: fIEVersion == 10,
|
23992 | isIe11: fIEVersion == 11
|
23993 | };
|
23994 | return browser;
|
23995 | }
|
23996 |
|
23997 | function judgeSys() {
|
23998 | var userAgent = navigator.userAgent;
|
23999 | var browser = {
|
24000 | isMac: /Mac OS/.test(userAgent),
|
24001 | isIpad: /ipad/.test(userAgent),
|
24002 | isIphone: /iphone os/.test(userAgent),
|
24003 | isAndroid: /android/.test(userAgent),
|
24004 | isWindowsCe: /windows ce/.test(userAgent),
|
24005 | isWindowsMobile: /windows mobile/.test(userAgent),
|
24006 | isWin2K: /windows nt 5.0/.test(userAgent),
|
24007 | isXP: /windows nt 5.1/.test(userAgent),
|
24008 | isVista: /windows nt 6.0/.test(userAgent),
|
24009 | isWin7: /windows nt 6.1/.test(userAgent),
|
24010 | isWin8: /windows nt 6.2/.test(userAgent),
|
24011 | isWin81: /windows nt 6.3/.test(userAgent),
|
24012 | isWin10: /"Windows NT 10.0/.test(userAgent)
|
24013 | };
|
24014 | return browser;
|
24015 | }
|
24016 |
|
24017 | // 判断n 元素是否是 root中的子元素
|
24018 | function contains(root, n) {
|
24019 | var node = n;
|
24020 | while (node) {
|
24021 | if (node === root) {
|
24022 | return true;
|
24023 | }
|
24024 | node = node.parentNode;
|
24025 | }
|
24026 |
|
24027 | return false;
|
24028 | }
|
24029 |
|
24030 | /* Modified from https://github.com/sdecima/javascript-detect-element-resize
|
24031 | * version: 0.5.3
|
24032 | *
|
24033 | * The MIT License (MIT)
|
24034 | *
|
24035 | * Copyright (c) 2013 Sebastián Décima
|
24036 | *
|
24037 | * Permission is hereby granted, free of charge, to any person obtaining a copy of
|
24038 | * this software and associated documentation files (the "Software"), to deal in
|
24039 | * the Software without restriction, including without limitation the rights to
|
24040 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
24041 | * the Software, and to permit persons to whom the Software is furnished to do so,
|
24042 | * subject to the following conditions:
|
24043 | *
|
24044 | * The above copyright notice and this permission notice shall be included in all
|
24045 | * copies or substantial portions of the Software.
|
24046 | *
|
24047 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
24048 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
24049 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
24050 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
24051 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
24052 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
24053 | *
|
24054 | */
|
24055 | /* eslint-disable */
|
24056 | var isServer = typeof window === 'undefined';
|
24057 |
|
24058 | /* istanbul ignore next */
|
24059 | var requestFrame = function () {
|
24060 | if (isServer) return;
|
24061 | var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (fn) {
|
24062 | return window.setTimeout(fn, 20);
|
24063 | };
|
24064 | return function (fn) {
|
24065 | return raf(fn);
|
24066 | };
|
24067 | }();
|
24068 |
|
24069 | /* istanbul ignore next */
|
24070 | var cancelFrame = function () {
|
24071 | if (isServer) return;
|
24072 | var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;
|
24073 | return function (id) {
|
24074 | return cancel(id);
|
24075 | };
|
24076 | }();
|
24077 |
|
24078 | /* istanbul ignore next */
|
24079 | var resetTrigger = function resetTrigger(element) {
|
24080 | var trigger = element.__resizeTrigger__;
|
24081 | var expand = trigger.firstElementChild;
|
24082 | var contract = trigger.lastElementChild;
|
24083 | var expandChild = expand.firstElementChild;
|
24084 |
|
24085 | contract.scrollLeft = contract.scrollWidth;
|
24086 | contract.scrollTop = contract.scrollHeight;
|
24087 | expandChild.style.width = expand.offsetWidth + 1 + 'px';
|
24088 | expandChild.style.height = expand.offsetHeight + 1 + 'px';
|
24089 | expand.scrollLeft = expand.scrollWidth;
|
24090 | expand.scrollTop = expand.scrollHeight;
|
24091 | };
|
24092 |
|
24093 | /* istanbul ignore next */
|
24094 | var checkTriggers = function checkTriggers(element) {
|
24095 | return element.offsetWidth !== element.__resizeLast__.width || element.offsetHeight !== element.__resizeLast__.height;
|
24096 | };
|
24097 |
|
24098 | /* istanbul ignore next */
|
24099 | var scrollListener = function scrollListener(event) {
|
24100 | var _this = this;
|
24101 |
|
24102 | resetTrigger(this);
|
24103 | if (this.__resizeRAF__) cancelFrame(this.__resizeRAF__);
|
24104 | this.__resizeRAF__ = requestFrame(function () {
|
24105 | if (checkTriggers(_this)) {
|
24106 | _this.__resizeLast__.width = _this.offsetWidth;
|
24107 | _this.__resizeLast__.height = _this.offsetHeight;
|
24108 | _this.__resizeListeners__.forEach(function (fn) {
|
24109 | fn.call(_this, event);
|
24110 | });
|
24111 | }
|
24112 | });
|
24113 | };
|
24114 |
|
24115 | /* Detect CSS Animations support to detect element display/re-attach */
|
24116 | var attachEvent = isServer ? {} : document.attachEvent;
|
24117 | var DOM_PREFIXES = 'Webkit Moz O ms'.split(' ');
|
24118 | var START_EVENTS = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' ');
|
24119 | var RESIZE_ANIMATION_NAME = 'resizeanim';
|
24120 | var animation = false;
|
24121 | var keyFramePrefix = '';
|
24122 | var animationStartEvent = 'animationstart';
|
24123 |
|
24124 | /* istanbul ignore next */
|
24125 | if (!attachEvent && !isServer) {
|
24126 | var testElement = document.createElement('fakeelement');
|
24127 | if (testElement.style.animationName !== undefined) {
|
24128 | animation = true;
|
24129 | }
|
24130 |
|
24131 | if (animation === false) {
|
24132 | var prefix = '';
|
24133 | for (var i = 0; i < DOM_PREFIXES.length; i++) {
|
24134 | if (testElement.style[DOM_PREFIXES[i] + 'AnimationName'] !== undefined) {
|
24135 | prefix = DOM_PREFIXES[i];
|
24136 | keyFramePrefix = '-' + prefix.toLowerCase() + '-';
|
24137 | animationStartEvent = START_EVENTS[i];
|
24138 | animation = true;
|
24139 | break;
|
24140 | }
|
24141 | }
|
24142 | }
|
24143 | }
|
24144 |
|
24145 | var stylesCreated = false;
|
24146 | /* istanbul ignore next */
|
24147 | var createStyles = function createStyles() {
|
24148 | if (!stylesCreated && !isServer) {
|
24149 | var animationKeyframes = '@' + keyFramePrefix + 'keyframes ' + RESIZE_ANIMATION_NAME + ' { from { opacity: 0; } to { opacity: 0; } } ';
|
24150 | var animationStyle = keyFramePrefix + 'animation: 1ms ' + RESIZE_ANIMATION_NAME + ';';
|
24151 |
|
24152 | // opacity: 0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
|
24153 | var css = animationKeyframes + '\n .resize-triggers { ' + animationStyle + ' visibility: hidden; opacity: 0; }\n .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1 }\n .resize-triggers > div { background: #eee; overflow: auto; }\n .contract-trigger:before { width: 200%; height: 200%; }';
|
24154 |
|
24155 | var head = document.head || document.getElementsByTagName('head')[0];
|
24156 | var style = document.createElement('style');
|
24157 |
|
24158 | style.type = 'text/css';
|
24159 | if (style.styleSheet) {
|
24160 | style.styleSheet.cssText = css;
|
24161 | } else {
|
24162 | style.appendChild(document.createTextNode(css));
|
24163 | }
|
24164 |
|
24165 | head.appendChild(style);
|
24166 | stylesCreated = true;
|
24167 | }
|
24168 | };
|
24169 |
|
24170 | /* istanbul ignore next */
|
24171 | var addResizeListener = exports.addResizeListener = function addResizeListener(element, fn) {
|
24172 | if (isServer) return;
|
24173 | if (attachEvent) {
|
24174 | element.attachEvent('onresize', fn);
|
24175 | } else {
|
24176 | if (!element.__resizeTrigger__) {
|
24177 | if (getComputedStyle(element).position === 'static') {
|
24178 | element.style.position = 'relative';
|
24179 | }
|
24180 | createStyles();
|
24181 | element.__resizeLast__ = {};
|
24182 | element.__resizeListeners__ = [];
|
24183 |
|
24184 | var resizeTrigger = element.__resizeTrigger__ = document.createElement('div');
|
24185 | resizeTrigger.className = 'resize-triggers';
|
24186 | resizeTrigger.innerHTML = '<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>';
|
24187 | element.appendChild(resizeTrigger);
|
24188 |
|
24189 | resetTrigger(element);
|
24190 | element.addEventListener('scroll', scrollListener, true);
|
24191 |
|
24192 | /* Listen for a css animation to detect element display/re-attach */
|
24193 | if (animationStartEvent) {
|
24194 | resizeTrigger.addEventListener(animationStartEvent, function (event) {
|
24195 | if (event.animationName === RESIZE_ANIMATION_NAME) {
|
24196 | resetTrigger(element);
|
24197 | }
|
24198 | });
|
24199 | }
|
24200 | }
|
24201 | element.__resizeListeners__.push(fn);
|
24202 | }
|
24203 | };
|
24204 |
|
24205 | /* istanbul ignore next */
|
24206 | var removeResizeListener = exports.removeResizeListener = function removeResizeListener(element, fn) {
|
24207 | if (attachEvent) {
|
24208 | element.detachEvent('onresize', fn);
|
24209 | } else {
|
24210 | element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
|
24211 | if (!element.__resizeListeners__.length) {
|
24212 | element.removeEventListener('scroll', scrollListener);
|
24213 | element.__resizeTrigger__ = !element.removeChild(element.__resizeTrigger__);
|
24214 | }
|
24215 | }
|
24216 | };
|
24217 |
|
24218 | // 创建挂载容器
|
24219 | function createDom(id) {
|
24220 | if (document.getElementById(id)) return;
|
24221 | var oDiv = document.createElement('div');
|
24222 | oDiv.id = id;
|
24223 | document.body.appendChild(oDiv);
|
24224 | }
|
24225 |
|
24226 | function getHeightLight(searchval, text, notCaseSensitive) {
|
24227 | var str = [];
|
24228 | if (searchval.length > 0) {
|
24229 | //获取搜索字符在字段中的位置,分两种 1.首位(index==0) 2.非首位
|
24230 | var index = notCaseSensitive ? text.toLowerCase().indexOf(searchval.toLowerCase()) : text.indexOf(searchval);
|
24231 | var valueLength = searchval.length;
|
24232 |
|
24233 | if (index == 0) {
|
24234 | str.beforeText = "";
|
24235 | var subValue = text.substring(index, valueLength);
|
24236 | str.searchContent = _react2.default.createElement(
|
24237 | 'em',
|
24238 | null,
|
24239 | subValue
|
24240 | );
|
24241 | str.lastext = text.substring(valueLength, text.length);
|
24242 | } else if (index > 0) {
|
24243 | str.beforeText = text.substring(0, index);
|
24244 | var _subValue = text.substring(index, valueLength + index);
|
24245 | str.searchContent = _react2.default.createElement(
|
24246 | 'em',
|
24247 | null,
|
24248 | _subValue
|
24249 | );
|
24250 | str.lastext = text.substring(valueLength + index, text.length);
|
24251 | } else {
|
24252 | str.beforeText = "";
|
24253 | str.searchContent = "";
|
24254 | str.lastext = text;
|
24255 | }
|
24256 | } else {
|
24257 | str.beforeText = "";
|
24258 | str.searchContent = "";
|
24259 | str.lastext = text;
|
24260 | }
|
24261 | return str;
|
24262 | }
|
24263 |
|
24264 | function deepClone(item) {
|
24265 | if (!item) return item;
|
24266 | var types = [Number, String, Boolean],
|
24267 | result;
|
24268 | types.forEach(function (type) {
|
24269 | if (item instanceof type) {
|
24270 | result = type(item);
|
24271 | }
|
24272 | });
|
24273 |
|
24274 | if (typeof result == "undefined") {
|
24275 | if (Object.prototype.toString.call(item) === "[object Array]") {
|
24276 | result = [];
|
24277 | item.forEach(function (child, index, array) {
|
24278 | result[index] = deepClone(child);
|
24279 | });
|
24280 | } else if ((typeof item === 'undefined' ? 'undefined' : _typeof(item)) == "object") {
|
24281 | if (item.nodeType && typeof item.cloneNode == "function") {
|
24282 | result = item.cloneNode(true);
|
24283 | } else if (!item.prototype) {
|
24284 | if (item instanceof Date) {
|
24285 | result = new Date(item);
|
24286 | } else {
|
24287 | result = {};
|
24288 | for (var i in item) {
|
24289 | result[i] = deepClone(item[i]);
|
24290 | }
|
24291 | }
|
24292 | } else {
|
24293 | result = item;
|
24294 | }
|
24295 | } else {
|
24296 | result = item;
|
24297 | }
|
24298 | }
|
24299 | return result;
|
24300 | }
|
24301 |
|
24302 | function transferData(data) {
|
24303 | var filter = [],
|
24304 | getData = {},
|
24305 | self = this;
|
24306 |
|
24307 | for (var _i in data) {
|
24308 | if (data[_i] != undefined) getData[data[_i]["id"]] = data[_i];
|
24309 | }
|
24310 | for (var j in data) {
|
24311 | if (data[j]) {
|
24312 | var item = data[j],
|
24313 | temp = getData[item["pid"]];
|
24314 | if (temp && temp.id != temp.pid) {
|
24315 | !temp["li"] && (temp["li"] = []);
|
24316 | temp["li"].push(item);
|
24317 | } else {
|
24318 | filter.push(item);
|
24319 | }
|
24320 | }
|
24321 | }
|
24322 | return filter;
|
24323 | }
|
24324 |
|
24325 | function encode(str) {
|
24326 | if (!str || typeof str != 'string') {
|
24327 | return str;
|
24328 | }
|
24329 | str = str.toString();
|
24330 | return str.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>');
|
24331 | }
|
24332 |
|
24333 | function decode(str) {
|
24334 | if (!str || typeof str != 'string') {
|
24335 | return str;
|
24336 | }
|
24337 | str = str.toString();
|
24338 | return str.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
|
24339 | }
|
24340 |
|
24341 | /***/ }),
|
24342 | /* 253 */
|
24343 | /***/ (function(module, exports, __webpack_require__) {
|
24344 |
|
24345 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
24346 |
|
24347 | // load the styles
|
24348 | var content = __webpack_require__(254);
|
24349 | if(typeof content === 'string') content = [[module.id, content, '']];
|
24350 | // add the styles to the DOM
|
24351 | var update = __webpack_require__(248)(content, {});
|
24352 | if(content.locals) module.exports = content.locals;
|
24353 | // Hot Module Replacement
|
24354 | if(false) {
|
24355 | // When the styles change, update the <style> tags
|
24356 | if(!content.locals) {
|
24357 | module.hot.accept("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss", function() {
|
24358 | var newContent = require("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss");
|
24359 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
24360 | update(newContent);
|
24361 | });
|
24362 | }
|
24363 | // When the module is disposed, remove the <style> tags
|
24364 | module.hot.dispose(function() { update(); });
|
24365 | }
|
24366 |
|
24367 | /***/ }),
|
24368 | /* 254 */
|
24369 | /***/ (function(module, exports, __webpack_require__) {
|
24370 |
|
24371 | exports = module.exports = __webpack_require__(246)();
|
24372 | // imports
|
24373 |
|
24374 |
|
24375 | // module
|
24376 | exports.push([module.id, ".tooltip__hidden {\n visibility: hidden;\n position: absolute;\n width: 100%;\n top: 0;\n left: 0;\n z-index: -10; }\n\n.tooltip {\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n line-height: 20px;\n z-index: 999999999;\n display: block;\n position: absolute;\n letter-spacing: normal;\n line-break: auto;\n text-align: left;\n text-decoration: none;\n word-break: break-all;\n word-spacing: normal;\n width: auto; }\n .tooltip.top {\n padding: 5px 0; }\n .tooltip.bottom {\n padding: 5px 0; }\n .tooltip.right {\n padding: 0 5px; }\n .tooltip.left {\n padding: 0 5px; }\n .tooltip .tooltip-inner {\n padding: 5px 10px;\n color: #f5f8fa;\n text-align: left;\n background-color: #36434d;\n border-radius: 2px;\n max-width: 600px; }\n\n.tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n z-index: 999999999; }\n .tooltip-arrow.top {\n border-left: 5px solid transparent;\n border-right: 5px solid transparent;\n border-top: 5px solid #36434d; }\n .tooltip-arrow.bottom {\n border-left: 5px solid transparent;\n border-right: 5px solid transparent;\n border-bottom: 5px solid #36434d; }\n .tooltip-arrow.right {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n border-right: 5px solid #36434d; }\n .tooltip-arrow.left {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n border-left: 5px solid #36434d; }\n", ""]);
|
24377 |
|
24378 | // exports
|
24379 |
|
24380 |
|
24381 | /***/ }),
|
24382 | /* 255 */
|
24383 | /***/ (function(module, exports, __webpack_require__) {
|
24384 |
|
24385 | 'use strict';
|
24386 |
|
24387 | 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; }; }();
|
24388 |
|
24389 | var _react = __webpack_require__(86);
|
24390 |
|
24391 | var _react2 = _interopRequireDefault(_react);
|
24392 |
|
24393 | var _reactDom = __webpack_require__(243);
|
24394 |
|
24395 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
24396 |
|
24397 | var _commonFunc = __webpack_require__(252);
|
24398 |
|
24399 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
24400 |
|
24401 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
24402 |
|
24403 | 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; }
|
24404 |
|
24405 | 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; }
|
24406 |
|
24407 | var ToolTipEl = function (_Component) {
|
24408 | _inherits(ToolTipEl, _Component);
|
24409 |
|
24410 | function ToolTipEl(props) {
|
24411 | _classCallCheck(this, ToolTipEl);
|
24412 |
|
24413 | return _possibleConstructorReturn(this, (ToolTipEl.__proto__ || Object.getPrototypeOf(ToolTipEl)).call(this, props));
|
24414 | }
|
24415 |
|
24416 | _createClass(ToolTipEl, [{
|
24417 | key: 'filterString',
|
24418 | value: function filterString(title) {
|
24419 | var showHtmlTag = false;
|
24420 | var htmlTag = ["<span>", "<p>", "</br>", "<br />", "<br/>"].concat(this.props.htmlTag);
|
24421 | var _iteratorNormalCompletion = true;
|
24422 | var _didIteratorError = false;
|
24423 | var _iteratorError = undefined;
|
24424 |
|
24425 | try {
|
24426 | for (var _iterator = htmlTag[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
24427 | var i = _step.value;
|
24428 |
|
24429 | if (title && title.indexOf(i) !== -1) showHtmlTag = true;
|
24430 | }
|
24431 | } catch (err) {
|
24432 | _didIteratorError = true;
|
24433 | _iteratorError = err;
|
24434 | } finally {
|
24435 | try {
|
24436 | if (!_iteratorNormalCompletion && _iterator.return) {
|
24437 | _iterator.return();
|
24438 | }
|
24439 | } finally {
|
24440 | if (_didIteratorError) {
|
24441 | throw _iteratorError;
|
24442 | }
|
24443 | }
|
24444 | }
|
24445 |
|
24446 | return showHtmlTag;
|
24447 | }
|
24448 | }, {
|
24449 | key: 'render',
|
24450 | value: function render() {
|
24451 | var tips = this.props.title;
|
24452 | if (this.props.tipsReason) {
|
24453 | tips = this.props.title + "<br/>" + this.props.tipsDes + this.props.tipsReason;
|
24454 | tips = this.props.single ? this.props.tipsReason : tips;
|
24455 | }
|
24456 | var showHtmlTag = this.filterString(tips);
|
24457 | var _html = {
|
24458 | __html: tips
|
24459 | };
|
24460 | if (!this.props.hidden) {
|
24461 | var realWidth = { 'width': 'auto' };
|
24462 | var hiddenDom = document.getElementsByClassName("tooltip__hidden")[0];
|
24463 | if (hiddenDom && hiddenDom.querySelector(".tooltip") && this.props.position == 'bottom') {
|
24464 | realWidth = {
|
24465 | 'width': hiddenDom.querySelector(".tooltip").clientWidth + 'px'
|
24466 | };
|
24467 | }
|
24468 | var assignStyle = Object.assign({}, realWidth, this.props.style);
|
24469 | }
|
24470 | return _react2.default.createElement(
|
24471 | 'div',
|
24472 | null,
|
24473 | _react2.default.createElement(
|
24474 | 'div',
|
24475 | { ref: 'tooltiptip', className: "tooltip " + this.props.position, style: this.props.hidden ? this.props.style : assignStyle },
|
24476 | showHtmlTag ? _react2.default.createElement('div', { className: 'tooltip-inner', dangerouslySetInnerHTML: _html }) : _react2.default.createElement(
|
24477 | 'div',
|
24478 | { className: 'tooltip-inner' },
|
24479 | (0, _commonFunc.encode)(tips)
|
24480 | )
|
24481 | ),
|
24482 | _react2.default.createElement('div', { className: "tooltip-arrow " + this.props.position, id: 'tooltip-arrow', style: this.props.arrowStyle })
|
24483 | );
|
24484 | }
|
24485 | }, {
|
24486 | key: 'componentDidMount',
|
24487 | value: function componentDidMount() {
|
24488 | var _dom = _reactDom2.default.findDOMNode(this.refs.tooltiptip);
|
24489 | this.props.getToolELSize(_dom.offsetWidth, _dom.offsetHeight);
|
24490 | }
|
24491 | }, {
|
24492 | key: 'componentDidUpdate',
|
24493 | value: function componentDidUpdate() {
|
24494 | this.componentDidMount();
|
24495 | }
|
24496 | }]);
|
24497 |
|
24498 | return ToolTipEl;
|
24499 | }(_react.Component);
|
24500 |
|
24501 | ToolTipEl.defaultProps = {
|
24502 | getToolELSize: function getToolELSize() {},
|
24503 | position: 'top',
|
24504 | htmlTag: []
|
24505 | };
|
24506 |
|
24507 |
|
24508 | module.exports = ToolTipEl;
|
24509 |
|
24510 | /***/ }),
|
24511 | /* 256 */
|
24512 | /***/ (function(module, exports, __webpack_require__) {
|
24513 |
|
24514 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
24515 |
|
24516 | // load the styles
|
24517 | var content = __webpack_require__(257);
|
24518 | if(typeof content === 'string') content = [[module.id, content, '']];
|
24519 | // add the styles to the DOM
|
24520 | var update = __webpack_require__(248)(content, {});
|
24521 | if(content.locals) module.exports = content.locals;
|
24522 | // Hot Module Replacement
|
24523 | if(false) {
|
24524 | // When the styles change, update the <style> tags
|
24525 | if(!content.locals) {
|
24526 | module.hot.accept("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss", function() {
|
24527 | var newContent = require("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss");
|
24528 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
24529 | update(newContent);
|
24530 | });
|
24531 | }
|
24532 | // When the module is disposed, remove the <style> tags
|
24533 | module.hot.dispose(function() { update(); });
|
24534 | }
|
24535 |
|
24536 | /***/ }),
|
24537 | /* 257 */
|
24538 | /***/ (function(module, exports, __webpack_require__) {
|
24539 |
|
24540 | exports = module.exports = __webpack_require__(246)();
|
24541 | // imports
|
24542 |
|
24543 |
|
24544 | // module
|
24545 | exports.push([module.id, "[data-style-sys=ux-tree].base-tree-component {\n border-radius: 2px;\n overflow: auto; }\n [data-style-sys=ux-tree].base-tree-component li .disable-click {\n cursor: no-drop; }\n [data-style-sys=ux-tree].base-tree-component li .disable-click .text_tv_parent {\n color: #ACB7BF; }\n [data-style-sys=ux-tree].base-tree-component li .disable-click .icon-tv {\n cursor: pointer; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view {\n margin: 10px 0; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .us-no-data {\n width: 100%;\n height: 200px;\n position: relative; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .us-no-data .pc-sys-no-data-svg {\n position: absolute;\n margin: auto;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 138px;\n height: 33px;\n display: inline-block; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view li li {\n padding: 0;\n padding-left: 20px; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .text_tv_parent {\n max-width: calc(100% - 40px);\n display: inline-block;\n padding: 5px 0px 5px 0;\n min-width: 70px; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .title-tv {\n border-left: none;\n color: #36434D;\n *zoom: 1;\n min-width: 60px;\n height: 30px;\n white-space: nowrap;\n cursor: pointer; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .title-tv .text_tv_parent .empty-child-text {\n margin-left: 31px; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .title-tv .text_tv_parent .empty-child-text-first {\n margin-left: 31px; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .title-tv .has-child-icon {\n margin-left: 7px; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .title-tv .text_tv {\n font-size: 12px;\n line-height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n float: left;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: inline-block;\n max-width: 100%;\n /*max-width: 120px;*/ }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view ul ul {\n display: none; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .icon-tv {\n width: 16px;\n height: 16px;\n color: #acb7bf;\n display: inline-block;\n vertical-align: middle;\n position: relative;\n float: left;\n top: 2px;\n padding: 5px 10px 5px 5px; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .icon-tv:hover {\n color: #8F9CA6; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .icon-tv:hover::before {\n color: #8F9CA6; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .unfold > ul {\n display: block; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view {\n padding: 0 15px 0 15px;\n position: relative; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .hover-style {\n height: 30px;\n width: 100%;\n position: absolute;\n left: 0;\n background-color: #F5F8FA;\n z-index: -1; }\n [data-style-sys=ux-tree].base-tree-component .base-tree-view .click-style {\n height: 30px;\n width: 100%;\n color: #005999;\n position: absolute;\n left: 0;\n z-index: -1;\n background-color: #f5f8fa;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n[data-style-sys=ux-tree] ::-webkit-scrollbar {\n width: 10px;\n height: 10px; }\n\n[data-style-sys=ux-tree] ::-webkit-scrollbar-track {\n background-color: transparent;\n border-radius: 10px; }\n\n[data-style-sys=ux-tree] ::-webkit-scrollbar-thumb:vertical {\n border-radius: 8px;\n -webkit-box-shadow: inset 0 0 20px rgba(10, 19, 26, 0.3);\n border-top: 2px solid transparent;\n border-right: 2px solid transparent;\n border-bottom: 2px solid transparent; }\n\n[data-style-sys=ux-tree] ::-webkit-scrollbar-thumb:horizontal {\n border-radius: 8px;\n -webkit-box-shadow: inset 0 0 20px rgba(10, 19, 26, 0.3);\n border-top: 0px solid transparent;\n border-left: 2px solid transparent;\n border-right: 2px solid transparent;\n border-bottom: 2px solid transparent; }\n\n[data-style-sys=ux-tree] ::-webkit-scrollbar-thumb:hover {\n -webkit-box-shadow: inset 0 0 20px rgba(10, 19, 26, 0.8); }\n", ""]);
|
24546 |
|
24547 | // exports
|
24548 |
|
24549 |
|
24550 | /***/ }),
|
24551 | /* 258 */
|
24552 | /***/ (function(module, exports, __webpack_require__) {
|
24553 |
|
24554 | 'use strict';
|
24555 |
|
24556 | 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; };
|
24557 |
|
24558 | var _react = __webpack_require__(86);
|
24559 |
|
24560 | var _react2 = _interopRequireDefault(_react);
|
24561 |
|
24562 | __webpack_require__(259);
|
24563 |
|
24564 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
24565 |
|
24566 | function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
24567 |
|
24568 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
24569 |
|
24570 | 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; }
|
24571 |
|
24572 | 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) : _defaults(subClass, superClass); } /*
|
24573 | * author:lianglongfei
|
24574 | * desc:loading component
|
24575 | *
|
24576 | * add props hidden zhongjiahao
|
24577 | * custom style
|
24578 | */
|
24579 |
|
24580 |
|
24581 | var Loading = function (_Component) {
|
24582 | _inherits(Loading, _Component);
|
24583 |
|
24584 | function Loading(props) {
|
24585 | _classCallCheck(this, Loading);
|
24586 |
|
24587 | var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
24588 |
|
24589 | _this.state = {
|
24590 | hidden: _this.props.hidden
|
24591 | };
|
24592 | return _this;
|
24593 | }
|
24594 |
|
24595 | Loading.prototype.renderElm = function renderElm(count, type) {
|
24596 | var temp = [];
|
24597 | for (var i = 1; i <= count; i++) {
|
24598 | type ? temp.push(_react2.default.createElement('div', { key: i, className: "Loading__block" + i })) : temp.push(_react2.default.createElement('div', { key: i, className: "loading__img" + i }));
|
24599 | }
|
24600 | return temp;
|
24601 | };
|
24602 |
|
24603 | Loading.prototype.renderAnimation = function renderAnimation() {
|
24604 | var self = this;
|
24605 | var _props = this.props,
|
24606 | type = _props.type,
|
24607 | wrapStyle = _props.wrapStyle;
|
24608 |
|
24609 | var imgCount = type == "index" ? 3 : type == "standar" ? 3 : 5;
|
24610 | var blockCount = type == "index" ? 4 : type == "standar" ? 5 : 6;
|
24611 | switch (type) {
|
24612 | case "index":
|
24613 | return _react2.default.createElement(
|
24614 | 'div',
|
24615 | { className: 'Loading__container Loading__index-container' },
|
24616 | _react2.default.createElement(
|
24617 | 'div',
|
24618 | { className: 'loading__indexPage' },
|
24619 | self.renderElm(imgCount)
|
24620 | ),
|
24621 | _react2.default.createElement('div', { className: 'Loading__temp' }),
|
24622 | this.renderElm(blockCount, 1),
|
24623 | _react2.default.createElement('div', { className: 'Loading__shadow' })
|
24624 | );
|
24625 | break;
|
24626 | case "standar":
|
24627 | return _react2.default.createElement(
|
24628 | 'div',
|
24629 | { className: 'Loading__container Loading__standar-container' },
|
24630 | _react2.default.createElement(
|
24631 | 'div',
|
24632 | { className: 'loading__standarPage' },
|
24633 | self.renderElm(imgCount)
|
24634 | ),
|
24635 | _react2.default.createElement('div', { className: 'Loading__temp' }),
|
24636 | this.renderElm(blockCount, 1),
|
24637 | _react2.default.createElement('div', { className: 'Loading__shadow' })
|
24638 | );
|
24639 | break;
|
24640 | case "detail":
|
24641 | return _react2.default.createElement(
|
24642 | 'div',
|
24643 | { className: 'Loading__container Loading__detail-container' },
|
24644 | _react2.default.createElement(
|
24645 | 'div',
|
24646 | { className: 'loading__detailPage' },
|
24647 | self.renderElm(imgCount)
|
24648 | ),
|
24649 | _react2.default.createElement('div', { className: 'Loading__temp' }),
|
24650 | this.renderElm(blockCount, 1),
|
24651 | _react2.default.createElement('div', { className: 'Loading__shadow' })
|
24652 | );
|
24653 | break;
|
24654 | case "small":
|
24655 | return _react2.default.createElement(
|
24656 | 'div',
|
24657 | { className: 'loading__wrap', style: wrapStyle },
|
24658 | _react2.default.createElement(
|
24659 | 'div',
|
24660 | { className: 'loading__showarea' },
|
24661 | _react2.default.createElement(
|
24662 | 'div',
|
24663 | { className: 'loading__xwrap' },
|
24664 | _react2.default.createElement(
|
24665 | 'div',
|
24666 | { className: 'loading__ywrap' },
|
24667 | _react2.default.createElement('div', { className: 'loading__small' })
|
24668 | )
|
24669 | )
|
24670 | )
|
24671 | );
|
24672 | break;
|
24673 | default:
|
24674 | return _react2.default.createElement(
|
24675 | 'div',
|
24676 | { className: 'loading__wrap', style: wrapStyle },
|
24677 | _react2.default.createElement(
|
24678 | 'div',
|
24679 | { className: 'loading__showarea' },
|
24680 | _react2.default.createElement(
|
24681 | 'div',
|
24682 | { className: 'loading__xwrap' },
|
24683 | _react2.default.createElement(
|
24684 | 'div',
|
24685 | { className: 'loading__ywrap' },
|
24686 | _react2.default.createElement('div', { className: 'loading__sun' })
|
24687 | )
|
24688 | )
|
24689 | ),
|
24690 | _react2.default.createElement(
|
24691 | 'div',
|
24692 | { className: 'loading__threeLine' },
|
24693 | _react2.default.createElement('div', { className: "loading__line longding__longline" }),
|
24694 | _react2.default.createElement('div', { className: "loading__line loading__midline" }),
|
24695 | _react2.default.createElement('div', { className: "loading__line loading__shortline" })
|
24696 | )
|
24697 | );
|
24698 | }
|
24699 | };
|
24700 |
|
24701 | Loading.prototype.render = function render() {
|
24702 | var _style = {
|
24703 | background: 'rgba(255, 255, 255, 0.8)',
|
24704 | position: this.props.isFixed ? 'fixed' : 'absolute',
|
24705 | zIndex: '999999',
|
24706 | width: '100%',
|
24707 | height: '100%',
|
24708 | top: 0,
|
24709 | left: 0
|
24710 | };
|
24711 | var _props2 = this.props,
|
24712 | _props2$hidden = _props2.hidden,
|
24713 | hidden = _props2$hidden === undefined ? false : _props2$hidden,
|
24714 | _props2$style = _props2.style,
|
24715 | style = _props2$style === undefined ? {} : _props2$style;
|
24716 |
|
24717 | var tempDis = this.props.hidden ? { display: 'none' } : { display: 'block' };
|
24718 | var __style = _extends(tempDis, _style, style);
|
24719 | return _react2.default.createElement(
|
24720 | 'div',
|
24721 | { className: "loading " + "loading_is-show", style: __style },
|
24722 | this.renderAnimation()
|
24723 | );
|
24724 | };
|
24725 |
|
24726 | return Loading;
|
24727 | }(_react.Component);
|
24728 |
|
24729 | module.exports = Loading;
|
24730 |
|
24731 | /***/ }),
|
24732 | /* 259 */
|
24733 | /***/ (function(module, exports, __webpack_require__) {
|
24734 |
|
24735 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
24736 |
|
24737 | // load the styles
|
24738 | var content = __webpack_require__(260);
|
24739 | if(typeof content === 'string') content = [[module.id, content, '']];
|
24740 | // add the styles to the DOM
|
24741 | var update = __webpack_require__(248)(content, {});
|
24742 | if(content.locals) module.exports = content.locals;
|
24743 | // Hot Module Replacement
|
24744 | if(false) {
|
24745 | // When the styles change, update the <style> tags
|
24746 | if(!content.locals) {
|
24747 | module.hot.accept("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss", function() {
|
24748 | var newContent = require("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss");
|
24749 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
24750 | update(newContent);
|
24751 | });
|
24752 | }
|
24753 | // When the module is disposed, remove the <style> tags
|
24754 | module.hot.dispose(function() { update(); });
|
24755 | }
|
24756 |
|
24757 | /***/ }),
|
24758 | /* 260 */
|
24759 | /***/ (function(module, exports, __webpack_require__) {
|
24760 |
|
24761 | exports = module.exports = __webpack_require__(246)();
|
24762 | // imports
|
24763 |
|
24764 |
|
24765 | // module
|
24766 | exports.push([module.id, "@charset \"UTF-8\";\n.loading_is-show .loading__xwrap {\n position: relative;\n top: 2.375rem;\n left: 0.1875rem;\n width: 2.625rem; }\n .loading_is-show .loading__xwrap .loading__sun {\n width: 2.625rem;\n height: 2.625rem;\n margin: 0;\n background: url(" + __webpack_require__(261) + ");\n background-size: 2.625rem;\n animation: circling 1s linear 0s infinite; }\n .loading_is-show .loading__xwrap .loading__small {\n width: 16px;\n height: 16px;\n margin: 0;\n background: url(" + __webpack_require__(262) + ");\n animation: circling 1s linear 0s infinite; }\n\n.loading_is-show .Loading__container {\n width: 100%;\n height: 100%; }\n .loading_is-show .Loading__container.Loading__detail-container .Loading__block1 {\n background: #e4ebf0;\n position: absolute;\n width: 50px;\n height: 50px;\n border-radius: 25px;\n top: 15px;\n left: 20px; }\n .loading_is-show .Loading__container.Loading__detail-container .Loading__block2 {\n background: #e4ebf0;\n position: absolute;\n width: 70px;\n height: 20px;\n top: 25px;\n left: 100px; }\n .loading_is-show .Loading__container.Loading__detail-container .Loading__block3 {\n background: #e4ebf0;\n position: absolute;\n width: 200px;\n height: 15px;\n top: 70px;\n left: 100px; }\n .loading_is-show .Loading__container.Loading__detail-container .Loading__block4 {\n background: #e4ebf0;\n position: absolute;\n width: 70px;\n height: 30px;\n top: 20px;\n right: 200px; }\n .loading_is-show .Loading__container.Loading__detail-container .Loading__block5 {\n background: #e4ebf0;\n position: absolute;\n width: 70px;\n height: 30px;\n top: 20px;\n right: 115px; }\n .loading_is-show .Loading__container.Loading__detail-container .Loading__block6 {\n background: #e4ebf0;\n position: absolute;\n width: 80px;\n height: 30px;\n top: 20px;\n right: 20px; }\n .loading_is-show .Loading__container .loading__detailPage {\n position: relative;\n z-index: 9;\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex; }\n .loading_is-show .Loading__container .loading__detailPage + .Loading__temp {\n height: 729px; }\n .loading_is-show .Loading__container .loading__detailPage .loading__img1 {\n width: 166px;\n height: 100%;\n margin: 0;\n background-repeat: no-repeat;\n background-image: url(" + __webpack_require__(263) + "); }\n .loading_is-show .Loading__container .loading__detailPage .loading__img2 {\n -webkit-box-flex: 0;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n min-width: 17px;\n background-repeat: repeat-x;\n height: 100%;\n margin: 0;\n background-image: url(" + __webpack_require__(264) + "); }\n .loading_is-show .Loading__container .loading__detailPage .loading__img3 {\n width: 183px;\n height: 100%;\n margin: 0;\n background-repeat: no-repeat;\n background-image: url(" + __webpack_require__(265) + "); }\n .loading_is-show .Loading__container .loading__detailPage .loading__img4 {\n -webkit-box-flex: 0;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n min-width: 30px;\n background-repeat: repeat-x;\n height: 100%;\n margin: 0;\n background-image: url(" + __webpack_require__(266) + "); }\n .loading_is-show .Loading__container .loading__detailPage .loading__img5 {\n width: 398px;\n height: 100%;\n margin: 0;\n background-repeat: no-repeat;\n background-image: url(" + __webpack_require__(267) + "); }\n .loading_is-show .Loading__container.Loading__standar-container .Loading__block1 {\n background: #e4ebf0;\n position: absolute;\n width: 60px;\n height: 15px;\n top: 75px;\n left: 20px; }\n .loading_is-show .Loading__container.Loading__standar-container .Loading__block2 {\n background: #e4ebf0;\n position: absolute;\n width: 100px;\n height: 20px;\n top: 25px;\n left: 250px; }\n .loading_is-show .Loading__container.Loading__standar-container .Loading__block3 {\n background: #e4ebf0;\n position: absolute;\n width: 70px;\n height: 30px;\n top: 20px;\n right: 200px; }\n .loading_is-show .Loading__container.Loading__standar-container .Loading__block4 {\n background: #e4ebf0;\n position: absolute;\n width: 70px;\n height: 30px;\n top: 20px;\n right: 115px; }\n .loading_is-show .Loading__container.Loading__standar-container .Loading__block5 {\n background: #e4ebf0;\n position: absolute;\n width: 80px;\n height: 30px;\n top: 20px;\n right: 20px; }\n .loading_is-show .Loading__container .loading__standarPage {\n position: relative;\n z-index: 9;\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex; }\n .loading_is-show .Loading__container .loading__standarPage + .Loading__temp {\n height: 760px; }\n .loading_is-show .Loading__container .loading__standarPage .loading__img1 {\n width: 575px;\n height: 100%;\n margin: 0;\n background-repeat: no-repeat;\n display: inline-block;\n background-image: url(" + __webpack_require__(268) + "); }\n .loading_is-show .Loading__container .loading__standarPage .loading__img2 {\n width: 600px;\n -webkit-box-flex: 0;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n background-repeat: repeat-x;\n height: 100%;\n margin: 0;\n display: inline-block;\n background-image: url(" + __webpack_require__(269) + "); }\n .loading_is-show .Loading__container .loading__standarPage .loading__img3 {\n width: 316px;\n height: 100%;\n margin: 0;\n background-repeat: no-repeat;\n background-image: url(" + __webpack_require__(270) + "); }\n .loading_is-show .Loading__container.Loading__index-container .Loading__block1 {\n background: #e4ebf0;\n position: absolute;\n width: 100px;\n height: 20px;\n top: 25px;\n left: 20px; }\n .loading_is-show .Loading__container.Loading__index-container .Loading__block2 {\n background: #e4ebf0;\n position: absolute;\n width: 70px;\n height: 30px;\n top: 20px;\n right: 200px; }\n .loading_is-show .Loading__container.Loading__index-container .Loading__block3 {\n background: #e4ebf0;\n position: absolute;\n width: 70px;\n height: 30px;\n top: 20px;\n right: 115px; }\n .loading_is-show .Loading__container.Loading__index-container .Loading__block4 {\n background: #e4ebf0;\n position: absolute;\n width: 80px;\n height: 30px;\n top: 20px;\n right: 20px; }\n .loading_is-show .Loading__container .loading__indexPage {\n position: relative;\n z-index: 9;\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex; }\n .loading_is-show .Loading__container .loading__indexPage + .Loading__temp {\n height: 760px; }\n .loading_is-show .Loading__container .loading__indexPage .loading__img1 {\n width: 590px;\n height: 100%;\n margin: 0;\n background-repeat: no-repeat;\n background-image: url(" + __webpack_require__(271) + "); }\n .loading_is-show .Loading__container .loading__indexPage .loading__img2 {\n -webkit-box-flex: 0;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n background-repeat: repeat-x;\n height: 100%;\n margin: 0;\n background-image: url(" + __webpack_require__(272) + "); }\n .loading_is-show .Loading__container .loading__indexPage .loading__img3 {\n width: 316px;\n height: 100%;\n margin: 0;\n background-repeat: no-repeat;\n background-image: url(" + __webpack_require__(273) + "); }\n .loading_is-show .Loading__container .Loading__temp {\n width: 100%;\n background: #ECF1F4;\n position: absolute;\n top: 0; }\n .loading_is-show .Loading__container .Loading__shadow {\n display: block;\n height: 100%;\n width: 250px;\n background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.51), rgba(255, 255, 255, 0.08));\n background: linear-gradient(to right, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.51), rgba(255, 255, 255, 0.08));\n position: absolute;\n left: 0;\n top: 0;\n z-index: 8;\n -webkit-animation: shadowGo 1.2s ease infinite;\n animation: shadowGo 1.2s ease infinite; }\n\n.loading__wrap {\n width: 3rem;\n text-align: center;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n position: absolute; }\n .loading__wrap .loading__showarea {\n width: 5rem;\n height: 3.875rem;\n overflow: hidden; }\n .loading__wrap .loading__threeLine {\n position: relative; }\n .loading__wrap .loading__threeLine .loading__line {\n height: 0.0625rem;\n background-color: #FFBE00;\n margin-bottom: 0.125rem;\n margin: 0 auto; }\n .loading__wrap .loading__threeLine .longding__longline {\n width: 3rem; }\n .loading__wrap .loading__threeLine .loading__midline {\n width: 2rem;\n opacity: 0.6;\n animation: linemove 0.1s forwards; }\n .loading__wrap .loading__threeLine .loading__shortline {\n width: 0.75rem;\n opacity: 0.4;\n animation: linemovetwo 0.1s forwards; }\n .loading__wrap .loading__threeLine .loading__longline-hidden {\n display: none; }\n .loading__wrap .loading__threeLine .loading__midline-hidden {\n display: none; }\n .loading__wrap .loading__threeLine .loading__shortline-hidden {\n display: none; }\n\n@keyframes shadowGo {\n 0% {\n left: 0;\n opacity: 1; }\n 100% {\n left: calc(100% - 250px);\n opacity: 0.5; } }\n\n@keyframes circling {\n from {\n transform: rotate(0deg); }\n to {\n transform: rotate(360deg); } }\n\n@keyframes linemove {\n from {\n transform: translateY(0px) ;; }\n to {\n transform: translateY(2px); } }\n\n@keyframes linemovetwo {\n from {\n transform: translateY(0px); }\n to {\n transform: translateY(4px); } }\n\n@-webkit-keyframes yAxis {\n 100% {\n opacity: 0;\n animation-timing-function: cubic-bezier(0.66, 1.65, 0.23, 0.87);\n transform: translateY(-109px); } }\n\n@keyframes yAxis {\n 100% {\n opacity: 0;\n animation-timing-function: cubic-bezier(0.66, 1.65, 0.23, 0.87);\n transform: translateY(-109px); } }\n\n@-webkit-keyframes xAxis {\n 100% {\n opacity: 0;\n animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);\n transform: translateX(60px) scale3d(0, 0, 0); } }\n\n@keyframes xAxis {\n 100% {\n opacity: 0;\n animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);\n transform: translateX(60px) scale3d(0, 0, 0); } }\n\n@-webkit-keyframes scaleSmall {\n 100% {\n opacity: 0;\n animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);\n transform: scale3d(0, 0, 0); } }\n\n@keyframes scaleSmall {\n 100% {\n opacity: 0;\n animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);\n transform: scale3d(0, 0, 0); } }\n\n@keyframes bounceInUp {\n from,\n 30%,\n 75% {\n -webkit-animation-timing-function: cubic-bezier(0.25, 0.5, 0.25, 1);\n animation-timing-function: cubic-bezier(0.25, 0.5, 0.25, 1); }\n 90%,\n to {\n -webkit-animation-timing-function: cubic-bezier(0.75, 0, 0.75, 0.9);\n animation-timing-function: cubic-bezier(0.75, 0, 0.75, 0.9); }\n from {\n opacity: 0;\n -webkit-transform: translate3d(0, 70px, 0);\n transform: translate3d(0, 70px, 0); }\n 30% {\n opacity: 1;\n -webkit-transform: translate3d(0, -20px, 0);\n transform: translate3d(0, -20px, 0); }\n 75% {\n -webkit-transform: translate3d(0, 3px, 0);\n transform: translate3d(0, 3px, 0); }\n 90% {\n -webkit-transform: translate3d(0, -1px, 0);\n transform: translate3d(0, -1px, 0); }\n to {\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0); } }\n", ""]);
|
24767 |
|
24768 | // exports
|
24769 |
|
24770 |
|
24771 | /***/ }),
|
24772 | /* 261 */
|
24773 | /***/ (function(module, exports, __webpack_require__) {
|
24774 |
|
24775 | module.exports = __webpack_require__.p + "images/299c76ac.sun.svg";
|
24776 |
|
24777 | /***/ }),
|
24778 | /* 262 */
|
24779 | /***/ (function(module, exports, __webpack_require__) {
|
24780 |
|
24781 | module.exports = __webpack_require__.p + "59a42b18f95baf86068e8c87c04bd97c.png";
|
24782 |
|
24783 | /***/ }),
|
24784 | /* 263 */
|
24785 | /***/ (function(module, exports, __webpack_require__) {
|
24786 |
|
24787 | module.exports = __webpack_require__.p + "b7db89fe00bae2d17855ac827897e713.png";
|
24788 |
|
24789 | /***/ }),
|
24790 | /* 264 */
|
24791 | /***/ (function(module, exports, __webpack_require__) {
|
24792 |
|
24793 | module.exports = __webpack_require__.p + "ab558408e7a91b1b7bad64b886b473a4.png";
|
24794 |
|
24795 | /***/ }),
|
24796 | /* 265 */
|
24797 | /***/ (function(module, exports, __webpack_require__) {
|
24798 |
|
24799 | module.exports = __webpack_require__.p + "396d951539944fe31a498bc36d3f9716.png";
|
24800 |
|
24801 | /***/ }),
|
24802 | /* 266 */
|
24803 | /***/ (function(module, exports, __webpack_require__) {
|
24804 |
|
24805 | module.exports = __webpack_require__.p + "87674c226c0d5debb72e5527f2865be3.png";
|
24806 |
|
24807 | /***/ }),
|
24808 | /* 267 */
|
24809 | /***/ (function(module, exports, __webpack_require__) {
|
24810 |
|
24811 | module.exports = __webpack_require__.p + "09f5d4ecb709c8dccfa8d2966a61c676.png";
|
24812 |
|
24813 | /***/ }),
|
24814 | /* 268 */
|
24815 | /***/ (function(module, exports, __webpack_require__) {
|
24816 |
|
24817 | module.exports = __webpack_require__.p + "bfd09130a09298a9c99c370b0b8dbfbd.png";
|
24818 |
|
24819 | /***/ }),
|
24820 | /* 269 */
|
24821 | /***/ (function(module, exports, __webpack_require__) {
|
24822 |
|
24823 | module.exports = __webpack_require__.p + "2fa1cae913b59ec4d3246809cbbcdf7c.png";
|
24824 |
|
24825 | /***/ }),
|
24826 | /* 270 */
|
24827 | /***/ (function(module, exports, __webpack_require__) {
|
24828 |
|
24829 | module.exports = __webpack_require__.p + "77c9aefb6fe929026d6c231787ce8a8b.png";
|
24830 |
|
24831 | /***/ }),
|
24832 | /* 271 */
|
24833 | /***/ (function(module, exports, __webpack_require__) {
|
24834 |
|
24835 | module.exports = __webpack_require__.p + "2f8dcfb33756916ecf923ec08b1343c2.png";
|
24836 |
|
24837 | /***/ }),
|
24838 | /* 272 */
|
24839 | /***/ (function(module, exports, __webpack_require__) {
|
24840 |
|
24841 | module.exports = __webpack_require__.p + "6db58b66c8d8f9afc358c15a416258b2.png";
|
24842 |
|
24843 | /***/ }),
|
24844 | /* 273 */
|
24845 | /***/ (function(module, exports, __webpack_require__) {
|
24846 |
|
24847 | module.exports = __webpack_require__.p + "97c7fbfc8d4b54de9940daedd2754a32.png";
|
24848 |
|
24849 | /***/ }),
|
24850 | /* 274 */
|
24851 | /***/ (function(module, exports, __webpack_require__) {
|
24852 |
|
24853 | 'use strict';
|
24854 |
|
24855 | var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
24856 |
|
24857 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
24858 |
|
24859 | var _react = __webpack_require__(86);
|
24860 |
|
24861 | var _react2 = _interopRequireDefault(_react);
|
24862 |
|
24863 | var _reactDom = __webpack_require__(243);
|
24864 |
|
24865 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
24866 |
|
24867 | var _debounce = __webpack_require__(275);
|
24868 |
|
24869 | var _debounce2 = _interopRequireDefault(_debounce);
|
24870 |
|
24871 | var _commonFunc = __webpack_require__(252);
|
24872 |
|
24873 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
24874 |
|
24875 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
24876 |
|
24877 | var CommonMount = function CommonMount(params) {
|
24878 | var _this = this;
|
24879 |
|
24880 | _classCallCheck(this, CommonMount);
|
24881 |
|
24882 | this.createDom = function () {
|
24883 | if (document.getElementById(_this.containerId)) return;
|
24884 | var oDiv = document.createElement('div');
|
24885 | oDiv.id = _this.containerId;
|
24886 | document.body.appendChild(oDiv);
|
24887 | };
|
24888 |
|
24889 | this.renderDom = function (id, Component, tigger, positionInfo) {
|
24890 | var isInput = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
24891 | var deviationLeft = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
24892 | var directionLeft = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
24893 | var resizeTime = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 100;
|
24894 | var inputHeight = arguments[8];
|
24895 | var z_Index = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : undefined;
|
24896 |
|
24897 | _this.id = id;
|
24898 | var self = _this;
|
24899 | self.positionInfo = positionInfo;
|
24900 | deviationLeft = typeof deviationLeft === 'number' ? deviationLeft : 0;
|
24901 | window.onresize = (0, _debounce2.default)(function () {
|
24902 | var ele = document.getElementById(id);
|
24903 | if (ele && ele.style) {
|
24904 | ele.style.top = self.getPosition(self.positionInfo, isInput, deviationLeft, directionLeft, resizeTime, inputHeight, z_Index).top + 'px';
|
24905 | ele.style.left = self.getPosition(self.positionInfo, isInput, deviationLeft, directionLeft, resizeTime, inputHeight, z_Index).left + 'px';
|
24906 | }
|
24907 | }, resizeTime);
|
24908 |
|
24909 | var offset = _this.getPosition(positionInfo, isInput, deviationLeft, directionLeft, resizeTime, inputHeight, z_Index);
|
24910 | window.commonMountOffset = offset;
|
24911 | var targetDom = document.getElementById(_this.containerId);
|
24912 | if (!targetDom) {
|
24913 | _this.createDom();
|
24914 | }
|
24915 | if ((typeof Component === 'undefined' ? 'undefined' : _typeof(Component)) == 'object') {
|
24916 | _reactDom2.default.render(_react2.default.createElement(
|
24917 | 'div',
|
24918 | { className: id, id: id, style: offset },
|
24919 | Component
|
24920 | ), document.getElementById(_this.containerId));
|
24921 | }
|
24922 | if (typeof Component == 'function') {
|
24923 | _reactDom2.default.render(_react2.default.createElement(
|
24924 | 'div',
|
24925 | { className: id, id: id, style: offset },
|
24926 | _react2.default.createElement(Component, null)
|
24927 | ), document.getElementById(_this.containerId));
|
24928 | }
|
24929 | // 是否滚动跟随
|
24930 | if (_this.follow) {
|
24931 | var node = document.getElementById(id);
|
24932 | _this.autoFollowScroll(tigger, node, positionInfo, isInput, deviationLeft, directionLeft, resizeTime, inputHeight, z_Index);
|
24933 | }
|
24934 |
|
24935 | //挂载组件高度增高时,挂载位置适应变化
|
24936 | _this.resizeListener = function () {
|
24937 | if (!document.getElementById(id)) return;
|
24938 | var height = document.getElementById(id).offsetHeight;
|
24939 | var top = document.getElementById(id).offsetTop;
|
24940 | if (height + top > window.innerHeight) {
|
24941 | top -= height + top - window.innerHeight;
|
24942 | document.getElementById(id).style.top = top + 'px';
|
24943 | } else {
|
24944 | if (window.commonMountOffset && window.commonMountOffset.top > top) {
|
24945 | document.getElementById(id).style.top = window.commonMountOffset.top + 'px';
|
24946 | }
|
24947 | }
|
24948 | };
|
24949 | if (document.getElementById(id)) {
|
24950 | (0, _commonFunc.addResizeListener)(document.getElementById(id), _this.resizeListener);
|
24951 | }
|
24952 | };
|
24953 |
|
24954 | this.autoFollowScroll = function (tigger, follower, positionInfo, isInput, deviationLeft, directionLeft, resizeTime, inputHeight, z_Index) {
|
24955 | if (!tigger || !follower) {
|
24956 | return false;
|
24957 | }
|
24958 | // let lastPosition = 0;
|
24959 | var self = _this;
|
24960 | _this.autoFollow = (0, _debounce2.default)(function (e) {
|
24961 | //如果监听到滚动的target是挂载的话则跳出
|
24962 | var dom = document.getElementById(self.containerId);
|
24963 | if (dom && dom.contains(e.target) || dom == e.target) return;
|
24964 | var offset = self.getPosition(positionInfo, isInput, deviationLeft, directionLeft, resizeTime, inputHeight, z_Index);
|
24965 | follower.style.top = offset.top + 'px';
|
24966 | }, 0);
|
24967 | window.removeEventListener("scroll", _this.autoFollow, true);
|
24968 | window.addEventListener('scroll', _this.autoFollow, true);
|
24969 | };
|
24970 |
|
24971 | this.unmountBox = function () {
|
24972 | if (_this.resizeListeners && document.getElementById(_this.id)) {
|
24973 | (0, _commonFunc.removeResizeListener)(document.getElementById(_this.id), _this.windowResizeListener);
|
24974 | };
|
24975 | window.removeEventListener("scroll", _this.autoFollow, true);
|
24976 | window.onresize = null;
|
24977 | var targetDom = _this.containerId && document.getElementById(_this.containerId);
|
24978 | if (targetDom) {
|
24979 | _reactDom2.default.unmountComponentAtNode(targetDom);
|
24980 | document.body.removeChild(targetDom);
|
24981 | }
|
24982 | };
|
24983 |
|
24984 | this.getPosition = function (positionInfo, isInput, deviationLeft, directionLeft, resizeTime, inputHeight, z_Index) {
|
24985 |
|
24986 | // target 挂载节点
|
24987 | // mount 挂载元素宽高 {width: '', height: ''}
|
24988 | // tHeight 挂载节点偏移量,默认为0,可不传
|
24989 | var _positionInfo = _slicedToArray(positionInfo, 4),
|
24990 | target = _positionInfo[0],
|
24991 | mount = _positionInfo[1],
|
24992 | tHeight = _positionInfo[2],
|
24993 | container = _positionInfo[3];
|
24994 |
|
24995 | var offset = {};
|
24996 | var _container = container === undefined ? window : container;
|
24997 | var _tHeight = tHeight === undefined ? 0 : tHeight;
|
24998 | // dom_offset 挂载节点相对屏幕的位置 宽高
|
24999 | var dom_offset = target.getBoundingClientRect();
|
25000 | // 挂载容器的 宽高 相对屏幕位置
|
25001 | var container_bottom = _container == window ? _container.innerHeight : _container.getBoundingClientRect().bottom;
|
25002 | var container_right = _container == window ? _container.innerWidth : _container.getBoundingClientRect().right;
|
25003 | // input距离可视区域底距离
|
25004 | var _tempTop = container_bottom - (dom_offset.top + dom_offset.height);
|
25005 | var _tempBottom = dom_offset.top; //input上边缘距离可视区域顶距离
|
25006 | var _tempRight = container_right - dom_offset.left; //右边缘到可视区域右边缘距离
|
25007 | var mountH = parseFloat(mount.height);
|
25008 | var mountW = parseFloat(mount.width);
|
25009 | var zIndex_temp = void 0,
|
25010 | iHeight = void 0;
|
25011 | iHeight = isInput ? 0 : inputHeight ? inputHeight : 48;
|
25012 | // 判断并计算左右位置
|
25013 | if (_tempRight > mountW) {
|
25014 | offset.left = dom_offset.left;
|
25015 | if (dom_offset.left <= 0) offset.left = 0;
|
25016 | } else if (dom_offset.left > mountW) {
|
25017 | offset.left = dom_offset.left - mountW + target.clientWidth;
|
25018 | if (dom_offset.left + target.clientWidth > container_right) offset.left = container_right - mountW;
|
25019 | } else {
|
25020 | offset.left = container_right - mountW;
|
25021 | }
|
25022 | //自定义水平居左居右
|
25023 | if (directionLeft) offset.left = dom_offset.left - mountW + target.clientWidth;
|
25024 | // 判断并计算上下位置
|
25025 | if (_tempTop > mountH) {
|
25026 | //下
|
25027 | offset.top = dom_offset.top + dom_offset.height;
|
25028 | } else if (_tempBottom > mountH) {
|
25029 | //上
|
25030 | offset.top = dom_offset.bottom - mountH - 2 - _tHeight - iHeight;
|
25031 | if (offset.top < 0) {
|
25032 | //防止弹层超出可视区域,使其在边界内展示,2是为了防止被阴影挡住
|
25033 | var difference = window.innerHeight - mountH;
|
25034 | if (difference > 0) {
|
25035 | offset.top = offset.top + difference > 0 ? 2 : offset.top + difference;
|
25036 | }
|
25037 | }
|
25038 | } else {
|
25039 | offset.top = container_bottom - mountH;
|
25040 | }
|
25041 | //zyt
|
25042 | if (z_Index == undefined) {
|
25043 | zIndex_temp = '999999';
|
25044 | } else {
|
25045 | zIndex_temp = z_Index;
|
25046 | }
|
25047 | return {
|
25048 | width: mount.width,
|
25049 | zIndex: zIndex_temp,
|
25050 | left: offset.left - deviationLeft,
|
25051 | top: offset.top,
|
25052 | position: _this.fixed ? 'fixed' : 'absolute'
|
25053 | };
|
25054 | };
|
25055 |
|
25056 | // 容器ID
|
25057 | this.containerId = params.containerId;
|
25058 | // 是否滚动跟随,默认true
|
25059 | this.follow = params.follow;
|
25060 | // 定位:fixed,false时为absolute
|
25061 | this.fixed = typeof params.fixed == 'boolean' ? params.fixed : true;
|
25062 | this.createDom();
|
25063 | }
|
25064 | // 创建挂载容器
|
25065 |
|
25066 |
|
25067 | // 渲染挂载节点
|
25068 |
|
25069 |
|
25070 | // 滚动跟随
|
25071 |
|
25072 | // 卸载
|
25073 |
|
25074 | // 获取位置信息
|
25075 | ;
|
25076 |
|
25077 | module.exports = CommonMount;
|
25078 |
|
25079 | /***/ }),
|
25080 | /* 275 */
|
25081 | /***/ (function(module, exports) {
|
25082 |
|
25083 | /**
|
25084 | * Returns a function, that, as long as it continues to be invoked, will not
|
25085 | * be triggered. The function will be called after it stops being called for
|
25086 | * N milliseconds. If `immediate` is passed, trigger the function on the
|
25087 | * leading edge, instead of the trailing. The function also has a property 'clear'
|
25088 | * that is a function which will clear the timer to prevent previously scheduled executions.
|
25089 | *
|
25090 | * @source underscore.js
|
25091 | * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
|
25092 | * @param {Function} function to wrap
|
25093 | * @param {Number} timeout in ms (`100`)
|
25094 | * @param {Boolean} whether to execute at the beginning (`false`)
|
25095 | * @api public
|
25096 | */
|
25097 | function debounce(func, wait, immediate){
|
25098 | var timeout, args, context, timestamp, result;
|
25099 | if (null == wait) wait = 100;
|
25100 |
|
25101 | function later() {
|
25102 | var last = Date.now() - timestamp;
|
25103 |
|
25104 | if (last < wait && last >= 0) {
|
25105 | timeout = setTimeout(later, wait - last);
|
25106 | } else {
|
25107 | timeout = null;
|
25108 | if (!immediate) {
|
25109 | result = func.apply(context, args);
|
25110 | context = args = null;
|
25111 | }
|
25112 | }
|
25113 | };
|
25114 |
|
25115 | var debounced = function(){
|
25116 | context = this;
|
25117 | args = arguments;
|
25118 | timestamp = Date.now();
|
25119 | var callNow = immediate && !timeout;
|
25120 | if (!timeout) timeout = setTimeout(later, wait);
|
25121 | if (callNow) {
|
25122 | result = func.apply(context, args);
|
25123 | context = args = null;
|
25124 | }
|
25125 |
|
25126 | return result;
|
25127 | };
|
25128 |
|
25129 | debounced.clear = function() {
|
25130 | if (timeout) {
|
25131 | clearTimeout(timeout);
|
25132 | timeout = null;
|
25133 | }
|
25134 | };
|
25135 |
|
25136 | debounced.flush = function() {
|
25137 | if (timeout) {
|
25138 | result = func.apply(context, args);
|
25139 | context = args = null;
|
25140 |
|
25141 | clearTimeout(timeout);
|
25142 | timeout = null;
|
25143 | }
|
25144 | };
|
25145 |
|
25146 | return debounced;
|
25147 | };
|
25148 |
|
25149 | // Adds compatibility for ES modules
|
25150 | debounce.debounce = debounce;
|
25151 |
|
25152 | module.exports = debounce;
|
25153 |
|
25154 |
|
25155 | /***/ }),
|
25156 | /* 276 */
|
25157 | /***/ (function(module, exports) {
|
25158 |
|
25159 | (function() {
|
25160 |
|
25161 | "use strict";
|
25162 |
|
25163 | module.exports = function(func, wait, immediate) {
|
25164 |
|
25165 | var timeout;
|
25166 | return function() {
|
25167 |
|
25168 | var context = this, args = arguments;
|
25169 |
|
25170 | return new Promise(function(resolve) {
|
25171 | var later = function() {
|
25172 | timeout = null;
|
25173 | if (!immediate) resolve(func.apply(context, args));
|
25174 | };
|
25175 |
|
25176 | var callNow = immediate && !timeout;
|
25177 | clearTimeout(timeout);
|
25178 | timeout = setTimeout(later, wait);
|
25179 |
|
25180 | if (callNow) resolve(func.apply(context, args));
|
25181 | });
|
25182 | };
|
25183 | };
|
25184 |
|
25185 | })();
|
25186 |
|
25187 |
|
25188 | /***/ }),
|
25189 | /* 277 */
|
25190 | /***/ (function(module, exports, __webpack_require__) {
|
25191 |
|
25192 | 'use strict';
|
25193 |
|
25194 | Object.defineProperty(exports, "__esModule", {
|
25195 | value: true
|
25196 | });
|
25197 | exports.getCommonInputData = undefined;
|
25198 |
|
25199 | var _extends2 = __webpack_require__(5);
|
25200 |
|
25201 | var _extends3 = _interopRequireDefault(_extends2);
|
25202 |
|
25203 | exports.getBtnData = getBtnData;
|
25204 | exports.getSearchData = getSearchData;
|
25205 | exports.getSysVersion = getSysVersion;
|
25206 | exports.getElByClass = getElByClass;
|
25207 | exports.setMaskStyle = setMaskStyle;
|
25208 | exports.setRealNode = setRealNode;
|
25209 | exports.renderTree = renderTree;
|
25210 | exports.renderAutoUl = renderAutoUl;
|
25211 | exports.setResult_Height = setResult_Height;
|
25212 | exports.resetPosition = resetPosition;
|
25213 | exports.getSelectedData = getSelectedData;
|
25214 | exports.pushLi = pushLi;
|
25215 | exports.getText = getText;
|
25216 | exports.getHightLightData = getHightLightData;
|
25217 |
|
25218 | var _react = __webpack_require__(86);
|
25219 |
|
25220 | var _react2 = _interopRequireDefault(_react);
|
25221 |
|
25222 | var _toolTip = __webpack_require__(251);
|
25223 |
|
25224 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
25225 |
|
25226 | var _loading = __webpack_require__(258);
|
25227 |
|
25228 | var _loading2 = _interopRequireDefault(_loading);
|
25229 |
|
25230 | var _tree = __webpack_require__(249);
|
25231 |
|
25232 | var _tree2 = _interopRequireDefault(_tree);
|
25233 |
|
25234 | var _commonFunc = __webpack_require__(252);
|
25235 |
|
25236 | var _resizeEvent = __webpack_require__(278);
|
25237 |
|
25238 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25239 |
|
25240 | /* eslint-disable */
|
25241 | function getBtnData(bsStyle, bsSize, title, func) {
|
25242 | var ret = {
|
25243 | bsStyle: bsStyle || 'default',
|
25244 | bsSize: bsSize || 'default',
|
25245 | active: true,
|
25246 | title: title || '确认',
|
25247 | onClick: func || function (val) {}
|
25248 | };
|
25249 | return ret;
|
25250 | }
|
25251 |
|
25252 | function getSearchData(searchValue, active, placeholder) {
|
25253 | var ret = {
|
25254 | "placeholder": "请搜索" /**没有值的时候显示的内容(string)**/
|
25255 | , "iconName": "sys-icon-sousuo" /**IconName 文字前面的图标**/
|
25256 | , "value": searchValue || '' //搜索框中的默认值
|
25257 | , "active": active ? active : false //input框激活
|
25258 | , "hidden": false //隐藏搜索框
|
25259 | , "readonly": false //搜索框只读
|
25260 | , "disabled": false //搜索框禁用
|
25261 | , useInputPlaceHolder: placeholder,
|
25262 | "onClick": function onClick(val) {},
|
25263 | "onBlur": function onBlur(val) {},
|
25264 | "onFocus": function onFocus(val) {}
|
25265 | };
|
25266 | return ret;
|
25267 | }
|
25268 |
|
25269 | function getCommonInputData(isActive, placeholder, _defaultValue, disabled, errorStatus, errorMsg, resultsData, _itemClose, onChange, addClass, removeClass) {
|
25270 | var ret = {
|
25271 | "status": "show",
|
25272 | "isActive": isActive //蓝线是否出现
|
25273 | , "placeHolder": placeholder //input中的placeholder
|
25274 | , "defaultValue": _defaultValue //input中的defaultvalue
|
25275 | , "readonly": disabled || '' //只读态
|
25276 | , "errorStatus": errorStatus //报错
|
25277 | , "errorMsg": errorMsg //报错信息,为空时不显示
|
25278 | , "selectDate": resultsData,
|
25279 | 'istips': false,
|
25280 | 'hasInput': true
|
25281 | //数据
|
25282 | , handlerClick: function handlerClick() {},
|
25283 | itemClose: function itemClose(event, item, index) {
|
25284 | _itemClose(event, item, index);
|
25285 | } //删除按钮回调
|
25286 | , inputChange: function inputChange(event, status, value) {
|
25287 | onChange(event);
|
25288 | } //input的change事件
|
25289 | , inputClick: function inputClick(event, status, value) {
|
25290 | addClass(event);
|
25291 | } //input的点击事件
|
25292 | , inputBlur: function inputBlur(event, status, value) {
|
25293 | removeClass(event);
|
25294 | } //input的blur事件
|
25295 | };
|
25296 | return ret;
|
25297 | }
|
25298 |
|
25299 | exports.getCommonInputData = getCommonInputData;
|
25300 | function getSysVersion() {
|
25301 | //判断浏览器版本
|
25302 | var Sys = {};
|
25303 | var ua = navigator.userAgent.toLowerCase();
|
25304 | var s = void 0;
|
25305 | (s = ua.match(/rv:([\d.]+)\) like gecko/)) ? Sys.ie = s[1] : (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] : (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] : (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] : (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] : (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
|
25306 | // if (Sys.chrome) document.write('Chrome: ' + Sys.chrome);
|
25307 | return Sys;
|
25308 | }
|
25309 |
|
25310 | function getElByClass(classN) {
|
25311 | return document.getElementsByClassName(classN)[0];
|
25312 | }
|
25313 |
|
25314 | function setMaskStyle() {
|
25315 | var mask = getElByClass('AutoTree-mask');
|
25316 | if (mask != undefined) {
|
25317 | mask.style.height = window.innerHeight + 'px';
|
25318 | mask.style.width = window.innerWidth + 'px';
|
25319 | }
|
25320 | }
|
25321 |
|
25322 | function setRealNode(event) {
|
25323 | var node = event.target;
|
25324 | var toLowerCase = node.tagName.toLowerCase();
|
25325 | if (toLowerCase !== 'li' && toLowerCase !== 'span' && toLowerCase !== 'em' && node.className !== 'autoTree_ItemName' && node.className !== 'autoTree_ParentName') return;
|
25326 | if (toLowerCase == 'span' || toLowerCase == 'em') {
|
25327 | node = node.parentNode;
|
25328 | }
|
25329 | if (node.className == 'autoTree_ParentName') node = node.previousSibling;
|
25330 | if (node.className == 'auto-tree__item ') node = node.firstChild;
|
25331 | var nodeId = node.getAttribute('data-index');
|
25332 | if (nodeId == null) node = node.parentNode;
|
25333 | return node;
|
25334 | }
|
25335 |
|
25336 | function renderTree(self, temp, offset, treeItemClick, ul_Content, itemClick, searchChange, searchCom, showPanel) {
|
25337 | var _self$props = self.props,
|
25338 | treeData = _self$props.treeData,
|
25339 | autoTreeData = _self$props.autoTreeData,
|
25340 | isFetching = _self$props.isFetching,
|
25341 | componentId = _self$props.componentId,
|
25342 | showDropDown = _self$props.showDropDown;
|
25343 | var _self$state = self.state,
|
25344 | inputValue = _self$state.inputValue,
|
25345 | isFocus = _self$state.isFocus,
|
25346 | searchValue = _self$state.searchValue;
|
25347 |
|
25348 | var _tar = self.refs.autoForm_ref.refs.autoTreeInput;
|
25349 | var autoTreeSum = autoTreeData ? autoTreeData : [];
|
25350 | var assignTreeData = (0, _extends3.default)({}, treeData, { style: { "height": "315px" } });
|
25351 |
|
25352 | var AutoDom = isFetching ? _react2.default.createElement(
|
25353 | 'div',
|
25354 | { style: { "maxHeight": '310px', 'overflowY': 'scroll', backgroundColor: "#FFF", height: '310px' } },
|
25355 | _react2.default.createElement(_loading2.default, { type: 'small' })
|
25356 | ) : searchChange ? (inputValue.length > 0 || searchValue.length > 0) && autoTreeSum.length > 0 ? _react2.default.createElement(
|
25357 | 'div',
|
25358 | null,
|
25359 | showPanel ? _react2.default.createElement(
|
25360 | 'div',
|
25361 | { className: 'auto-result-container-search' },
|
25362 | _react2.default.createElement(
|
25363 | 'ul',
|
25364 | { className: 'auto-result', onClick: itemClick },
|
25365 | ul_Content
|
25366 | )
|
25367 | ) : '',
|
25368 | searchCom
|
25369 | ) : (inputValue.length > 0 || searchValue.length > 0) && autoTreeSum.length == 0 ? _react2.default.createElement('div', { className: 'empty-con error_page' }) : _react2.default.createElement(
|
25370 | 'div',
|
25371 | null,
|
25372 | showPanel ? _react2.default.createElement(_tree2.default, (0, _extends3.default)({}, assignTreeData, { onClick: treeItemClick })) : '',
|
25373 | searchCom
|
25374 | ) : _react2.default.createElement(
|
25375 | 'div',
|
25376 | null,
|
25377 | showPanel ? _react2.default.createElement(_tree2.default, (0, _extends3.default)({}, assignTreeData, { onClick: treeItemClick })) : '',
|
25378 | searchCom
|
25379 | );
|
25380 | var treeLength = treeData.treeData ? treeData.treeData.length : 0;
|
25381 | var treeDOM = document.getElementsByClassName('base-tree-component')[0];
|
25382 | var treeHeight = showDropDown ? 361 : 310;
|
25383 | var height = isFetching ? 310 : treeHeight;
|
25384 | if (!showPanel && showDropDown) height = 51;
|
25385 | //修复点击后错位bug
|
25386 | self.CommonMount.renderDom('autotree__tree-panel', // wrap's classname & id
|
25387 | AutoDom, // content dom
|
25388 | _tar, // 跟随目标
|
25389 | [_tar, //挂载目标节点
|
25390 | { // 挂载元素宽高 {width: '', height: ''}
|
25391 | width: 340, // 挂载宽度
|
25392 | height: height
|
25393 | }], false, //labeL和input框是否为竖向结构,会留出对应的label空间
|
25394 | 0, //水平向左偏移量,为负数则向右
|
25395 | false, //弹层靠左靠右模式,默认为false 靠左模式
|
25396 | 100 //window.onresize执行时间,默认100ms
|
25397 | , 30);
|
25398 | }
|
25399 |
|
25400 | function renderAutoUl(self, temp, offset) {
|
25401 | var _self$state2 = self.state,
|
25402 | isFocus = _self$state2.isFocus,
|
25403 | inputValue = _self$state2.inputValue,
|
25404 | isShow = _self$state2.isShow,
|
25405 | showTree = _self$state2.showTree,
|
25406 | style = _self$state2.style,
|
25407 | status = _self$state2.status,
|
25408 | autoTreeItems = _self$state2.autoTreeItems,
|
25409 | hasClick = _self$state2.hasClick,
|
25410 | single = _self$state2.single;
|
25411 | var _self$props2 = self.props,
|
25412 | autoTreeData = _self$props2.autoTreeData,
|
25413 | sync = _self$props2.sync,
|
25414 | componentId = _self$props2.componentId,
|
25415 | isFetching = _self$props2.isFetching;
|
25416 |
|
25417 | if (!isFocus && showTree == false) self['domState' + componentId] = false;
|
25418 | var autoResultHeight = void 0,
|
25419 | tempPadding = void 0,
|
25420 | showAutoUl = void 0,
|
25421 | findAllText = void 0,
|
25422 | ulChild = void 0,
|
25423 | tempStyle = void 0,
|
25424 | ulStyle = void 0,
|
25425 | autoLi = void 0,
|
25426 | li_ItemHeight = void 0,
|
25427 | tempPopStyle = void 0,
|
25428 | findAll_style = void 0;
|
25429 | autoResultHeight = setResult_Height(autoTreeItems, inputValue, isFocus, hasClick, autoTreeData, sync, componentId);
|
25430 | autoLi = self.returnAutoLi(true);
|
25431 | if (status == 'edit') {
|
25432 | ulChild = autoLi.length == 0 && inputValue.length >= 0 ? _react2.default.createElement('div', { className: 'findNothing empty-con' }) : autoLi;
|
25433 | tempStyle = inputValue.length == 0 && autoLi.length == 0 ? '' : _react2.default.createElement(
|
25434 | 'div',
|
25435 | { className: 'findAll', onClick: self.findAll, style: { 'position': 'absolute', 'bottom': '0', 'right': '15px' } },
|
25436 | _react2.default.createElement(
|
25437 | 'label',
|
25438 | null,
|
25439 | '\u5168\u90E8\u67E5\u627E'
|
25440 | )
|
25441 | );
|
25442 | ulStyle = tempStyle == '' ? { 'padding': '0 0 0 0' } : { 'maxHeight': '280px' };
|
25443 | if (tempStyle == '') {
|
25444 | ulStyle = { 'padding': '0 0 0 0' };
|
25445 | } else if (self.renderParents_Node) {
|
25446 | ulStyle = { 'maxHeight': '280px' };
|
25447 | } else {
|
25448 | ulStyle = { 'maxHeight': '250px' };
|
25449 | }
|
25450 | findAll_style = self.renderParents_Node ? {} : { 'bottom': '50px' };
|
25451 | findAllText = inputValue.length >= 0 && autoLi.length == 0 && isFocus == true ? _react2.default.createElement(
|
25452 | 'div',
|
25453 | { style: findAll_style, className: 'findAll-null' },
|
25454 | _react2.default.createElement(
|
25455 | 'label',
|
25456 | { onClick: self.findAll },
|
25457 | '\u201C\u67E5\u627E\u5168\u90E8\u201D'
|
25458 | )
|
25459 | ) : tempStyle;
|
25460 | showAutoUl = isShow ? _react2.default.createElement(
|
25461 | 'ul',
|
25462 | { className: 'auto-result', style: ulStyle, onClick: self.itemClick },
|
25463 | ulChild
|
25464 | ) : '';
|
25465 | }
|
25466 |
|
25467 | //根据是否显示父级设置下拉最大高度
|
25468 | li_ItemHeight = self.renderParents_Node ? '280px' : '250px';
|
25469 | tempPadding = isShow ? '44px' : '0';
|
25470 | tempPopStyle = autoLi.length > 0 ? { 'maxHeight': li_ItemHeight, 'paddingBottom': tempPadding, 'lineHeight': '34px' } : { 'maxHeight': '280px' };
|
25471 |
|
25472 | var _tar = void 0;
|
25473 | if (status == 'search' && single) {
|
25474 | _tar = getElByClass('autoTree-search-input');
|
25475 | } else if (status == 'edit' && !single) {
|
25476 | _tar = self.refs.autoForm_ref.refs.autoTree_commonInput;
|
25477 | } else if (status == 'edit' && single) {
|
25478 | _tar = self.refs.autoForm_ref.refs.autoTreeInput;
|
25479 | }
|
25480 |
|
25481 | var tempFecthing = isFetching ? _react2.default.createElement(
|
25482 | 'div',
|
25483 | { style: { "maxHeight": '250px', 'overflowY': 'scroll', backgroundColor: "#FFF", height: '200px' } },
|
25484 | _react2.default.createElement(_loading2.default, { type: 'small' })
|
25485 | ) : _react2.default.createElement(
|
25486 | 'div',
|
25487 | { style: { width: _tar.clientWidth } },
|
25488 | showAutoUl,
|
25489 | isShow ? findAllText : ''
|
25490 | );
|
25491 | var AutoDom = status == 'edit' ? _react2.default.createElement(
|
25492 | 'div',
|
25493 | { className: status == 'edit' ? 'auto-result-container' : 'auto-result-container-search',
|
25494 | style: tempPopStyle },
|
25495 | tempFecthing
|
25496 | ) : '';
|
25497 |
|
25498 | // AutoDom = isFetching ? tempFecthing : AutoDom;
|
25499 | if (!showTree) {
|
25500 | self.CommonMount.renderDom('mount-box', // wrap's classname & id
|
25501 | AutoDom, // content dom
|
25502 | _tar, // 跟随目标
|
25503 | [_tar, //挂载目标节点
|
25504 | { // 挂载元素宽高 {width: '', height: ''}
|
25505 | width: _tar.clientWidth, // 挂载宽度
|
25506 | height: autoResultHeight
|
25507 | }]);
|
25508 | }
|
25509 | resetPosition(status, showTree, inputValue, autoTreeItems, componentId, autoTreeData, sync);
|
25510 | }
|
25511 |
|
25512 | //根据数据计算下拉框的实际高度 以便利用高度计算定位位置
|
25513 | function setResult_Height(autoTreeItems, inputValue, isFocus, hasClick, autoTreeData, sync, componentId) {
|
25514 | var autoResultHeight = void 0;
|
25515 | var sessionData = JSON.parse(sessionStorage.getItem('search' + componentId));
|
25516 | var dataResult = sync ? autoTreeItems : autoTreeData;
|
25517 | var tempBool = (dataResult == undefined || dataResult.length == 0) && isFocus == true && sessionData != null && sessionData.length > 0 && hasClick == true || inputValue == '' && isFocus == true && sessionData != null && sessionData.length > 0 && hasClick == false;
|
25518 | //根据数据计算下拉框的实际高度 以便利用高度计算定位位置
|
25519 | // if(dataResult!=undefined || tempBool){
|
25520 | var tempResult = dataResult != undefined ? tempBool ? sessionData : dataResult : sessionData;
|
25521 | var maxLength = void 0,
|
25522 | itemHeight = void 0;
|
25523 | if (tempResult.length > 0) {
|
25524 | maxLength = tempResult[0].pname ? 5 : 8;
|
25525 | itemHeight = tempResult[0].pname ? 54 : 30;
|
25526 | }
|
25527 | if (tempResult.length == 0) {
|
25528 | autoResultHeight = 259;
|
25529 | } else if (tempResult.length > maxLength) {
|
25530 | autoResultHeight = tempResult[0].pname ? 320 : 290;
|
25531 | } else {
|
25532 | autoResultHeight = tempResult.length * itemHeight + 56;
|
25533 | }
|
25534 | // }
|
25535 | return autoResultHeight;
|
25536 | }
|
25537 |
|
25538 | //弹窗定位
|
25539 | function resetPosition(status, showTree, inputValue, autoTreeItems, componentId, autoTreeData, sync) {
|
25540 | var windowH = window.innerHeight;
|
25541 | var windowW = window.innerWidth;
|
25542 | var popAutoResult = getElByClass('pop-auto-result'); //弹窗中搜索结果节点
|
25543 | var searchContainer = getElByClass('searchContainer');
|
25544 | var autoResultContainer = getElByClass('auto-result-container');
|
25545 | //设置弹窗定位
|
25546 | if (status == 'edit' && autoResultContainer != undefined && searchContainer != undefined) {
|
25547 | autoResultContainer.style.left = (windowW - autoResultContainer.offsetWidth) * 0.5 + 'px';
|
25548 | autoResultContainer.style.top = (windowH - autoResultContainer.offsetHeight - 50) * 0.5 + 'px';
|
25549 | autoResultContainer.display = 'block';
|
25550 | } else if (status == 'search' && searchContainer != undefined) {
|
25551 | searchContainer.style.left = (windowW - searchContainer.offsetWidth) * 0.5 + 'px';
|
25552 | searchContainer.style.top = (windowH - searchContainer.offsetHeight) * 0.5 + 'px';
|
25553 | }
|
25554 | }
|
25555 |
|
25556 | function getSelectedData(func, dropDownData) {
|
25557 | var ret = {
|
25558 | defaultValue: dropDownData.defaultValue || "本级别及所有下级",
|
25559 | inputItems: [{
|
25560 | "value": 0,
|
25561 | "text": "本级别",
|
25562 | "isChecked": true
|
25563 | }, {
|
25564 | "value": 4,
|
25565 | "text": "本级别及所有下级",
|
25566 | "isChecked": false
|
25567 | }],
|
25568 | itemClickCallback: function itemClickCallback(event, target, val) {
|
25569 | func(event, target, val);
|
25570 | }
|
25571 | };
|
25572 | return ret;
|
25573 | }
|
25574 |
|
25575 | function pushLi(autoLi, itemClass, holdon_class, i, id, text, sideTip, hiddenTip, index, beforeText, searchContent, searchText, renderParents_Node, pname, props) {
|
25576 | var resultText = index == -1 ? text : _react2.default.createElement(
|
25577 | 'span',
|
25578 | null,
|
25579 | beforeText,
|
25580 | searchContent,
|
25581 | searchText
|
25582 | );
|
25583 | var status = props.status,
|
25584 | single = props.single;
|
25585 |
|
25586 | if (status == 'edit' && !single) {
|
25587 | autoLi.push(_react2.default.createElement(
|
25588 | 'li',
|
25589 | { className: itemClass, id: holdon_class, key: i, 'data-index': id },
|
25590 | _react2.default.createElement(
|
25591 | 'div',
|
25592 | { className: 'autoTree_ItemName', 'data-index': id },
|
25593 | _react2.default.createElement(
|
25594 | _toolTip2.default,
|
25595 | { title: text, side: sideTip, hidden: hiddenTip },
|
25596 | _react2.default.createElement(
|
25597 | 'span',
|
25598 | { 'data-index': id },
|
25599 | resultText
|
25600 | )
|
25601 | )
|
25602 | ),
|
25603 | renderParents_Node == true ? _react2.default.createElement(
|
25604 | 'div',
|
25605 | { className: 'autoTree_ParentName', 'data-index': id },
|
25606 | _react2.default.createElement(
|
25607 | _toolTip2.default,
|
25608 | { title: pname ? pname : '-无-', side: sideTip, hidden: hiddenTip },
|
25609 | _react2.default.createElement(
|
25610 | 'span',
|
25611 | { 'data-index': id },
|
25612 | pname ? pname : '-无-'
|
25613 | )
|
25614 | )
|
25615 | ) : ''
|
25616 | ));
|
25617 | } else {
|
25618 | autoLi.push(_react2.default.createElement(
|
25619 | 'li',
|
25620 | { className: itemClass, id: holdon_class, key: i, 'data-index': id },
|
25621 | _react2.default.createElement(
|
25622 | 'div',
|
25623 | { className: 'autoTree_ItemName', 'data-index': id },
|
25624 | _react2.default.createElement(
|
25625 | _toolTip2.default,
|
25626 | { title: text, side: sideTip, hidden: hiddenTip },
|
25627 | _react2.default.createElement(
|
25628 | 'span',
|
25629 | { 'data-index': id },
|
25630 | resultText
|
25631 | )
|
25632 | ),
|
25633 | renderParents_Node == true ? _react2.default.createElement(
|
25634 | _toolTip2.default,
|
25635 | { title: pname ? pname : '-无-', side: sideTip, hidden: hiddenTip },
|
25636 | _react2.default.createElement(
|
25637 | 'span',
|
25638 | { className: 'auto-tree__item-pname', 'data-index': id },
|
25639 | '(' + (pname ? pname : '-无-') + ')'
|
25640 | )
|
25641 | ) : ''
|
25642 | )
|
25643 | ));
|
25644 | }
|
25645 | }
|
25646 |
|
25647 | function getText(index, text, valueLength, autoLi, itemClass, holdon_class, i, sideTip, hiddenTip, renderParents_Node, item, props) {
|
25648 | var searchContent = void 0,
|
25649 | searchText = void 0,
|
25650 | beforeText = void 0;
|
25651 | if (index != -1) {
|
25652 | beforeText = index == 0 ? '' : text.substring(0, index);
|
25653 | var subValue = text.substring(index, index == 0 ? valueLength : valueLength + index);
|
25654 | searchContent = _react2.default.createElement(
|
25655 | 'em',
|
25656 | null,
|
25657 | subValue
|
25658 | );
|
25659 | searchText = text.substring(index == 0 ? valueLength : valueLength + index, text.length);
|
25660 | }
|
25661 | pushLi(autoLi, itemClass, holdon_class, i, item.id, text, sideTip, hiddenTip, index, beforeText, searchContent, searchText, renderParents_Node, (0, _commonFunc.decode)(item.pname), props);
|
25662 | }
|
25663 |
|
25664 | function getHightLightData(holdOn_index, item, value, autoLi, i, renderParents_Node, sideTip, hiddenTip, props) {
|
25665 | var text = void 0;
|
25666 | text = (0, _commonFunc.decode)(item.name);
|
25667 | var itemClass = renderParents_Node ? "auto-tree__item " : "auto-tree__item_notShow ";
|
25668 | var holdon_class = i == holdOn_index ? 'li-hold-on' : '';
|
25669 | //获取搜索字符在字段中的位置,分两种 1.首位(index==0) 2.非首位
|
25670 | var index = text.indexOf(value);
|
25671 | var valueLength = value.length;
|
25672 | getText(index, text, valueLength, autoLi, itemClass, holdon_class, i, sideTip, hiddenTip, renderParents_Node, item, props);
|
25673 | return autoLi;
|
25674 | }
|
25675 |
|
25676 | /***/ }),
|
25677 | /* 278 */
|
25678 | /***/ (function(module, exports) {
|
25679 |
|
25680 | 'use strict';
|
25681 |
|
25682 | Object.defineProperty(exports, "__esModule", {
|
25683 | value: true
|
25684 | });
|
25685 | /* Modified from https://github.com/sdecima/javascript-detect-element-resize
|
25686 | * version: 0.5.3
|
25687 | *
|
25688 | * The MIT License (MIT)
|
25689 | *
|
25690 | * Copyright (c) 2013 Sebastián Décima
|
25691 | *
|
25692 | * Permission is hereby granted, free of charge, to any person obtaining a copy of
|
25693 | * this software and associated documentation files (the "Software"), to deal in
|
25694 | * the Software without restriction, including without limitation the rights to
|
25695 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
25696 | * the Software, and to permit persons to whom the Software is furnished to do so,
|
25697 | * subject to the following conditions:
|
25698 | *
|
25699 | * The above copyright notice and this permission notice shall be included in all
|
25700 | * copies or substantial portions of the Software.
|
25701 | *
|
25702 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
25703 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
25704 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
25705 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
25706 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
25707 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25708 | *
|
25709 | */
|
25710 | /* eslint-disable */
|
25711 | var isServer = typeof window === 'undefined';
|
25712 |
|
25713 | /* istanbul ignore next */
|
25714 | var requestFrame = function () {
|
25715 | if (isServer) return;
|
25716 | var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (fn) {
|
25717 | return window.setTimeout(fn, 20);
|
25718 | };
|
25719 | return function (fn) {
|
25720 | return raf(fn);
|
25721 | };
|
25722 | }();
|
25723 |
|
25724 | /* istanbul ignore next */
|
25725 | var cancelFrame = function () {
|
25726 | if (isServer) return;
|
25727 | var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;
|
25728 | return function (id) {
|
25729 | return cancel(id);
|
25730 | };
|
25731 | }();
|
25732 |
|
25733 | /* istanbul ignore next */
|
25734 | var resetTrigger = function resetTrigger(element) {
|
25735 | var trigger = element.__resizeTrigger__;
|
25736 | var expand = trigger.firstElementChild;
|
25737 | var contract = trigger.lastElementChild;
|
25738 | var expandChild = expand.firstElementChild;
|
25739 |
|
25740 | contract.scrollLeft = contract.scrollWidth;
|
25741 | contract.scrollTop = contract.scrollHeight;
|
25742 | expandChild.style.width = expand.offsetWidth + 1 + 'px';
|
25743 | expandChild.style.height = expand.offsetHeight + 1 + 'px';
|
25744 | expand.scrollLeft = expand.scrollWidth;
|
25745 | expand.scrollTop = expand.scrollHeight;
|
25746 | };
|
25747 |
|
25748 | /* istanbul ignore next */
|
25749 | var checkTriggers = function checkTriggers(element) {
|
25750 | return element.offsetWidth !== element.__resizeLast__.width || element.offsetHeight !== element.__resizeLast__.height;
|
25751 | };
|
25752 |
|
25753 | /* istanbul ignore next */
|
25754 | var scrollListener = function scrollListener(event) {
|
25755 | var _this = this;
|
25756 |
|
25757 | resetTrigger(this);
|
25758 | if (this.__resizeRAF__) cancelFrame(this.__resizeRAF__);
|
25759 | this.__resizeRAF__ = requestFrame(function () {
|
25760 | if (checkTriggers(_this)) {
|
25761 | _this.__resizeLast__.width = _this.offsetWidth;
|
25762 | _this.__resizeLast__.height = _this.offsetHeight;
|
25763 | _this.__resizeListeners__.forEach(function (fn) {
|
25764 | fn.call(_this, event);
|
25765 | });
|
25766 | }
|
25767 | });
|
25768 | };
|
25769 |
|
25770 | /* Detect CSS Animations support to detect element display/re-attach */
|
25771 | var attachEvent = isServer ? {} : document.attachEvent;
|
25772 | var DOM_PREFIXES = 'Webkit Moz O ms'.split(' ');
|
25773 | var START_EVENTS = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' ');
|
25774 | var RESIZE_ANIMATION_NAME = 'resizeanim';
|
25775 | var animation = false;
|
25776 | var keyFramePrefix = '';
|
25777 | var animationStartEvent = 'animationstart';
|
25778 |
|
25779 | /* istanbul ignore next */
|
25780 | if (!attachEvent && !isServer) {
|
25781 | var testElement = document.createElement('fakeelement');
|
25782 | if (testElement.style.animationName !== undefined) {
|
25783 | animation = true;
|
25784 | }
|
25785 |
|
25786 | if (animation === false) {
|
25787 | var prefix = '';
|
25788 | for (var i = 0; i < DOM_PREFIXES.length; i++) {
|
25789 | if (testElement.style[DOM_PREFIXES[i] + 'AnimationName'] !== undefined) {
|
25790 | prefix = DOM_PREFIXES[i];
|
25791 | keyFramePrefix = '-' + prefix.toLowerCase() + '-';
|
25792 | animationStartEvent = START_EVENTS[i];
|
25793 | animation = true;
|
25794 | break;
|
25795 | }
|
25796 | }
|
25797 | }
|
25798 | }
|
25799 |
|
25800 | var stylesCreated = false;
|
25801 | /* istanbul ignore next */
|
25802 | var createStyles = function createStyles() {
|
25803 | if (!stylesCreated && !isServer) {
|
25804 | var animationKeyframes = '@' + keyFramePrefix + 'keyframes ' + RESIZE_ANIMATION_NAME + ' { from { opacity: 0; } to { opacity: 0; } } ';
|
25805 | var animationStyle = keyFramePrefix + 'animation: 1ms ' + RESIZE_ANIMATION_NAME + ';';
|
25806 |
|
25807 | // opacity: 0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
|
25808 | var css = animationKeyframes + '\n .resize-triggers { ' + animationStyle + ' visibility: hidden; opacity: 0; }\n .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1 }\n .resize-triggers > div { background: #eee; overflow: auto; }\n .contract-trigger:before { width: 200%; height: 200%; }';
|
25809 |
|
25810 | var head = document.head || document.getElementsByTagName('head')[0];
|
25811 | var style = document.createElement('style');
|
25812 |
|
25813 | style.type = 'text/css';
|
25814 | if (style.styleSheet) {
|
25815 | style.styleSheet.cssText = css;
|
25816 | } else {
|
25817 | style.appendChild(document.createTextNode(css));
|
25818 | }
|
25819 |
|
25820 | head.appendChild(style);
|
25821 | stylesCreated = true;
|
25822 | }
|
25823 | };
|
25824 |
|
25825 | /* istanbul ignore next */
|
25826 | var addResizeListener = exports.addResizeListener = function addResizeListener(element, fn) {
|
25827 | if (isServer) return;
|
25828 | if (attachEvent) {
|
25829 | element.attachEvent('onresize', fn);
|
25830 | } else {
|
25831 | if (!element.__resizeTrigger__) {
|
25832 | if (getComputedStyle(element).position === 'static') {
|
25833 | element.style.position = 'relative';
|
25834 | }
|
25835 | createStyles();
|
25836 | element.__resizeLast__ = {};
|
25837 | element.__resizeListeners__ = [];
|
25838 |
|
25839 | var resizeTrigger = element.__resizeTrigger__ = document.createElement('div');
|
25840 | resizeTrigger.className = 'resize-triggers';
|
25841 | resizeTrigger.innerHTML = '<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>';
|
25842 | element.appendChild(resizeTrigger);
|
25843 |
|
25844 | resetTrigger(element);
|
25845 | element.addEventListener('scroll', scrollListener, true);
|
25846 |
|
25847 | /* Listen for a css animation to detect element display/re-attach */
|
25848 | if (animationStartEvent) {
|
25849 | resizeTrigger.addEventListener(animationStartEvent, function (event) {
|
25850 | if (event.animationName === RESIZE_ANIMATION_NAME) {
|
25851 | resetTrigger(element);
|
25852 | }
|
25853 | });
|
25854 | }
|
25855 | }
|
25856 | element.__resizeListeners__.push(fn);
|
25857 | }
|
25858 | };
|
25859 |
|
25860 | /* istanbul ignore next */
|
25861 | var removeResizeListener = exports.removeResizeListener = function removeResizeListener(element, fn) {
|
25862 | if (attachEvent) {
|
25863 | element.detachEvent('onresize', fn);
|
25864 | } else {
|
25865 | element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
|
25866 | if (!element.__resizeListeners__.length) {
|
25867 | element.removeEventListener('scroll', scrollListener);
|
25868 | element.__resizeTrigger__ = !element.removeChild(element.__resizeTrigger__);
|
25869 | }
|
25870 | }
|
25871 | };
|
25872 |
|
25873 | /***/ }),
|
25874 | /* 279 */
|
25875 | /***/ (function(module, exports, __webpack_require__) {
|
25876 |
|
25877 | 'use strict';
|
25878 |
|
25879 | Object.defineProperty(exports, "__esModule", {
|
25880 | value: true
|
25881 | });
|
25882 | exports.default = undefined;
|
25883 |
|
25884 | var _classCallCheck2 = __webpack_require__(42);
|
25885 |
|
25886 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
25887 |
|
25888 | var _possibleConstructorReturn2 = __webpack_require__(43);
|
25889 |
|
25890 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
25891 |
|
25892 | var _inherits2 = __webpack_require__(78);
|
25893 |
|
25894 | var _inherits3 = _interopRequireDefault(_inherits2);
|
25895 |
|
25896 | var _react = __webpack_require__(86);
|
25897 |
|
25898 | var _react2 = _interopRequireDefault(_react);
|
25899 |
|
25900 | var _constant = __webpack_require__(277);
|
25901 |
|
25902 | var _selectedComponent = __webpack_require__(280);
|
25903 |
|
25904 | var _selectedComponent2 = _interopRequireDefault(_selectedComponent);
|
25905 |
|
25906 | var _baseButton = __webpack_require__(284);
|
25907 |
|
25908 | var _baseButton2 = _interopRequireDefault(_baseButton);
|
25909 |
|
25910 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25911 |
|
25912 | var Search_Filters = function (_Component) {
|
25913 | (0, _inherits3.default)(Search_Filters, _Component);
|
25914 |
|
25915 | function Search_Filters() {
|
25916 | (0, _classCallCheck3.default)(this, Search_Filters);
|
25917 | return (0, _possibleConstructorReturn3.default)(this, _Component.apply(this, arguments));
|
25918 | }
|
25919 |
|
25920 | Search_Filters.prototype.render = function render() {
|
25921 | var _props = this.props,
|
25922 | isSearchAutoTreeEdit = _props.isSearchAutoTreeEdit,
|
25923 | DropDownData = _props.DropDownData,
|
25924 | showDropDown = _props.showDropDown,
|
25925 | _props$isPanelShow = _props.isPanelShow,
|
25926 | isPanelShow = _props$isPanelShow === undefined ? true : _props$isPanelShow;
|
25927 |
|
25928 | if (isSearchAutoTreeEdit && showDropDown) {
|
25929 | return _react2.default.createElement(
|
25930 | 'div',
|
25931 | { className: 'auto-tree__panel-bottom ' + (isPanelShow ? 'border-top-1px' : '') },
|
25932 | _react2.default.createElement(
|
25933 | 'div',
|
25934 | { className: 'selectedComponent' },
|
25935 | _react2.default.createElement(_selectedComponent2.default, (0, _constant.getSelectedData)(this.props.changeFilter, DropDownData)),
|
25936 | _react2.default.createElement(
|
25937 | 'div',
|
25938 | { className: 'submitBtn' },
|
25939 | _react2.default.createElement(_baseButton2.default, (0, _constant.getBtnData)("default", "small", "确定", this.props.handelSubmit))
|
25940 | )
|
25941 | )
|
25942 | );
|
25943 | } else {
|
25944 | return null;
|
25945 | }
|
25946 | };
|
25947 |
|
25948 | return Search_Filters;
|
25949 | }(_react.Component);
|
25950 |
|
25951 | exports.default = Search_Filters;
|
25952 | module.exports = exports['default'];
|
25953 |
|
25954 | /***/ }),
|
25955 | /* 280 */
|
25956 | /***/ (function(module, exports, __webpack_require__) {
|
25957 |
|
25958 | 'use strict';
|
25959 |
|
25960 | 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; }; }();
|
25961 |
|
25962 | var _react = __webpack_require__(86);
|
25963 |
|
25964 | var _react2 = _interopRequireDefault(_react);
|
25965 |
|
25966 | var _reactDom = __webpack_require__(243);
|
25967 |
|
25968 | var _InputItem = __webpack_require__(281);
|
25969 |
|
25970 | var _InputItem2 = _interopRequireDefault(_InputItem);
|
25971 |
|
25972 | __webpack_require__(282);
|
25973 |
|
25974 | var _commonFunc = __webpack_require__(252);
|
25975 |
|
25976 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25977 |
|
25978 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
25979 |
|
25980 | 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; }
|
25981 |
|
25982 | 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; } /* eslint-disable */
|
25983 |
|
25984 |
|
25985 | var SelectedComponent = function (_Component) {
|
25986 | _inherits(SelectedComponent, _Component);
|
25987 |
|
25988 | function SelectedComponent(props) {
|
25989 | _classCallCheck(this, SelectedComponent);
|
25990 |
|
25991 | var _this = _possibleConstructorReturn(this, (SelectedComponent.__proto__ || Object.getPrototypeOf(SelectedComponent)).call(this, props));
|
25992 |
|
25993 | _this.handleInputFocus = function (event) {
|
25994 | var writeInputNode = _this.refs.selectInput;
|
25995 | if (writeInputNode) {
|
25996 | _this.setState({ inputStyle: {
|
25997 | top: writeInputNode.offsetTop + writeInputNode.offsetHeight + 'px',
|
25998 | left: writeInputNode.offsetLeft + 1 + 'px'
|
25999 | } });
|
26000 | }
|
26001 | _this.setState({ inputClassName: 'writeInput writeInputonClick', showDropDown: !_this.state.showDropDown });
|
26002 | document.removeEventListener('click', _this.handleInputBlur);
|
26003 | document.addEventListener('click', _this.handleInputBlur);
|
26004 | };
|
26005 |
|
26006 | _this.handleInputBlur = function (event) {
|
26007 | var area = document.getElementsByClassName('writeInput')[0];
|
26008 | if (area != undefined && !area.contains(event.target)) {
|
26009 | _this.setState({ inputClassName: 'writeInputonBlur', showDropDown: false });
|
26010 | }
|
26011 | };
|
26012 |
|
26013 | _this.itemClick = function (event) {
|
26014 | var val = {
|
26015 | text: event.target.innerText
|
26016 | };
|
26017 | (0, _commonFunc.clearToolTipDom)();
|
26018 | _this.setState({ showDropDown: false, inputValue: val.text });
|
26019 | _this.props.itemClickCallback && _this.props.itemClickCallback(event, event.target, val);
|
26020 | };
|
26021 |
|
26022 | _this.state = {
|
26023 | inputValue: props && props.defaultValue || '',
|
26024 | inputClassName: 'writeInput writeInputonBlur',
|
26025 | showDropDown: false,
|
26026 | inputStyle: {}
|
26027 | };
|
26028 | return _this;
|
26029 | }
|
26030 |
|
26031 | _createClass(SelectedComponent, [{
|
26032 | key: 'componentWillUnMount',
|
26033 | value: function componentWillUnMount() {
|
26034 | document.removeEventListener('click', this.handleInputBlur);
|
26035 | }
|
26036 | }, {
|
26037 | key: 'render',
|
26038 | value: function render() {
|
26039 | var _this2 = this;
|
26040 |
|
26041 | var _state = this.state,
|
26042 | inputValue = _state.inputValue,
|
26043 | inputClassName = _state.inputClassName,
|
26044 | inputStyle = _state.inputStyle,
|
26045 | showDropDown = _state.showDropDown;
|
26046 | var _props = this.props,
|
26047 | inputItems = _props.inputItems,
|
26048 | sideTip = _props.sideTip,
|
26049 | hiddenTip = _props.hiddenTip;
|
26050 |
|
26051 | var selectIconClassName = showDropDown ? 'selectIcon pc-sys-dropdownmin-active-svg' : 'selectIcon pc-sys-dropdownmin-nomal-svg';
|
26052 | return _react2.default.createElement(
|
26053 | 'div',
|
26054 | null,
|
26055 | _react2.default.createElement(
|
26056 | 'div',
|
26057 | { ref: 'selectInput', onClick: this.handleInputFocus, className: inputClassName },
|
26058 | _react2.default.createElement(
|
26059 | 'span',
|
26060 | { className: 'inputText' },
|
26061 | (0, _commonFunc.decode)(inputValue)
|
26062 | ),
|
26063 | _react2.default.createElement('span', { className: selectIconClassName })
|
26064 | ),
|
26065 | showDropDown ? _react2.default.createElement(
|
26066 | 'div',
|
26067 | { className: 'input-dropDown' },
|
26068 | _react2.default.createElement(
|
26069 | 'ul',
|
26070 | { className: 'input-dropDownUl' },
|
26071 | inputItems.map(function (item, index) {
|
26072 | return _react2.default.createElement(_InputItem2.default, {
|
26073 | item: item,
|
26074 | key: index,
|
26075 | text: item.text,
|
26076 | hiddenTip: hiddenTip,
|
26077 | sideTip: sideTip,
|
26078 | itemClick: _this2.itemClick
|
26079 | });
|
26080 | })
|
26081 | )
|
26082 | ) : ''
|
26083 | );
|
26084 | }
|
26085 | }]);
|
26086 |
|
26087 | return SelectedComponent;
|
26088 | }(_react.Component);
|
26089 |
|
26090 | module.exports = SelectedComponent;
|
26091 |
|
26092 | /***/ }),
|
26093 | /* 281 */
|
26094 | /***/ (function(module, exports, __webpack_require__) {
|
26095 |
|
26096 | 'use strict';
|
26097 |
|
26098 | Object.defineProperty(exports, "__esModule", {
|
26099 | value: true
|
26100 | });
|
26101 |
|
26102 | 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; }; }();
|
26103 |
|
26104 | var _react = __webpack_require__(86);
|
26105 |
|
26106 | var _react2 = _interopRequireDefault(_react);
|
26107 |
|
26108 | var _reactDom = __webpack_require__(243);
|
26109 |
|
26110 | var _toolTip = __webpack_require__(251);
|
26111 |
|
26112 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
26113 |
|
26114 | var _commonFunc = __webpack_require__(252);
|
26115 |
|
26116 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
26117 |
|
26118 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
26119 |
|
26120 | 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; }
|
26121 |
|
26122 | 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; } /* eslint-disable */
|
26123 |
|
26124 |
|
26125 | var InputItem = function (_Component) {
|
26126 | _inherits(InputItem, _Component);
|
26127 |
|
26128 | function InputItem() {
|
26129 | _classCallCheck(this, InputItem);
|
26130 |
|
26131 | return _possibleConstructorReturn(this, (InputItem.__proto__ || Object.getPrototypeOf(InputItem)).apply(this, arguments));
|
26132 | }
|
26133 |
|
26134 | _createClass(InputItem, [{
|
26135 | key: 'render',
|
26136 | value: function render() {
|
26137 | var _props = this.props,
|
26138 | text = _props.text,
|
26139 | sideTip = _props.sideTip,
|
26140 | hiddenTip = _props.hiddenTip;
|
26141 |
|
26142 | return _react2.default.createElement(
|
26143 | 'li',
|
26144 | { className: 'input__item', onClick: this.props.itemClick.bind(this) },
|
26145 | _react2.default.createElement(
|
26146 | _toolTip2.default,
|
26147 | { title: text, side: sideTip, hidden: hiddenTip },
|
26148 | _react2.default.createElement(
|
26149 | 'span',
|
26150 | { className: 'input__text' },
|
26151 | (0, _commonFunc.decode)(text)
|
26152 | )
|
26153 | )
|
26154 | );
|
26155 | }
|
26156 | }]);
|
26157 |
|
26158 | return InputItem;
|
26159 | }(_react.Component);
|
26160 |
|
26161 | exports.default = InputItem;
|
26162 |
|
26163 | /***/ }),
|
26164 | /* 282 */
|
26165 | /***/ (function(module, exports, __webpack_require__) {
|
26166 |
|
26167 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
26168 |
|
26169 | // load the styles
|
26170 | var content = __webpack_require__(283);
|
26171 | if(typeof content === 'string') content = [[module.id, content, '']];
|
26172 | // add the styles to the DOM
|
26173 | var update = __webpack_require__(248)(content, {});
|
26174 | if(content.locals) module.exports = content.locals;
|
26175 | // Hot Module Replacement
|
26176 | if(false) {
|
26177 | // When the styles change, update the <style> tags
|
26178 | if(!content.locals) {
|
26179 | module.hot.accept("!!../../../../css-loader/index.js!../../../../sass-loader/index.js!./selectedStyle.scss", function() {
|
26180 | var newContent = require("!!../../../../css-loader/index.js!../../../../sass-loader/index.js!./selectedStyle.scss");
|
26181 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
26182 | update(newContent);
|
26183 | });
|
26184 | }
|
26185 | // When the module is disposed, remove the <style> tags
|
26186 | module.hot.dispose(function() { update(); });
|
26187 | }
|
26188 |
|
26189 | /***/ }),
|
26190 | /* 283 */
|
26191 | /***/ (function(module, exports, __webpack_require__) {
|
26192 |
|
26193 | exports = module.exports = __webpack_require__(246)();
|
26194 | // imports
|
26195 |
|
26196 |
|
26197 | // module
|
26198 | exports.push([module.id, ".writeInputonBlur,\n.writeInputonClick {\n display: inline-block;\n height: 100%;\n border-radius: 2px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.71;\n color: #36434D;\n padding-top: 5px;\n vertical-align: middle;\n position: relative;\n cursor: pointer; }\n .writeInputonBlur .inputText,\n .writeInputonClick .inputText {\n display: inline-block;\n vertical-align: middle;\n height: 24px;\n line-height: 24px;\n margin-left: 10px; }\n .writeInputonBlur .selectIcon,\n .writeInputonClick .selectIcon {\n display: inline-block;\n height: 5px;\n width: 6px;\n cursor: pointer;\n vertical-align: middle;\n margin-left: 10px; }\n\n.writeInputonClick span.inputText {\n color: #1587d9; }\n\n.input-dropDown {\n width: 250px;\n border-radius: 2px;\n background-color: #ffffff;\n box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.15);\n margin-top: 10px; }\n .input-dropDown .input-dropDownUl {\n padding-left: 0px; }\n .input-dropDown .input-dropDownUl .input__item {\n width: 100%;\n height: 30px;\n list-style: none;\n cursor: pointer; }\n .input-dropDown .input-dropDownUl .input__item .input__text {\n display: inline-block;\n height: 20px;\n line-height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.67;\n color: #36434D;\n margin-top: 5px;\n margin-left: 15px; }\n .input-dropDown .input-dropDownUl .input__item:hover {\n background-color: #F5F8FA; }\n", ""]);
|
26199 |
|
26200 | // exports
|
26201 |
|
26202 |
|
26203 | /***/ }),
|
26204 | /* 284 */
|
26205 | /***/ (function(module, exports, __webpack_require__) {
|
26206 |
|
26207 | 'use strict';
|
26208 |
|
26209 | 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; }; }();
|
26210 |
|
26211 | var _react = __webpack_require__(86);
|
26212 |
|
26213 | var _react2 = _interopRequireDefault(_react);
|
26214 |
|
26215 | __webpack_require__(285);
|
26216 |
|
26217 | var _toolTip = __webpack_require__(251);
|
26218 |
|
26219 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
26220 |
|
26221 | var _commonFunc = __webpack_require__(252);
|
26222 |
|
26223 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
26224 |
|
26225 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
26226 |
|
26227 | 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; }
|
26228 |
|
26229 | 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; }
|
26230 |
|
26231 | var BaseButton = function (_Component) {
|
26232 | _inherits(BaseButton, _Component);
|
26233 |
|
26234 | function BaseButton(props) {
|
26235 | _classCallCheck(this, BaseButton);
|
26236 |
|
26237 | var _this = _possibleConstructorReturn(this, (BaseButton.__proto__ || Object.getPrototypeOf(BaseButton)).call(this, props));
|
26238 |
|
26239 | _this.state = {
|
26240 | btnActive: '',
|
26241 | btnStyle: '',
|
26242 | btnSize: '',
|
26243 | btnDisabled: '',
|
26244 | maxWidth: '',
|
26245 | top: 0,
|
26246 | left: 0
|
26247 | };
|
26248 | _this.bnRipple = _this.bnRipple.bind(_this);
|
26249 | _this.initData = {
|
26250 | "bsSize": {
|
26251 | "small": "base-btns-bgc-small ",
|
26252 | "block": "base-btns-bgc-block ",
|
26253 | "default": "base-btns-bgc-big "
|
26254 | },
|
26255 | "bsStyle": {
|
26256 | "weaken": "base-btns-weaken ",
|
26257 | "default": " ",
|
26258 | "link": " "
|
26259 | },
|
26260 | "btnDisabled": {
|
26261 | "weaken": "base-btns-bg-gray-weaken ",
|
26262 | "default": "base-btns-bg-gray-defalult ",
|
26263 | "link": " "
|
26264 | }
|
26265 | };
|
26266 | return _this;
|
26267 | }
|
26268 |
|
26269 | _createClass(BaseButton, [{
|
26270 | key: 'bnRipple',
|
26271 | value: function bnRipple(e) {
|
26272 | //点击按钮扩散效果
|
26273 | var _props = this.props,
|
26274 | disabled = _props.disabled,
|
26275 | onClick = _props.onClick;
|
26276 |
|
26277 | if (disabled) return false;
|
26278 | var bgBtn = this.refs.bgBtn;
|
26279 | bgBtn.setAttribute('class', bgBtn.className.replace('base-bg-ripple-active', ''));
|
26280 | var bgBtn_offset = bgBtn.getBoundingClientRect();
|
26281 | var realLeft = e.clientX - bgBtn_offset.left;
|
26282 | var realTop = e.clientY - bgBtn_offset.top;
|
26283 |
|
26284 | bgBtn.setAttribute('class', bgBtn.className + 'base-bg-ripple-active');
|
26285 | this.setState({
|
26286 | top: realTop,
|
26287 | left: realLeft
|
26288 | });
|
26289 | setTimeout(function () {
|
26290 | bgBtn.setAttribute('class', bgBtn.className.replace('base-bg-ripple-active', ''));
|
26291 | }, 350);
|
26292 | (0, _commonFunc.clearToolTipDom)();
|
26293 | onClick && onClick(e, true, this.state);
|
26294 | }
|
26295 | }, {
|
26296 | key: 'componentWillReceiveProps',
|
26297 | value: function componentWillReceiveProps(nextProps) {
|
26298 | var btnDisabled = nextProps.disabled ? this.initData.btnDisabled[nextProps.bsStyle] : this.state.btnDisabled = " ";
|
26299 | this.setState({ btnDisabled: btnDisabled });
|
26300 | }
|
26301 | }, {
|
26302 | key: 'componentWillMount',
|
26303 | value: function componentWillMount() {
|
26304 | //初始化数据,为按钮添加样式
|
26305 | var _props2 = this.props,
|
26306 | active = _props2.active,
|
26307 | bsStyle = _props2.bsStyle,
|
26308 | bsSize = _props2.bsSize,
|
26309 | maxWidth = _props2.maxWidth,
|
26310 | disabled = _props2.disabled;
|
26311 |
|
26312 | if (active) this.state.btnActive = "base-bg-ripple-active ";
|
26313 |
|
26314 | var btnDisabled = disabled ? this.initData.btnDisabled[bsStyle] : this.state.btnDisabled = " ",
|
26315 | btnSize = this.initData.bsSize[bsSize],
|
26316 | maxBtnWidth = maxWidth && maxWidth.length > 0 ? maxWidth : 'none';
|
26317 |
|
26318 | this.setState({
|
26319 | btnDisabled: btnDisabled,
|
26320 | btnSize: btnSize,
|
26321 | maxWidth: maxBtnWidth
|
26322 | });
|
26323 | }
|
26324 | }, {
|
26325 | key: 'render',
|
26326 | value: function render() {
|
26327 | var _state = this.state,
|
26328 | maxWidth = _state.maxWidth,
|
26329 | btnSize = _state.btnSize,
|
26330 | btnDisabled = _state.btnDisabled,
|
26331 | left = _state.left,
|
26332 | top = _state.top;
|
26333 | var _props3 = this.props,
|
26334 | hidden = _props3.hidden,
|
26335 | bsStyle = _props3.bsStyle,
|
26336 | title = _props3.title,
|
26337 | href = _props3.href,
|
26338 | bsSize = _props3.bsSize,
|
26339 | tipsReason = _props3.tipsReason,
|
26340 | tipsDes = _props3.tipsDes,
|
26341 | dataUdt = _props3.dataUdt,
|
26342 | dataUdc = _props3.dataUdc;
|
26343 |
|
26344 | var btnStyle = this.initData.bsStyle[bsStyle];
|
26345 | var status = bsSize != "block" ? "" : "block-btn-style";
|
26346 | if (hidden) {
|
26347 | return _react2.default.createElement('div', null);
|
26348 | } else {
|
26349 | switch (bsStyle) {
|
26350 | case "link":
|
26351 | return _react2.default.createElement(
|
26352 | 'a',
|
26353 | { href: href, title: (0, _commonFunc.decode)(title), target: '_blank' },
|
26354 | (0, _commonFunc.decode)(title)
|
26355 | );
|
26356 | default:
|
26357 | return _react2.default.createElement(
|
26358 | 'div',
|
26359 | { 'data-style-sys': 'ux-base-button', 'data-style-extend': 'ux-base-button', 'data-udt': encodeURIComponent(dataUdt), 'data-udc': encodeURIComponent(dataUdc), className: 'base-button-component clearfix ' + status },
|
26360 | _react2.default.createElement(
|
26361 | _toolTip2.default,
|
26362 | { title: (0, _commonFunc.decode)(title), tipsReason: tipsReason, tipsDes: tipsDes, alwaysShowTips: tipsReason && tipsReason.length > 0 ? 'true' : '' },
|
26363 | _react2.default.createElement(
|
26364 | 'span',
|
26365 | { ref: 'bgBtn',
|
26366 | style: { "maxWidth": maxWidth },
|
26367 | className: 'base-bg-ripple ' + (btnStyle + btnSize + btnDisabled),
|
26368 | onClick: this.bnRipple
|
26369 | },
|
26370 | _react2.default.createElement(
|
26371 | 'span',
|
26372 | { className: 'base-btn-title' },
|
26373 | (0, _commonFunc.decode)(title)
|
26374 | ),
|
26375 | _react2.default.createElement('i', { className: 'ripple', style: { 'left': left, 'top': top } })
|
26376 | )
|
26377 | )
|
26378 | );
|
26379 | }
|
26380 | }
|
26381 | }
|
26382 | }]);
|
26383 |
|
26384 | return BaseButton;
|
26385 | }(_react.Component);
|
26386 |
|
26387 | BaseButton.defaultProps = {
|
26388 | tipsReason: '',
|
26389 | dataUdt: ''
|
26390 | };
|
26391 |
|
26392 |
|
26393 | module.exports = BaseButton;
|
26394 |
|
26395 | /***/ }),
|
26396 | /* 285 */
|
26397 | /***/ (function(module, exports, __webpack_require__) {
|
26398 |
|
26399 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
26400 |
|
26401 | // load the styles
|
26402 | var content = __webpack_require__(286);
|
26403 | if(typeof content === 'string') content = [[module.id, content, '']];
|
26404 | // add the styles to the DOM
|
26405 | var update = __webpack_require__(248)(content, {});
|
26406 | if(content.locals) module.exports = content.locals;
|
26407 | // Hot Module Replacement
|
26408 | if(false) {
|
26409 | // When the styles change, update the <style> tags
|
26410 | if(!content.locals) {
|
26411 | module.hot.accept("!!../../../../css-loader/index.js!../../../../sass-loader/index.js!./all.scss", function() {
|
26412 | var newContent = require("!!../../../../css-loader/index.js!../../../../sass-loader/index.js!./all.scss");
|
26413 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
26414 | update(newContent);
|
26415 | });
|
26416 | }
|
26417 | // When the module is disposed, remove the <style> tags
|
26418 | module.hot.dispose(function() { update(); });
|
26419 | }
|
26420 |
|
26421 | /***/ }),
|
26422 | /* 286 */
|
26423 | /***/ (function(module, exports, __webpack_require__) {
|
26424 |
|
26425 | exports = module.exports = __webpack_require__(246)();
|
26426 | // imports
|
26427 |
|
26428 |
|
26429 | // module
|
26430 | exports.push([module.id, "[data-style-sys=ux-base-button]div.block-btn-style {\n display: block; }\n\n[data-style-sys=ux-base-button].base-button-component {\n display: inline-block; }\n [data-style-sys=ux-base-button].base-button-component .base-btn-common-style, [data-style-sys=ux-base-button].base-button-component .base-btns-bgc-small, [data-style-sys=ux-base-button].base-button-component .base-btns-bgc-big, [data-style-sys=ux-base-button].base-button-component .base-btns-bgc-block, [data-style-sys=ux-base-button].base-button-component .base-btns-weaken {\n text-align: center;\n min-width: 0;\n cursor: pointer;\n font-size: 14px;\n color: #fff;\n margin: 5px 0;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;\n border-radius: 2px;\n float: left;\n -webkit-user-select: none;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis; }\n [data-style-sys=ux-base-button].base-button-component .base-btn-common-style:hover, [data-style-sys=ux-base-button].base-button-component .base-btns-bgc-small:hover, [data-style-sys=ux-base-button].base-button-component .base-btns-bgc-big:hover, [data-style-sys=ux-base-button].base-button-component .base-btns-bgc-block:hover, [data-style-sys=ux-base-button].base-button-component .base-btns-weaken:hover {\n box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);\n transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s; }\n [data-style-sys=ux-base-button].base-button-component .base-btns-bgc-small {\n font-size: 12px;\n line-height: 20px;\n padding: 3px 10px;\n min-width: 30px;\n background-color: #1687d9;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n [data-style-sys=ux-base-button].base-button-component .base-btns-bgc-big {\n font-size: 14px;\n line-height: 24px;\n padding: 3px 15px;\n min-width: 30px;\n background-color: #1687d9;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n [data-style-sys=ux-base-button].base-button-component .base-btns-bgc-block {\n width: 100%;\n height: 46px;\n line-height: 46px;\n background-color: #1687d9;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n [data-style-sys=ux-base-button].base-button-component span.base-btns-bg-gray, [data-style-sys=ux-base-button].base-button-component span.base-btns-bg-gray-defalult, [data-style-sys=ux-base-button].base-button-component span.base-btns-bg-gray-weaken {\n text-align: center;\n min-width: 0;\n border-radius: 2px;\n background-repeat: no-repeat;\n float: left;\n -webkit-user-select: none;\n cursor: not-allowed;\n box-shadow: none; }\n [data-style-sys=ux-base-button].base-button-component span.base-btns-bg-gray:hover, [data-style-sys=ux-base-button].base-button-component span.base-btns-bg-gray-defalult:hover, [data-style-sys=ux-base-button].base-button-component span.base-btns-bg-gray-weaken:hover {\n box-shadow: none; }\n [data-style-sys=ux-base-button].base-button-component .base-btns-bg-gray-defalult {\n color: #D5E9F8;\n background-color: #9FCFF1; }\n [data-style-sys=ux-base-button].base-button-component span.base-btns-bg-gray-weaken {\n color: #C1C7CB; }\n [data-style-sys=ux-base-button].base-button-component .base-btns-weaken {\n color: #36434D;\n background-color: #F5F8FA;\n border-radius: 2px;\n background-repeat: no-repeat; }\n [data-style-sys=ux-base-button].base-button-component .base-bg-ripple {\n position: relative;\n overflow: hidden;\n z-index: 6; }\n [data-style-sys=ux-base-button].base-button-component .base-bg-ripple .ripple {\n display: block;\n position: absolute;\n border: 0 solid rgba(0, 0, 0, 0.2);\n border-radius: 50%;\n opacity: .3;\n pointer-events: none;\n opacity: 1;\n -webkit-border-radius: 50%;\n -moz-border-radius: 50%;\n -ms-border-radius: 50%;\n -o-border-radius: 50%; }\n [data-style-sys=ux-base-button].base-button-component .base-bg-ripple .base-btn-title {\n z-index: 8;\n pointer-events: none; }\n [data-style-sys=ux-base-button].base-button-component .base-bg-ripple-active .ripple {\n z-index: -1;\n border-width: 150px;\n margin-top: -150px;\n margin-left: -150px;\n opacity: 0;\n transition: border-width 1s,margin-top 1s,margin-left 1s,opacity 1s; }\n", ""]);
|
26431 |
|
26432 | // exports
|
26433 |
|
26434 |
|
26435 | /***/ }),
|
26436 | /* 287 */
|
26437 | /***/ (function(module, exports, __webpack_require__) {
|
26438 |
|
26439 | 'use strict';
|
26440 |
|
26441 | Object.defineProperty(exports, "__esModule", {
|
26442 | value: true
|
26443 | });
|
26444 | exports.default = undefined;
|
26445 |
|
26446 | var _classCallCheck2 = __webpack_require__(42);
|
26447 |
|
26448 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
26449 |
|
26450 | var _possibleConstructorReturn2 = __webpack_require__(43);
|
26451 |
|
26452 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
26453 |
|
26454 | var _inherits2 = __webpack_require__(78);
|
26455 |
|
26456 | var _inherits3 = _interopRequireDefault(_inherits2);
|
26457 |
|
26458 | var _react = __webpack_require__(86);
|
26459 |
|
26460 | var _react2 = _interopRequireDefault(_react);
|
26461 |
|
26462 | var _es6PromiseDebounce = __webpack_require__(276);
|
26463 |
|
26464 | var _es6PromiseDebounce2 = _interopRequireDefault(_es6PromiseDebounce);
|
26465 |
|
26466 | var _commonInput = __webpack_require__(288);
|
26467 |
|
26468 | var _commonInput2 = _interopRequireDefault(_commonInput);
|
26469 |
|
26470 | var _edit_Filters = __webpack_require__(292);
|
26471 |
|
26472 | var _edit_Filters2 = _interopRequireDefault(_edit_Filters);
|
26473 |
|
26474 | var _commonFunc = __webpack_require__(252);
|
26475 |
|
26476 | var _toolTip = __webpack_require__(251);
|
26477 |
|
26478 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
26479 |
|
26480 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
26481 |
|
26482 | var AutoForm_Input = function (_Component) {
|
26483 | (0, _inherits3.default)(AutoForm_Input, _Component);
|
26484 |
|
26485 | function AutoForm_Input(props) {
|
26486 | (0, _classCallCheck3.default)(this, AutoForm_Input);
|
26487 |
|
26488 | var _this = (0, _possibleConstructorReturn3.default)(this, _Component.call(this, props));
|
26489 |
|
26490 | _this.resizeInputWidth = function () {
|
26491 | var inputNode = _this.refs.autoFormInput;
|
26492 | if (inputNode != undefined && inputNode.clientWidth != 0) {
|
26493 | inputNode.clientWidth <= 270 ? _this.setState({ isMinWidth: true }) : _this.setState({ isMinWidth: false });
|
26494 | }
|
26495 | };
|
26496 |
|
26497 | _this.onMouseTip = function () {
|
26498 | var self = _this;
|
26499 | //解决点击输入框时光标错位,引起原因是输入框上有层div导致
|
26500 | setTimeout(function () {
|
26501 | self.setState({ mouseTips: true });
|
26502 | }, 100);
|
26503 | };
|
26504 |
|
26505 | _this.tipsClick = function () {
|
26506 | _this.setState({ pointerEvent: "none", showHiddenTips: 'none' });
|
26507 | _this.refs.autoTreeInput.focus();
|
26508 | };
|
26509 |
|
26510 | _this.handlerOver = function () {
|
26511 | _this.props.handlerOver();
|
26512 | };
|
26513 |
|
26514 | _this.handlerOut = function (e) {
|
26515 | _this.setState({
|
26516 | mouseTips: false,
|
26517 | hoverFocusing: false
|
26518 | });
|
26519 | (0, _commonFunc.clearToolTipDom)();
|
26520 | _this.props.handlerOut(e);
|
26521 | };
|
26522 |
|
26523 | _this.state = {
|
26524 | isMinWidth: false,
|
26525 | pointerEvent: "auto",
|
26526 | showHiddenTips: 'block',
|
26527 | mouseTips: false
|
26528 | };
|
26529 | return _this;
|
26530 | }
|
26531 |
|
26532 | AutoForm_Input.prototype.componentDidMount = function componentDidMount() {
|
26533 | var _props = this.props,
|
26534 | status = _props.status,
|
26535 | showDropDown = _props.showDropDown;
|
26536 |
|
26537 | var self = this;
|
26538 | //编辑态双排排列时 根据宽度自适应
|
26539 | if (status == 'edit' && showDropDown == true) {
|
26540 | this.resizeInputWidth();
|
26541 | window.addEventListener('resize', (0, _es6PromiseDebounce2.default)(function () {
|
26542 | self.resizeInputWidth();
|
26543 | }, 200), false);
|
26544 | }
|
26545 | };
|
26546 |
|
26547 | AutoForm_Input.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
26548 | var _props2 = this.props,
|
26549 | commmonInput_Data = _props2.commmonInput_Data,
|
26550 | single = _props2.single,
|
26551 | defaultValue = _props2.defaultValue,
|
26552 | inputValue = _props2.inputValue,
|
26553 | disabled = _props2.disabled;
|
26554 |
|
26555 | if (defaultValue != nextProps.defaultValue && single && !disabled) {
|
26556 | this.refs.autoTreeInput.value = (0, _commonFunc.decode)(nextProps.defaultValue);
|
26557 | }
|
26558 | if (inputValue != nextProps.inputValue && single && !disabled) {
|
26559 | this.refs.autoTreeInput.value = (0, _commonFunc.decode)(nextProps.inputValue);
|
26560 | }
|
26561 | if (commmonInput_Data.selectDate && nextProps.selectDate) {
|
26562 | var updateSelectData = commmonInput_Data.selectDate.length != nextProps.selectDate.length ? true : false;
|
26563 | if (updateSelectData) this.setState({});
|
26564 | }
|
26565 | if (commmonInput_Data.isActive && nextProps.isActive && commmonInput_Data.isActive != nextProps.isActive) {
|
26566 | this.setState({});
|
26567 | }
|
26568 | };
|
26569 |
|
26570 | AutoForm_Input.prototype.render = function render() {
|
26571 | var _props3 = this.props,
|
26572 | disabled = _props3.disabled,
|
26573 | status = _props3.status,
|
26574 | isShowMouseOverIcon = _props3.isShowMouseOverIcon,
|
26575 | showDropDown = _props3.showDropDown,
|
26576 | DropDownData = _props3.DropDownData,
|
26577 | placeholder = _props3.placeholder,
|
26578 | inputValue = _props3.inputValue,
|
26579 | defaultValue = _props3.defaultValue,
|
26580 | isFocus = _props3.isFocus,
|
26581 | errorStatus = _props3.errorStatus,
|
26582 | errorMsg = _props3.errorMsg,
|
26583 | single = _props3.single,
|
26584 | showText = _props3.showText,
|
26585 | commmonInput_Data = _props3.commmonInput_Data,
|
26586 | isSearchAutoTreeEdit = _props3.isSearchAutoTreeEdit,
|
26587 | readOnly = _props3.readOnly;
|
26588 | var _state = this.state,
|
26589 | isMinWidth = _state.isMinWidth,
|
26590 | pointerEvent = _state.pointerEvent,
|
26591 | showHiddenTips = _state.showHiddenTips,
|
26592 | mouseTips = _state.mouseTips;
|
26593 |
|
26594 | var isMinClass = void 0,
|
26595 | inutClassStyle = void 0,
|
26596 | inputClass = void 0,
|
26597 | isDisabled = void 0,
|
26598 | inputStyle = void 0,
|
26599 | autoInput_class = void 0,
|
26600 | closeBtnClass = void 0,
|
26601 | dropDownIcon = void 0,
|
26602 | iconOrText = void 0,
|
26603 | erroStyle = void 0,
|
26604 | notDropDown = void 0,
|
26605 | baseStyle = void 0;
|
26606 | var _autoTreeLeft_Class = '';
|
26607 |
|
26608 | isMinClass = isMinWidth ? 'leftInput-showDropDown isMinWidth' : 'leftInput-showDropDown notMin';
|
26609 | inutClassStyle = status == 'edit' ? showDropDown ? isMinWidth ? 'auto-form-input-active-showDropDownisMin ' : 'auto-form-input-active-showDropDown ' : 'auto-form-input-active-notShowDropDown ' : 'auto-form-input-active-seach ';
|
26610 |
|
26611 | inputClass = !errorStatus && isFocus && single ? inutClassStyle : '';
|
26612 | closeBtnClass = status == 'search' ? 'sys-icon-close date-time-close-search closeBtn-search' : showDropDown ? 'sys-icon-close date-time-close closeBtn-edit-showDropDown' : 'sys-icon-close date-time-close closeBtn-edit-notShowDropDown';
|
26613 |
|
26614 | if (status == 'search') erroStyle = { 'height': '45px' };
|
26615 | if (!errorStatus) baseStyle = { 'height': '0px' };
|
26616 | var showClose = inputValue.length > 0 && (isFocus == true || isShowMouseOverIcon) ? 'block' : 'none';
|
26617 |
|
26618 | if (disabled == false || disabled == undefined) {
|
26619 | isDisabled = '';
|
26620 | inputStyle = { 'paddingRight': '33px' };
|
26621 | } else {
|
26622 | isDisabled = 'disabled';
|
26623 | inputStyle = { 'background': 'rgb(245, 248, 250)',
|
26624 | 'border': '1px solid rgb(228, 235, 240)',
|
26625 | 'borderRadius': '5px',
|
26626 | 'fontFamily': 'PingFangSC-Regular',
|
26627 | 'fontSize': '12px',
|
26628 | 'color': '#3E4E59',
|
26629 | 'letterSpacing': '0px',
|
26630 | 'lineHeight': '20px',
|
26631 | 'textAlign': 'left',
|
26632 | 'cursor': 'no-drop'
|
26633 | };
|
26634 | }
|
26635 |
|
26636 | if (disabled) {
|
26637 | dropDownIcon = '';
|
26638 | } else {
|
26639 | dropDownIcon = _react2.default.createElement('span', { className: showDropDown ? 'autoTreeIcon-showDropDown pc-sys-arrowdown-nomal-svg' : 'autoTreeIcon-notShowDropDown pc-sys-arrowdown-nomal-svg', onClick: this.props.editInput_focus });
|
26640 | }
|
26641 |
|
26642 | if (status == 'edit') {
|
26643 | iconOrText = dropDownIcon;
|
26644 | autoInput_class = single ? 'auto-input-edit' : 'auto-input-edit_muit';
|
26645 | _autoTreeLeft_Class = !single ? '' : 'autoTreeLeftInput-single ';
|
26646 | notDropDown = isSearchAutoTreeEdit ? ' auto-tree__input_not-dropdown' : '';
|
26647 | } else {
|
26648 | autoInput_class = 'auto-input-search';
|
26649 | iconOrText = _react2.default.createElement(
|
26650 | 'div',
|
26651 | { className: 'findAll' },
|
26652 | _react2.default.createElement(
|
26653 | 'label',
|
26654 | { onClick: this.props.findAll },
|
26655 | '\u5168\u90E8\u67E5\u627E'
|
26656 | )
|
26657 | );
|
26658 | }
|
26659 | var decodeValue = (0, _commonFunc.decode)(defaultValue);
|
26660 | console.log(decodeValue);
|
26661 | return _react2.default.createElement(
|
26662 | 'div',
|
26663 | { ref: 'autoFormInput',
|
26664 | className: "field-right auto-rightinput auto-form-input " + inputClass + autoInput_class + notDropDown,
|
26665 | style: erroStyle
|
26666 | },
|
26667 | _react2.default.createElement(
|
26668 | 'div',
|
26669 | { ref: 'leftInput', className: status == 'edit' ? showDropDown && !isSearchAutoTreeEdit ? isMinClass : 'leftInput-notShowDropDown' : '' },
|
26670 | single && status == 'edit' || status == 'search' ? isDisabled ? _react2.default.createElement(_commonInput2.default, { readonly: true, errorStatus: errorStatus, errorMsg: errorMsg, defaultValue: decodeValue }) : _react2.default.createElement(
|
26671 | 'div',
|
26672 | { onMouseOver: this.handlerOver, onMouseOut: this.handlerOut },
|
26673 | mouseTips ? null : _react2.default.createElement(
|
26674 | _toolTip2.default,
|
26675 | { title: inputValue },
|
26676 | _react2.default.createElement(
|
26677 | 'div',
|
26678 | { className: 'form-item_is-hidden-tips', onMouseEnter: this.onMouseTip, style: { pointerEvents: pointerEvent, display: showHiddenTips }, onClick: this.tipsClick },
|
26679 | inputValue
|
26680 | )
|
26681 | ),
|
26682 | _react2.default.createElement('input', {
|
26683 | className: 'autoTreeLeftInput ' + _autoTreeLeft_Class + (status == 'edit' ? '' : 'autoTree-search-input'),
|
26684 | type: 'text',
|
26685 | ref: 'autoTreeInput',
|
26686 | placeholder: disabled ? '' : placeholder,
|
26687 | defaultValue: decodeValue,
|
26688 | onClick: this.props.addClass,
|
26689 | onBlur: this.props.removeClass,
|
26690 | onChange: this.props.onChange,
|
26691 | onFocus: this.props.addClass,
|
26692 | disabled: isDisabled,
|
26693 | readOnly: readOnly,
|
26694 | style: inputStyle
|
26695 | }),
|
26696 | _react2.default.createElement('span', { style: { "display": showClose, "top": (0, _commonFunc.judgeBrowser)().isIe10 ? '0' : 'none' }, className: closeBtnClass, ref: 'mouseIconClose', onClick: this.props.clearData }),
|
26697 | iconOrText,
|
26698 | status == 'edit' ? _react2.default.createElement(
|
26699 | 'div',
|
26700 | { className: 'base-input-show', style: baseStyle },
|
26701 | _react2.default.createElement(
|
26702 | 'span',
|
26703 | { className: 'base-input-show-text ' + (isFocus ? 'input-pFoucus ' + (errorStatus ? 'input-pError ' : 'input-pRight ') : errorStatus ? 'input-pFoucus input-pError ' : 'input-pBlur input-pRight ') },
|
26704 | errorStatus ? errorMsg : showText
|
26705 | )
|
26706 | ) : ''
|
26707 | ) : _react2.default.createElement(
|
26708 | 'div',
|
26709 | { ref: 'autoTree_commonInput', className: 'autoTreeLeftInput ' + (status == 'edit' ? '' : 'autoTree-search-input') },
|
26710 | _react2.default.createElement(_commonInput2.default, commmonInput_Data)
|
26711 | )
|
26712 | ),
|
26713 | !isSearchAutoTreeEdit ? _react2.default.createElement(_edit_Filters2.default, { DropDownData: DropDownData, isMinWidth: isMinWidth, status: status, changeFilter: this.props.changeFilter, showDropDown: showDropDown }) : ''
|
26714 | );
|
26715 | };
|
26716 |
|
26717 | return AutoForm_Input;
|
26718 | }(_react.Component);
|
26719 |
|
26720 | exports.default = AutoForm_Input;
|
26721 | module.exports = exports['default'];
|
26722 |
|
26723 | /***/ }),
|
26724 | /* 288 */
|
26725 | /***/ (function(module, exports, __webpack_require__) {
|
26726 |
|
26727 | 'use strict';
|
26728 |
|
26729 | 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; };
|
26730 |
|
26731 | 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; }; }();
|
26732 |
|
26733 | var _react = __webpack_require__(86);
|
26734 |
|
26735 | var _react2 = _interopRequireDefault(_react);
|
26736 |
|
26737 | __webpack_require__(289);
|
26738 |
|
26739 | var _item = __webpack_require__(291);
|
26740 |
|
26741 | var _item2 = _interopRequireDefault(_item);
|
26742 |
|
26743 | var _toolTip = __webpack_require__(251);
|
26744 |
|
26745 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
26746 |
|
26747 | var _es6PromiseDebounce = __webpack_require__(276);
|
26748 |
|
26749 | var _es6PromiseDebounce2 = _interopRequireDefault(_es6PromiseDebounce);
|
26750 |
|
26751 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
26752 |
|
26753 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
26754 |
|
26755 | 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; }
|
26756 |
|
26757 | 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; }
|
26758 |
|
26759 | var CommonInput = function (_Component) {
|
26760 | _inherits(CommonInput, _Component);
|
26761 |
|
26762 | function CommonInput(props) {
|
26763 | _classCallCheck(this, CommonInput);
|
26764 |
|
26765 | var _this = _possibleConstructorReturn(this, (CommonInput.__proto__ || Object.getPrototypeOf(CommonInput)).call(this, props));
|
26766 |
|
26767 | _this.hasScrollBar = function () {
|
26768 | if (_this.refs.listUl && _this.refs.listUl.scrollHeight > _this.refs.listUl.clientHeight) {
|
26769 | _this.setState({ hasScroll: true });
|
26770 | } else {
|
26771 | _this.setState({ hasScroll: false });
|
26772 | }
|
26773 | };
|
26774 |
|
26775 | _this.handlerClick = function (event) {
|
26776 | event.stopPropagation();
|
26777 | _this.props.handlerClick && _this.props.handlerClick(event, _this.refs.listUl);
|
26778 | };
|
26779 |
|
26780 | _this.inputClick = function (event) {
|
26781 | var value = _this.refs.inputBox.value;
|
26782 | _this.callBackValue(event, "inputClick", value);
|
26783 | };
|
26784 |
|
26785 | _this.inputBlur = function (event) {
|
26786 | var value = _this.refs.inputBox.value;
|
26787 | _this.setState({ focusing: false });
|
26788 | _this.callBackValue(event, "inputBlur", value);
|
26789 | };
|
26790 |
|
26791 | _this.onRealChange = function (event) {
|
26792 | event.persist();
|
26793 | _this.inputChange(event);
|
26794 | };
|
26795 |
|
26796 | _this.inputChange = function (event) {
|
26797 | var value = _this.refs.inputBox.value;
|
26798 | _this.callBackValue(event, "inputChange", value);
|
26799 | };
|
26800 |
|
26801 | _this.handlerFocus = function (event) {
|
26802 | _this.setState({ focusing: true });
|
26803 | };
|
26804 |
|
26805 | _this.callBackValue = function (event, status, value) {
|
26806 | if (_this.props.disabled || _this.props.readonly) return false;
|
26807 | _this.props[status] && _this.props[status](event, status, value);
|
26808 | };
|
26809 |
|
26810 | _this.itemClose = function (event, item, index) {
|
26811 | event.stopPropagation();
|
26812 | _this.props.itemClose(event, item, index);
|
26813 | };
|
26814 |
|
26815 | _this.dropClick = function (event) {
|
26816 | _this.props.dropClick && _this.props.dropClick(event, "dropClick", _this.refs.listUl);
|
26817 | };
|
26818 |
|
26819 | _this._isSafariBrowser = function () {
|
26820 | var ua = window.navigator.userAgent;
|
26821 | return ua.indexOf("Safari") != -1 && ua.indexOf("Version") != -1 ? true : false;
|
26822 | };
|
26823 |
|
26824 | _this.state = {
|
26825 | defaultValue: props.defaultValue,
|
26826 | focusing: false,
|
26827 | hasScroll: false
|
26828 | };
|
26829 | _this.inputChange = (0, _es6PromiseDebounce2.default)(_this.inputChange, 200);
|
26830 | _this.isSafariBrowser = _this._isSafariBrowser();
|
26831 | return _this;
|
26832 | }
|
26833 |
|
26834 | _createClass(CommonInput, [{
|
26835 | key: 'componentWillReceiveProps',
|
26836 | value: function componentWillReceiveProps(nextProps) {
|
26837 | if (this.props.hasInput && nextProps.defaultValue != this.state.defaultValue) {
|
26838 | this.setState({ defaultValue: nextProps.defaultValue });
|
26839 | if (this.props.hasInput) {
|
26840 | return false;
|
26841 | } else {
|
26842 | this.refs.inputBox.value = nextProps.defaultValue;
|
26843 | }
|
26844 | /*
|
26845 | * 问题 判断safari浏览器,解决在新版浏览器上input.value时,不能正确消失placeholder问题;
|
26846 | * 解决方法 通过两次setValue可解决问题
|
26847 | * author:lsh;
|
26848 | */
|
26849 | this.isSafariBrowser && (this.refs.inputBox.value = nextProps.defaultValue);
|
26850 | }
|
26851 | }
|
26852 | }, {
|
26853 | key: 'componentDidMount',
|
26854 | value: function componentDidMount() {
|
26855 | this.hasScrollBar();
|
26856 | }
|
26857 | }, {
|
26858 | key: 'componentDidUpdate',
|
26859 | value: function componentDidUpdate(prevProps) {
|
26860 | if (JSON.stringify(prevProps.selectDate) != JSON.stringify(this.props.selectDate)) {
|
26861 | this.hasScrollBar();
|
26862 | }
|
26863 | }
|
26864 | }, {
|
26865 | key: 'render',
|
26866 | value: function render() {
|
26867 | var _props = this.props,
|
26868 | selectDate = _props.selectDate,
|
26869 | hasInput = _props.hasInput,
|
26870 | showInput = _props.showInput,
|
26871 | placeHolder = _props.placeHolder,
|
26872 | defaultValue = _props.defaultValue,
|
26873 | isActive = _props.isActive,
|
26874 | readonly = _props.readonly,
|
26875 | errorStatus = _props.errorStatus,
|
26876 | errorMsg = _props.errorMsg,
|
26877 | PromptMsg = _props.PromptMsg,
|
26878 | isShowTips = _props.isShowTips,
|
26879 | sideTip = _props.sideTip;
|
26880 |
|
26881 | var self = this;
|
26882 | var hasScroll = this.state.hasScroll;
|
26883 |
|
26884 | var multipleReadonly = [];
|
26885 | selectDate && selectDate.map(function (item, index) {
|
26886 | multipleReadonly.push(item.name + (item.pname ? ' (' + item.pname + ') ' : ''));
|
26887 | });
|
26888 | if (hasInput) {
|
26889 | defaultValue = '';
|
26890 | }
|
26891 | if (showInput) {
|
26892 | if (selectDate.length > 0) {
|
26893 | hasInput = false;
|
26894 | }
|
26895 | }
|
26896 |
|
26897 | //临时处理
|
26898 | var mutiValue = multipleReadonly.toString() == "" ? defaultValue : multipleReadonly.toString();
|
26899 | if (readonly) {
|
26900 | return _react2.default.createElement(
|
26901 | 'div',
|
26902 | { 'data-style-sys': 'ux-common-input', 'data-style-extend': 'ux-common-input', className: "form-item__control form-item__control_is-readonly " + (errorStatus ? "form-item__control_has-error" : "") },
|
26903 | _react2.default.createElement(
|
26904 | _toolTip2.default,
|
26905 | { title: mutiValue, side: sideTip, hidden: false },
|
26906 | _react2.default.createElement(
|
26907 | 'div',
|
26908 | { className: 'u-input_is-readonly' },
|
26909 | mutiValue
|
26910 | )
|
26911 | ),
|
26912 | errorStatus || PromptMsg ? _react2.default.createElement(
|
26913 | 'span',
|
26914 | { className: 'form-item__explain' },
|
26915 | errorStatus ? errorMsg : PromptMsg
|
26916 | ) : ""
|
26917 | );
|
26918 | } else {
|
26919 | return _react2.default.createElement(
|
26920 | 'div',
|
26921 | { 'data-style-sys': 'ux-common-input', 'data-style-extend': 'ux-common-input', className: "form-item__control " + (this.state.focusing || isActive ? "form-item__control_is-active " : "") + (errorStatus || PromptMsg ? "form-item__control_is-active form-item__control_has-info " : "") + (errorStatus ? "form-item__control_has-error" : ""), tabIndex: '0' },
|
26922 | _react2.default.createElement(
|
26923 | 'ul',
|
26924 | { className: 'list_horizontal list_wrap form-item__multi-list area-select-items list_is-edit-status', onClick: this.handlerClick, ref: 'listUl' },
|
26925 | selectDate.map(function (item, index) {
|
26926 | var itemDate = {
|
26927 | "status": readonly ? "show" : "edit",
|
26928 | "name": item.name,
|
26929 | "pname": item.pname,
|
26930 | "isActive": false,
|
26931 | "isShowTips": isShowTips,
|
26932 | "sideTip": sideTip,
|
26933 | "icon": "",
|
26934 | itemClose: function itemClose(event, data) {
|
26935 | self.itemClose(event, data, data.index);
|
26936 | },
|
26937 | "item": item
|
26938 | };
|
26939 | return _react2.default.createElement(_item2.default, _extends({}, itemDate, { index: index, key: index }));
|
26940 | }),
|
26941 | hasInput ? _react2.default.createElement('input', {
|
26942 | className: 'common_input_box',
|
26943 | ref: 'inputBox',
|
26944 | placeholder: placeHolder,
|
26945 | defaultValue: defaultValue,
|
26946 | onFocus: this.handlerFocus,
|
26947 | onClick: this.inputClick,
|
26948 | onBlur: this.inputBlur,
|
26949 | onChange: this.onRealChange
|
26950 | }) : ""
|
26951 | ),
|
26952 | errorStatus || PromptMsg ? _react2.default.createElement(
|
26953 | 'span',
|
26954 | { className: 'form-item__explain' },
|
26955 | errorStatus ? errorMsg : PromptMsg
|
26956 | ) : "",
|
26957 | _react2.default.createElement(
|
26958 | 'span',
|
26959 | { className: 'form-item__right-icon', style: { "marginRight": hasScroll ? "15px" : "0px" } },
|
26960 | _react2.default.createElement('i', { className: 'u-icon pc-sys-arrowdown-nomal-svg', onClick: this.dropClick })
|
26961 | )
|
26962 | );
|
26963 | }
|
26964 | }
|
26965 | }]);
|
26966 |
|
26967 | return CommonInput;
|
26968 | }(_react.Component);
|
26969 |
|
26970 | CommonInput.defaultProps = {
|
26971 | selectDate: []
|
26972 | };
|
26973 |
|
26974 |
|
26975 | module.exports = CommonInput;
|
26976 |
|
26977 | /***/ }),
|
26978 | /* 289 */
|
26979 | /***/ (function(module, exports, __webpack_require__) {
|
26980 |
|
26981 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
26982 |
|
26983 | // load the styles
|
26984 | var content = __webpack_require__(290);
|
26985 | if(typeof content === 'string') content = [[module.id, content, '']];
|
26986 | // add the styles to the DOM
|
26987 | var update = __webpack_require__(248)(content, {});
|
26988 | if(content.locals) module.exports = content.locals;
|
26989 | // Hot Module Replacement
|
26990 | if(false) {
|
26991 | // When the styles change, update the <style> tags
|
26992 | if(!content.locals) {
|
26993 | module.hot.accept("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss", function() {
|
26994 | var newContent = require("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss");
|
26995 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
26996 | update(newContent);
|
26997 | });
|
26998 | }
|
26999 | // When the module is disposed, remove the <style> tags
|
27000 | module.hot.dispose(function() { update(); });
|
27001 | }
|
27002 |
|
27003 | /***/ }),
|
27004 | /* 290 */
|
27005 | /***/ (function(module, exports, __webpack_require__) {
|
27006 |
|
27007 | exports = module.exports = __webpack_require__(246)();
|
27008 | // imports
|
27009 |
|
27010 |
|
27011 | // module
|
27012 | exports.push([module.id, "[data-style-sys=ux-common-input] .common_input_box {\n outline: none;\n border: none;\n width: auto;\n flex: 1 1 auto;\n height: 28px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n line-height: 20px;\n color: #021726;\n outline: transparent;\n padding: 0; }\n\n[data-style-sys=ux-common-input] .form-item__multi-list .form-item__multi-item {\n vertical-align: middle; }\n\n[data-style-sys=ux-common-input] .form-item__multi-item {\n height: 28px;\n line-height: 26px;\n padding-right: 10px;\n padding-right: .625rem;\n padding-left: 0;\n padding-left: 0rem;\n margin-right: 5px;\n margin-right: .3125rem;\n margin-bottom: 2px;\n margin-bottom: .125rem;\n cursor: default;\n border-radius: 2px;\n border-radius: .125rem;\n display: inline-table;\n transition: opacity 1s; }\n\n[data-style-sys=ux-common-input] .form-item__multi-item .form-item__text {\n max-width: calc(100% - 19px);\n max-width: 18.75rem;\n margin-right: 5px;\n margin-right: .3125rem;\n overflow: hidden;\n color: #021726;\n text-overflow: ellipsis;\n white-space: nowrap;\n vertical-align: middle; }\n [data-style-sys=ux-common-input] .form-item__multi-item .form-item__text .form-item__text-parent {\n margin-left: 3px;\n color: #828F99;\n font-weight: 200; }\n\n[data-style-sys=ux-common-input] .form-item__multi-item .sys-icon-close, [data-style-sys=ux-common-input] .form-item__multi-list .form-item__multi-item .sys-icon-cus-renyuan, [data-style-sys=ux-common-input] .form-item__multi-list .form-item__multi-item .sys-icon-cus-chengshi {\n font-size: 14px;\n font-size: .875rem;\n vertical-align: middle; }\n\n[data-style-sys=ux-common-input] .form-item__text {\n display: inline-block;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 14px;\n font-size: .875rem;\n line-height: 24px;\n line-height: 1.5rem; }\n\n[data-style-sys=ux-common-input] .u-icon.sys-icon-close {\n cursor: pointer; }\n\n[data-style-sys=ux-common-input] .u-icon.sys-icon-close:before {\n color: #acb7bf; }\n\n[data-style-sys=ux-common-input] .u-icon.sys-icon-close:hover:before {\n color: #cc2929; }\n\n[data-style-sys=ux-common-input] .common_input_box::-webkit-input-placeholder {\n color: #bcc8d1;\n opacity: 1; }\n\n[data-style-sys=ux-common-input] .common_input_box::-moz-placeholder {\n color: #bcc8d1;\n opacity: 1; }\n\n[data-style-sys=ux-common-input] .common_input_box:-ms-input-placeholder {\n color: #bcc8d1;\n opacity: 1; }\n\n[data-style-sys=ux-common-input] .common_input_box::placeholder {\n color: #bcc8d1;\n opacity: 1; }\n\n[data-style-sys=ux-common-input] .common_input_box::-webkit-input-placeholder {\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 14px;\n line-height: 20px;\n line-height: 1.25rem;\n color: #bcc8d1; }\n\n[data-style-sys=ux-common-input] .common_input_box:-moz-placeholder {\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 14px;\n line-height: 28px;\n color: #bcc8d1; }\n\n[data-style-sys=ux-common-input] .common_input_box::-moz-placeholder {\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 14px;\n line-height: 28px;\n color: #bcc8d1; }\n\n[data-style-sys=ux-common-input] .common_input_box:-ms-input-placeholder {\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 14px;\n line-height: 20px;\n line-height: 1.25rem;\n color: #bcc8d1; }\n\n[data-style-sys=ux-common-input] .disabled-icon {\n height: 13px;\n width: 11px;\n position: absolute;\n right: 5px;\n bottom: 5px; }\n\n[data-style-sys=ux-common-input] input::-ms-clear {\n display: none; }\n\n[data-style-sys=ux-common-input] .form-item__title {\n position: relative;\n max-width: 100%;\n overflow: hidden;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-size: .75rem;\n line-height: 20px;\n line-height: 1.25rem;\n color: #3d5566;\n text-overflow: ellipsis;\n white-space: nowrap;\n vertical-align: middle; }\n\n[data-style-sys=ux-common-input] .form-item__title .indent-style {\n text-indent: 5px;\n text-indent: .3125rem; }\n\n[data-style-sys=ux-common-input] .form-item__title .form-item__text {\n height: 20px;\n text-indent: 5px;\n text-indent: .3125rem;\n max-width: inherit;\n overflow: hidden;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: inherit;\n line-height: inherit;\n text-overflow: ellipsis;\n white-space: nowrap;\n vertical-align: middle; }\n\n[data-style-sys=ux-common-input] .form-item__text {\n display: inline-block;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 14px;\n font-size: .875rem;\n line-height: 24px;\n line-height: 1.5rem; }\n\n[data-style-sys=ux-common-input].form-item__control {\n border: 1px solid #e4ebf0;\n border-radius: 5px;\n position: relative;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-flex-wrap: wrap;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap; }\n [data-style-sys=ux-common-input].form-item__control.form-item__control_is-readonly {\n border: none; }\n [data-style-sys=ux-common-input].form-item__control:hover {\n border-color: #96d0fa; }\n [data-style-sys=ux-common-input].form-item__control:focus {\n background: #ffffff;\n border: 1px solid #1687d9;\n box-shadow: 0 0 2px 1px #96d0fa;\n outline: 0; }\n [data-style-sys=ux-common-input].form-item__control .u-input_is-readonly {\n border: transparent;\n border: 1px solid #e4ebf0;\n width: 100%;\n height: 28px;\n padding: 0px 5px 0px 5px;\n padding: 0rem 0.3125rem 0rem 0.3125rem;\n outline: transparent;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", SimSun, STHeitiSC, sans-serif;\n color: #021726; }\n [data-style-sys=ux-common-input].form-item__control .common_input_box {\n border-radius: 5px; }\n\n[data-style-sys=ux-common-input].form-item__control_is-active {\n background: #ffffff;\n border-color: #1687d9;\n box-shadow: 0 0 2px 1px #96d0fa; }\n [data-style-sys=ux-common-input].form-item__control_is-active:hover {\n border-color: #1687d9; }\n\n[data-style-sys=ux-common-input].form-item__control_has-error {\n border: none;\n box-shadow: none; }\n [data-style-sys=ux-common-input].form-item__control_has-error .list_horizontal {\n background: rgba(204, 41, 41, 0.05);\n border: 1px solid #cc2929;\n border-radius: 5px; }\n [data-style-sys=ux-common-input].form-item__control_has-error .common_input_box {\n background-color: transparent; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_is-active .form-item__bottom-line {\n left: 0;\n width: 100%;\n background-color: #1687d9;\n -webkit-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s;\n -o-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s;\n transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_is-active .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-nomal-svg {\n display: none; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_is-active .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-active-svg {\n display: inline-block; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_has-info .form-item__explain {\n color: #1687d9; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_has-info .form-item__bottom-line {\n bottom: 20px;\n bottom: 1.25rem; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_has-info .u-textarea .form-item__bottom-line {\n bottom: 0; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_has-error [type=\"text\"]:focus + .form-item__bottom-line {\n background-color: #cc2929; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_has-error .u-textarea__element:focus + .form-item__bottom-line {\n background-color: #cc2929; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_has-error .form-item__bottom-line {\n background-color: #cc2929; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_has-error .form-item__explain {\n color: #cc2929; }\n\n[data-style-sys=ux-common-input].form-item__control.form-item__control_is-readonly [type=\"text\"]:focus + .form-item__bottom-line,\n[data-style-sys=ux-common-input] .form-item__control.form-item__control_is-readonly .u-textarea__element:focus + .form-item__bottom-line {\n width: 0; }\n\n[data-style-sys=ux-common-input].form-item__control .u-radio,\n[data-style-sys=ux-common-input] .form-item__control .u-checkbox {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n margin-right: 15px;\n margin-right: .9375rem;\n margin-left: 5px;\n margin-left: .3125rem; }\n\n[data-style-sys=ux-common-input].form-item__control [type=\"text\"]:focus + .form-item__bottom-line,\n[data-style-sys=ux-common-input] .form-item__control .u-textarea__element:focus + .form-item__bottom-line {\n left: 0;\n width: 100%;\n background-color: #1687d9;\n -webkit-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s;\n -o-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s;\n transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s; }\n\n[data-style-sys=ux-common-input].form-item__control [type=\"text\"]:focus + .form-item__bottom-line .form-item + .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-nomal-svg,\n[data-style-sys=ux-common-input] .form-item__control .u-textarea__element:focus + .form-item__bottom-line .form-item + .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-nomal-svg {\n display: none; }\n\n[data-style-sys=ux-common-input].form-item__control [type=\"text\"]:focus + .form-item__bottom-line .form-item + .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-active-svg,\n[data-style-sys=ux-common-input] .form-item__control .u-textarea__element:focus + .form-item__bottom-line .form-item + .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-active-svg {\n display: inline-block; }\n\n[data-style-sys=ux-common-input].form-item__control .form-item__bottom-line {\n position: absolute;\n bottom: 0;\n left: 50%;\n width: 0;\n height: 2px; }\n\n[data-style-sys=ux-common-input] .form-item__explain {\n display: block;\n width: 100%;\n min-height: 20px;\n min-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n font-size: .75rem;\n line-height: 20px;\n line-height: 1.25rem;\n margin-left: 5px; }\n\n[data-style-sys=ux-common-input] .form-item__label {\n display: inline-block;\n padding-top: 15px;\n padding-top: .9375rem;\n padding-bottom: 10px;\n padding-bottom: .625rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 14px;\n font-size: .875rem;\n line-height: 24px;\n line-height: 1.5rem; }\n\n[data-style-sys=ux-common-input] .form-item__right-icon {\n position: absolute;\n top: 5px;\n top: .3125rem;\n right: 5px;\n right: .3125rem;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -webkit-align-items: center;\n -ms-flex-align: center;\n align-items: center; }\n\n[data-style-sys=ux-common-input] .form-item__right-icon i + i {\n margin-left: 5px;\n margin-left: .3125rem; }\n\n[data-style-sys=ux-common-input] .form-item__multi-list {\n width: 100%;\n cursor: pointer;\n border-bottom: none; }\n\n[data-style-sys=ux-common-input] .form-item__multi-list .form-item__multi-item {\n max-width: calc(100% - 10px);\n padding-right: 5px;\n padding-right: .3125rem;\n padding-left: 5px;\n padding-left: .3125rem;\n margin-right: 5px;\n margin-right: .3125rem;\n cursor: pointer;\n border-radius: 2px;\n border-radius: .125rem;\n display: inline-block; }\n\n[data-style-sys=ux-common-input] .form-item__multi-list .form-item__multi-item .form-item__text {\n max-width: calc(100% - 18px);\n margin-right: 5px;\n margin-right: .3125rem;\n overflow: hidden;\n color: #021726;\n text-overflow: ellipsis;\n white-space: nowrap;\n vertical-align: middle; }\n\n[data-style-sys=ux-common-input] .form-item__multi-list .form-item__multi-item .sys-icon-close {\n font-size: 14px;\n font-size: .875rem;\n vertical-align: middle; }\n\n[data-style-sys=ux-common-input] .list_horizontal {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n cursor: pointer; }\n [data-style-sys=ux-common-input] .list_horizontal .common_input_box {\n cursor: pointer; }\n\n[data-style-sys=ux-common-input] .list_wrap {\n -webkit-flex-wrap: wrap;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap; }\n\n[data-style-sys=ux-common-input].form-item__control_is-readonly input {\n border: 1px solid #e4ebf0;\n border-radius: 5px;\n background: #f5f8fa;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n color: #3E4E59;\n letter-spacing: 0;\n text-align: left; }\n\n[data-style-sys=ux-common-input].form-item__control_is-readonly input {\n line-height: 20px; }\n\n[data-style-sys=ux-common-input].form-item__control_is-readonly .u-input_is-readonly {\n border-radius: 5px;\n background: #f5f8fa;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 12px;\n color: #3E4E59;\n letter-spacing: 0;\n text-align: left;\n line-height: 26px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n cursor: no-drop; }\n", ""]);
|
27013 |
|
27014 | // exports
|
27015 |
|
27016 |
|
27017 | /***/ }),
|
27018 | /* 291 */
|
27019 | /***/ (function(module, exports, __webpack_require__) {
|
27020 |
|
27021 | 'use strict';
|
27022 |
|
27023 | 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; }; }();
|
27024 |
|
27025 | var _react = __webpack_require__(86);
|
27026 |
|
27027 | var _react2 = _interopRequireDefault(_react);
|
27028 |
|
27029 | var _toolTip = __webpack_require__(251);
|
27030 |
|
27031 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
27032 |
|
27033 | var _reactDom = __webpack_require__(243);
|
27034 |
|
27035 | var _commonFunc = __webpack_require__(252);
|
27036 |
|
27037 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
27038 |
|
27039 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
27040 |
|
27041 | 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; }
|
27042 |
|
27043 | 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; }
|
27044 |
|
27045 | var MultiItem = function (_Component) {
|
27046 | _inherits(MultiItem, _Component);
|
27047 |
|
27048 | function MultiItem() {
|
27049 | var _ref;
|
27050 |
|
27051 | var _temp, _this, _ret;
|
27052 |
|
27053 | _classCallCheck(this, MultiItem);
|
27054 |
|
27055 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
27056 | args[_key] = arguments[_key];
|
27057 | }
|
27058 |
|
27059 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = MultiItem.__proto__ || Object.getPrototypeOf(MultiItem)).call.apply(_ref, [this].concat(args))), _this), _this.itemClose = function (event) {
|
27060 | var item = (0, _reactDom.findDOMNode)(_this);
|
27061 | item.style.opacity = 0;
|
27062 | _this.props.itemClose(event, _this.props.item);
|
27063 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
27064 | }
|
27065 |
|
27066 | _createClass(MultiItem, [{
|
27067 | key: 'componentWillReceiveProps',
|
27068 | value: function componentWillReceiveProps() {
|
27069 | var item = (0, _reactDom.findDOMNode)(this);
|
27070 | item.style.opacity = 1;
|
27071 | }
|
27072 | }, {
|
27073 | key: 'render',
|
27074 | value: function render() {
|
27075 | var _props = this.props,
|
27076 | name = _props.name,
|
27077 | pname = _props.pname,
|
27078 | status = _props.status,
|
27079 | isShowTips = _props.isShowTips,
|
27080 | sideTip = _props.sideTip,
|
27081 | icon = _props.icon;
|
27082 |
|
27083 | var tipTitle = (0, _commonFunc.decode)(name) + (pname ? " (" + (0, _commonFunc.decode)(pname) + ") " : "");
|
27084 | return _react2.default.createElement(
|
27085 | 'li',
|
27086 | { className: 'form-item__multi-item' },
|
27087 | icon ? _react2.default.createElement('i', { className: "u-icon " + icon }) : "",
|
27088 | _react2.default.createElement(
|
27089 | _toolTip2.default,
|
27090 | { hidden: !isShowTips, side: sideTip, title: tipTitle },
|
27091 | _react2.default.createElement(
|
27092 | 'span',
|
27093 | { className: 'form-item__text' },
|
27094 | (0, _commonFunc.decode)(name),
|
27095 | pname ? _react2.default.createElement(
|
27096 | 'span',
|
27097 | { className: 'form-item__text-parent' },
|
27098 | '(',
|
27099 | (0, _commonFunc.decode)(pname),
|
27100 | ')'
|
27101 | ) : ""
|
27102 | )
|
27103 | ),
|
27104 | status != "show" ? _react2.default.createElement('i', { className: 'u-icon sys-icon-close ', onClick: this.itemClose }) : ""
|
27105 | );
|
27106 | }
|
27107 | }]);
|
27108 |
|
27109 | return MultiItem;
|
27110 | }(_react.Component);
|
27111 |
|
27112 | module.exports = MultiItem;
|
27113 |
|
27114 | /***/ }),
|
27115 | /* 292 */
|
27116 | /***/ (function(module, exports, __webpack_require__) {
|
27117 |
|
27118 | 'use strict';
|
27119 |
|
27120 | Object.defineProperty(exports, "__esModule", {
|
27121 | value: true
|
27122 | });
|
27123 | exports.default = undefined;
|
27124 |
|
27125 | var _extends2 = __webpack_require__(5);
|
27126 |
|
27127 | var _extends3 = _interopRequireDefault(_extends2);
|
27128 |
|
27129 | var _classCallCheck2 = __webpack_require__(42);
|
27130 |
|
27131 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
27132 |
|
27133 | var _possibleConstructorReturn2 = __webpack_require__(43);
|
27134 |
|
27135 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
27136 |
|
27137 | var _inherits2 = __webpack_require__(78);
|
27138 |
|
27139 | var _inherits3 = _interopRequireDefault(_inherits2);
|
27140 |
|
27141 | var _react = __webpack_require__(86);
|
27142 |
|
27143 | var _react2 = _interopRequireDefault(_react);
|
27144 |
|
27145 | var _dropdownList = __webpack_require__(293);
|
27146 |
|
27147 | var _dropdownList2 = _interopRequireDefault(_dropdownList);
|
27148 |
|
27149 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
27150 |
|
27151 | var Edit_Filters = function (_Component) {
|
27152 | (0, _inherits3.default)(Edit_Filters, _Component);
|
27153 |
|
27154 | function Edit_Filters() {
|
27155 | (0, _classCallCheck3.default)(this, Edit_Filters);
|
27156 | return (0, _possibleConstructorReturn3.default)(this, _Component.apply(this, arguments));
|
27157 | }
|
27158 |
|
27159 | Edit_Filters.prototype.render = function render() {
|
27160 | var _props = this.props,
|
27161 | isMinWidth = _props.isMinWidth,
|
27162 | status = _props.status,
|
27163 | DropDownData = _props.DropDownData,
|
27164 | showDropDown = _props.showDropDown;
|
27165 |
|
27166 | return _react2.default.createElement(
|
27167 | 'div',
|
27168 | null,
|
27169 | status == 'edit' && showDropDown == true ? _react2.default.createElement(
|
27170 | 'div',
|
27171 | { ref: 'autoTreeDropdown', className: isMinWidth ? 'dropdownMin' : "dropDownList" },
|
27172 | _react2.default.createElement(_dropdownList2.default, (0, _extends3.default)({}, DropDownData, { onChange: this.props.changeFilter }))
|
27173 | ) : ''
|
27174 | );
|
27175 | };
|
27176 |
|
27177 | return Edit_Filters;
|
27178 | }(_react.Component);
|
27179 |
|
27180 | exports.default = Edit_Filters;
|
27181 | module.exports = exports['default'];
|
27182 |
|
27183 | /***/ }),
|
27184 | /* 293 */
|
27185 | /***/ (function(module, exports, __webpack_require__) {
|
27186 |
|
27187 | 'use strict';
|
27188 |
|
27189 | 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; };
|
27190 |
|
27191 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
27192 |
|
27193 | 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; }; }();
|
27194 |
|
27195 | var _react = __webpack_require__(86);
|
27196 |
|
27197 | var _react2 = _interopRequireDefault(_react);
|
27198 |
|
27199 | var _reactDom = __webpack_require__(243);
|
27200 |
|
27201 | var _commonMount = __webpack_require__(274);
|
27202 |
|
27203 | var _commonMount2 = _interopRequireDefault(_commonMount);
|
27204 |
|
27205 | var _inputBox = __webpack_require__(294);
|
27206 |
|
27207 | var _inputBox2 = _interopRequireDefault(_inputBox);
|
27208 |
|
27209 | var _dropdown = __webpack_require__(298);
|
27210 |
|
27211 | var _dropdown2 = _interopRequireDefault(_dropdown);
|
27212 |
|
27213 | var _commonFunc = __webpack_require__(252);
|
27214 |
|
27215 | __webpack_require__(309);
|
27216 |
|
27217 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
27218 |
|
27219 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
27220 |
|
27221 | 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; }
|
27222 |
|
27223 | 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; }
|
27224 |
|
27225 | var App = function (_Component) {
|
27226 | _inherits(App, _Component);
|
27227 |
|
27228 | function App(props) {
|
27229 | _classCallCheck(this, App);
|
27230 |
|
27231 | var _this = _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).call(this, props));
|
27232 |
|
27233 | _this.clearToolTipDom = function () {
|
27234 | var dom_1 = document.getElementById('DropdownList_ul');
|
27235 | if (dom_1) {
|
27236 | var parNode = dom_1.parentNode;
|
27237 | parNode.removeChild(dom_1);
|
27238 | }
|
27239 | };
|
27240 |
|
27241 | _this.onClose = function (event) {
|
27242 | try {
|
27243 | (0, _reactDom.findDOMNode)(_this);
|
27244 | } catch (e) {
|
27245 | _this.CommonMount.unmountBox();
|
27246 | _this.setState({ keepActive: false });
|
27247 | document.removeEventListener('mousedown', _this.onClose);
|
27248 | _this.props.onClose && _this.props.onClose("close");
|
27249 | return;
|
27250 | }
|
27251 | // let selfDom = findDOMNode(this);
|
27252 | var area = document.getElementById("DropdownList_ul");
|
27253 | if (area && !area.contains(event.target)) {
|
27254 | if (event.target.className.indexOf('sys-icon-close') > -1 || event.target.className.indexOf('u-icon') > -1 || event.target.tagName === 'BODY') return;
|
27255 | _this.CommonMount.unmountBox();
|
27256 | _this.setState({ keepActive: false });
|
27257 | document.removeEventListener('mousedown', _this.onClose);
|
27258 | _this.props.onClose && _this.props.onClose("close");
|
27259 | }
|
27260 | if (event.target.className == "btn btn_default btn_sm") {
|
27261 | _this.setState({ keepActive: false });
|
27262 | }
|
27263 | };
|
27264 |
|
27265 | _this.handlerClick = function (event, dom) {
|
27266 | setTimeout(function () {
|
27267 | _this.renderDOM(dom, _this.state.selectDate);
|
27268 | }, 0);
|
27269 | _this.setState({ keepActive: true });
|
27270 | _this.props.onFocus && _this.props.onFocus(event);
|
27271 | window.activeTarget = event;
|
27272 | document.removeEventListener('mousedown', _this.onClose);
|
27273 | document.addEventListener('mousedown', _this.onClose);
|
27274 | };
|
27275 |
|
27276 | _this.itemClose = function (event, index, item) {
|
27277 | var selectDate = _this.state.selectDate;
|
27278 | selectDate = selectDate.filter(function (it) {
|
27279 | return item.value != it.value;
|
27280 | });
|
27281 | _this.setState({ selectDate: selectDate });
|
27282 | window.activeTarget = null;
|
27283 | _this.props.onClick && _this.props.onClick(event, item, selectDate);
|
27284 | _this.props.onChange && _this.props.onChange(event, item, selectDate);
|
27285 | if (_this.state.keepActive) {
|
27286 | _this.renderDOM(event.target.parentNode.parentNode, selectDate);
|
27287 | }
|
27288 | };
|
27289 |
|
27290 | _this.state = {
|
27291 | defaultValue: props.defaultValue,
|
27292 | keepActive: false,
|
27293 | children: props.children,
|
27294 | selectDate: props.children.filter(function (item) {
|
27295 | return item.isChecked;
|
27296 | }),
|
27297 | defaultPlaceholder: props && props.placeholder || '请选择'
|
27298 | };
|
27299 | _this.CommonMount = new _commonMount2.default({
|
27300 | containerId: 'DropdownList_ul', // 容器ID
|
27301 | follow: true, // 是否滚动跟随,默认true
|
27302 | fixed: true // 定位:fixed,false时为absolute
|
27303 | });
|
27304 | return _this;
|
27305 | }
|
27306 |
|
27307 | _createClass(App, [{
|
27308 | key: 'componentWillReceiveProps',
|
27309 | value: function componentWillReceiveProps(nextProps) {
|
27310 | if (JSON.stringify(nextProps.children) != JSON.stringify(this.props.children)) {
|
27311 | this.setState({
|
27312 | children: nextProps.children,
|
27313 | selectDate: nextProps.children.filter(function (item) {
|
27314 | return item.isChecked;
|
27315 | })
|
27316 | });
|
27317 | }
|
27318 | if (nextProps.defaultValue != this.state.defaultValue) {
|
27319 | this.setState({ defaultValue: nextProps.defaultValue });
|
27320 | }
|
27321 | }
|
27322 | }, {
|
27323 | key: 'componentDidUpdate',
|
27324 | value: function componentDidUpdate() {
|
27325 | var dom = document.getElementsByClassName("form-item__control_is-active")[0];
|
27326 | if (dom && this.state.keepActive && this.props.autoShowPanel) this.renderDOM(dom, this.state.selectDate);
|
27327 | if (this.props.readonly || this.props.disabled) {
|
27328 | this.CommonMount.unmountBox();
|
27329 | }
|
27330 | }
|
27331 | }, {
|
27332 | key: 'componentWillUnmount',
|
27333 | value: function componentWillUnmount() {
|
27334 | this.CommonMount.unmountBox();
|
27335 | }
|
27336 | }, {
|
27337 | key: 'renderDOM',
|
27338 | value: function renderDOM(tar, selectDate) {
|
27339 | if (!this.props.showPanel || !tar) return;
|
27340 | var children = this.state.children;
|
27341 | children.map(function (item, index) {
|
27342 | item.isChecked = false;
|
27343 | selectDate.map(function (it, i) {
|
27344 | if (item.value == it.value) {
|
27345 | item.isChecked = true;
|
27346 | }
|
27347 | });
|
27348 | });
|
27349 | var self = this;
|
27350 | var dropdownDate = {
|
27351 | "limitCount": this.props.limitCount,
|
27352 | "multiple": this.props.multiple,
|
27353 | "children": children.filter(function (item) {
|
27354 | return !item.onlyShowInput;
|
27355 | }),
|
27356 | "dropdownWidth": this.props.dropDownWidth || tar.offsetWidth,
|
27357 | "hasSearch": children.length > 10 && this.props.hasSearch != false,
|
27358 | "onClick": function onClick(event, val) {
|
27359 | if ((typeof val === 'undefined' ? 'undefined' : _typeof(val)) == 'object' && val.constructor == Array) {
|
27360 | self.setState({ selectDate: val, keepActive: false });
|
27361 | self.props.onClick && self.props.onClick(event, event.target, val);
|
27362 | self.props.onChange && self.props.onChange(event, event.target, val);
|
27363 | } else {
|
27364 | self.setState({ keepActive: false });
|
27365 | self.props.onClick && self.props.onClick(event, event.target, val);
|
27366 | self.props.onChange && self.props.onChange(event, event.target, val);
|
27367 | }
|
27368 | self.CommonMount.unmountBox();
|
27369 | document.removeEventListener('mousedown', self.onClose);
|
27370 | }
|
27371 | };
|
27372 | var dropHeight = void 0,
|
27373 | documentHeight = void 0;
|
27374 | documentHeight = document.body.scrollHeight == 0 ? document.documentElement.scrollHeight : document.body.scrollHeight;
|
27375 | var dropcount = this.props.children.length > 10 ? 10 : this.props.children.length;
|
27376 | dropHeight = this.props.children.length > 10 ? this.props.multiple ? 374 : 260 : this.props.multiple ? dropcount * 26 + 66 : dropcount * 26 + 10;
|
27377 | while (documentHeight < dropHeight) {
|
27378 | dropHeight = dropHeight - 26;
|
27379 | }
|
27380 | var maxHeight = this.props.multiple ? this.props.children.length > 10 ? dropHeight - 118 : dropHeight - 66 : dropHeight;
|
27381 | maxHeight = maxHeight < 120 ? 120 : maxHeight;
|
27382 | maxHeight = maxHeight > 260 ? 260 : maxHeight;
|
27383 | dropHeight = this.props.children.length ? dropHeight : 0;
|
27384 | var hasSearch = this.props.children.length > 10 && this.props.hasSearch != false;
|
27385 | if (!this.props.multiple) dropHeight = dropHeight + (hasSearch ? 40 : 0);
|
27386 | var isIE = !!window.ActiveXObject || "ActiveXObject" in window;
|
27387 | var showAutoUl = _react2.default.createElement(_dropdown2.default, _extends({}, dropdownDate, { maxHeight: maxHeight }));
|
27388 | this.CommonMount.renderDom('mount-box-dropdownlist', // wrap's classname & id
|
27389 | showAutoUl, // content dom
|
27390 | tar, // 跟随目标
|
27391 | [tar, //挂载目标节点
|
27392 | { // 挂载元素宽高 {width: '', height: ''}
|
27393 | width: this.props.dropDownWidth || tar.clientWidth, // 挂载宽度
|
27394 | height: dropHeight
|
27395 | }], true, //labeL和input框是否为竖向结构,会留出对应的label空间
|
27396 | 0, //水平向左偏移量,为负数则向右
|
27397 | false, //弹层靠左靠右模式,默认为false 靠左模式
|
27398 | 100 //window.onresize执行时间,默认100ms
|
27399 | , false //输入框高度
|
27400 | , this.props.isSearchDrop && isIE ? false : undefined //自定义zindex
|
27401 | );
|
27402 | }
|
27403 | }, {
|
27404 | key: 'render',
|
27405 | value: function render() {
|
27406 | if (this.tar && document.getElementById('mount-box-dropdownlist')) {
|
27407 | var _bottom = this.tar.getBoundingClientRect().bottom;
|
27408 | var _width = this.props.dropDownWidth || this.tar.offsetWidth;
|
27409 | document.getElementById('mount-box-dropdownlist').style.top = _bottom + 'px';
|
27410 | document.getElementById('mount-box-dropdownlist').style.width = _width + 'px';
|
27411 | }
|
27412 | var self = this;
|
27413 | var _props = this.props,
|
27414 | title = _props.title,
|
27415 | PromptMsg = _props.PromptMsg,
|
27416 | errorStatus = _props.errorStatus,
|
27417 | errorMsg = _props.errorMsg,
|
27418 | helpMsg = _props.helpMsg,
|
27419 | multiple = _props.multiple,
|
27420 | disabled = _props.disabled,
|
27421 | readonly = _props.readonly,
|
27422 | required = _props.required,
|
27423 | hasClosebtn = _props.hasClosebtn,
|
27424 | lablePos = _props.lablePos,
|
27425 | lableTxt = _props.lableTxt,
|
27426 | hasInput = _props.hasInput,
|
27427 | showInput = _props.showInput,
|
27428 | isShowTips = _props.isShowTips,
|
27429 | sideTip = _props.sideTip;
|
27430 |
|
27431 | var oriData = this.state.selectDate;
|
27432 | oriData.map(function (item, index) {
|
27433 | item["value"] = item.value, item["name"] = item.text, item["isActive"] = item.isActive, item["tipText"] = item.tipText, item["isChecked"] = item.isChecked;
|
27434 | });
|
27435 | var inputDate = {
|
27436 | "status": "" //展示态为show,编辑态为其他
|
27437 | , "multiple": multiple //单选还是多选
|
27438 | , titleDate: {
|
27439 | "title": title //标题
|
27440 | , "required": required //必选
|
27441 | , "helpMsg": helpMsg //帮助信息,当为空时没有帮助信息
|
27442 | , "lablePos": lablePos //label位置,true时在左边,false在上边
|
27443 | , "lableTxt": lableTxt //label中文字对齐方式,true左对齐,false右对齐
|
27444 | },
|
27445 | commonDate: {
|
27446 | "defaultValue": this.state.defaultValue //默认文字
|
27447 | , "placeholder": this.state.defaultPlaceholder //input中placeholder
|
27448 | , "keepActive": this.state.keepActive //保持蓝线一直存在
|
27449 | , "PromptMsg": PromptMsg //提示信息,为空时不显示
|
27450 | , "errorStatus": errorStatus //报错
|
27451 | , "errorMsg": errorMsg //报错信息,为空时不显示
|
27452 | , "disabled": disabled //input的disable状态,没有下划线
|
27453 | , "readonly": readonly //input的readonly状态
|
27454 | , "isShowTips": isShowTips //是否显示tooltip,若不传默认显示
|
27455 | , "sideTip": sideTip //toolTip是否左右显示
|
27456 | },
|
27457 | showDate: {
|
27458 | "isLink": false //展示态是否是链接
|
27459 | , "linkValue": "" //展示态链接地址
|
27460 | , "selfJump": true //链接跳转方式
|
27461 | },
|
27462 | singleDate: {
|
27463 | "closeBtn": hasClosebtn == undefined || hasClosebtn ? true : false //是否使用close按钮
|
27464 | , "arrowdownBtn": true //是否使用下拉图标
|
27465 | , "keepValue": true //用于带下拉,可以focue以及蓝线等,只是不可以输入值,通过defaultvalue改变
|
27466 | , handlerClick: function handlerClick(event, status, value) {
|
27467 | if (readonly || disabled) return;
|
27468 | // if (event.target.tagName == 'INPUT') {
|
27469 | // self.handlerClick(event, event.target.parentNode)
|
27470 | // } else {
|
27471 | var target = void 0;
|
27472 | if (event.className == 'u-input') {
|
27473 | target = event;
|
27474 | if (event.style.maxWidth.indexOf('calc') >= 0) {
|
27475 | target = event.parentNode;
|
27476 | }
|
27477 | } else if (event.target.className == 'u-input') {
|
27478 | target = event.target.parentNode;
|
27479 | } else {
|
27480 | target = event.target;
|
27481 | }
|
27482 | self.handlerClick(event, target);
|
27483 | // }
|
27484 | },
|
27485 | dropClick: function dropClick(event, value, dom) {
|
27486 | self.handlerClick(event, dom.parentNode);
|
27487 | },
|
27488 | handlerChange: function handlerChange(event, status, value) {
|
27489 | self.props.onChange && self.props.onChange(event, status, value);
|
27490 | }
|
27491 | },
|
27492 | multiDate: {
|
27493 | "hasInput": hasInput,
|
27494 | "showInput": showInput,
|
27495 | "selectDate": oriData //数据
|
27496 | , handlerClick: function handlerClick(event, dom) {
|
27497 | self.handlerClick(event, dom);
|
27498 | },
|
27499 | itemClose: function itemClose(event, item, index, selectDate) {
|
27500 | self.itemClose(event, index, item);
|
27501 | },
|
27502 | dropClick: function dropClick(event, status, dom) {
|
27503 | self.handlerClick(event, dom);
|
27504 | }
|
27505 | }
|
27506 | };
|
27507 | return _react2.default.createElement(_inputBox2.default, _extends({}, inputDate, { ref: 'inputbox' }));
|
27508 | }
|
27509 | }]);
|
27510 |
|
27511 | return App;
|
27512 | }(_react.Component);
|
27513 |
|
27514 | App.defaultProps = {
|
27515 | showPanel: true,
|
27516 | hasSearch: true,
|
27517 | limitCount: 999999,
|
27518 | PromptMsg: ""
|
27519 | };
|
27520 |
|
27521 | module.exports = App;
|
27522 |
|
27523 | /***/ }),
|
27524 | /* 294 */
|
27525 | /***/ (function(module, exports, __webpack_require__) {
|
27526 |
|
27527 | 'use strict';
|
27528 |
|
27529 | 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; }; }();
|
27530 |
|
27531 | var _react = __webpack_require__(86);
|
27532 |
|
27533 | var _react2 = _interopRequireDefault(_react);
|
27534 |
|
27535 | var _reactDom = __webpack_require__(243);
|
27536 |
|
27537 | var _toolTip = __webpack_require__(251);
|
27538 |
|
27539 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
27540 |
|
27541 | var _commonInput = __webpack_require__(288);
|
27542 |
|
27543 | var _commonInput2 = _interopRequireDefault(_commonInput);
|
27544 |
|
27545 | var _commonLabel = __webpack_require__(295);
|
27546 |
|
27547 | var _commonLabel2 = _interopRequireDefault(_commonLabel);
|
27548 |
|
27549 | var _commonFunc = __webpack_require__(252);
|
27550 |
|
27551 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
27552 |
|
27553 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
27554 |
|
27555 | 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; }
|
27556 |
|
27557 | 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; }
|
27558 |
|
27559 | var App = function (_Component) {
|
27560 | _inherits(App, _Component);
|
27561 |
|
27562 | function App(props) {
|
27563 | _classCallCheck(this, App);
|
27564 |
|
27565 | var _this = _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).call(this, props));
|
27566 |
|
27567 | _this.handlerChange = function (event) {
|
27568 | var value = _this.refs.textinput.value;
|
27569 | _this.callBackValue(event, "handlerChange", value);
|
27570 | _this.setState({ defaultValue: _this.refs.textinput.value });
|
27571 | };
|
27572 |
|
27573 | _this.handlerFocus = function (event) {
|
27574 | var value = _this.refs.textinput.value;
|
27575 | _this.callBackValue(event, "handlerFocus", value);
|
27576 | if (!_this.props.commonDate.readonly) {
|
27577 | _this.setState({
|
27578 | focusing: true,
|
27579 | isShowMouseOverIcon: false
|
27580 | });
|
27581 | }
|
27582 | };
|
27583 |
|
27584 | _this.handlerBlur = function (event) {
|
27585 | var value = _this.refs.textinput.value;
|
27586 | _this.callBackValue(event, "handlerBlur", value);
|
27587 | _this.setState({ focusing: false, pointerEvent: 'auto', showHiddenTips: 'block' });
|
27588 | };
|
27589 |
|
27590 | _this.handlerClick = function (event) {
|
27591 | var value = _this.refs.textinput.value;
|
27592 | _this.callBackValue(event, "handlerClick", value);
|
27593 | };
|
27594 |
|
27595 | _this.controlClick = function (event) {
|
27596 | if (event.target.className && event.target.className.indexOf('close') >= 0) return;
|
27597 | var value = _this.refs.textinput.value;
|
27598 | _this.callBackValue(_this.refs.textinput, "handlerClick", value);
|
27599 | };
|
27600 |
|
27601 | _this.handlerKeyup = function (event) {
|
27602 | var value = _this.refs.textinput.value;
|
27603 | _this.callBackValue(event, "handlerKeyup", value);
|
27604 | };
|
27605 |
|
27606 | _this.dropClick = function (event) {
|
27607 | var value = _this.refs.textinput.value;
|
27608 | _this.props.singleDate.dropClick && _this.props.singleDate.dropClick(event, value, _this.refs.textinput);
|
27609 | };
|
27610 |
|
27611 | _this.callBackValue = function (event, status, value) {
|
27612 | if (_this.props.commonDate.disabled || _this.props.commonDate.readonly) {
|
27613 | return false;
|
27614 | }
|
27615 | _this.props.singleDate[status] && _this.props.singleDate[status](event, status, value);
|
27616 | _this.setState({ defaultValue: value });
|
27617 | };
|
27618 |
|
27619 | _this.clearDate = function (event, hoverClear) {
|
27620 | if (_this.props.commonDate.readonly || _this.props.commonDate.disabled) {
|
27621 | return;
|
27622 | }
|
27623 | _this.refs.textinput.value = "";
|
27624 | _this.setState({ defaultValue: "" });
|
27625 | // this.callBackValue(event, "handlerBlur", "");
|
27626 | _this.callBackValue(event, "handlerChange", "");
|
27627 | };
|
27628 |
|
27629 | _this.editClick = function (event) {
|
27630 | _this.props.editClick("edit");
|
27631 | };
|
27632 |
|
27633 | _this.handlerOver = function (event) {
|
27634 | if (_this.props.commonDate.readonly || _this.props.commonDate.disabled) {
|
27635 | return;
|
27636 | }
|
27637 | if (!_this.props.singleDate.closeBtn) return;
|
27638 | var dom = (0, _reactDom.findDOMNode)(_this.refs.mouseIconClose);
|
27639 | if (dom.style.visibility == 'inherit' || _this.state.focusing || !_this.state.defaultValue) {
|
27640 | return;
|
27641 | } else {
|
27642 | _this.setState({
|
27643 | isShowMouseOverIcon: true
|
27644 | }, _this.forceUpdate());
|
27645 | }
|
27646 | };
|
27647 |
|
27648 | _this.handlerOut = function (event) {
|
27649 | if (_this.props.commonDate.readonly || _this.props.commonDate.disabled) {
|
27650 | return;
|
27651 | }
|
27652 | if (!_this.props.singleDate.closeBtn) return;
|
27653 | var node = event.target;
|
27654 | var dom = (0, _reactDom.findDOMNode)(_this.refs.formItem);
|
27655 | if (node.nodeName.toLowerCase() == 'i' && !dom.contains(node)) {
|
27656 | return;
|
27657 | } else {
|
27658 | _this.setState({
|
27659 | isShowMouseOverIcon: false
|
27660 | }, _this.forceUpdate());
|
27661 | }
|
27662 | };
|
27663 |
|
27664 | _this.tipsClick = function () {
|
27665 | _this.setState({ pointerEvent: "none", showHiddenTips: 'none' });
|
27666 | _this.refs.textinput.focus();
|
27667 | };
|
27668 |
|
27669 | _this.state = {
|
27670 | defaultValue: props.commonDate.defaultValue,
|
27671 | focusing: false,
|
27672 | pointerEvent: "auto",
|
27673 | showHiddenTips: 'block',
|
27674 | defaultPlaceholder: props && props.commonDate.placeholder || '请输入'
|
27675 | };
|
27676 | return _this;
|
27677 | }
|
27678 |
|
27679 | _createClass(App, [{
|
27680 | key: 'componentWillReceiveProps',
|
27681 | value: function componentWillReceiveProps(nextProps) {
|
27682 | if (nextProps.commonDate.defaultValue != this.state.defaultValue) {
|
27683 | this.setState({ defaultValue: nextProps.commonDate.defaultValue });
|
27684 | this.refs.textinput && (this.refs.textinput.value = (0, _commonFunc.decode)(nextProps.commonDate.defaultValue));
|
27685 | }
|
27686 | }
|
27687 | }, {
|
27688 | key: 'render',
|
27689 | value: function render() {
|
27690 | var _state = this.state,
|
27691 | focusing = _state.focusing,
|
27692 | defaultValue = _state.defaultValue,
|
27693 | pointerEvent = _state.pointerEvent,
|
27694 | showHiddenTips = _state.showHiddenTips;
|
27695 | var _props = this.props,
|
27696 | status = _props.status,
|
27697 | multiple = _props.multiple,
|
27698 | titleDate = _props.titleDate,
|
27699 | commonDate = _props.commonDate,
|
27700 | showDate = _props.showDate,
|
27701 | singleDate = _props.singleDate,
|
27702 | multiDate = _props.multiDate;
|
27703 |
|
27704 |
|
27705 | var isError = commonDate.errorStatus;
|
27706 | var isShowTips = commonDate.isShowTips || false;
|
27707 | var sideTip = commonDate.sideTip || false;
|
27708 | //默认值不为空时修改errorstatus,只针对于必填,如果有其他错误验证可增加判断条件
|
27709 | // if (defaultValue != '') {
|
27710 | // isError = false;
|
27711 | // }
|
27712 | var readonlyClass = commonDate.disabled || commonDate.readonly ? 'form-item__control_is-readonly ' : '';
|
27713 | var hasinfoClass = isError || commonDate.PromptMsg && (focusing || commonDate.keepActive) ? 'form-item__control_has-info ' : '';
|
27714 | var activeClass = isError || focusing || commonDate.keepActive ? 'form-item__control_is-active ' : '';
|
27715 | var errClass = isError ? 'form-item__control_has-error ' : '';
|
27716 | var self = this;
|
27717 | var multipleDate = {
|
27718 | "status": "show",
|
27719 | "isActive": commonDate.keepActive, //蓝线是否出现
|
27720 | "placeHolder": this.state.defaultPlaceholder, //input中的placeholder
|
27721 | "defaultValue": defaultValue, //input中的defaultvalue
|
27722 | "readonly": commonDate.readonly, //只读态
|
27723 | "errorStatus": isError, //报错
|
27724 | "errorMsg": commonDate.errorMsg, //报错信息,为空时不显示
|
27725 | "PromptMsg": "", //报错信息,为空时不显示
|
27726 | "selectDate": multiDate.selectDate, //数据
|
27727 | "isShowTips": isShowTips,
|
27728 | 'sideTip': sideTip,
|
27729 | "hasInput": multiDate.hasInput,
|
27730 | "showInput": multiDate.showInput,
|
27731 | handlerClick: function handlerClick(event, dom) {
|
27732 | self.props.multiDate.handlerClick && self.props.multiDate.handlerClick(event, dom);
|
27733 | }, //组件点击事件
|
27734 | itemClose: function itemClose(event, item, index, selectDate) {
|
27735 | self.props.multiDate.itemClose && self.props.multiDate.itemClose(event, item, index, selectDate);
|
27736 | }, //删除按钮回调
|
27737 | inputChange: function inputChange(event, status, value) {
|
27738 | self.props.multiDate.inputChange && self.props.multiDate.inputChange(event, status, value);
|
27739 | }, //input的change事件
|
27740 | inputClick: function inputClick(event, status, value) {
|
27741 | self.props.multiDate.inputClick && self.props.multiDate.inputClick(event, status, value);
|
27742 | }, //input的点击事件
|
27743 | inputBlur: function inputBlur(event, status, value) {
|
27744 | self.props.multiDate.inputBlur && self.props.multiDate.inputBlur(event, status, value);
|
27745 | }, //input的blur事件
|
27746 | dropClick: function dropClick(event, status, dom) {
|
27747 | self.props.multiDate.dropClick && self.props.multiDate.dropClick(event, status, dom);
|
27748 | }
|
27749 | };
|
27750 |
|
27751 | var mouseIconClose = this.state.isShowMouseOverIcon ? { 'visibility': 'inherit', 'pointerEvents': 'auto' } : { 'visibility': 'hidden', 'pointerEvents': 'auto' };
|
27752 | var showCloseBtn = singleDate.closeBtn && !commonDate.readonly && !commonDate.disabled;
|
27753 | var readOnlyStyle = void 0;
|
27754 | if (commonDate.readonly) {
|
27755 | readOnlyStyle = {
|
27756 | 'background': '#f5f8fa',
|
27757 | 'border': '1px solid #e4ebf0',
|
27758 | 'borderRadius': '5px',
|
27759 | 'fontFamily': 'PingFangSC-Regular',
|
27760 | 'fontSize': '12px',
|
27761 | 'color': '#3E4E59',
|
27762 | 'letterSpacing': '0',
|
27763 | 'lineHeight': '20px',
|
27764 | 'textAlign': 'left',
|
27765 | 'cursor': 'no-drop'
|
27766 | };
|
27767 | } else {
|
27768 | readOnlyStyle = {
|
27769 | 'maxWidth': 'calc(100% - ' + (showCloseBtn ? 40 : 26) + 'px)',
|
27770 | 'cursor': singleDate.keepValue ? 'pointer' : 'text'
|
27771 | };
|
27772 | }
|
27773 | if (status == "show") {
|
27774 | return _react2.default.createElement(
|
27775 | 'div',
|
27776 | { 'data-style-sys': 'ux-input-box', 'data-style-extend': 'ux-input-box', className: 'form-item form-item_is-static' },
|
27777 | titleDate.title.length > 0 ? _react2.default.createElement(
|
27778 | 'div',
|
27779 | { className: 'form-item__title' },
|
27780 | _react2.default.createElement(
|
27781 | _toolTip2.default,
|
27782 | { title: titleDate.title, hidden: hiddenTip, side: sideTip },
|
27783 | _react2.default.createElement(
|
27784 | 'label',
|
27785 | { htmlFor: '', title: titleDate.title, className: 'form-item__text' },
|
27786 | titleDate.title
|
27787 | )
|
27788 | )
|
27789 | ) : "",
|
27790 | _react2.default.createElement(
|
27791 | 'div',
|
27792 | { className: 'form-item__control' },
|
27793 | showDate.isLink ? _react2.default.createElement(
|
27794 | 'a',
|
27795 | { className: 'form-item__link', target: showDate.selfJump ? "_self" : "_block", href: showDate.linkValue
|
27796 | },
|
27797 | defaultValue
|
27798 | ) : _react2.default.createElement(
|
27799 | 'p',
|
27800 | { className: 'form-item__text' },
|
27801 | defaultValue
|
27802 | ),
|
27803 | _react2.default.createElement(
|
27804 | 'span',
|
27805 | { className: 'form-item__right-icon' },
|
27806 | _react2.default.createElement('i', { className: 'u-icon sys-icon-cus-bianji', onClick: this.editClick })
|
27807 | )
|
27808 | )
|
27809 | );
|
27810 | } else {
|
27811 | return _react2.default.createElement(
|
27812 | 'div',
|
27813 | { 'data-style-sys': 'ux-input-box', 'data-style-extend': 'ux-input-box', className: 'form-item ', ref: 'formItem' },
|
27814 | _react2.default.createElement(_commonLabel2.default, this.props.titleDate),
|
27815 | !multiple ? commonDate.readonly || commonDate.disabled ? _react2.default.createElement(_commonInput2.default, { readonly: true, errorStatus: commonDate.errorStatus, errorMsg: commonDate.errorMsg, defaultValue: (0, _commonFunc.decode)(defaultValue) }) : _react2.default.createElement(
|
27816 | 'div',
|
27817 | { className: "form-item__control " + readonlyClass + hasinfoClass + activeClass + errClass, onMouseOver: this.handlerOver,
|
27818 | onMouseOut: this.handlerOut,
|
27819 | onClick: this.controlClick
|
27820 | },
|
27821 | _react2.default.createElement(
|
27822 | _toolTip2.default,
|
27823 | { title: (0, _commonFunc.decode)(defaultValue), hidden: !isShowTips, side: sideTip },
|
27824 | _react2.default.createElement(
|
27825 | 'div',
|
27826 | { className: 'form-item_is-hidden-tips', style: { width: commonDate.readonly ? "100%" : 'calc(100% - ' + (showCloseBtn ? 52 : 38) + 'px)', pointerEvents: pointerEvent, 'cursor': singleDate.keepValue ? 'pointer' : 'text', display: showHiddenTips }, onClick: this.tipsClick },
|
27827 | (0, _commonFunc.decode)(defaultValue)
|
27828 | )
|
27829 | ),
|
27830 | _react2.default.createElement('input', { type: 'text', className: 'u-input',
|
27831 | placeholder: commonDate.readonly ? '' : this.state.defaultPlaceholder,
|
27832 | defaultValue: (0, _commonFunc.decode)(defaultValue),
|
27833 | readOnly: commonDate.readonly || commonDate.disabled || singleDate.keepValue,
|
27834 | disabled: commonDate.disabled,
|
27835 | onFocus: this.handlerFocus,
|
27836 | onBlur: this.handlerBlur,
|
27837 | onClick: this.handlerClick,
|
27838 | onChange: this.handlerChange,
|
27839 | onKeyUp: this.handlerKeyup,
|
27840 | ref: 'textinput',
|
27841 | style: readOnlyStyle
|
27842 | }),
|
27843 | _react2.default.createElement(
|
27844 | 'span',
|
27845 | { className: 'form-item__right-icon', style: { minHeight: 14 } },
|
27846 | commonDate.readonly ? _react2.default.createElement('i', { className: 'u-icon' }) : _react2.default.createElement('i', { className: 'u-icon sys-icon-close', style: mouseIconClose, ref: 'mouseIconClose', onMouseDown: this.clearDate.bind(true) }),
|
27847 | showCloseBtn && defaultValue && defaultValue.length > 0 && focusing ? _react2.default.createElement('i', { className: 'u-icon sys-icon-close', onMouseDown: this.clearDate }) : '',
|
27848 | singleDate.arrowdownBtn && !commonDate.readonly && !commonDate.disabled ? _react2.default.createElement('i', { className: 'u-icon pc-sys-arrowdown-nomal-svg', onMouseDown: this.dropClick }) : "",
|
27849 | singleDate.symbol ? _react2.default.createElement(
|
27850 | 'span',
|
27851 | { style: { "width": "14px", "height": "14px", "lineHeight": "14px" } },
|
27852 | singleDate.symbol
|
27853 | ) : ""
|
27854 | ),
|
27855 | !commonDate.readonly && commonDate.PromptMsg && (this.state.focusing || commonDate.keepActive) || isError ? _react2.default.createElement(
|
27856 | 'span',
|
27857 | { className: 'form-item__explain' },
|
27858 | isError ? commonDate.errorMsg : commonDate.PromptMsg
|
27859 | ) : ''
|
27860 | ) : _react2.default.createElement(_commonInput2.default, multipleDate)
|
27861 | );
|
27862 | }
|
27863 | }
|
27864 | }]);
|
27865 |
|
27866 | return App;
|
27867 | }(_react.Component);
|
27868 |
|
27869 | App.defaultProps = {
|
27870 | hiddenTip: false,
|
27871 | sideTip: false
|
27872 | };
|
27873 |
|
27874 | module.exports = App;
|
27875 |
|
27876 | /***/ }),
|
27877 | /* 295 */
|
27878 | /***/ (function(module, exports, __webpack_require__) {
|
27879 |
|
27880 | 'use strict';
|
27881 |
|
27882 | var _react = __webpack_require__(86);
|
27883 |
|
27884 | var _react2 = _interopRequireDefault(_react);
|
27885 |
|
27886 | var _toolTip = __webpack_require__(251);
|
27887 |
|
27888 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
27889 |
|
27890 | var _commonFunc = __webpack_require__(252);
|
27891 |
|
27892 | __webpack_require__(296);
|
27893 |
|
27894 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
27895 |
|
27896 | function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
27897 |
|
27898 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
27899 |
|
27900 | 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; }
|
27901 |
|
27902 | 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) : _defaults(subClass, superClass); }
|
27903 |
|
27904 | var CommonLabel = function (_Component) {
|
27905 | _inherits(CommonLabel, _Component);
|
27906 |
|
27907 | function CommonLabel(props) {
|
27908 | _classCallCheck(this, CommonLabel);
|
27909 |
|
27910 | return _possibleConstructorReturn(this, _Component.call(this, props));
|
27911 | }
|
27912 |
|
27913 | CommonLabel.prototype.render = function render() {
|
27914 | var _props = this.props,
|
27915 | labelText = _props.labelText,
|
27916 | labeltext = _props.labeltext,
|
27917 | radioLabel = _props.radioLabel,
|
27918 | showTag = _props.showTag,
|
27919 | name = _props.name,
|
27920 | required = _props.required,
|
27921 | helpMsg = _props.helpMsg,
|
27922 | sideTip = _props.sideTip,
|
27923 | hiddenTip = _props.hiddenTip,
|
27924 | lablePos = _props.lablePos,
|
27925 | lableTxt = _props.lableTxt,
|
27926 | title = _props.title,
|
27927 | status = _props.status,
|
27928 | hiddenLabel = _props.hiddenLabel;
|
27929 |
|
27930 |
|
27931 | var lableStyle = void 0;
|
27932 |
|
27933 | if (lablePos) {
|
27934 | lableStyle = lableTxt ? { 'float': 'left', 'textAlign': 'left' } : { 'float': 'left', 'textAlign': 'right' };
|
27935 | } else {
|
27936 | lableStyle = {};
|
27937 | }
|
27938 | var textStyle = !lablePos && helpMsg ? { "maxWidth": "calc(100% - 30px)" } : {};
|
27939 | var showTitle = labelText || labeltext || title || radioLabel || showTag || name;
|
27940 | //如果有 iconClick的话 帮助的icon鼠标悬浮变成小手
|
27941 | //如果有 iconClick的话 icon可以被点击
|
27942 | var iconClass = this.props.iconClick ? 'u-icon sys-icon-cus-bangzhu pointer' : 'u-icon sys-icon-cus-bangzhu';
|
27943 |
|
27944 | if (hiddenLabel) {
|
27945 | return null;
|
27946 | } else {
|
27947 | return _react2.default.createElement(
|
27948 | 'div',
|
27949 | { 'data-style-sys': 'ux-common-label', 'data-style-extend': 'ux-common-label', className: "form-item__title " + (helpMsg ? "form-item__help" : ""), style: lableStyle },
|
27950 | required && status != 'show' ? _react2.default.createElement(
|
27951 | 'a',
|
27952 | { className: 'form-item__required' },
|
27953 | _react2.default.createElement('i', { className: 'u-icon pc-sys-cus-bitian-svg' })
|
27954 | ) : '',
|
27955 | _react2.default.createElement(
|
27956 | _toolTip2.default,
|
27957 | { title: (0, _commonFunc.decode)(showTitle), side: sideTip, hidden: hiddenTip },
|
27958 | _react2.default.createElement(
|
27959 | 'label',
|
27960 | { htmlFor: '', style: textStyle, className: 'form-item__text' },
|
27961 | (0, _commonFunc.decode)(showTitle),
|
27962 | lablePos ? _react2.default.createElement('div', { className: 'fade-out' }) : ''
|
27963 | )
|
27964 | ),
|
27965 | helpMsg ? _react2.default.createElement(
|
27966 | _toolTip2.default,
|
27967 | { title: (0, _commonFunc.decode)(helpMsg), side: sideTip, hidden: hiddenTip },
|
27968 | _react2.default.createElement('i', { className: iconClass, onClick: this.props.iconClick && this.props.iconClick.bind(this) })
|
27969 | ) : ''
|
27970 | );
|
27971 | }
|
27972 | };
|
27973 |
|
27974 | return CommonLabel;
|
27975 | }(_react.Component);
|
27976 |
|
27977 | module.exports = CommonLabel;
|
27978 |
|
27979 | /***/ }),
|
27980 | /* 296 */
|
27981 | /***/ (function(module, exports, __webpack_require__) {
|
27982 |
|
27983 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
27984 |
|
27985 | // load the styles
|
27986 | var content = __webpack_require__(297);
|
27987 | if(typeof content === 'string') content = [[module.id, content, '']];
|
27988 | // add the styles to the DOM
|
27989 | var update = __webpack_require__(248)(content, {});
|
27990 | if(content.locals) module.exports = content.locals;
|
27991 | // Hot Module Replacement
|
27992 | if(false) {
|
27993 | // When the styles change, update the <style> tags
|
27994 | if(!content.locals) {
|
27995 | module.hot.accept("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss", function() {
|
27996 | var newContent = require("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss");
|
27997 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
27998 | update(newContent);
|
27999 | });
|
28000 | }
|
28001 | // When the module is disposed, remove the <style> tags
|
28002 | module.hot.dispose(function() { update(); });
|
28003 | }
|
28004 |
|
28005 | /***/ }),
|
28006 | /* 297 */
|
28007 | /***/ (function(module, exports, __webpack_require__) {
|
28008 |
|
28009 | exports = module.exports = __webpack_require__(246)();
|
28010 | // imports
|
28011 |
|
28012 |
|
28013 | // module
|
28014 | exports.push([module.id, "[data-style-sys=ux-common-label] .pointer {\n cursor: pointer; }\n", ""]);
|
28015 |
|
28016 | // exports
|
28017 |
|
28018 |
|
28019 | /***/ }),
|
28020 | /* 298 */
|
28021 | /***/ (function(module, exports, __webpack_require__) {
|
28022 |
|
28023 | 'use strict';
|
28024 |
|
28025 | 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; };
|
28026 |
|
28027 | 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; }; }();
|
28028 |
|
28029 | var _react = __webpack_require__(86);
|
28030 |
|
28031 | var _react2 = _interopRequireDefault(_react);
|
28032 |
|
28033 | var _search = __webpack_require__(299);
|
28034 |
|
28035 | var _search2 = _interopRequireDefault(_search);
|
28036 |
|
28037 | var _droplist = __webpack_require__(304);
|
28038 |
|
28039 | var _droplist2 = _interopRequireDefault(_droplist);
|
28040 |
|
28041 | __webpack_require__(307);
|
28042 |
|
28043 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
28044 |
|
28045 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
28046 |
|
28047 | 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; }
|
28048 |
|
28049 | 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; }
|
28050 |
|
28051 | var App = function (_Component) {
|
28052 | _inherits(App, _Component);
|
28053 |
|
28054 | function App(props) {
|
28055 | _classCallCheck(this, App);
|
28056 |
|
28057 | var _this = _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).call(this, props));
|
28058 |
|
28059 | _this.setLimitChildren = function () {
|
28060 | _this.state.children.map(function (item) {
|
28061 | item.disabled = false;
|
28062 | });
|
28063 | };
|
28064 |
|
28065 | _this.getLimitData = function (children) {
|
28066 | //将已选中并超出限制数量的数据禁用,并将其它未选中数据禁用
|
28067 | var limitCount = _this.props.limitCount;
|
28068 |
|
28069 | var checkedData = children.filter(function (item) {
|
28070 | return item.isChecked;
|
28071 | }).length;
|
28072 | if (checkedData >= limitCount) {
|
28073 | // let count = limitCount
|
28074 | children.map(function (item) {
|
28075 | // if (item.isChecked && count<=0) {
|
28076 | // item.isChecked = false
|
28077 | // item.disabled = true
|
28078 | // }
|
28079 | if (!item.isChecked) item.disabled = true;
|
28080 | // count--
|
28081 | });
|
28082 | }
|
28083 | return children;
|
28084 | };
|
28085 |
|
28086 | _this.handleKeyDown = function (e) {
|
28087 | if (e.target.nodeName == 'BUTTON' || e.target.nodeName == 'A') {
|
28088 | return;
|
28089 | }
|
28090 |
|
28091 | var _this$state = _this.state,
|
28092 | hidden = _this$state.hidden,
|
28093 | index = _this$state.index,
|
28094 | children = _this$state.children;
|
28095 |
|
28096 |
|
28097 | if (!hidden && index >= 0) {
|
28098 | switch (e.keyCode) {
|
28099 | case 38:
|
28100 | // 上
|
28101 | index = index - 1;
|
28102 | break;
|
28103 | case 40:
|
28104 | // 下
|
28105 | index = index + 1;
|
28106 | break;
|
28107 | case 13:
|
28108 | // 回车
|
28109 | _this.chkEnterItem(e);
|
28110 | break;
|
28111 | case 9:
|
28112 | // tab
|
28113 | break;
|
28114 | default:
|
28115 | break;
|
28116 | }
|
28117 | } else if (typeof index == 'undefined') {
|
28118 | index = 0;
|
28119 | }
|
28120 |
|
28121 | // 回车键时不应该调整 index
|
28122 | if (e.keyCode == 13) {
|
28123 | return;
|
28124 | }
|
28125 | if (_this.state.multiple) {
|
28126 | if (index < 0) {
|
28127 | index = children.length; // chidren.length 为确定键的 index,如果还有取消,再向上取一位即可
|
28128 | } else if (index > children.length) {
|
28129 | index = 0;
|
28130 | }
|
28131 | } else {
|
28132 | if (index < 0) {
|
28133 | index = children.length - 1;
|
28134 | } else if (index > children.length - 1) {
|
28135 | index = 0;
|
28136 | }
|
28137 | }
|
28138 |
|
28139 | _this.setState({ index: index });
|
28140 | };
|
28141 |
|
28142 | _this.addKeyListener = function () {
|
28143 | window.removeEventListener('keydown', _this.handleKeyDown, true);
|
28144 | window.addEventListener('keydown', _this.handleKeyDown, true);
|
28145 | };
|
28146 |
|
28147 | _this.removeKeyListener = function () {
|
28148 | window.removeEventListener('keydown', _this.handleKeyDown, true);
|
28149 | };
|
28150 |
|
28151 | var defualt = {
|
28152 | searchValue: '', //搜索值
|
28153 | searchActive: true //打开后默认激活状态
|
28154 | };
|
28155 | _this.state = Object.assign({}, defualt, props);
|
28156 | _this.handleClick = _this.handleClick.bind(_this);
|
28157 | _this.confirmClick = _this.confirmClick.bind(_this);
|
28158 | _this.searchValueChange = _this.searchValueChange.bind(_this);
|
28159 | _this.setLimitChildren();
|
28160 | _this.getLimitData(_this.state.children);
|
28161 | _this.addKeyListener();
|
28162 | return _this;
|
28163 | }
|
28164 |
|
28165 | _createClass(App, [{
|
28166 | key: 'componentWillReceiveProps',
|
28167 | value: function componentWillReceiveProps(nextProps) {
|
28168 | var children = this.getLimitData(nextProps.children);
|
28169 | this.setState({ children: children, multiple: nextProps.multiple, maxHeight: nextProps.maxHeight });
|
28170 | }
|
28171 | }, {
|
28172 | key: 'searchValueChange',
|
28173 |
|
28174 |
|
28175 | //根据搜索值进行筛选
|
28176 | value: function searchValueChange(val) {
|
28177 | this.searchStatus = true;
|
28178 | var dropListData = this.props.children;
|
28179 | var saveData = this.props.children.filter(function (item) {
|
28180 | return item.isChecked;
|
28181 | });
|
28182 | var filterData = dropListData.filter(function (item) {
|
28183 | return item.text.includes(val.value);
|
28184 | });
|
28185 | this.setState({ children: filterData, searchValue: val.value, saveData: saveData });
|
28186 | }
|
28187 |
|
28188 | //多选中勾选某一项
|
28189 |
|
28190 | }, {
|
28191 | key: 'handleClick',
|
28192 | value: function handleClick(event, value) {
|
28193 | var children = this.state.children;
|
28194 | var limitCount = this.props.limitCount;
|
28195 |
|
28196 | children.map(function (item, index) {
|
28197 | if (item.value == value.value) item.isChecked = !item.isChecked;
|
28198 | });
|
28199 | //增加选择数量限制功能,当超出限制数量,则禁止选择其它的
|
28200 | var checkedCount = children.filter(function (item) {
|
28201 | return item.isChecked;
|
28202 | }).length;
|
28203 | children.map(function (item, index) {
|
28204 | if (!item.isChecked) item.disabled = checkedCount >= limitCount;
|
28205 | });
|
28206 | this.setState({ children: children });
|
28207 | }
|
28208 |
|
28209 | //多选中确认按钮点击
|
28210 |
|
28211 | }, {
|
28212 | key: 'confirmClick',
|
28213 | value: function confirmClick(event) {
|
28214 | if (this.searchStatus) {
|
28215 | var self = this;
|
28216 | for (var i = 0; i < self.state.saveData.length; i++) {
|
28217 | for (var j = 0; j < self.state.children.length; j++) {
|
28218 | if (self.state.saveData[i].value == self.state.children[j].value) {
|
28219 | self.state.children.splice(j, 1);
|
28220 | }
|
28221 | }
|
28222 | }
|
28223 | this.saveData = this.state.saveData.concat(this.state.children).filter(function (item) {
|
28224 | return item.isChecked;
|
28225 | });
|
28226 | this.searchStatus = false;
|
28227 | this.state.saveData = '';
|
28228 | } else {
|
28229 | this.saveData = this.state.children.filter(function (item) {
|
28230 | return item.isChecked;
|
28231 | });
|
28232 | }
|
28233 | this.props.onClick(event, this.saveData);
|
28234 | }
|
28235 | }, {
|
28236 | key: 'render',
|
28237 | value: function render() {
|
28238 | var self = this;
|
28239 | var _props = this.props,
|
28240 | sideTip = _props.sideTip,
|
28241 | hiddenTip = _props.hiddenTip,
|
28242 | templateDrop = _props.templateDrop,
|
28243 | templateComponent = _props.templateComponent,
|
28244 | maxHeight = _props.maxHeight;
|
28245 |
|
28246 | var SearchData = {
|
28247 | "placeholder": "搜索" /**没有值的时候显示的内容(string)**/
|
28248 | , "iconName": "sys-icon-sousuo" /**IconName 文字前面的图标**/
|
28249 | , "value": this.state.searchValue //搜索框中的默认值
|
28250 | , "active": this.state.searchActive //input框激活
|
28251 | , "hidden": false //隐藏搜索框
|
28252 | , "readonly": false //搜索框只读
|
28253 | , "disabled": false //搜索框禁用
|
28254 | , "onChange": function onChange(val) {
|
28255 | self.searchValueChange(val);
|
28256 | }
|
28257 | };
|
28258 | var confirmButton = this.props.multiple ? _react2.default.createElement(
|
28259 | 'div',
|
28260 | { className: 'dropdown__footer' },
|
28261 | _react2.default.createElement(
|
28262 | 'button',
|
28263 | { className: "btn btn_default btn_sm" + (this.state.index == this.props.children.length ? ' pointOver' : ''), onClick: this.confirmClick },
|
28264 | '\u786E\u5B9A'
|
28265 | )
|
28266 | ) : "";
|
28267 | var searchshow = this.props.hasSearch ? _react2.default.createElement(
|
28268 | 'div',
|
28269 | { className: 'search__wrap' },
|
28270 | _react2.default.createElement(_search2.default, _extends({ ref: 'dropdownInput' }, SearchData))
|
28271 | ) : null;
|
28272 | var droplist = this.state.children.length > 0 ? _react2.default.createElement(_droplist2.default, _extends({}, this.state, { sideTip: sideTip, hiddenTip: hiddenTip, itemClick: this.props.onClick, handleClick: this.handleClick })) : _react2.default.createElement('span', { className: 'u-icon empty-icon' });
|
28273 |
|
28274 | if (this.props.hidden) {
|
28275 | return _react2.default.createElement('div', null);
|
28276 | } else if (this.props.children && this.props.children.length == 0) {
|
28277 | return _react2.default.createElement(
|
28278 | 'div',
|
28279 | { className: "dropdown dropdown_has-search a-diglog_lt a-dialog_is-open" + (!this.props.hasSearch ? ' dropdown_hasNo-search' : ''), style: { "width": this.state.dropdownWidth, "height": "200px" } },
|
28280 | _react2.default.createElement('span', { className: 'u-icon empty-icon' })
|
28281 | );
|
28282 | } else {
|
28283 | return _react2.default.createElement(
|
28284 | 'div',
|
28285 | { className: "dropdown dropdown_has-search a-diglog_lt a-dialog_is-open" + (!this.props.hasSearch ? ' dropdown_hasNo-search' : ''), style: { "width": this.state.dropdownWidth } },
|
28286 | templateDrop ? _react2.default.createElement(
|
28287 | 'div',
|
28288 | { className: 'dropdown__container' },
|
28289 | _react2.default.createElement(
|
28290 | 'ul',
|
28291 | { style: { maxHeight: maxHeight, overflowY: "auto" } },
|
28292 | templateComponent.map(function (item) {
|
28293 | return item;
|
28294 | })
|
28295 | )
|
28296 | ) : _react2.default.createElement(
|
28297 | 'div',
|
28298 | null,
|
28299 | searchshow,
|
28300 | _react2.default.createElement(
|
28301 | 'div',
|
28302 | { className: 'dropdown__container' },
|
28303 | droplist,
|
28304 | confirmButton
|
28305 | )
|
28306 | )
|
28307 | );
|
28308 | }
|
28309 | }
|
28310 | }, {
|
28311 | key: 'componentWillUnmount',
|
28312 | value: function componentWillUnmount() {
|
28313 | this.removeKeyListener();
|
28314 | }
|
28315 |
|
28316 | // 监听键盘事件
|
28317 |
|
28318 | }, {
|
28319 | key: 'chkEnterItem',
|
28320 | value: function chkEnterItem(e) {
|
28321 | var index = this.state.index,
|
28322 | children = this.state.children;
|
28323 |
|
28324 | if (this.state.multiple) {
|
28325 | children.map(function (item, idx) {
|
28326 | if (idx == index) {
|
28327 | item.isChecked = !item.isChecked;
|
28328 | }
|
28329 | });
|
28330 |
|
28331 | // 选中了确定
|
28332 | if (e.keyCode == 13 && index == children.length) {
|
28333 | this.confirmClick(e);
|
28334 | }
|
28335 |
|
28336 | this.setState({ children: children });
|
28337 | } else {
|
28338 | this.props.onClick(e, children[index]);
|
28339 | }
|
28340 | }
|
28341 | }]);
|
28342 |
|
28343 | return App;
|
28344 | }(_react.Component);
|
28345 |
|
28346 | App.defaultProps = {
|
28347 | hasSearch: true,
|
28348 | limitCount: 9999999
|
28349 | };
|
28350 |
|
28351 |
|
28352 | module.exports = App;
|
28353 |
|
28354 | /***/ }),
|
28355 | /* 299 */
|
28356 | /***/ (function(module, exports, __webpack_require__) {
|
28357 |
|
28358 | 'use strict';
|
28359 |
|
28360 | 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; }; }();
|
28361 |
|
28362 | var _react = __webpack_require__(86);
|
28363 |
|
28364 | var _react2 = _interopRequireDefault(_react);
|
28365 |
|
28366 | var _reactDom = __webpack_require__(243);
|
28367 |
|
28368 | var _reactDom2 = _interopRequireDefault(_reactDom);
|
28369 |
|
28370 | var _es6PromiseDebounce = __webpack_require__(300);
|
28371 |
|
28372 | var _es6PromiseDebounce2 = _interopRequireDefault(_es6PromiseDebounce);
|
28373 |
|
28374 | var _commonFunc = __webpack_require__(252);
|
28375 |
|
28376 | __webpack_require__(302);
|
28377 |
|
28378 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
28379 |
|
28380 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
28381 |
|
28382 | 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; }
|
28383 |
|
28384 | 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; } /* eslint-disable */
|
28385 |
|
28386 |
|
28387 | var Search = function (_Component) {
|
28388 | _inherits(Search, _Component);
|
28389 |
|
28390 | function Search(props) {
|
28391 | _classCallCheck(this, Search);
|
28392 |
|
28393 | var _this = _possibleConstructorReturn(this, (Search.__proto__ || Object.getPrototypeOf(Search)).call(this, props));
|
28394 |
|
28395 | _this.onKeyDownHandler = function (event) {
|
28396 | if (event.keyCode === 13) {
|
28397 | _this.callBackValue(event, "onKeyDown");
|
28398 | }
|
28399 | };
|
28400 |
|
28401 | _this.onRealChange = function (event) {
|
28402 | event.persist();
|
28403 | _this.handelerChange(event);
|
28404 | };
|
28405 |
|
28406 | _this.state = {
|
28407 | left: 0 //并没什么用
|
28408 | , formActive: '' //添加类,控制input下的蓝条。
|
28409 | , placeholderShow: true //控制显示placeholder
|
28410 | , inputValue: "" //input 的显示值
|
28411 |
|
28412 | };
|
28413 | _this.removeInputValue = _this.removeInputValue.bind(_this);
|
28414 | _this.handelerFocus = _this.handelerFocus.bind(_this);
|
28415 | _this.handelerBlur = _this.handelerBlur.bind(_this);
|
28416 | _this.handelerClick = _this.handelerClick.bind(_this);
|
28417 | _this.handelerChange = (0, _es6PromiseDebounce2.default)(_this.handelerChange, 300);
|
28418 | return _this;
|
28419 | }
|
28420 |
|
28421 | _createClass(Search, [{
|
28422 | key: 'componentDidMount',
|
28423 | value: function componentDidMount() {
|
28424 | var self = this;
|
28425 | var _props = this.props,
|
28426 | value = _props.value,
|
28427 | active = _props.active;
|
28428 |
|
28429 |
|
28430 | if (value && value.length > 0) {
|
28431 | this.setState({ placeholderShow: false, inputValue: value });
|
28432 | this.refs.inputItem.value = (0, _commonFunc.decode)(value);
|
28433 | }
|
28434 | if (active) {
|
28435 | setTimeout(function () {
|
28436 | self.setState({ formActive: 'base-search-input-active' });
|
28437 | self.refs.inputItem && self.refs.inputItem.focus();
|
28438 | }, 100);
|
28439 | }
|
28440 | if (this.state.placeholderShow) {
|
28441 | var length = this.refs.palceholderCon.clientWidth + 28;
|
28442 | _reactDom2.default.findDOMNode(this).querySelector(".base-search-input-default").style.width = length + 'px';
|
28443 | }
|
28444 | }
|
28445 | }, {
|
28446 | key: 'componentWillReceiveProps',
|
28447 | value: function componentWillReceiveProps(nextProps) {
|
28448 | if (nextProps.value != this.state.inputValue && nextProps.value != undefined) {
|
28449 | if (nextProps.value.length != 0) {
|
28450 | this.setState({ inputValue: nextProps.value });
|
28451 | this.refs.inputItem.value = (0, _commonFunc.decode)(nextProps.value);
|
28452 | } else {
|
28453 | this.setState({ placeholderShow: true, inputValue: "" });
|
28454 | this.refs.inputItem.value = '';
|
28455 | }
|
28456 | }
|
28457 | if (nextProps.active != this.props.active && nextProps.active == false) {
|
28458 | this.setState({ formActive: '' });
|
28459 | }
|
28460 | }
|
28461 | }, {
|
28462 | key: 'handelerClick',
|
28463 | value: function handelerClick(event) {
|
28464 | if (this.props.disabled) return false;
|
28465 | this.callBackValue(event, "onClick");
|
28466 | this.setState({ formActive: 'base-search-input-active' });
|
28467 | }
|
28468 | }, {
|
28469 | key: 'handelerBlur',
|
28470 | value: function handelerBlur(event) {
|
28471 | this.callBackValue(event, "onBlur");
|
28472 | if (event.target.value.length == 0) {
|
28473 | this.setState({ placeholderShow: true, formActive: '' });
|
28474 | this.refs.inputItem.blur();
|
28475 | }
|
28476 | }
|
28477 | }, {
|
28478 | key: 'handelerFocus',
|
28479 | value: function handelerFocus(event) {
|
28480 | this.callBackValue(event, "onFocus");
|
28481 | }
|
28482 | }, {
|
28483 | key: 'handelerChange',
|
28484 | value: function handelerChange(event) {
|
28485 | this.callBackValue(event, "onChange");
|
28486 | this.setState({ placeholderShow: false, inputValue: event.target.value });
|
28487 | }
|
28488 | //所有的事件调用逻辑都走这里
|
28489 |
|
28490 | }, {
|
28491 | key: 'callBackValue',
|
28492 | value: function callBackValue(event, status) {
|
28493 | // if(status !='onChange'){
|
28494 | // event.stopPropagation();
|
28495 | // }
|
28496 | this.props[status] && this.props[status]({
|
28497 | "value": (0, _commonFunc.encode)(this.refs.inputItem.value //我们的input值
|
28498 | ), "event": event //我们触发的event
|
28499 | , "method": this.props.method //组件内并没有操作
|
28500 | });
|
28501 | }
|
28502 | }, {
|
28503 | key: 'removeInputValue',
|
28504 | value: function removeInputValue(event) {
|
28505 | event.stopPropagation();
|
28506 | this.refs.inputItem.value = '';
|
28507 | this.setState({ inputValue: '' });
|
28508 | this.refs.inputItem.focus();
|
28509 | this.callBackValue(event, 'onChange');
|
28510 | }
|
28511 | }, {
|
28512 | key: 'render',
|
28513 | value: function render() {
|
28514 | var _state = this.state,
|
28515 | formActive = _state.formActive,
|
28516 | placeholderShow = _state.placeholderShow,
|
28517 | inputValue = _state.inputValue;
|
28518 | var _props2 = this.props,
|
28519 | placeholder = _props2.placeholder,
|
28520 | disabled = _props2.disabled,
|
28521 | hidden = _props2.hidden,
|
28522 | readonly = _props2.readonly,
|
28523 | iconName = _props2.iconName,
|
28524 | useInputPlaceHolder = _props2.useInputPlaceHolder;
|
28525 |
|
28526 | var placeholderText = placeholderShow ? placeholder : "";
|
28527 | //后边的关闭按钮
|
28528 | var iconClose = inputValue.length > 0 && formActive.length > 0 ? _react2.default.createElement('a', { href: 'javascript:void(0)', className: 'sys-icon-close', onClick: this.removeInputValue }) : "";
|
28529 |
|
28530 | if (hidden) {
|
28531 | return _react2.default.createElement('div', null);
|
28532 | } else {
|
28533 | return _react2.default.createElement(
|
28534 | 'div',
|
28535 | { className: 'base-search-component' },
|
28536 | _react2.default.createElement(
|
28537 | 'div',
|
28538 | { ref: 'baseSearchInput', className: 'base-search-input ' + formActive + (disabled ? ' search-disabled' : ' ') },
|
28539 | _react2.default.createElement('input', {
|
28540 | ref: 'inputItem',
|
28541 | className: disabled ? 'base-search-disabled' : '',
|
28542 | onChange: this.onRealChange,
|
28543 | onFocus: this.handelerFocus,
|
28544 | readOnly: readonly,
|
28545 | disabled: disabled,
|
28546 | defaultValue: (0, _commonFunc.decode)(inputValue),
|
28547 | onKeyDown: this.onKeyDownHandler,
|
28548 | onBlur: this.handelerBlur,
|
28549 | placeholder: useInputPlaceHolder ? placeholderText : "",
|
28550 | onClick: this.handelerClick
|
28551 | }),
|
28552 | _react2.default.createElement(
|
28553 | 'div',
|
28554 | { ref: 'baseSearchDefault', className: 'base-search-input-default' },
|
28555 | iconName.length > 0 ? _react2.default.createElement('span', { className: 'base-search-input-icon ' + iconName }) : "",
|
28556 | _react2.default.createElement(
|
28557 | 'span',
|
28558 | { ref: 'palceholderCon', className: 'base-search-input-placeholder' },
|
28559 | placeholderText
|
28560 | )
|
28561 | ),
|
28562 | iconClose
|
28563 | )
|
28564 | );
|
28565 | }
|
28566 | }
|
28567 | }]);
|
28568 |
|
28569 | return Search;
|
28570 | }(_react.Component);
|
28571 |
|
28572 | Search.defaultProps = {
|
28573 | onKeyDown: function onKeyDown() {},
|
28574 | useInputPlaceHolder: false,
|
28575 | iconName: ""
|
28576 | };
|
28577 |
|
28578 |
|
28579 | module.exports = Search;
|
28580 |
|
28581 | /***/ }),
|
28582 | /* 300 */
|
28583 | /***/ (function(module, exports, __webpack_require__) {
|
28584 |
|
28585 | (function() {
|
28586 |
|
28587 | "use strict";
|
28588 | exports.Promise = __webpack_require__(301).Promise;
|
28589 | module.exports = function(func, wait, immediate) {
|
28590 |
|
28591 | var timeout;
|
28592 | return function() {
|
28593 |
|
28594 | var context = this, args = arguments;
|
28595 |
|
28596 | return new exports.Promise(function(resolve) {
|
28597 | var later = function() {
|
28598 | timeout = null;
|
28599 | if (!immediate) resolve(func.apply(context, args));
|
28600 | };
|
28601 |
|
28602 | var callNow = immediate && !timeout;
|
28603 | clearTimeout(timeout);
|
28604 | timeout = setTimeout(later, wait);
|
28605 |
|
28606 | if (callNow) resolve(func.apply(context, args));
|
28607 | });
|
28608 | };
|
28609 | };
|
28610 |
|
28611 | })();
|
28612 |
|
28613 |
|
28614 | /***/ }),
|
28615 | /* 301 */
|
28616 | /***/ (function(module, exports, __webpack_require__) {
|
28617 |
|
28618 | /* WEBPACK VAR INJECTION */(function(process, global) {/*!
|
28619 | * @overview es6-promise - a tiny implementation of Promises/A+.
|
28620 | * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
28621 | * @license Licensed under MIT license
|
28622 | * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
28623 | * @version v4.2.5+7f2b526d
|
28624 | */
|
28625 |
|
28626 | (function (global, factory) {
|
28627 | true ? module.exports = factory() :
|
28628 | typeof define === 'function' && define.amd ? define(factory) :
|
28629 | (global.ES6Promise = factory());
|
28630 | }(this, (function () { 'use strict';
|
28631 |
|
28632 | function objectOrFunction(x) {
|
28633 | var type = typeof x;
|
28634 | return x !== null && (type === 'object' || type === 'function');
|
28635 | }
|
28636 |
|
28637 | function isFunction(x) {
|
28638 | return typeof x === 'function';
|
28639 | }
|
28640 |
|
28641 |
|
28642 |
|
28643 | var _isArray = void 0;
|
28644 | if (Array.isArray) {
|
28645 | _isArray = Array.isArray;
|
28646 | } else {
|
28647 | _isArray = function (x) {
|
28648 | return Object.prototype.toString.call(x) === '[object Array]';
|
28649 | };
|
28650 | }
|
28651 |
|
28652 | var isArray = _isArray;
|
28653 |
|
28654 | var len = 0;
|
28655 | var vertxNext = void 0;
|
28656 | var customSchedulerFn = void 0;
|
28657 |
|
28658 | var asap = function asap(callback, arg) {
|
28659 | queue[len] = callback;
|
28660 | queue[len + 1] = arg;
|
28661 | len += 2;
|
28662 | if (len === 2) {
|
28663 | // If len is 2, that means that we need to schedule an async flush.
|
28664 | // If additional callbacks are queued before the queue is flushed, they
|
28665 | // will be processed by this flush that we are scheduling.
|
28666 | if (customSchedulerFn) {
|
28667 | customSchedulerFn(flush);
|
28668 | } else {
|
28669 | scheduleFlush();
|
28670 | }
|
28671 | }
|
28672 | };
|
28673 |
|
28674 | function setScheduler(scheduleFn) {
|
28675 | customSchedulerFn = scheduleFn;
|
28676 | }
|
28677 |
|
28678 | function setAsap(asapFn) {
|
28679 | asap = asapFn;
|
28680 | }
|
28681 |
|
28682 | var browserWindow = typeof window !== 'undefined' ? window : undefined;
|
28683 | var browserGlobal = browserWindow || {};
|
28684 | var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
|
28685 | var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
|
28686 |
|
28687 | // test for web worker but not in IE10
|
28688 | var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
|
28689 |
|
28690 | // node
|
28691 | function useNextTick() {
|
28692 | // node version 0.10.x displays a deprecation warning when nextTick is used recursively
|
28693 | // see https://github.com/cujojs/when/issues/410 for details
|
28694 | return function () {
|
28695 | return process.nextTick(flush);
|
28696 | };
|
28697 | }
|
28698 |
|
28699 | // vertx
|
28700 | function useVertxTimer() {
|
28701 | if (typeof vertxNext !== 'undefined') {
|
28702 | return function () {
|
28703 | vertxNext(flush);
|
28704 | };
|
28705 | }
|
28706 |
|
28707 | return useSetTimeout();
|
28708 | }
|
28709 |
|
28710 | function useMutationObserver() {
|
28711 | var iterations = 0;
|
28712 | var observer = new BrowserMutationObserver(flush);
|
28713 | var node = document.createTextNode('');
|
28714 | observer.observe(node, { characterData: true });
|
28715 |
|
28716 | return function () {
|
28717 | node.data = iterations = ++iterations % 2;
|
28718 | };
|
28719 | }
|
28720 |
|
28721 | // web worker
|
28722 | function useMessageChannel() {
|
28723 | var channel = new MessageChannel();
|
28724 | channel.port1.onmessage = flush;
|
28725 | return function () {
|
28726 | return channel.port2.postMessage(0);
|
28727 | };
|
28728 | }
|
28729 |
|
28730 | function useSetTimeout() {
|
28731 | // Store setTimeout reference so es6-promise will be unaffected by
|
28732 | // other code modifying setTimeout (like sinon.useFakeTimers())
|
28733 | var globalSetTimeout = setTimeout;
|
28734 | return function () {
|
28735 | return globalSetTimeout(flush, 1);
|
28736 | };
|
28737 | }
|
28738 |
|
28739 | var queue = new Array(1000);
|
28740 | function flush() {
|
28741 | for (var i = 0; i < len; i += 2) {
|
28742 | var callback = queue[i];
|
28743 | var arg = queue[i + 1];
|
28744 |
|
28745 | callback(arg);
|
28746 |
|
28747 | queue[i] = undefined;
|
28748 | queue[i + 1] = undefined;
|
28749 | }
|
28750 |
|
28751 | len = 0;
|
28752 | }
|
28753 |
|
28754 | function attemptVertx() {
|
28755 | try {
|
28756 | var vertx = Function('return this')().require('vertx');
|
28757 | vertxNext = vertx.runOnLoop || vertx.runOnContext;
|
28758 | return useVertxTimer();
|
28759 | } catch (e) {
|
28760 | return useSetTimeout();
|
28761 | }
|
28762 | }
|
28763 |
|
28764 | var scheduleFlush = void 0;
|
28765 | // Decide what async method to use to triggering processing of queued callbacks:
|
28766 | if (isNode) {
|
28767 | scheduleFlush = useNextTick();
|
28768 | } else if (BrowserMutationObserver) {
|
28769 | scheduleFlush = useMutationObserver();
|
28770 | } else if (isWorker) {
|
28771 | scheduleFlush = useMessageChannel();
|
28772 | } else if (browserWindow === undefined && "function" === 'function') {
|
28773 | scheduleFlush = attemptVertx();
|
28774 | } else {
|
28775 | scheduleFlush = useSetTimeout();
|
28776 | }
|
28777 |
|
28778 | function then(onFulfillment, onRejection) {
|
28779 | var parent = this;
|
28780 |
|
28781 | var child = new this.constructor(noop);
|
28782 |
|
28783 | if (child[PROMISE_ID] === undefined) {
|
28784 | makePromise(child);
|
28785 | }
|
28786 |
|
28787 | var _state = parent._state;
|
28788 |
|
28789 |
|
28790 | if (_state) {
|
28791 | var callback = arguments[_state - 1];
|
28792 | asap(function () {
|
28793 | return invokeCallback(_state, child, callback, parent._result);
|
28794 | });
|
28795 | } else {
|
28796 | subscribe(parent, child, onFulfillment, onRejection);
|
28797 | }
|
28798 |
|
28799 | return child;
|
28800 | }
|
28801 |
|
28802 | /**
|
28803 | `Promise.resolve` returns a promise that will become resolved with the
|
28804 | passed `value`. It is shorthand for the following:
|
28805 |
|
28806 | ```javascript
|
28807 | let promise = new Promise(function(resolve, reject){
|
28808 | resolve(1);
|
28809 | });
|
28810 |
|
28811 | promise.then(function(value){
|
28812 | // value === 1
|
28813 | });
|
28814 | ```
|
28815 |
|
28816 | Instead of writing the above, your code now simply becomes the following:
|
28817 |
|
28818 | ```javascript
|
28819 | let promise = Promise.resolve(1);
|
28820 |
|
28821 | promise.then(function(value){
|
28822 | // value === 1
|
28823 | });
|
28824 | ```
|
28825 |
|
28826 | @method resolve
|
28827 | @static
|
28828 | @param {Any} value value that the returned promise will be resolved with
|
28829 | Useful for tooling.
|
28830 | @return {Promise} a promise that will become fulfilled with the given
|
28831 | `value`
|
28832 | */
|
28833 | function resolve$1(object) {
|
28834 | /*jshint validthis:true */
|
28835 | var Constructor = this;
|
28836 |
|
28837 | if (object && typeof object === 'object' && object.constructor === Constructor) {
|
28838 | return object;
|
28839 | }
|
28840 |
|
28841 | var promise = new Constructor(noop);
|
28842 | resolve(promise, object);
|
28843 | return promise;
|
28844 | }
|
28845 |
|
28846 | var PROMISE_ID = Math.random().toString(36).substring(2);
|
28847 |
|
28848 | function noop() {}
|
28849 |
|
28850 | var PENDING = void 0;
|
28851 | var FULFILLED = 1;
|
28852 | var REJECTED = 2;
|
28853 |
|
28854 | var TRY_CATCH_ERROR = { error: null };
|
28855 |
|
28856 | function selfFulfillment() {
|
28857 | return new TypeError("You cannot resolve a promise with itself");
|
28858 | }
|
28859 |
|
28860 | function cannotReturnOwn() {
|
28861 | return new TypeError('A promises callback cannot return that same promise.');
|
28862 | }
|
28863 |
|
28864 | function getThen(promise) {
|
28865 | try {
|
28866 | return promise.then;
|
28867 | } catch (error) {
|
28868 | TRY_CATCH_ERROR.error = error;
|
28869 | return TRY_CATCH_ERROR;
|
28870 | }
|
28871 | }
|
28872 |
|
28873 | function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
|
28874 | try {
|
28875 | then$$1.call(value, fulfillmentHandler, rejectionHandler);
|
28876 | } catch (e) {
|
28877 | return e;
|
28878 | }
|
28879 | }
|
28880 |
|
28881 | function handleForeignThenable(promise, thenable, then$$1) {
|
28882 | asap(function (promise) {
|
28883 | var sealed = false;
|
28884 | var error = tryThen(then$$1, thenable, function (value) {
|
28885 | if (sealed) {
|
28886 | return;
|
28887 | }
|
28888 | sealed = true;
|
28889 | if (thenable !== value) {
|
28890 | resolve(promise, value);
|
28891 | } else {
|
28892 | fulfill(promise, value);
|
28893 | }
|
28894 | }, function (reason) {
|
28895 | if (sealed) {
|
28896 | return;
|
28897 | }
|
28898 | sealed = true;
|
28899 |
|
28900 | reject(promise, reason);
|
28901 | }, 'Settle: ' + (promise._label || ' unknown promise'));
|
28902 |
|
28903 | if (!sealed && error) {
|
28904 | sealed = true;
|
28905 | reject(promise, error);
|
28906 | }
|
28907 | }, promise);
|
28908 | }
|
28909 |
|
28910 | function handleOwnThenable(promise, thenable) {
|
28911 | if (thenable._state === FULFILLED) {
|
28912 | fulfill(promise, thenable._result);
|
28913 | } else if (thenable._state === REJECTED) {
|
28914 | reject(promise, thenable._result);
|
28915 | } else {
|
28916 | subscribe(thenable, undefined, function (value) {
|
28917 | return resolve(promise, value);
|
28918 | }, function (reason) {
|
28919 | return reject(promise, reason);
|
28920 | });
|
28921 | }
|
28922 | }
|
28923 |
|
28924 | function handleMaybeThenable(promise, maybeThenable, then$$1) {
|
28925 | if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
|
28926 | handleOwnThenable(promise, maybeThenable);
|
28927 | } else {
|
28928 | if (then$$1 === TRY_CATCH_ERROR) {
|
28929 | reject(promise, TRY_CATCH_ERROR.error);
|
28930 | TRY_CATCH_ERROR.error = null;
|
28931 | } else if (then$$1 === undefined) {
|
28932 | fulfill(promise, maybeThenable);
|
28933 | } else if (isFunction(then$$1)) {
|
28934 | handleForeignThenable(promise, maybeThenable, then$$1);
|
28935 | } else {
|
28936 | fulfill(promise, maybeThenable);
|
28937 | }
|
28938 | }
|
28939 | }
|
28940 |
|
28941 | function resolve(promise, value) {
|
28942 | if (promise === value) {
|
28943 | reject(promise, selfFulfillment());
|
28944 | } else if (objectOrFunction(value)) {
|
28945 | handleMaybeThenable(promise, value, getThen(value));
|
28946 | } else {
|
28947 | fulfill(promise, value);
|
28948 | }
|
28949 | }
|
28950 |
|
28951 | function publishRejection(promise) {
|
28952 | if (promise._onerror) {
|
28953 | promise._onerror(promise._result);
|
28954 | }
|
28955 |
|
28956 | publish(promise);
|
28957 | }
|
28958 |
|
28959 | function fulfill(promise, value) {
|
28960 | if (promise._state !== PENDING) {
|
28961 | return;
|
28962 | }
|
28963 |
|
28964 | promise._result = value;
|
28965 | promise._state = FULFILLED;
|
28966 |
|
28967 | if (promise._subscribers.length !== 0) {
|
28968 | asap(publish, promise);
|
28969 | }
|
28970 | }
|
28971 |
|
28972 | function reject(promise, reason) {
|
28973 | if (promise._state !== PENDING) {
|
28974 | return;
|
28975 | }
|
28976 | promise._state = REJECTED;
|
28977 | promise._result = reason;
|
28978 |
|
28979 | asap(publishRejection, promise);
|
28980 | }
|
28981 |
|
28982 | function subscribe(parent, child, onFulfillment, onRejection) {
|
28983 | var _subscribers = parent._subscribers;
|
28984 | var length = _subscribers.length;
|
28985 |
|
28986 |
|
28987 | parent._onerror = null;
|
28988 |
|
28989 | _subscribers[length] = child;
|
28990 | _subscribers[length + FULFILLED] = onFulfillment;
|
28991 | _subscribers[length + REJECTED] = onRejection;
|
28992 |
|
28993 | if (length === 0 && parent._state) {
|
28994 | asap(publish, parent);
|
28995 | }
|
28996 | }
|
28997 |
|
28998 | function publish(promise) {
|
28999 | var subscribers = promise._subscribers;
|
29000 | var settled = promise._state;
|
29001 |
|
29002 | if (subscribers.length === 0) {
|
29003 | return;
|
29004 | }
|
29005 |
|
29006 | var child = void 0,
|
29007 | callback = void 0,
|
29008 | detail = promise._result;
|
29009 |
|
29010 | for (var i = 0; i < subscribers.length; i += 3) {
|
29011 | child = subscribers[i];
|
29012 | callback = subscribers[i + settled];
|
29013 |
|
29014 | if (child) {
|
29015 | invokeCallback(settled, child, callback, detail);
|
29016 | } else {
|
29017 | callback(detail);
|
29018 | }
|
29019 | }
|
29020 |
|
29021 | promise._subscribers.length = 0;
|
29022 | }
|
29023 |
|
29024 | function tryCatch(callback, detail) {
|
29025 | try {
|
29026 | return callback(detail);
|
29027 | } catch (e) {
|
29028 | TRY_CATCH_ERROR.error = e;
|
29029 | return TRY_CATCH_ERROR;
|
29030 | }
|
29031 | }
|
29032 |
|
29033 | function invokeCallback(settled, promise, callback, detail) {
|
29034 | var hasCallback = isFunction(callback),
|
29035 | value = void 0,
|
29036 | error = void 0,
|
29037 | succeeded = void 0,
|
29038 | failed = void 0;
|
29039 |
|
29040 | if (hasCallback) {
|
29041 | value = tryCatch(callback, detail);
|
29042 |
|
29043 | if (value === TRY_CATCH_ERROR) {
|
29044 | failed = true;
|
29045 | error = value.error;
|
29046 | value.error = null;
|
29047 | } else {
|
29048 | succeeded = true;
|
29049 | }
|
29050 |
|
29051 | if (promise === value) {
|
29052 | reject(promise, cannotReturnOwn());
|
29053 | return;
|
29054 | }
|
29055 | } else {
|
29056 | value = detail;
|
29057 | succeeded = true;
|
29058 | }
|
29059 |
|
29060 | if (promise._state !== PENDING) {
|
29061 | // noop
|
29062 | } else if (hasCallback && succeeded) {
|
29063 | resolve(promise, value);
|
29064 | } else if (failed) {
|
29065 | reject(promise, error);
|
29066 | } else if (settled === FULFILLED) {
|
29067 | fulfill(promise, value);
|
29068 | } else if (settled === REJECTED) {
|
29069 | reject(promise, value);
|
29070 | }
|
29071 | }
|
29072 |
|
29073 | function initializePromise(promise, resolver) {
|
29074 | try {
|
29075 | resolver(function resolvePromise(value) {
|
29076 | resolve(promise, value);
|
29077 | }, function rejectPromise(reason) {
|
29078 | reject(promise, reason);
|
29079 | });
|
29080 | } catch (e) {
|
29081 | reject(promise, e);
|
29082 | }
|
29083 | }
|
29084 |
|
29085 | var id = 0;
|
29086 | function nextId() {
|
29087 | return id++;
|
29088 | }
|
29089 |
|
29090 | function makePromise(promise) {
|
29091 | promise[PROMISE_ID] = id++;
|
29092 | promise._state = undefined;
|
29093 | promise._result = undefined;
|
29094 | promise._subscribers = [];
|
29095 | }
|
29096 |
|
29097 | function validationError() {
|
29098 | return new Error('Array Methods must be provided an Array');
|
29099 | }
|
29100 |
|
29101 | var Enumerator = function () {
|
29102 | function Enumerator(Constructor, input) {
|
29103 | this._instanceConstructor = Constructor;
|
29104 | this.promise = new Constructor(noop);
|
29105 |
|
29106 | if (!this.promise[PROMISE_ID]) {
|
29107 | makePromise(this.promise);
|
29108 | }
|
29109 |
|
29110 | if (isArray(input)) {
|
29111 | this.length = input.length;
|
29112 | this._remaining = input.length;
|
29113 |
|
29114 | this._result = new Array(this.length);
|
29115 |
|
29116 | if (this.length === 0) {
|
29117 | fulfill(this.promise, this._result);
|
29118 | } else {
|
29119 | this.length = this.length || 0;
|
29120 | this._enumerate(input);
|
29121 | if (this._remaining === 0) {
|
29122 | fulfill(this.promise, this._result);
|
29123 | }
|
29124 | }
|
29125 | } else {
|
29126 | reject(this.promise, validationError());
|
29127 | }
|
29128 | }
|
29129 |
|
29130 | Enumerator.prototype._enumerate = function _enumerate(input) {
|
29131 | for (var i = 0; this._state === PENDING && i < input.length; i++) {
|
29132 | this._eachEntry(input[i], i);
|
29133 | }
|
29134 | };
|
29135 |
|
29136 | Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {
|
29137 | var c = this._instanceConstructor;
|
29138 | var resolve$$1 = c.resolve;
|
29139 |
|
29140 |
|
29141 | if (resolve$$1 === resolve$1) {
|
29142 | var _then = getThen(entry);
|
29143 |
|
29144 | if (_then === then && entry._state !== PENDING) {
|
29145 | this._settledAt(entry._state, i, entry._result);
|
29146 | } else if (typeof _then !== 'function') {
|
29147 | this._remaining--;
|
29148 | this._result[i] = entry;
|
29149 | } else if (c === Promise$1) {
|
29150 | var promise = new c(noop);
|
29151 | handleMaybeThenable(promise, entry, _then);
|
29152 | this._willSettleAt(promise, i);
|
29153 | } else {
|
29154 | this._willSettleAt(new c(function (resolve$$1) {
|
29155 | return resolve$$1(entry);
|
29156 | }), i);
|
29157 | }
|
29158 | } else {
|
29159 | this._willSettleAt(resolve$$1(entry), i);
|
29160 | }
|
29161 | };
|
29162 |
|
29163 | Enumerator.prototype._settledAt = function _settledAt(state, i, value) {
|
29164 | var promise = this.promise;
|
29165 |
|
29166 |
|
29167 | if (promise._state === PENDING) {
|
29168 | this._remaining--;
|
29169 |
|
29170 | if (state === REJECTED) {
|
29171 | reject(promise, value);
|
29172 | } else {
|
29173 | this._result[i] = value;
|
29174 | }
|
29175 | }
|
29176 |
|
29177 | if (this._remaining === 0) {
|
29178 | fulfill(promise, this._result);
|
29179 | }
|
29180 | };
|
29181 |
|
29182 | Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {
|
29183 | var enumerator = this;
|
29184 |
|
29185 | subscribe(promise, undefined, function (value) {
|
29186 | return enumerator._settledAt(FULFILLED, i, value);
|
29187 | }, function (reason) {
|
29188 | return enumerator._settledAt(REJECTED, i, reason);
|
29189 | });
|
29190 | };
|
29191 |
|
29192 | return Enumerator;
|
29193 | }();
|
29194 |
|
29195 | /**
|
29196 | `Promise.all` accepts an array of promises, and returns a new promise which
|
29197 | is fulfilled with an array of fulfillment values for the passed promises, or
|
29198 | rejected with the reason of the first passed promise to be rejected. It casts all
|
29199 | elements of the passed iterable to promises as it runs this algorithm.
|
29200 |
|
29201 | Example:
|
29202 |
|
29203 | ```javascript
|
29204 | let promise1 = resolve(1);
|
29205 | let promise2 = resolve(2);
|
29206 | let promise3 = resolve(3);
|
29207 | let promises = [ promise1, promise2, promise3 ];
|
29208 |
|
29209 | Promise.all(promises).then(function(array){
|
29210 | // The array here would be [ 1, 2, 3 ];
|
29211 | });
|
29212 | ```
|
29213 |
|
29214 | If any of the `promises` given to `all` are rejected, the first promise
|
29215 | that is rejected will be given as an argument to the returned promises's
|
29216 | rejection handler. For example:
|
29217 |
|
29218 | Example:
|
29219 |
|
29220 | ```javascript
|
29221 | let promise1 = resolve(1);
|
29222 | let promise2 = reject(new Error("2"));
|
29223 | let promise3 = reject(new Error("3"));
|
29224 | let promises = [ promise1, promise2, promise3 ];
|
29225 |
|
29226 | Promise.all(promises).then(function(array){
|
29227 | // Code here never runs because there are rejected promises!
|
29228 | }, function(error) {
|
29229 | // error.message === "2"
|
29230 | });
|
29231 | ```
|
29232 |
|
29233 | @method all
|
29234 | @static
|
29235 | @param {Array} entries array of promises
|
29236 | @param {String} label optional string for labeling the promise.
|
29237 | Useful for tooling.
|
29238 | @return {Promise} promise that is fulfilled when all `promises` have been
|
29239 | fulfilled, or rejected if any of them become rejected.
|
29240 | @static
|
29241 | */
|
29242 | function all(entries) {
|
29243 | return new Enumerator(this, entries).promise;
|
29244 | }
|
29245 |
|
29246 | /**
|
29247 | `Promise.race` returns a new promise which is settled in the same way as the
|
29248 | first passed promise to settle.
|
29249 |
|
29250 | Example:
|
29251 |
|
29252 | ```javascript
|
29253 | let promise1 = new Promise(function(resolve, reject){
|
29254 | setTimeout(function(){
|
29255 | resolve('promise 1');
|
29256 | }, 200);
|
29257 | });
|
29258 |
|
29259 | let promise2 = new Promise(function(resolve, reject){
|
29260 | setTimeout(function(){
|
29261 | resolve('promise 2');
|
29262 | }, 100);
|
29263 | });
|
29264 |
|
29265 | Promise.race([promise1, promise2]).then(function(result){
|
29266 | // result === 'promise 2' because it was resolved before promise1
|
29267 | // was resolved.
|
29268 | });
|
29269 | ```
|
29270 |
|
29271 | `Promise.race` is deterministic in that only the state of the first
|
29272 | settled promise matters. For example, even if other promises given to the
|
29273 | `promises` array argument are resolved, but the first settled promise has
|
29274 | become rejected before the other promises became fulfilled, the returned
|
29275 | promise will become rejected:
|
29276 |
|
29277 | ```javascript
|
29278 | let promise1 = new Promise(function(resolve, reject){
|
29279 | setTimeout(function(){
|
29280 | resolve('promise 1');
|
29281 | }, 200);
|
29282 | });
|
29283 |
|
29284 | let promise2 = new Promise(function(resolve, reject){
|
29285 | setTimeout(function(){
|
29286 | reject(new Error('promise 2'));
|
29287 | }, 100);
|
29288 | });
|
29289 |
|
29290 | Promise.race([promise1, promise2]).then(function(result){
|
29291 | // Code here never runs
|
29292 | }, function(reason){
|
29293 | // reason.message === 'promise 2' because promise 2 became rejected before
|
29294 | // promise 1 became fulfilled
|
29295 | });
|
29296 | ```
|
29297 |
|
29298 | An example real-world use case is implementing timeouts:
|
29299 |
|
29300 | ```javascript
|
29301 | Promise.race([ajax('foo.json'), timeout(5000)])
|
29302 | ```
|
29303 |
|
29304 | @method race
|
29305 | @static
|
29306 | @param {Array} promises array of promises to observe
|
29307 | Useful for tooling.
|
29308 | @return {Promise} a promise which settles in the same way as the first passed
|
29309 | promise to settle.
|
29310 | */
|
29311 | function race(entries) {
|
29312 | /*jshint validthis:true */
|
29313 | var Constructor = this;
|
29314 |
|
29315 | if (!isArray(entries)) {
|
29316 | return new Constructor(function (_, reject) {
|
29317 | return reject(new TypeError('You must pass an array to race.'));
|
29318 | });
|
29319 | } else {
|
29320 | return new Constructor(function (resolve, reject) {
|
29321 | var length = entries.length;
|
29322 | for (var i = 0; i < length; i++) {
|
29323 | Constructor.resolve(entries[i]).then(resolve, reject);
|
29324 | }
|
29325 | });
|
29326 | }
|
29327 | }
|
29328 |
|
29329 | /**
|
29330 | `Promise.reject` returns a promise rejected with the passed `reason`.
|
29331 | It is shorthand for the following:
|
29332 |
|
29333 | ```javascript
|
29334 | let promise = new Promise(function(resolve, reject){
|
29335 | reject(new Error('WHOOPS'));
|
29336 | });
|
29337 |
|
29338 | promise.then(function(value){
|
29339 | // Code here doesn't run because the promise is rejected!
|
29340 | }, function(reason){
|
29341 | // reason.message === 'WHOOPS'
|
29342 | });
|
29343 | ```
|
29344 |
|
29345 | Instead of writing the above, your code now simply becomes the following:
|
29346 |
|
29347 | ```javascript
|
29348 | let promise = Promise.reject(new Error('WHOOPS'));
|
29349 |
|
29350 | promise.then(function(value){
|
29351 | // Code here doesn't run because the promise is rejected!
|
29352 | }, function(reason){
|
29353 | // reason.message === 'WHOOPS'
|
29354 | });
|
29355 | ```
|
29356 |
|
29357 | @method reject
|
29358 | @static
|
29359 | @param {Any} reason value that the returned promise will be rejected with.
|
29360 | Useful for tooling.
|
29361 | @return {Promise} a promise rejected with the given `reason`.
|
29362 | */
|
29363 | function reject$1(reason) {
|
29364 | /*jshint validthis:true */
|
29365 | var Constructor = this;
|
29366 | var promise = new Constructor(noop);
|
29367 | reject(promise, reason);
|
29368 | return promise;
|
29369 | }
|
29370 |
|
29371 | function needsResolver() {
|
29372 | throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
|
29373 | }
|
29374 |
|
29375 | function needsNew() {
|
29376 | throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
|
29377 | }
|
29378 |
|
29379 | /**
|
29380 | Promise objects represent the eventual result of an asynchronous operation. The
|
29381 | primary way of interacting with a promise is through its `then` method, which
|
29382 | registers callbacks to receive either a promise's eventual value or the reason
|
29383 | why the promise cannot be fulfilled.
|
29384 |
|
29385 | Terminology
|
29386 | -----------
|
29387 |
|
29388 | - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
|
29389 | - `thenable` is an object or function that defines a `then` method.
|
29390 | - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
|
29391 | - `exception` is a value that is thrown using the throw statement.
|
29392 | - `reason` is a value that indicates why a promise was rejected.
|
29393 | - `settled` the final resting state of a promise, fulfilled or rejected.
|
29394 |
|
29395 | A promise can be in one of three states: pending, fulfilled, or rejected.
|
29396 |
|
29397 | Promises that are fulfilled have a fulfillment value and are in the fulfilled
|
29398 | state. Promises that are rejected have a rejection reason and are in the
|
29399 | rejected state. A fulfillment value is never a thenable.
|
29400 |
|
29401 | Promises can also be said to *resolve* a value. If this value is also a
|
29402 | promise, then the original promise's settled state will match the value's
|
29403 | settled state. So a promise that *resolves* a promise that rejects will
|
29404 | itself reject, and a promise that *resolves* a promise that fulfills will
|
29405 | itself fulfill.
|
29406 |
|
29407 |
|
29408 | Basic Usage:
|
29409 | ------------
|
29410 |
|
29411 | ```js
|
29412 | let promise = new Promise(function(resolve, reject) {
|
29413 | // on success
|
29414 | resolve(value);
|
29415 |
|
29416 | // on failure
|
29417 | reject(reason);
|
29418 | });
|
29419 |
|
29420 | promise.then(function(value) {
|
29421 | // on fulfillment
|
29422 | }, function(reason) {
|
29423 | // on rejection
|
29424 | });
|
29425 | ```
|
29426 |
|
29427 | Advanced Usage:
|
29428 | ---------------
|
29429 |
|
29430 | Promises shine when abstracting away asynchronous interactions such as
|
29431 | `XMLHttpRequest`s.
|
29432 |
|
29433 | ```js
|
29434 | function getJSON(url) {
|
29435 | return new Promise(function(resolve, reject){
|
29436 | let xhr = new XMLHttpRequest();
|
29437 |
|
29438 | xhr.open('GET', url);
|
29439 | xhr.onreadystatechange = handler;
|
29440 | xhr.responseType = 'json';
|
29441 | xhr.setRequestHeader('Accept', 'application/json');
|
29442 | xhr.send();
|
29443 |
|
29444 | function handler() {
|
29445 | if (this.readyState === this.DONE) {
|
29446 | if (this.status === 200) {
|
29447 | resolve(this.response);
|
29448 | } else {
|
29449 | reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
|
29450 | }
|
29451 | }
|
29452 | };
|
29453 | });
|
29454 | }
|
29455 |
|
29456 | getJSON('/posts.json').then(function(json) {
|
29457 | // on fulfillment
|
29458 | }, function(reason) {
|
29459 | // on rejection
|
29460 | });
|
29461 | ```
|
29462 |
|
29463 | Unlike callbacks, promises are great composable primitives.
|
29464 |
|
29465 | ```js
|
29466 | Promise.all([
|
29467 | getJSON('/posts'),
|
29468 | getJSON('/comments')
|
29469 | ]).then(function(values){
|
29470 | values[0] // => postsJSON
|
29471 | values[1] // => commentsJSON
|
29472 |
|
29473 | return values;
|
29474 | });
|
29475 | ```
|
29476 |
|
29477 | @class Promise
|
29478 | @param {Function} resolver
|
29479 | Useful for tooling.
|
29480 | @constructor
|
29481 | */
|
29482 |
|
29483 | var Promise$1 = function () {
|
29484 | function Promise(resolver) {
|
29485 | this[PROMISE_ID] = nextId();
|
29486 | this._result = this._state = undefined;
|
29487 | this._subscribers = [];
|
29488 |
|
29489 | if (noop !== resolver) {
|
29490 | typeof resolver !== 'function' && needsResolver();
|
29491 | this instanceof Promise ? initializePromise(this, resolver) : needsNew();
|
29492 | }
|
29493 | }
|
29494 |
|
29495 | /**
|
29496 | The primary way of interacting with a promise is through its `then` method,
|
29497 | which registers callbacks to receive either a promise's eventual value or the
|
29498 | reason why the promise cannot be fulfilled.
|
29499 | ```js
|
29500 | findUser().then(function(user){
|
29501 | // user is available
|
29502 | }, function(reason){
|
29503 | // user is unavailable, and you are given the reason why
|
29504 | });
|
29505 | ```
|
29506 | Chaining
|
29507 | --------
|
29508 | The return value of `then` is itself a promise. This second, 'downstream'
|
29509 | promise is resolved with the return value of the first promise's fulfillment
|
29510 | or rejection handler, or rejected if the handler throws an exception.
|
29511 | ```js
|
29512 | findUser().then(function (user) {
|
29513 | return user.name;
|
29514 | }, function (reason) {
|
29515 | return 'default name';
|
29516 | }).then(function (userName) {
|
29517 | // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
|
29518 | // will be `'default name'`
|
29519 | });
|
29520 | findUser().then(function (user) {
|
29521 | throw new Error('Found user, but still unhappy');
|
29522 | }, function (reason) {
|
29523 | throw new Error('`findUser` rejected and we're unhappy');
|
29524 | }).then(function (value) {
|
29525 | // never reached
|
29526 | }, function (reason) {
|
29527 | // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
|
29528 | // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
|
29529 | });
|
29530 | ```
|
29531 | If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
|
29532 | ```js
|
29533 | findUser().then(function (user) {
|
29534 | throw new PedagogicalException('Upstream error');
|
29535 | }).then(function (value) {
|
29536 | // never reached
|
29537 | }).then(function (value) {
|
29538 | // never reached
|
29539 | }, function (reason) {
|
29540 | // The `PedgagocialException` is propagated all the way down to here
|
29541 | });
|
29542 | ```
|
29543 | Assimilation
|
29544 | ------------
|
29545 | Sometimes the value you want to propagate to a downstream promise can only be
|
29546 | retrieved asynchronously. This can be achieved by returning a promise in the
|
29547 | fulfillment or rejection handler. The downstream promise will then be pending
|
29548 | until the returned promise is settled. This is called *assimilation*.
|
29549 | ```js
|
29550 | findUser().then(function (user) {
|
29551 | return findCommentsByAuthor(user);
|
29552 | }).then(function (comments) {
|
29553 | // The user's comments are now available
|
29554 | });
|
29555 | ```
|
29556 | If the assimliated promise rejects, then the downstream promise will also reject.
|
29557 | ```js
|
29558 | findUser().then(function (user) {
|
29559 | return findCommentsByAuthor(user);
|
29560 | }).then(function (comments) {
|
29561 | // If `findCommentsByAuthor` fulfills, we'll have the value here
|
29562 | }, function (reason) {
|
29563 | // If `findCommentsByAuthor` rejects, we'll have the reason here
|
29564 | });
|
29565 | ```
|
29566 | Simple Example
|
29567 | --------------
|
29568 | Synchronous Example
|
29569 | ```javascript
|
29570 | let result;
|
29571 | try {
|
29572 | result = findResult();
|
29573 | // success
|
29574 | } catch(reason) {
|
29575 | // failure
|
29576 | }
|
29577 | ```
|
29578 | Errback Example
|
29579 | ```js
|
29580 | findResult(function(result, err){
|
29581 | if (err) {
|
29582 | // failure
|
29583 | } else {
|
29584 | // success
|
29585 | }
|
29586 | });
|
29587 | ```
|
29588 | Promise Example;
|
29589 | ```javascript
|
29590 | findResult().then(function(result){
|
29591 | // success
|
29592 | }, function(reason){
|
29593 | // failure
|
29594 | });
|
29595 | ```
|
29596 | Advanced Example
|
29597 | --------------
|
29598 | Synchronous Example
|
29599 | ```javascript
|
29600 | let author, books;
|
29601 | try {
|
29602 | author = findAuthor();
|
29603 | books = findBooksByAuthor(author);
|
29604 | // success
|
29605 | } catch(reason) {
|
29606 | // failure
|
29607 | }
|
29608 | ```
|
29609 | Errback Example
|
29610 | ```js
|
29611 | function foundBooks(books) {
|
29612 | }
|
29613 | function failure(reason) {
|
29614 | }
|
29615 | findAuthor(function(author, err){
|
29616 | if (err) {
|
29617 | failure(err);
|
29618 | // failure
|
29619 | } else {
|
29620 | try {
|
29621 | findBoooksByAuthor(author, function(books, err) {
|
29622 | if (err) {
|
29623 | failure(err);
|
29624 | } else {
|
29625 | try {
|
29626 | foundBooks(books);
|
29627 | } catch(reason) {
|
29628 | failure(reason);
|
29629 | }
|
29630 | }
|
29631 | });
|
29632 | } catch(error) {
|
29633 | failure(err);
|
29634 | }
|
29635 | // success
|
29636 | }
|
29637 | });
|
29638 | ```
|
29639 | Promise Example;
|
29640 | ```javascript
|
29641 | findAuthor().
|
29642 | then(findBooksByAuthor).
|
29643 | then(function(books){
|
29644 | // found books
|
29645 | }).catch(function(reason){
|
29646 | // something went wrong
|
29647 | });
|
29648 | ```
|
29649 | @method then
|
29650 | @param {Function} onFulfilled
|
29651 | @param {Function} onRejected
|
29652 | Useful for tooling.
|
29653 | @return {Promise}
|
29654 | */
|
29655 |
|
29656 | /**
|
29657 | `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
|
29658 | as the catch block of a try/catch statement.
|
29659 | ```js
|
29660 | function findAuthor(){
|
29661 | throw new Error('couldn't find that author');
|
29662 | }
|
29663 | // synchronous
|
29664 | try {
|
29665 | findAuthor();
|
29666 | } catch(reason) {
|
29667 | // something went wrong
|
29668 | }
|
29669 | // async with promises
|
29670 | findAuthor().catch(function(reason){
|
29671 | // something went wrong
|
29672 | });
|
29673 | ```
|
29674 | @method catch
|
29675 | @param {Function} onRejection
|
29676 | Useful for tooling.
|
29677 | @return {Promise}
|
29678 | */
|
29679 |
|
29680 |
|
29681 | Promise.prototype.catch = function _catch(onRejection) {
|
29682 | return this.then(null, onRejection);
|
29683 | };
|
29684 |
|
29685 | /**
|
29686 | `finally` will be invoked regardless of the promise's fate just as native
|
29687 | try/catch/finally behaves
|
29688 |
|
29689 | Synchronous example:
|
29690 |
|
29691 | ```js
|
29692 | findAuthor() {
|
29693 | if (Math.random() > 0.5) {
|
29694 | throw new Error();
|
29695 | }
|
29696 | return new Author();
|
29697 | }
|
29698 |
|
29699 | try {
|
29700 | return findAuthor(); // succeed or fail
|
29701 | } catch(error) {
|
29702 | return findOtherAuther();
|
29703 | } finally {
|
29704 | // always runs
|
29705 | // doesn't affect the return value
|
29706 | }
|
29707 | ```
|
29708 |
|
29709 | Asynchronous example:
|
29710 |
|
29711 | ```js
|
29712 | findAuthor().catch(function(reason){
|
29713 | return findOtherAuther();
|
29714 | }).finally(function(){
|
29715 | // author was either found, or not
|
29716 | });
|
29717 | ```
|
29718 |
|
29719 | @method finally
|
29720 | @param {Function} callback
|
29721 | @return {Promise}
|
29722 | */
|
29723 |
|
29724 |
|
29725 | Promise.prototype.finally = function _finally(callback) {
|
29726 | var promise = this;
|
29727 | var constructor = promise.constructor;
|
29728 |
|
29729 | if (isFunction(callback)) {
|
29730 | return promise.then(function (value) {
|
29731 | return constructor.resolve(callback()).then(function () {
|
29732 | return value;
|
29733 | });
|
29734 | }, function (reason) {
|
29735 | return constructor.resolve(callback()).then(function () {
|
29736 | throw reason;
|
29737 | });
|
29738 | });
|
29739 | }
|
29740 |
|
29741 | return promise.then(callback, callback);
|
29742 | };
|
29743 |
|
29744 | return Promise;
|
29745 | }();
|
29746 |
|
29747 | Promise$1.prototype.then = then;
|
29748 | Promise$1.all = all;
|
29749 | Promise$1.race = race;
|
29750 | Promise$1.resolve = resolve$1;
|
29751 | Promise$1.reject = reject$1;
|
29752 | Promise$1._setScheduler = setScheduler;
|
29753 | Promise$1._setAsap = setAsap;
|
29754 | Promise$1._asap = asap;
|
29755 |
|
29756 | /*global self*/
|
29757 | function polyfill() {
|
29758 | var local = void 0;
|
29759 |
|
29760 | if (typeof global !== 'undefined') {
|
29761 | local = global;
|
29762 | } else if (typeof self !== 'undefined') {
|
29763 | local = self;
|
29764 | } else {
|
29765 | try {
|
29766 | local = Function('return this')();
|
29767 | } catch (e) {
|
29768 | throw new Error('polyfill failed because global object is unavailable in this environment');
|
29769 | }
|
29770 | }
|
29771 |
|
29772 | var P = local.Promise;
|
29773 |
|
29774 | if (P) {
|
29775 | var promiseToString = null;
|
29776 | try {
|
29777 | promiseToString = Object.prototype.toString.call(P.resolve());
|
29778 | } catch (e) {
|
29779 | // silently ignored
|
29780 | }
|
29781 |
|
29782 | if (promiseToString === '[object Promise]' && !P.cast) {
|
29783 | return;
|
29784 | }
|
29785 | }
|
29786 |
|
29787 | local.Promise = Promise$1;
|
29788 | }
|
29789 |
|
29790 | // Strange compat..
|
29791 | Promise$1.polyfill = polyfill;
|
29792 | Promise$1.Promise = Promise$1;
|
29793 |
|
29794 | return Promise$1;
|
29795 |
|
29796 | })));
|
29797 |
|
29798 |
|
29799 |
|
29800 | //# sourceMappingURL=es6-promise.map
|
29801 |
|
29802 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89), (function() { return this; }())))
|
29803 |
|
29804 | /***/ }),
|
29805 | /* 302 */
|
29806 | /***/ (function(module, exports, __webpack_require__) {
|
29807 |
|
29808 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
29809 |
|
29810 | // load the styles
|
29811 | var content = __webpack_require__(303);
|
29812 | if(typeof content === 'string') content = [[module.id, content, '']];
|
29813 | // add the styles to the DOM
|
29814 | var update = __webpack_require__(248)(content, {});
|
29815 | if(content.locals) module.exports = content.locals;
|
29816 | // Hot Module Replacement
|
29817 | if(false) {
|
29818 | // When the styles change, update the <style> tags
|
29819 | if(!content.locals) {
|
29820 | module.hot.accept("!!../../../../css-loader/index.js!../../../../sass-loader/index.js!./all.scss", function() {
|
29821 | var newContent = require("!!../../../../css-loader/index.js!../../../../sass-loader/index.js!./all.scss");
|
29822 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
29823 | update(newContent);
|
29824 | });
|
29825 | }
|
29826 | // When the module is disposed, remove the <style> tags
|
29827 | module.hot.dispose(function() { update(); });
|
29828 | }
|
29829 |
|
29830 | /***/ }),
|
29831 | /* 303 */
|
29832 | /***/ (function(module, exports, __webpack_require__) {
|
29833 |
|
29834 | exports = module.exports = __webpack_require__(246)();
|
29835 | // imports
|
29836 |
|
29837 |
|
29838 | // module
|
29839 | exports.push([module.id, "/*$A2-Blod {\n font-family: PingFangSC-Semibold;\n font-size: 12px;\n line-height: 1.7;\n}*/\n.base-search-component {\n margin: 15px 0 5px 0; }\n .base-search-component input::-ms-clear {\n display: none; }\n .base-search-component .search-disabled {\n background-color: #f0f0f0; }\n .base-search-component .sys-icon-close {\n text-decoration: none; }\n .base-search-component .base-search-input {\n width: 100%;\n /*height: 39px;*/\n border: 1px solid #e4ebf0;\n border-radius: 5px;\n position: relative; }\n .base-search-component .base-search-input:hover {\n border-color: #96d0fa; }\n .base-search-component .base-search-input input {\n height: 24px; }\n .base-search-component .base-search-input:after {\n display: block;\n position: absolute;\n content: \"\";\n left: 50%;\n top: 33px;\n width: 0;\n height: 2px;\n background-color: #1b85d6;\n transition: left ease-in-out .15s, width ease-in-out .15s;\n -ms-transition: left ease-in-out .15s, width ease-in-out .15s; }\n .base-search-component .base-search-input .base-search-input-default {\n font-size: 12px;\n line-height: 20px;\n top: -1px;\n left: 10px;\n pointer-events: none;\n position: absolute; }\n .base-search-component .base-search-input .base-search-input-default .base-search-input-icon {\n color: #8f9ca6;\n margin-right: 5px;\n font-size: 11px;\n display: inline-block;\n line-height: 20px;\n padding: 5px 0;\n vertical-align: top; }\n .base-search-component .base-search-input .base-search-input-default .base-search-input-placeholder {\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n padding: 5px 0;\n display: inline-block;\n color: #c3cbd1; }\n .base-search-component .base-search-input input {\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 14px;\n line-height: 24px;\n padding: 2px 0;\n display: block;\n width: calc(100% - 2px);\n color: #36434D;\n text-indent: 25px;\n border: 1px solid transparent;\n outline: none;\n border-radius: 5px; }\n .base-search-component .base-search-disabled {\n background-color: #f0f0f0;\n cursor: no-drop; }\n .base-search-component .base-search-input-active input {\n border: 1px solid #1687d9;\n box-shadow: 0 0 2px 1px #96d0fa;\n background: #ffffff;\n border-radius: 5px; }\n .base-search-component .base-search-input-active div.base-search-input-default .base-search-input-icon {\n color: #1687d9; }\n .base-search-component .base-search-input-active div.base-search-input-default .sys-icon-sousuo:before {\n color: #1687d9; }\n .base-search-component .sys-icon-close {\n width: 14px;\n height: 14px;\n position: absolute;\n right: 5px;\n font-size: 14px;\n top: 7px; }\n .base-search-component .sys-icon-close:before {\n color: #acb7bf; }\n .base-search-component .sys-icon-close:hover:before {\n color: #cc2929; }\n\n.search-icon-box {\n width: 100%;\n height: 100%; }\n .search-icon-box .common-link {\n display: block;\n width: 100%;\n height: 100%;\n font-size: 18px;\n color: #66757f;\n -webkit-transition: color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);\n -moz-transition: color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);\n -ms-transition: color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);\n -o-transition: color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);\n transition: color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);\n text-align: center;\n line-height: 40px !important; }\n .search-icon-box .list-wrapper {\n width: 340px;\n height: auto;\n max-height: 612px;\n background-color: #fff;\n position: absolute;\n z-index: 1200;\n top: 43px;\n right: 10px;\n overflow: hidden;\n border-radius: 3px;\n -webkit-transform: translate3d(0, 0, 0) scale(0);\n -moz-transform: translate3d(0, 0, 0) scale(0);\n -o-transform: translate3d(0, 0, 0) scale(0);\n transform: translate3d(0, 0, 0) scale(0);\n -webkit-backface-visibility: hidden;\n -moz-backface-visibility: hidden;\n -ms-backface-visibility: hidden;\n -o-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-perspective: 1000;\n -moz-perspective: 1000;\n -ms-perspective: 1000;\n -o-perspective: 1000;\n perspective: 1000;\n -webkit-transform-origin: top right;\n -moz-transform-origin: top right;\n -ms-transform-origin: top right;\n -o-transform-origin: top right;\n transform-origin: top right;\n overflow: hidden\\9;\n border: 1px solid #e4ebf0;\n display: none\\9; }\n .search-icon-box .list-wrapper.list-open {\n box-shadow: 1px 3px 11px rgba(0, 0, 0, 0.2);\n -webkit-transition: box-shadow .3s linear .4s;\n -moz-transition: box-shadow .3s linear .4s;\n -ms-transition: box-shadow .3s linear .4s;\n -o-transition: box-shadow .3s linear .4s;\n transition: box-shadow .3s linear .4s;\n -webkit-animation: popShow 0.3s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards;\n -moz-animation: popShow 0.3s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards;\n -ms-animation: popShow 0.3s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards;\n -o-animation: popShow 0.3s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards;\n animation: popShow 0.3s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards;\n display: block\\9; }\n .search-icon-box .list-wrapper.list-close {\n display: none\\9;\n filter: alpha(opacity=0);\n opacity: 0;\n -webkit-transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n -moz-transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n -ms-transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n -o-transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n -webkit-animation: popHide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;\n -moz-animation: popHide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;\n -ms-animation: popHide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;\n -o-animation: popHide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;\n animation: popHide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }\n\n@-webkit-keyframes popShow {\n from {\n -webkit-transform: scale(0); }\n to {\n -webkit-transform: scale(1); } }\n\n@-moz-keyframes popShow {\n from {\n -moz-transform: scale(0); }\n to {\n -moz-transform: scale(1); } }\n\n@-ms-keyframes popShow {\n .search-icon-box from {\n -ms-transform: scale(0); }\n .search-icon-box to {\n -ms-transform: scale(1); } }\n\n@-o-keyframes popShow {\n from {\n -o-transform: scale(0); }\n to {\n -o-transform: scale(1); } }\n\n@keyframes popShow {\n from {\n transform: scale(0); }\n to {\n transform: scale(1); } }\n\n@-webkit-keyframes popHide {\n from {\n -webkit-transform: scale(1); }\n to {\n -webkit-transform: scale(0); } }\n\n@-moz-keyframes popHide {\n from {\n -moz-transform: scale(1); }\n to {\n -moz-transform: scale(0); } }\n\n@-ms-keyframes popHide {\n .search-icon-box from {\n -ms-transform: scale(1); }\n .search-icon-box to {\n -ms-transform: scale(0); } }\n\n@-o-keyframes popHide {\n from {\n -o-transform: scale(1); }\n to {\n -o-transform: scale(0); } }\n\n@keyframes popHide {\n from {\n transform: scale(1); }\n to {\n transform: scale(0); } }\n .search-icon-box .search-icon-box .form-input {\n height: 27px;\n width: 310px;\n margin: 20px 15px;\n border-bottom: 1px solid #e4ebf0;\n position: relative; }\n .search-icon-box .search-icon-box .form-input-active:after {\n width: 100%;\n left: 0;\n -webkit-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s;\n -moz-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s;\n -ms-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s;\n -o-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s;\n transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s; }\n .search-icon-box .search-icon-box .form-input:after {\n display: block;\n position: absolute;\n content: \"\";\n left: 50%;\n top: 26px;\n width: 0;\n height: 2px;\n background-color: #1b85d6;\n -webkit-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.15s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.15s;\n -moz-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.15s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.15s;\n -ms-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.15s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.15s;\n -o-transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.15s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.15s;\n transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.15s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.15s; }\n .search-icon-box .search-icon-box .form-input input {\n display: block;\n width: 100%;\n height: 20px;\n margin: auto;\n line-height: 20px;\n border: 0;\n outline: 0;\n font-size: 14px;\n color: #36434d;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n", ""]);
|
29840 |
|
29841 | // exports
|
29842 |
|
29843 |
|
29844 | /***/ }),
|
29845 | /* 304 */
|
29846 | /***/ (function(module, exports, __webpack_require__) {
|
29847 |
|
29848 | 'use strict';
|
29849 |
|
29850 | 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; }; }();
|
29851 |
|
29852 | var _react = __webpack_require__(86);
|
29853 |
|
29854 | var _react2 = _interopRequireDefault(_react);
|
29855 |
|
29856 | var _checkboxitem = __webpack_require__(305);
|
29857 |
|
29858 | var _checkboxitem2 = _interopRequireDefault(_checkboxitem);
|
29859 |
|
29860 | var _radioitem = __webpack_require__(306);
|
29861 |
|
29862 | var _radioitem2 = _interopRequireDefault(_radioitem);
|
29863 |
|
29864 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29865 |
|
29866 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
29867 |
|
29868 | 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; }
|
29869 |
|
29870 | 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; } /* eslint-disable */
|
29871 |
|
29872 |
|
29873 | var DropList = function (_Component) {
|
29874 | _inherits(DropList, _Component);
|
29875 |
|
29876 | function DropList(props) {
|
29877 | _classCallCheck(this, DropList);
|
29878 |
|
29879 | var _this = _possibleConstructorReturn(this, (DropList.__proto__ || Object.getPrototypeOf(DropList)).call(this, props));
|
29880 |
|
29881 | _this.state = props;
|
29882 | return _this;
|
29883 | }
|
29884 |
|
29885 | _createClass(DropList, [{
|
29886 | key: 'componentWillReceiveProps',
|
29887 | value: function componentWillReceiveProps(nextProps) {
|
29888 | this.setState({ children: nextProps.children });
|
29889 | this.syncListScroll(nextProps);
|
29890 | }
|
29891 | }, {
|
29892 | key: 'syncListScroll',
|
29893 | value: function syncListScroll(props) {
|
29894 | var index = props.index,
|
29895 | dropdownUl = this.refs.dropdownUl;
|
29896 |
|
29897 | if (dropdownUl.hasChildNodes()) {
|
29898 | var maxHeight = dropdownUl.clientHeight,
|
29899 | // 页整体高度
|
29900 | itemHeight = dropdownUl.childNodes[0].clientHeight,
|
29901 | // 单条内容高度
|
29902 | top = dropdownUl.scrollTop,
|
29903 | bottom = dropdownUl.scrollTop + maxHeight;
|
29904 |
|
29905 | if (index == 0) {
|
29906 | dropdownUl.scrollTop = 0;
|
29907 | } else if (index == props.children.length) {
|
29908 | dropdownUl.scrollTop = itemHeight * dropdownUl.childNodes.length;
|
29909 | } else if (index == props.children.length - 1) {
|
29910 | dropdownUl.scrollTop = itemHeight * index;
|
29911 | } else if (itemHeight * index >= bottom) {
|
29912 | dropdownUl.scrollTop = top + itemHeight;
|
29913 | } else if (itemHeight * index <= top) {
|
29914 | dropdownUl.scrollTop = top - itemHeight;
|
29915 | }
|
29916 | }
|
29917 | }
|
29918 | }, {
|
29919 | key: 'render',
|
29920 | value: function render() {
|
29921 | var _props = this.props,
|
29922 | sideTip = _props.sideTip,
|
29923 | hiddenTip = _props.hiddenTip,
|
29924 | multiple = _props.multiple,
|
29925 | children = _props.children,
|
29926 | searchValue = _props.searchValue,
|
29927 | itemClick = _props.itemClick,
|
29928 | handleClick = _props.handleClick,
|
29929 | index = _props.index,
|
29930 | maxHeight = _props.maxHeight;
|
29931 |
|
29932 | var item = multiple ? _react2.default.createElement(_checkboxitem2.default, null) : _react2.default.createElement(_radioitem2.default, null);
|
29933 | var list = children.map(function (item, idx) {
|
29934 | var className = '';
|
29935 | if (idx == index) {
|
29936 | className += ' pointerOver';
|
29937 | }
|
29938 | if (multiple) {
|
29939 | return _react2.default.createElement(_checkboxitem2.default, { extendClassName: className, sideTip: sideTip, hiddenTip: hiddenTip, searchValue: searchValue, itemClick: itemClick, handleClick: handleClick, key: idx, item: item, index: idx });
|
29940 | } else {
|
29941 | return _react2.default.createElement(_radioitem2.default, { extendClassName: className, sideTip: sideTip, hiddenTip: hiddenTip, searchValue: searchValue, itemClick: itemClick, key: idx, item: item, index: idx });
|
29942 | }
|
29943 | });
|
29944 | return _react2.default.createElement(
|
29945 | 'ul',
|
29946 | { ref: 'dropdownUl', className: 'dropdown__list a-height-spread', style: { "maxHeight": maxHeight } },
|
29947 | list
|
29948 | );
|
29949 | }
|
29950 | }]);
|
29951 |
|
29952 | return DropList;
|
29953 | }(_react.Component);
|
29954 |
|
29955 | module.exports = DropList;
|
29956 |
|
29957 | /***/ }),
|
29958 | /* 305 */
|
29959 | /***/ (function(module, exports, __webpack_require__) {
|
29960 |
|
29961 | 'use strict';
|
29962 |
|
29963 | 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; }; }();
|
29964 |
|
29965 | var _react = __webpack_require__(86);
|
29966 |
|
29967 | var _react2 = _interopRequireDefault(_react);
|
29968 |
|
29969 | var _toolTip = __webpack_require__(251);
|
29970 |
|
29971 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
29972 |
|
29973 | var _commonFunc = __webpack_require__(252);
|
29974 |
|
29975 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29976 |
|
29977 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
29978 |
|
29979 | 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; }
|
29980 |
|
29981 | 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; }
|
29982 |
|
29983 | var Checkboxitem = function (_Component) {
|
29984 | _inherits(Checkboxitem, _Component);
|
29985 |
|
29986 | function Checkboxitem(props) {
|
29987 | _classCallCheck(this, Checkboxitem);
|
29988 |
|
29989 | var _this = _possibleConstructorReturn(this, (Checkboxitem.__proto__ || Object.getPrototypeOf(Checkboxitem)).call(this, props));
|
29990 |
|
29991 | _this.handleChange = _this.handleChange.bind(_this);
|
29992 | _this.state = {
|
29993 | animation: "none"
|
29994 | };
|
29995 | return _this;
|
29996 | }
|
29997 |
|
29998 | //勾选
|
29999 |
|
30000 |
|
30001 | _createClass(Checkboxitem, [{
|
30002 | key: 'handleChange',
|
30003 | value: function handleChange(event) {
|
30004 | if (this.props.item.disabled) return;
|
30005 | this.setState({ animation: "checkToDft 0.2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards" });
|
30006 | this.props.handleClick(event, this.props.item);
|
30007 | }
|
30008 | }, {
|
30009 | key: 'render',
|
30010 | value: function render() {
|
30011 | var _props = this.props,
|
30012 | searchValue = _props.searchValue,
|
30013 | index = _props.index,
|
30014 | item = _props.item,
|
30015 | sideTip = _props.sideTip,
|
30016 | hiddenTip = _props.hiddenTip;
|
30017 |
|
30018 | var text = (0, _commonFunc.decode)(item.text);
|
30019 | var str = (0, _commonFunc.getHeightLight)(searchValue, text);
|
30020 | //win10的ie下取消转动的动画
|
30021 | var agent = navigator.userAgent;
|
30022 | var isWin10 = agent.indexOf("Windows NT 10.0") > -1 && !!window.ActiveXObject || "ActiveXObject" in window;
|
30023 | var isIEorEdge = agent.indexOf('Edge') > -1 || agent.indexOf('Trident') > -1 || agent.indexOf('MSIE 10') > -1;
|
30024 | var win10Sty = isWin10 ? isIEorEdge ? { 'backgroundSize': 'auto', 'animation': 'none' } : { 'animation': 'none' } : isIEorEdge ? { 'backgroundSize': 'auto' } : { animation: this.state.animation };
|
30025 |
|
30026 | var tipContent = item.tipText ? item.tipText : str.beforeText + (typeof str.searchContent == "string" ? str.searchContent : str.searchContent.props.children) + str.lastext;
|
30027 |
|
30028 | var tipUpSpan = _react2.default.createElement(
|
30029 | 'li',
|
30030 | { className: "dropdown__item" + this.props.extendClassName, id: 'dropdown__item', onClick: this.handleChange },
|
30031 | _react2.default.createElement(
|
30032 | 'span',
|
30033 | { className: 'u-checkbox' },
|
30034 | _react2.default.createElement('input', { tabIndex: '-1', type: 'checkbox', id: "checkbox" + index, disabled: item.disabled, name: 'options1', defaultChecked: item.isChecked, checked: item.isChecked, onChange: this.handleChange }),
|
30035 | _react2.default.createElement(
|
30036 | 'label',
|
30037 | { htmlFor: "checkbox" + index, className: 'u-checkbox__label' },
|
30038 | _react2.default.createElement(
|
30039 | 'span',
|
30040 | { className: 'u-checkbox__icon' },
|
30041 | _react2.default.createElement('i', { className: 'u-icon pc-sys-Checkbox-nomal-svg', style: win10Sty }),
|
30042 | _react2.default.createElement('i', { className: 'u-icon pc-sys-Checkbox-active-svg', style: win10Sty }),
|
30043 | _react2.default.createElement('i', { className: 'u-icon pc-sys-Checkbox-active-disabled-svg' })
|
30044 | ),
|
30045 | _react2.default.createElement(
|
30046 | _toolTip2.default,
|
30047 | { title: tipContent, alwaysShowTips: item.tipText && item.tipText.length > 0 ? 'true' : '', side: sideTip, hidden: hiddenTip },
|
30048 | _react2.default.createElement(
|
30049 | 'span',
|
30050 | { id: 'form-item__label', className: 'form-item__label' },
|
30051 | str.beforeText,
|
30052 | str.searchContent,
|
30053 | str.lastext
|
30054 | )
|
30055 | )
|
30056 | )
|
30057 | )
|
30058 | );
|
30059 | return _react2.default.createElement(
|
30060 | 'div',
|
30061 | null,
|
30062 | tipUpSpan
|
30063 | );
|
30064 | }
|
30065 | }]);
|
30066 |
|
30067 | return Checkboxitem;
|
30068 | }(_react.Component);
|
30069 |
|
30070 | module.exports = Checkboxitem;
|
30071 |
|
30072 | /***/ }),
|
30073 | /* 306 */
|
30074 | /***/ (function(module, exports, __webpack_require__) {
|
30075 |
|
30076 | 'use strict';
|
30077 |
|
30078 | 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; }; }();
|
30079 |
|
30080 | var _react = __webpack_require__(86);
|
30081 |
|
30082 | var _react2 = _interopRequireDefault(_react);
|
30083 |
|
30084 | var _toolTip = __webpack_require__(251);
|
30085 |
|
30086 | var _toolTip2 = _interopRequireDefault(_toolTip);
|
30087 |
|
30088 | var _commonFunc = __webpack_require__(252);
|
30089 |
|
30090 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
30091 |
|
30092 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
30093 |
|
30094 | 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; }
|
30095 |
|
30096 | 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; }
|
30097 |
|
30098 | var Radioitem = function (_Component) {
|
30099 | _inherits(Radioitem, _Component);
|
30100 |
|
30101 | function Radioitem(props) {
|
30102 | _classCallCheck(this, Radioitem);
|
30103 |
|
30104 | var _this = _possibleConstructorReturn(this, (Radioitem.__proto__ || Object.getPrototypeOf(Radioitem)).call(this, props));
|
30105 |
|
30106 | _this.handelClick = _this.handelClick.bind(_this);
|
30107 | return _this;
|
30108 | }
|
30109 |
|
30110 | _createClass(Radioitem, [{
|
30111 | key: 'handelClick',
|
30112 | value: function handelClick(event) {
|
30113 | (0, _commonFunc.clearToolTipDom)();
|
30114 | this.props.itemClick(event, this.props.item);
|
30115 | }
|
30116 | }, {
|
30117 | key: 'render',
|
30118 | value: function render() {
|
30119 | var _props = this.props,
|
30120 | searchValue = _props.searchValue,
|
30121 | item = _props.item,
|
30122 | sideTip = _props.sideTip,
|
30123 | hiddenTip = _props.hiddenTip;
|
30124 |
|
30125 | var text = (0, _commonFunc.decode)(item.text);
|
30126 | var str = (0, _commonFunc.getHeightLight)(searchValue, text);
|
30127 |
|
30128 | var tipContent = item.tipText ? item.tipText : str.beforeText + (str.searchContent.props ? str.searchContent.props.children : str.searchContent) + str.lastext;
|
30129 |
|
30130 | return _react2.default.createElement(
|
30131 | 'li',
|
30132 | { className: "dropdown__item" + this.props.extendClassName, onClick: this.handelClick },
|
30133 | _react2.default.createElement(
|
30134 | _toolTip2.default,
|
30135 | { title: tipContent, alwaysShowTips: item.tipText && item.tipText.length > 0 ? 'true' : '', side: sideTip, hidden: hiddenTip },
|
30136 | _react2.default.createElement(
|
30137 | 'span',
|
30138 | { className: 'dropdown__text' },
|
30139 | str.beforeText,
|
30140 | str.searchContent,
|
30141 | str.lastext
|
30142 | )
|
30143 | )
|
30144 | );
|
30145 | }
|
30146 | }]);
|
30147 |
|
30148 | return Radioitem;
|
30149 | }(_react.Component);
|
30150 |
|
30151 | module.exports = Radioitem;
|
30152 |
|
30153 | /***/ }),
|
30154 | /* 307 */
|
30155 | /***/ (function(module, exports, __webpack_require__) {
|
30156 |
|
30157 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
30158 |
|
30159 | // load the styles
|
30160 | var content = __webpack_require__(308);
|
30161 | if(typeof content === 'string') content = [[module.id, content, '']];
|
30162 | // add the styles to the DOM
|
30163 | var update = __webpack_require__(248)(content, {});
|
30164 | if(content.locals) module.exports = content.locals;
|
30165 | // Hot Module Replacement
|
30166 | if(false) {
|
30167 | // When the styles change, update the <style> tags
|
30168 | if(!content.locals) {
|
30169 | module.hot.accept("!!../../../../../../css-loader/index.js!../../../../../../sass-loader/index.js!./style.scss", function() {
|
30170 | var newContent = require("!!../../../../../../css-loader/index.js!../../../../../../sass-loader/index.js!./style.scss");
|
30171 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
30172 | update(newContent);
|
30173 | });
|
30174 | }
|
30175 | // When the module is disposed, remove the <style> tags
|
30176 | module.hot.dispose(function() { update(); });
|
30177 | }
|
30178 |
|
30179 | /***/ }),
|
30180 | /* 308 */
|
30181 | /***/ (function(module, exports, __webpack_require__) {
|
30182 |
|
30183 | exports = module.exports = __webpack_require__(246)();
|
30184 | // imports
|
30185 |
|
30186 |
|
30187 | // module
|
30188 | exports.push([module.id, ".dropdown {\n min-width: 170px !important;\n border-radius: 5px !important;\n box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.15) !important; }\n .dropdown.a-dialog_is-open {\n animation: antSlideDownIn 0.2s cubic-bezier(0.755, 0.05, 0.855, 0.06);\n transition: none; }\n .dropdown.a-diglog_lt {\n -webkit-animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);\n animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);\n -webkit-animation-duration: .2s;\n animation-duration: .2s;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n -webkit-animation-play-state: paused;\n animation-play-state: paused;\n -webkit-animation-name: antSlideUpIn;\n animation-name: antSlideUpIn;\n -webkit-animation-play-state: running;\n animation-play-state: running; }\n\n@-webkit-keyframes antSlideUpIn {\n 0% {\n opacity: 0;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: scaleY(0.8);\n transform: scaleY(0.8); }\n 100% {\n opacity: 1;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: scaleY(1);\n transform: scaleY(1); } }\n\n@keyframes antSlideUpIn {\n 0% {\n opacity: 0;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: scaleY(0.8);\n transform: scaleY(0.8); }\n 100% {\n opacity: 1;\n -webkit-transform-origin: 0% 0%;\n transform-origin: 0% 0%;\n -webkit-transform: scaleY(1);\n transform: scaleY(1); } }\n .dropdown .search__wrap {\n margin: 0 15px; }\n .dropdown .dropdown__item {\n transition: initial !important; }\n .dropdown .dropdown__item .u-checkbox {\n width: 100%; }\n .dropdown .dropdown__item:hover {\n background-color: #f5f8fa !important; }\n .dropdown .dropdown__item.pointerOver {\n background-color: #f5f8fa !important; }\n .dropdown .base-search-component {\n box-sizing: content-box; }\n .dropdown .u-icon.empty-icon {\n display: inline-block;\n width: 100%;\n height: 150px;\n background-repeat: no-repeat;\n background-position: 50%; }\n .dropdown .form-item__label em {\n color: #36434D;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n .dropdown .dropdown__container .dropdown__text {\n display: inline-block;\n max-width: -webkit-calc(100% - 0px);\n max-width: calc(100% - 0px);\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; }\n\n.dropdown.dropdown_has-search .u-checkbox .form-item__label {\n max-width: -webkit-calc(100% - 23px);\n max-width: calc(100% - 23px);\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; }\n\n.dropdown.dropdown_has-search .u-checkbox .u-checkbox__label {\n width: 100%;\n cursor: pointer; }\n\n.dropdown.dropdown_has-search .u-checkbox {\n width: 100%; }\n\n.dropdown__footer .btn.btn_default.btn_sm.pointOver {\n box-shadow: 0 0 0 5px #fff, 0 0 7px 5px #1687d9; }\n\n.dropdown.dropdown_has-search .dropdown__item {\n padding-top: 3px !important;\n padding-bottom: 3px !important; }\n", ""]);
|
30189 |
|
30190 | // exports
|
30191 |
|
30192 |
|
30193 | /***/ }),
|
30194 | /* 309 */
|
30195 | /***/ (function(module, exports, __webpack_require__) {
|
30196 |
|
30197 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
30198 |
|
30199 | // load the styles
|
30200 | var content = __webpack_require__(310);
|
30201 | if(typeof content === 'string') content = [[module.id, content, '']];
|
30202 | // add the styles to the DOM
|
30203 | var update = __webpack_require__(248)(content, {});
|
30204 | if(content.locals) module.exports = content.locals;
|
30205 | // Hot Module Replacement
|
30206 | if(false) {
|
30207 | // When the styles change, update the <style> tags
|
30208 | if(!content.locals) {
|
30209 | module.hot.accept("!!../../../../css-loader/index.js!../../../../sass-loader/index.js!./index.scss", function() {
|
30210 | var newContent = require("!!../../../../css-loader/index.js!../../../../sass-loader/index.js!./index.scss");
|
30211 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
30212 | update(newContent);
|
30213 | });
|
30214 | }
|
30215 | // When the module is disposed, remove the <style> tags
|
30216 | module.hot.dispose(function() { update(); });
|
30217 | }
|
30218 |
|
30219 | /***/ }),
|
30220 | /* 310 */
|
30221 | /***/ (function(module, exports, __webpack_require__) {
|
30222 |
|
30223 | exports = module.exports = __webpack_require__(246)();
|
30224 | // imports
|
30225 |
|
30226 |
|
30227 | // module
|
30228 | exports.push([module.id, "@charset \"UTF-8\";\n/*\n* @Author: zhongjiahao\n* @Date: 2016-09-07 11:18:30\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-17 17:53:19\n*/\n/*\n* @Author: zhongjiahao\n* @Date: 2016-09-13 10:44:22\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-08 10:28:06\n*/\n/*\n 主色\n*/\n/*\n 中性色\n*/\n/*\n 辅助色\n*/\n/*\n 系统提示色\n*/\n/*\n z-index\n */\n/*\n* @Author: zhongjiahao\n* @Date: 2016-09-07 11:17:15\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-09-29 14:15:09\n*/\n/*\n* @Author: zhongjiahao\n* @Date: 2016-08-03 15:31:16\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-10-18 15:54:22\n*/\n/*\n font-size: 34px;\n*/\n/*\n font-size: 24px;\n*/\n/*\n font-size: 20px;\n*/\n/*\n font-size: 16px;\n*/\n/*\n font-size: 14px;\n*/\n/*\n font-size: 12px;\n*/\n/*\n font-size: 14px;\n*/\n/*\n font-size: 12px;\n*/\n/*\n clearfix\n */\n/*\n text overflow\n */\n/*\n* @Author: zhongjiahao\n* @Date: 2016-09-05 17:54:06\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-12-12 18:44:30\n*/\n/*\n* @Author: zhongjiahao\n* @Date: 2016-08-03 16:36:12\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-15 15:46:47\n*/\nhtml {\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n font-size: 16px !important;\n -webkit-tap-highlight-color: transparent; }\n\n::-webkit-scrollbar {\n width: 10px; }\n\n::-webkit-scrollbar-track {\n background-color: transparent;\n border-radius: 10px; }\n\n::-webkit-scrollbar-thumb:vertical {\n border-radius: 8px;\n -webkit-box-shadow: inset 0 0 20px rgba(10, 19, 26, 0.3);\n border-top: 2px solid transparent;\n border-right: 2px solid transparent;\n border-bottom: 2px solid transparent; }\n\n::-webkit-scrollbar-thumb:horizontal {\n border-radius: 8px;\n -webkit-box-shadow: inset 0 0 20px rgba(10, 19, 26, 0.3);\n border-top: 0px solid transparent;\n border-left: 2px solid transparent;\n border-right: 2px solid transparent;\n border-bottom: 2px solid transparent; }\n\n::-webkit-scrollbar-thumb:hover {\n -webkit-box-shadow: inset 0 0 20px rgba(10, 19, 26, 0.8); }\n\n/*\n* @Author: zhongjiahao\n* @Date: 2016-10-18 14:41:05\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-17 11:17:57\n*/\nul,\nol {\n list-style: none outside none;\n margin: 0;\n padding: 0; }\n\na {\n color: #005999;\n outline: 0;\n cursor: pointer;\n text-decoration: none; }\n a:active {\n outline: 0; }\n\n/*\n* @Author: zhongjiahao\n* @Date: 2016-08-03 15:48:17\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-10 18:14:31\n*/\n/*\n clearfix\n */\n.f-cf {\n zoom: 1; }\n .f-cf:before, .f-cf:after {\n content: \" \";\n display: table; }\n .f-cf:after {\n clear: both;\n visibility: hidden;\n font-size: 0;\n height: 0; }\n\n/*\n floatleft\n */\n.f-fl {\n float: left; }\n\n/*\n floatright\n */\n.f-fr {\n float: right; }\n\n/*\n display inlineblock\n */\n.f-dib {\n display: inline-block; }\n\n/*\n display inline\n */\n.f-di {\n display: inline; }\n\n/*\n textaligin left\n */\n.f-tal {\n text-align: left; }\n\n/*\n textaligin right\n */\n.f-tar {\n text-align: right; }\n\n/*\n textaligin center\n */\n.f-tac {\n text-align: center; }\n\n/*\n verticalalign middle\n */\n.f-vam {\n vertical-align: middle; }\n\n/*\n display block\n */\n.f-db {\n display: block; }\n\n/*\n display none\n */\n.f-dn {\n display: none; }\n\n/*\n overflow hidden\n */\n.f-oh {\n overflow: hidden; }\n\n/*\n assistive text\n */\n.f-assistive-text {\n position: absolute !important;\n margin: -1px !important;\n border: 0 !important;\n padding: 0 !important;\n width: 1px !important;\n height: 1px !important;\n overflow: hidden !important;\n clip: rect(0 0 0 0) !important; }\n\n/*\n highlight text\n */\n.f-highlight-text {\n height: inherit;\n font-family: inherit;\n font-style: inherit;\n background: rgba(228, 166, 0, 0.2);\n border-radius: 2px; }\n\n/*\n padding\n*/\n.f-p-5 {\n padding: 5px;\n padding: 0.3125rem; }\n\n.f-p-10 {\n padding: 10px;\n padding: 0.625rem; }\n\n.f-p-15 {\n padding: 15px;\n padding: 0.9375rem; }\n\n.f-p-20 {\n padding: 20px;\n padding: 1.25rem; }\n\n/*\n padding left\n*/\n.f-pl-5 {\n padding-left: 5px;\n padding-left: 0.3125rem; }\n\n.f-pl-10 {\n padding-left: 10px;\n padding-left: 0.625rem; }\n\n.f-pl-15 {\n padding-left: 15px;\n padding-left: 0.9375rem; }\n\n.f-pl-20 {\n padding-left: 20px;\n padding-left: 1.25rem; }\n\n/*\n padding right\n*/\n.f-pr-5 {\n padding-right: 5px;\n padding-right: 0.3125rem; }\n\n.f-pr-10 {\n padding-right: 10px;\n padding-right: 0.625rem; }\n\n.f-pr-15 {\n padding-right: 15px;\n padding-right: 0.9375rem; }\n\n.f-pr-20 {\n padding-right: 20px;\n padding-right: 1.25rem; }\n\n/*\n padding top\n*/\n.f-pt-5 {\n padding-top: 5px;\n padding-top: 0.3125rem; }\n\n.f-pt-10 {\n padding-top: 10px;\n padding-top: 0.625rem; }\n\n.f-pt-15 {\n padding-top: 15px;\n padding-top: 0.9375rem; }\n\n.f-pt-20 {\n padding-top: 20px;\n padding-top: 1.25rem; }\n\n/*\n padding bottom\n*/\n.f-pb-5 {\n padding-bottom: 5px;\n padding-bottom: 0.3125rem; }\n\n.f-pb-10 {\n padding-bottom: 10px;\n padding-bottom: 0.625rem; }\n\n.f-pb-15 {\n padding-bottom: 15px;\n padding-bottom: 0.9375rem; }\n\n.f-pb-20 {\n padding-bottom: 20px;\n padding-bottom: 1.25rem; }\n\n/*\n margin\n*/\n.f-m-5 {\n margin: 5px;\n margin: 0.3125rem; }\n\n.f-m-10 {\n margin: 10px;\n margin: 0.625rem; }\n\n.f-m-15 {\n margin: 15px;\n margin: 0.9375rem; }\n\n.f-m-20 {\n margin: 20px;\n margin: 1.25rem; }\n\n/*\n margin left\n*/\n.f-ml-5 {\n margin-left: 5px;\n margin-left: 0.3125rem; }\n\n.f-ml-10 {\n margin-left: 10px;\n margin-left: 0.625rem; }\n\n.f-ml-15 {\n margin-left: 15px;\n margin-left: 0.9375rem; }\n\n.f-ml-20 {\n margin-left: 20px;\n margin-left: 1.25rem; }\n\n/*\n margin right\n*/\n.f-mr-5 {\n margin-right: 5px;\n margin-right: 0.3125rem; }\n\n.f-mr-10 {\n margin-right: 10px;\n margin-right: 0.625rem; }\n\n.f-mr-15 {\n margin-right: 15px;\n margin-right: 0.9375rem; }\n\n.f-mr-20 {\n margin-right: 20px;\n margin-right: 1.25rem; }\n\n/*\n margin top\n*/\n.f-mt-5 {\n margin-top: 5px;\n margin-top: 0.3125rem; }\n\n.f-mt-10 {\n margin-top: 10px;\n margin-top: 0.625rem; }\n\n.f-mt-15 {\n margin-top: 15px;\n margin-top: 0.9375rem; }\n\n.f-mt-20 {\n margin-top: 20px;\n margin-top: 1.25rem; }\n\n/*\n margin bottom\n*/\n.f-mb-5 {\n margin-bottom: 5px;\n margin-bottom: 0.3125rem; }\n\n.f-mb-10 {\n margin-bottom: 10px;\n margin-bottom: 0.625rem; }\n\n.f-mb-15 {\n margin-bottom: 15px;\n margin-bottom: 0.9375rem; }\n\n.f-mb-20 {\n margin-bottom: 20px;\n margin-bottom: 1.25rem; }\n\n/*\n* @Author: zhongjiahao\n* @Date: 2016-08-03 15:44:44\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-15 16:20:05\n*/\n.f-ft_a1 {\n color: #ed5858; }\n\n.f-ft_a2 {\n color: #f28d49; }\n\n.f-ft_a3 {\n color: #f5d540; }\n\n.f-ft_a4 {\n color: #38ba72; }\n\n.f-ft_a5 {\n color: #55c6c6; }\n\n.f-ft_a6 {\n color: #41b0d9; }\n\n.f-ft_a7 {\n color: #5b99ee; }\n\n.f-bg_a1 {\n background: #ed5858; }\n\n.f-bg_a2 {\n background: #f28d49; }\n\n.f-bg_a3 {\n background: #f5d540; }\n\n.f-bg_a4 {\n background: #38ba72; }\n\n.f-bg_a5 {\n background: #55c6c6; }\n\n.f-bg_a6 {\n background: #41b0d9; }\n\n.f-bg_a7 {\n background: #5b99ee; }\n\n/*\n* @Author: zhongjiahao\n* @Date: 2016-09-18 16:17:55\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-20 17:04:25\n*/\n/* \n background\n*/\n.s-bg_c1 {\n background-color: #004170 !important; }\n\n.s-bg_c2 {\n background-color: #005999 !important; }\n\n.s-bg_c3 {\n background-color: #1687d9 !important; }\n\n.s-bg_c4 {\n background-color: #96d0fa !important; }\n\n.s-bg_m1 {\n background-color: #021726 !important; }\n\n.s-bg_m2 {\n background-color: #3D5566 !important; }\n\n.s-bg_m3 {\n background-color: #BCC8D1 !important; }\n\n.s-bg_m4 {\n background-color: #e4ebf0 !important; }\n\n.s-bg_m5 {\n background-color: #f5f8fa !important; }\n\n.s-bg_m6 {\n background-color: #000 !important; }\n\n.s-bg_m7 {\n background-color: #fff !important; }\n\n/*\n color\n */\n.s-ft_c1 {\n color: #004170 !important; }\n\n.s-ft_c2 {\n color: #005999 !important; }\n\n.s-ft_c3 {\n color: #1687d9 !important; }\n\n.s-ft_c4 {\n color: #96d0fa !important; }\n\n.s-ft_m1 {\n color: #021726 !important; }\n\n.s-ft_m2 {\n color: #3D5566 !important; }\n\n.s-ft_m3 {\n color: #BCC8D1 !important; }\n\n.s-ft_m4 {\n color: #e4ebf0 !important; }\n\n.s-ft_m5 {\n color: #e4ebf0 !important; }\n\n/*\n border\n */\n.s-bd_c1 {\n border-color: #004170 !important; }\n\n.s-bd_c2 {\n border-color: #005999 !important; }\n\n.s-bd_c3 {\n border-color: #1687d9 !important; }\n\n.s-bd_c4 {\n border-color: #96d0fa !important; }\n\n.s-bd_m1 {\n border-color: #021726 !important; }\n\n.s-bd_m2 {\n border-color: #3D5566 !important; }\n\n.s-bd_m3 {\n border-color: #BCC8D1 !important; }\n\n.s-bd_m4 {\n border-color: #e4ebf0 !important; }\n\n.s-bd_m5 {\n border-color: #f5f8fa !important; }\n\n/*\n hover color\n */\n.s-ft-hv_c1:hover {\n color: #004170 !important; }\n\n.s-ft-hv_c2:hover {\n color: #005999 !important; }\n\n.s-ft-hv_c3:hover {\n color: #1687d9 !important; }\n\n.s-ft-hv_c4:hover {\n color: #96d0fa !important; }\n\n.s-ft-hv_m1:hover {\n color: #021726 !important; }\n\n.s-ft-hv_m2:hover {\n color: #3D5566 !important; }\n\n.s-ft-hv_m3:hover {\n color: #BCC8D1 !important; }\n\n.s-ft-hv_m4:hover {\n color: #e4ebf0 !important; }\n\n.s-ft-hv_m5:hover {\n color: #e4ebf0 !important; }\n\n/*\n hover background-color\n */\n.s-bg-hv_c1:hover {\n background-color: #004170 !important; }\n\n.s-bg-hv_c2:hover {\n background-color: #005999 !important; }\n\n.s-bg-hv_c3:hover {\n background-color: #1687d9 !important; }\n\n.s-bg-hv_c4:hover {\n background-color: #96d0fa !important; }\n\n.s-bg-hv_m1:hover {\n background-color: #021726 !important; }\n\n.s-bg-hv_m2:hover {\n background-color: #3D5566 !important; }\n\n.s-bg-hv_m3:hover {\n background-color: #BCC8D1 !important; }\n\n.s-bg-hv_m4:hover {\n background-color: #e4ebf0 !important; }\n\n.s-bg-hv_m5:hover {\n background-color: #e4ebf0 !important; }\n\n/*\n 一些额外自定义的\n */\n.s-bd-left_m4 {\n border-left-color: #e4ebf0 !important; }\n\n/*\n* @Author: zhongjiahao\n* @Date: 2016-08-03 15:31:16\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-09-29 14:14:56\n*/\n.f-font-h1 {\n font-size: 34px;\n font-size: 2.125rem;\n line-height: 60px;\n line-height: 3.75rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n.f-font-h2 {\n font-size: 24px;\n font-size: 1.5rem;\n line-height: 42px;\n line-height: 2.625rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n.f-font-h3 {\n font-size: 20px;\n font-size: 1.25rem;\n line-height: 36px;\n line-height: 2.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n.f-font-h4 {\n font-size: 16px;\n font-size: 1rem;\n line-height: 30px;\n line-height: 1.875rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n.f-font-h5 {\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n.f-font-h6 {\n font-size: 12px;\n font-size: 0.75rem;\n line-height: 20px;\n line-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n.f-font-a1 {\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", SimSun, STHeitiSC, sans-serif; }\n\n.f-font-a2 {\n font-size: 12px;\n font-size: 0.75rem;\n line-height: 20px;\n line-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", SimSun, STHeitiSC, sans-serif; }\n\n/*\n* @Author: xiaosiyu\n* @Date: 2016-09-23 16:11:30\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-09-26 18:28:15\n*/\n.btn_ripple .ripple {\n z-index: -1;\n border-width: 150px;\n margin-top: -150px;\n margin-left: -150px;\n opacity: 0;\n transition: border-width 1s, margin-top 1s, margin-left 1s, opacity 1s; }\n\n.a-modal-pop {\n transition: top 0.5s cubic-bezier(0.44, 1.53, 0.32, 0.92), transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1); }\n\n.a-highspread {\n transition: height 0.3s cubic-bezier(0.25, 0.1, 0.25, 1); }\n\n.a-highlight {\n transition: top 0.2s cubic-bezier(0.25, 0.1, 0.25, 1) 0s;\n background-color: #f5f8fa; }\n\n.a-dialog_is-open {\n -webkit-transition: box-shadow .3s linear .4s;\n -moz-transition: box-shadow .3s linear .4s;\n -ms-transition: box-shadow .3s linear .4s;\n -o-transition: box-shadow .3s linear .4s;\n transition: box-shadow .3s linear .4s;\n -webkit-animation: popShow 0.3s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards;\n -moz-animation: popShow 0.3s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards;\n -ms-animation: popShow 0.3s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards;\n -o-animation: popShow 0.3s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards;\n animation: popShow 0.3s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards; }\n\n.a-dialog_is-close {\n -webkit-transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n -moz-transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n -ms-transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n -o-transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n -webkit-animation: popHide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;\n -moz-animation: popHide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;\n -ms-animation: popHide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;\n -o-animation: popHide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;\n animation: popHide 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }\n\n.a-diglog_lt {\n transform-origin: left top; }\n\n.a-diglog_rt {\n transform-origin: right top; }\n\n.a-diglog_ld {\n transform-origin: left bottom; }\n\n.a-diglog_rd {\n transform-origin: right bottom; }\n\n@-webkit-keyframes popShow {\n from {\n -webkit-transform: scale(0); }\n to {\n -webkit-transform: scale(1); } }\n\n@-moz-keyframes popShow {\n from {\n -moz-transform: scale(0); }\n to {\n -moz-transform: scale(1); } }\n\n@-ms-keyframes popShow {\n from {\n -ms-transform: scale(0); }\n to {\n -ms-transform: scale(1); } }\n\n@-o-keyframes popShow {\n from {\n -o-transform: scale(0); }\n to {\n -o-transform: scale(1); } }\n\n@keyframes popShow {\n from {\n transform: scale(0); }\n to {\n transform: scale(1); } }\n\n@-webkit-keyframes popHide {\n from {\n -webkit-transform: scale(1); }\n to {\n -webkit-transform: scale(0); } }\n\n@-moz-keyframes popHide {\n from {\n -moz-transform: scale(1); }\n to {\n -moz-transform: scale(0); } }\n\n@-ms-keyframes popHide {\n from {\n -ms-transform: scale(1); }\n to {\n -ms-transform: scale(0); } }\n\n@-o-keyframes popHide {\n from {\n -o-transform: scale(1); }\n to {\n -o-transform: scale(0); } }\n\n@keyframes popHide {\n from {\n transform: scale(1); }\n to {\n transform: scale(0); } }\n\n/* animation.css */\n.a-bounce,\n.a-flip,\n.a-flash,\n.a-shake,\n.a-swing,\n.a-wobble,\n.a-ring {\n -webkit-animation: 1s ease;\n -moz-animation: 1s ease;\n -ms-animation: 1s ease;\n animation: 1s ease; }\n\n.a-fadein,\n.a-fadein_t,\n.a-fadein_r,\n.a-fadein_b,\n.a-fadein_l,\n.a-bouncein,\n.a-bouncein_t,\n.a-bouncein_r,\n.a-bouncein_b,\n.a-bouncein_l,\n.a-rotatein,\n.a-rotatein_lt,\n.a-rotatein_lb,\n.a-rotatein_rt,\n.a-rotatein_rb,\n.a-flipin,\n.a-flipin_x,\n.a-flipin_y {\n -webkit-animation: 1s ease-out backwards;\n -moz-animation: 1s ease-out backwards;\n -ms-animation: 1s ease-out backwards;\n animation: 1s ease-out backwards; }\n\n.a-fadeout,\n.a-fadeout_t,\n.a-fadeout_r,\n.a-fadeout_b,\n.a-fadeout_l,\n.a-bounceout,\n.a-bounceout_t,\n.a-bounceout_r,\n.a-bounceout_b,\n.a-bounceout_l,\n.a-rotateout,\n.a-rotateout_lt,\n.a-rotateout_lb,\n.a-rotateout_rt,\n.a-rotateout_rb,\n.a-flipout,\n.a-flipout_x,\n.a-flipout_y {\n -webkit-animation: 1s ease-in forwards;\n -moz-animation: 1s ease-in forwards;\n -ms-animation: 1s ease-in forwards;\n animation: 1s ease-in forwards; }\n\n/* 淡入 */\n.a-fadein {\n -webkit-animation-name: fadein;\n -moz-animation-name: fadein;\n -ms-animation-name: fadein;\n animation-name: fadein; }\n\n/* 淡入-从上 */\n.a-fadein_t {\n -webkit-animation-name: fadein_t;\n -moz-animation-name: fadein_t;\n -ms-animation-name: fadein_t;\n animation-name: fadein_t; }\n\n/* 淡入-从右 */\n.a-fadein_r {\n -webkit-animation-name: fadein_r;\n -moz-animation-name: fadein_r;\n -ms-animation-name: fadein_r;\n animation-name: fadein_r; }\n\n/* 淡入-从下 */\n.a-fadein_b {\n -webkit-animation-name: fadein_b;\n -moz-animation-name: fadein_b;\n -ms-animation-name: fadein_b;\n animation-name: fadein_b; }\n\n/* 淡入-从左 */\n.a-fadein_l {\n -webkit-animation-name: fadein_l;\n -moz-animation-name: fadein_l;\n -ms-animation-name: fadein_l;\n animation-name: fadein_l; }\n\n/* 淡出 */\n.a-fadeout {\n -webkit-animation-name: fadeout;\n -moz-animation-name: fadeout;\n -ms-animation-name: fadeout;\n animation-name: fadeout; }\n\n/* 淡出-向上 */\n.a-fadeout_t {\n -webkit-animation-name: fadeout_t;\n -moz-animation-name: fadeout_t;\n -ms-animation-name: fadeout_t;\n animation-name: fadeout_t; }\n\n/* 淡出-向右 */\n.a-fadeout_r {\n -webkit-animation-name: fadeout_r;\n -moz-animation-name: fadeout_r;\n -ms-animation-name: fadeout_r;\n animation-name: fadeout_r; }\n\n/* 淡出-向下 */\n.a-fadeout_b {\n -webkit-animation-name: fadeout_b;\n -moz-animation-name: fadeout_b;\n -ms-animation-name: fadeout_b;\n animation-name: fadeout_b; }\n\n/* 淡出-向左 */\n.a-fadeout_l {\n -webkit-animation-name: fadeout_l;\n -moz-animation-name: fadeout_l;\n -ms-animation-name: fadeout_l;\n animation-name: fadeout_l; }\n\n/* 弹跳 */\n.a-bounce {\n -webkit-animation-name: bounce;\n -moz-animation-name: bounce;\n -ms-animation-name: bounce;\n animation-name: bounce; }\n\n/* 弹入 */\n.a-bouncein {\n -webkit-animation-name: bouncein;\n -moz-animation-name: bouncein;\n -ms-animation-name: bouncein;\n animation-name: bouncein; }\n\n/* 弹入-从上 */\n.a-bouncein_t {\n -webkit-animation-name: bouncein_t;\n -moz-animation-name: bouncein_t;\n -ms-animation-name: bouncein_t;\n animation-name: bouncein_t; }\n\n/* 弹入-从右 */\n.a-bouncein_r {\n -webkit-animation-name: bouncein_r;\n -moz-animation-name: bouncein_r;\n -ms-animation-name: bouncein_r;\n animation-name: bouncein_r; }\n\n/* 弹入-从下 */\n.a-bouncein_b {\n -webkit-animation-name: bouncein_b;\n -moz-animation-name: bouncein_b;\n -ms-animation-name: bouncein_b;\n animation-name: bouncein_b; }\n\n/* 弹入-从左 */\n.a-bouncein_l {\n -webkit-animation-name: bouncein_l;\n -moz-animation-name: bouncein_l;\n -ms-animation-name: bouncein_l;\n animation-name: bouncein_l; }\n\n/* 弹出 */\n.a-bounceout {\n -webkit-animation-name: bounceout;\n -moz-animation-name: bounceout;\n -ms-animation-name: bounceout;\n animation-name: bounceout; }\n\n/* 弹出-向上 */\n.a-bounceout_t {\n -webkit-animation-name: bounceout_t;\n -moz-animation-name: bounceout_t;\n -ms-animation-name: bounceout_t;\n animation-name: bounceout_t; }\n\n/* 弹出-向右 */\n.a-bounceout_r {\n -webkit-animation-name: bounceout_r;\n -moz-animation-name: bounceout_r;\n -ms-animation-name: bounceout_r;\n animation-name: bounceout_r; }\n\n/* 弹出-向下 */\n.a-bounceout_b {\n -webkit-animation-name: bounceout_b;\n -moz-animation-name: bounceout_b;\n -ms-animation-name: bounceout_b;\n animation-name: bounceout_b; }\n\n/* 弹出-向左 */\n.a-bounceout_l {\n -webkit-animation-name: bounceout_l;\n -moz-animation-name: bounceout_l;\n -ms-animation-name: bounceout_l;\n animation-name: bounceout_l; }\n\n/* 转入 */\n.a-rotatein {\n -webkit-animation-name: rotatein;\n -moz-animation-name: rotatein;\n -ms-animation-name: rotatein;\n animation-name: rotatein; }\n\n/* 转入-从左上 */\n.a-rotatein_lt {\n -webkit-animation-name: rotatein_lt;\n -moz-animation-name: rotatein_lt;\n -ms-animation-name: rotatein_lt;\n animation-name: rotatein_lt; }\n\n/* 转入-从左下 */\n.a-rotatein_lb {\n -webkit-animation-name: rotatein_lb;\n -moz-animation-name: rotatein_lb;\n -ms-animation-name: rotatein_lb;\n animation-name: rotatein_lb; }\n\n/* 转入-从右上 */\n.a-rotatein_rt {\n -webkit-animation-name: rotatein_rt;\n -moz-animation-name: rotatein_rt;\n -ms-animation-name: rotatein_rt;\n animation-name: rotatein_rt; }\n\n/* 转入-从右下*/\n.a-rotatein_rb {\n -webkit-animation-name: rotatein_rb;\n -moz-animation-name: rotatein_rb;\n -ms-animation-name: rotatein_rb;\n animation-name: rotatein_rb; }\n\n/* 转出 */\n.a-rotateout {\n -webkit-animation-name: rotateout;\n -moz-animation-name: rotateout;\n -ms-animation-name: rotateout;\n animation-name: rotateout; }\n\n/* 转出-向左上 */\n.a-rotateout_lt {\n -webkit-animation-name: rotateout_lt;\n -moz-animation-name: rotateout_lt;\n -ms-animation-name: rotateout_lt;\n animation-name: rotateout_lt; }\n\n/* 转出-向左下 */\n.a-rotateout_lb {\n -webkit-animation-name: rotateout_lb;\n -moz-animation-name: rotateout_lb;\n -ms-animation-name: rotateout_lb;\n animation-name: rotateout_lb; }\n\n/* 转出-向右上 */\n.a-rotateout_rt {\n -webkit-animation-name: rotateout_rt;\n -moz-animation-name: rotateout_rt;\n -ms-animation-name: rotateout_rt;\n animation-name: rotateout_rt; }\n\n/* 转出-向右下 */\n.a-rotateout_rb {\n -webkit-animation-name: rotateout_rb;\n -moz-animation-name: rotateout_rb;\n -ms-animation-name: rotateout_rb;\n animation-name: rotateout_rb; }\n\n/* 翻转 */\n.a-flip {\n -webkit-animation-name: flip;\n -moz-animation-name: flip;\n -ms-animation-name: flip;\n animation-name: flip; }\n\n/* 翻入-X轴 */\n.a-flipin_x {\n -webkit-animation-name: flipin_x;\n -moz-animation-name: flipin_x;\n -ms-animation-name: flipin_x;\n animation-name: flipin_x; }\n\n/* 翻入-Y轴 */\n.a-flipin,\n.a-flipin_y {\n -webkit-animation-name: flipin_y;\n -moz-animation-name: flipin_y;\n -ms-animation-name: flipin_y;\n animation-name: flipin_y; }\n\n/* 翻出-X轴 */\n.a-flipout_x {\n -webkit-animation-name: flipout_x;\n -moz-animation-name: flipout_x;\n -ms-animation-name: flipout_x;\n animation-name: flipout_x; }\n\n/* 翻出-Y轴 */\n.a-flipout,\n.a-flipout_y {\n -webkit-animation-name: flipout_y;\n -moz-animation-name: flipout_y;\n -ms-animation-name: flipout_y;\n animation-name: flipout_y; }\n\n/* 闪烁 */\n.a-flash {\n -webkit-animation-name: flash;\n -moz-animation-name: flash;\n -ms-animation-name: flash;\n animation-name: flash; }\n\n/* 震颤 */\n.a-shake {\n -webkit-animation-name: shake;\n -moz-animation-name: shake;\n -ms-animation-name: shake;\n animation-name: shake; }\n\n/* 摇摆 */\n.a-swing {\n -webkit-animation-name: swing;\n -moz-animation-name: swing;\n -ms-animation-name: swing;\n animation-name: swing; }\n\n/* 摇晃 */\n.a-wobble {\n -webkit-animation-name: wobble;\n -moz-animation-name: wobble;\n -ms-animation-name: wobble;\n animation-name: wobble; }\n\n/* 震铃 */\n.a-ring {\n -webkit-animation-name: ring;\n -moz-animation-name: ring;\n -ms-animation-name: ring;\n animation-name: ring; }\n\n/* define */\n/* 淡入 */\n@-webkit-keyframes fadein {\n 0% {\n opacity: 0; }\n 100% {\n opacity: 1; } }\n\n@-moz-keyframes fadein {\n 0% {\n opacity: 0; }\n 100% {\n opacity: 1; } }\n\n@-ms-keyframes fadein {\n 0% {\n opacity: 0; }\n 100% {\n opacity: 1; } }\n\n@keyframes fadein {\n 0% {\n opacity: 0; }\n 100% {\n opacity: 1; } }\n\n/* 淡入-从上 */\n@-webkit-keyframes fadein_t {\n 0% {\n opacity: 0;\n -webkit-transform: translateY(-100px); }\n 100% {\n opacity: 1;\n -webkit-transform: translateY(0); } }\n\n@-moz-keyframes fadein_t {\n 0% {\n opacity: 0;\n -moz-transform: translateY(-100px); }\n 100% {\n opacity: 1;\n -moz-transform: translateY(0); } }\n\n@-ms-keyframes fadein_t {\n 0% {\n opacity: 0;\n -ms-transform: translateY(-100px); }\n 100% {\n opacity: 1;\n -ms-transform: translateY(0); } }\n\n@keyframes fadein_t {\n 0% {\n opacity: 0;\n transform: translateY(-100px); }\n 100% {\n opacity: 1;\n transform: translateY(0); } }\n\n/* 淡入-从右 */\n@-webkit-keyframes fadein_r {\n 0% {\n opacity: 0;\n -webkit-transform: translateX(100px); }\n 100% {\n opacity: 1;\n -webkit-transform: translateX(0); } }\n\n@-moz-keyframes fadein_r {\n 0% {\n opacity: 0;\n -moz-transform: translateX(100px); }\n 100% {\n opacity: 1;\n -moz-transform: translateX(0); } }\n\n@-ms-keyframes fadein_r {\n 0% {\n opacity: 0;\n -ms-transform: translateX(100px); }\n 100% {\n opacity: 1;\n -ms-transform: translateX(0); } }\n\n@keyframes fadein_r {\n 0% {\n opacity: 0;\n transform: translateX(100px); }\n 100% {\n opacity: 1;\n transform: translateX(0); } }\n\n/* 淡入-从下 */\n@-webkit-keyframes fadein_b {\n 0% {\n opacity: 0;\n -webkit-transform: translateY(100px); }\n 100% {\n opacity: 1;\n -webkit-transform: translateY(0); } }\n\n@-moz-keyframes fadein_b {\n 0% {\n opacity: 0;\n -moz-transform: translateY(100px); }\n 100% {\n opacity: 1;\n -moz-transform: translateY(0); } }\n\n@-ms-keyframes fadein_b {\n 0% {\n opacity: 0;\n -ms-transform: translateY(100px); }\n 100% {\n opacity: 1;\n -ms-transform: translateY(0); } }\n\n@keyframes fadein_b {\n 0% {\n opacity: 0;\n transform: translateY(100px); }\n 100% {\n opacity: 1;\n transform: translateY(0); } }\n\n/* 淡入-从左 */\n@-webkit-keyframes fadein_l {\n 0% {\n opacity: 0;\n -webkit-transform: translateX(-100px); }\n 100% {\n opacity: 1;\n -webkit-transform: translateX(0); } }\n\n@-moz-keyframes fadein_l {\n 0% {\n opacity: 0;\n -moz-transform: translateX(-100px); }\n 100% {\n opacity: 1;\n -moz-transform: translateX(0); } }\n\n@-ms-keyframes fadein_l {\n 0% {\n opacity: 0;\n -ms-transform: translateX(-100px); }\n 100% {\n opacity: 1;\n -ms-transform: translateX(0); } }\n\n@keyframes fadein_l {\n 0% {\n opacity: 0;\n transform: translateX(-100px); }\n 100% {\n opacity: 1;\n transform: translateX(0); } }\n\n/* 淡出 */\n@-webkit-keyframes fadeout {\n 0% {\n opacity: 1; }\n 100% {\n opacity: 0; } }\n\n@-moz-keyframes fadeout {\n 0% {\n opacity: 1; }\n 100% {\n opacity: 0; } }\n\n@-ms-keyframes fadeout {\n 0% {\n opacity: 1; }\n 100% {\n opacity: 0; } }\n\n@keyframes fadeout {\n 0% {\n opacity: 1; }\n 100% {\n opacity: 0; } }\n\n/* 淡出-向上 */\n@-webkit-keyframes fadeout_t {\n 0% {\n opacity: 1;\n -webkit-transform: translateY(0); }\n 100% {\n opacity: 0;\n -webkit-transform: translateY(-100px); } }\n\n@-moz-keyframes fadeout_t {\n 0% {\n opacity: 1;\n -moz-transform: translateY(0); }\n 100% {\n opacity: 0;\n -moz-transform: translateY(-100px); } }\n\n@-ms-keyframes fadeout_t {\n 0% {\n opacity: 1;\n -ms-transform: translateY(0); }\n 100% {\n opacity: 0;\n -ms-transform: translateY(-100px); } }\n\n@keyframes fadeout_t {\n 0% {\n opacity: 1;\n transform: translateY(0); }\n 100% {\n opacity: 0;\n transform: translateY(-100px); } }\n\n/* 淡出-向右 */\n@-webkit-keyframes fadeout_r {\n 0% {\n opacity: 1;\n -webkit-transform: translateX(0); }\n 100% {\n opacity: 0;\n -webkit-transform: translateX(100px); } }\n\n@-moz-keyframes fadeout_r {\n 0% {\n opacity: 1;\n -moz-transform: translateX(0); }\n 100% {\n opacity: 0;\n -moz-transform: translateX(100px); } }\n\n@-ms-keyframes fadeout_r {\n 0% {\n opacity: 1;\n -ms-transform: translateX(0); }\n 100% {\n opacity: 0;\n -ms-transform: translateX(100px); } }\n\n@keyframes fadeout_r {\n 0% {\n opacity: 1;\n transform: translateX(0); }\n 100% {\n opacity: 0;\n transform: translateX(100px); } }\n\n/* 淡出-向下 */\n@-webkit-keyframes fadeout_b {\n 0% {\n opacity: 1;\n -webkit-transform: translateY(0); }\n 100% {\n opacity: 0;\n -webkit-transform: translateY(100px); } }\n\n@-moz-keyframes fadeout_b {\n 0% {\n opacity: 1;\n -moz-transform: translateY(0); }\n 100% {\n opacity: 0;\n -moz-transform: translateY(100px); } }\n\n@-ms-keyframes fadeout_b {\n 0% {\n opacity: 1;\n -ms-transform: translateY(0); }\n 100% {\n opacity: 0;\n -ms-transform: translateY(100px); } }\n\n@keyframes fadeout_b {\n 0% {\n opacity: 1;\n transform: translateY(0); }\n 100% {\n opacity: 0;\n transform: translateY(100px); } }\n\n/* 淡出-向左 */\n@-webkit-keyframes fadeout_l {\n 0% {\n opacity: 1;\n -webkit-transform: translateX(0); }\n 100% {\n opacity: 0;\n -webkit-transform: translateX(-100px); } }\n\n@-moz-keyframes fadeout_l {\n 0% {\n opacity: 1;\n -moz-transform: translateX(0); }\n 100% {\n opacity: 0;\n -moz-transform: translateX(-100px); } }\n\n@-ms-keyframes fadeout_l {\n 0% {\n opacity: 1;\n -ms-transform: translateX(0); }\n 100% {\n opacity: 0;\n -ms-transform: translateX(-100px); } }\n\n@keyframes fadeout_l {\n 0% {\n opacity: 1;\n transform: translateX(0); }\n 100% {\n opacity: 0;\n transform: translateX(-100px); } }\n\n/* 弹跳 */\n@-webkit-keyframes bounce {\n 0%,\n 20%,\n 50%,\n 80%,\n 100% {\n -webkit-transform: translateY(0); }\n 40% {\n -webkit-transform: translateY(-30px); }\n 60% {\n -webkit-transform: translateY(-15px); } }\n\n@-moz-keyframes bounce {\n 0%,\n 20%,\n 50%,\n 80%,\n 100% {\n -moz-transform: translateY(0); }\n 40% {\n -moz-transform: translateY(-30px); }\n 60% {\n -moz-transform: translateY(-15px); } }\n\n@-ms-keyframes bounce {\n 0%,\n 20%,\n 50%,\n 80%,\n 100% {\n -ms-transform: translateY(0); }\n 40% {\n -ms-transform: translateY(-30px); }\n 60% {\n -ms-transform: translateY(-15px); } }\n\n@keyframes bounce {\n 0%,\n 20%,\n 50%,\n 80%,\n 100% {\n transform: translateY(0); }\n 40% {\n transform: translateY(-30px); }\n 60% {\n transform: translateY(-15px); } }\n\n/* 弹入 */\n@-webkit-keyframes bouncein {\n 0% {\n opacity: 0;\n -webkit-transform: scale(0.3); }\n 50% {\n opacity: 1;\n -webkit-transform: scale(1.05); }\n 70% {\n -webkit-transform: scale(0.9); }\n 100% {\n -webkit-transform: scale(1); } }\n\n@-moz-keyframes bouncein {\n 0% {\n opacity: 0;\n -moz-transform: scale(0.3); }\n 50% {\n opacity: 1;\n -moz-transform: scale(1.05); }\n 70% {\n -moz-transform: scale(0.9); }\n 100% {\n -moz-transform: scale(1); } }\n\n@-ms-keyframes bouncein {\n 0% {\n opacity: 0;\n -ms-transform: scale(0.3); }\n 50% {\n opacity: 1;\n -ms-transform: scale(1.05); }\n 70% {\n -ms-transform: scale(0.9); }\n 100% {\n -ms-transform: scale(1); } }\n\n@keyframes bouncein {\n 0% {\n opacity: 0;\n transform: scale(0.3); }\n 50% {\n opacity: 1;\n transform: scale(1.05); }\n 70% {\n transform: scale(0.9); }\n 100% {\n transform: scale(1); } }\n\n/* 弹入-从上 */\n@-webkit-keyframes bouncein_t {\n 0% {\n opacity: 0;\n -webkit-transform: translateY(-100px); }\n 60% {\n opacity: 1;\n -webkit-transform: translateY(30px); }\n 80% {\n -webkit-transform: translateY(-10px); }\n 100% {\n -webkit-transform: translateY(0); } }\n\n@-moz-keyframes bouncein_t {\n 0% {\n opacity: 0;\n -moz-transform: translateY(-100px); }\n 60% {\n opacity: 1;\n -moz-transform: translateY(30px); }\n 80% {\n -moz-transform: translateY(-10px); }\n 100% {\n -moz-transform: translateY(0); } }\n\n@-ms-keyframes bouncein_t {\n 0% {\n opacity: 0;\n -ms-transform: translateY(-100px); }\n 60% {\n opacity: 1;\n -ms-transform: translateY(30px); }\n 80% {\n -ms-transform: translateY(-10px); }\n 100% {\n -ms-transform: translateY(0); } }\n\n@keyframes bouncein_t {\n 0% {\n opacity: 0;\n transform: translateY(-100px); }\n 60% {\n opacity: 1;\n transform: translateY(30px); }\n 80% {\n transform: translateY(-10px); }\n 100% {\n transform: translateY(0); } }\n\n/* 弹入-从右 */\n@-webkit-keyframes bouncein_r {\n 0% {\n opacity: 0;\n -webkit-transform: translateX(100px); }\n 60% {\n opacity: 1;\n -webkit-transform: translateX(-30px); }\n 80% {\n -webkit-transform: translateX(10px); }\n 100% {\n -webkit-transform: translateX(0); } }\n\n@-moz-keyframes bouncein_r {\n 0% {\n opacity: 0;\n -moz-transform: translateX(100px); }\n 60% {\n opacity: 1;\n -moz-transform: translateX(-30px); }\n 80% {\n -moz-transform: translateX(10px); }\n 100% {\n -moz-transform: translateX(0); } }\n\n@-ms-keyframes bouncein_r {\n 0% {\n opacity: 0;\n -ms-transform: translateX(100px); }\n 60% {\n opacity: 1;\n -ms-transform: translateX(-30px); }\n 80% {\n -ms-transform: translateX(10px); }\n 100% {\n -ms-transform: translateX(0); } }\n\n@keyframes bouncein_r {\n 0% {\n opacity: 0;\n transform: translateX(100px); }\n 60% {\n opacity: 1;\n transform: translateX(-30px); }\n 80% {\n transform: translateX(10px); }\n 100% {\n transform: translateX(0); } }\n\n/* 弹入-从下 */\n@-webkit-keyframes bouncein_b {\n 0% {\n opacity: 0;\n -webkit-transform: translateY(100px); }\n 60% {\n opacity: 1;\n -webkit-transform: translateY(-30px); }\n 80% {\n -webkit-transform: translateY(10px); }\n 100% {\n -webkit-transform: translateY(0); } }\n\n@-moz-keyframes bouncein_b {\n 0% {\n opacity: 0;\n -moz-transform: translateY(100px); }\n 60% {\n opacity: 1;\n -moz-transform: translateY(-30px); }\n 80% {\n -moz-transform: translateY(10px); }\n 100% {\n -moz-transform: translateY(0); } }\n\n@-ms-keyframes bouncein_b {\n 0% {\n opacity: 0;\n -ms-transform: translateY(100px); }\n 60% {\n opacity: 1;\n -ms-transform: translateY(-30px); }\n 80% {\n -ms-transform: translateY(10px); }\n 100% {\n -ms-transform: translateY(0); } }\n\n@keyframes bouncein_b {\n 0% {\n opacity: 0;\n transform: translateY(100px); }\n 60% {\n opacity: 1;\n transform: translateY(-30px); }\n 80% {\n transform: translateY(10px); }\n 100% {\n transform: translateY(0); } }\n\n/* 弹入-从左 */\n@-webkit-keyframes bouncein_l {\n 0% {\n opacity: 0;\n -webkit-transform: translateX(-100px); }\n 60% {\n opacity: 1;\n -webkit-transform: translateX(30px); }\n 80% {\n -webkit-transform: translateX(-10px); }\n 100% {\n -webkit-transform: translateX(0); } }\n\n@-moz-keyframes bouncein_l {\n 0% {\n opacity: 0;\n -moz-transform: translateX(-100px); }\n 60% {\n opacity: 1;\n -moz-transform: translateX(30px); }\n 80% {\n -moz-transform: translateX(-10px); }\n 100% {\n -moz-transform: translateX(0); } }\n\n@-ms-keyframes bouncein_l {\n 0% {\n opacity: 0;\n -ms-transform: translateX(-100px); }\n 60% {\n opacity: 1;\n -ms-transform: translateX(30px); }\n 80% {\n -ms-transform: translateX(-10px); }\n 100% {\n -ms-transform: translateX(0); } }\n\n@keyframes bouncein_l {\n 0% {\n opacity: 0;\n transform: translateX(-100px); }\n 60% {\n opacity: 1;\n transform: translateX(30px); }\n 80% {\n transform: translateX(-10px); }\n 100% {\n transform: translateX(0); } }\n\n/* 弹出 */\n@-webkit-keyframes bounceout {\n 0% {\n -webkit-transform: scale(1); }\n 25% {\n -webkit-transform: scale(0.95); }\n 50% {\n opacity: 1;\n -webkit-transform: scale(1.1); }\n 100% {\n opacity: 0;\n -webkit-transform: scale(0.3); } }\n\n@-moz-keyframes bounceout {\n 0% {\n -moz-transform: scale(1); }\n 25% {\n -moz-transform: scale(0.95); }\n 50% {\n opacity: 1;\n -moz-transform: scale(1.1); }\n 100% {\n opacity: 0;\n -moz-transform: scale(0.3); } }\n\n@-ms-keyframes bounceout {\n 0% {\n -ms-transform: scale(1); }\n 25% {\n -ms-transform: scale(0.95); }\n 50% {\n opacity: 1;\n -ms-transform: scale(1.1); }\n 100% {\n opacity: 0;\n -ms-transform: scale(0.3); } }\n\n@keyframes bounceout {\n 0% {\n transform: scale(1); }\n 25% {\n transform: scale(0.95); }\n 50% {\n opacity: 1;\n transform: scale(1.1); }\n 100% {\n opacity: 0;\n transform: scale(0.3); } }\n\n/* 弹出-向上*/\n@-webkit-keyframes bounceout_t {\n 0% {\n -webkit-transform: translateY(0); }\n 20% {\n opacity: 1;\n -webkit-transform: translateY(20px); }\n 100% {\n opacity: 0;\n -webkit-transform: translateY(-100px); } }\n\n@-moz-keyframes bounceout_t {\n 0% {\n -moz-transform: translateY(0); }\n 20% {\n opacity: 1;\n -moz-transform: translateY(20px); }\n 100% {\n opacity: 0;\n -moz-transform: translateY(-100px); } }\n\n@-ms-keyframes bounceout_t {\n 0% {\n -ms-transform: translateY(0); }\n 20% {\n opacity: 1;\n -ms-transform: translateY(20px); }\n 100% {\n opacity: 0;\n -ms-transform: translateY(-100px); } }\n\n@keyframes bounceout_t {\n 0% {\n transform: translateY(0); }\n 20% {\n opacity: 1;\n transform: translateY(20px); }\n 100% {\n opacity: 0;\n transform: translateY(-100px); } }\n\n/* 弹出-向右*/\n@-webkit-keyframes bounceout_r {\n 0% {\n -webkit-transform: translateX(0); }\n 20% {\n opacity: 1;\n -webkit-transform: translateX(-20px); }\n 100% {\n opacity: 0;\n -webkit-transform: translateX(100px); } }\n\n@-moz-keyframes bounceout_r {\n 0% {\n -moz-transform: translateX(0); }\n 20% {\n opacity: 1;\n -moz-transform: translateX(-20px); }\n 100% {\n opacity: 0;\n -moz-transform: translateX(100px); } }\n\n@-ms-keyframes bounceout_r {\n 0% {\n -ms-transform: translateX(0); }\n 20% {\n opacity: 1;\n -ms-transform: translateX(-20px); }\n 100% {\n opacity: 0;\n -ms-transform: translateX(100px); } }\n\n@keyframes bounceout_r {\n 0% {\n transform: translateX(0); }\n 20% {\n opacity: 1;\n transform: translateX(-20px); }\n 100% {\n opacity: 0;\n transform: translateX(100px); } }\n\n/* 弹出-向下 */\n@-webkit-keyframes bounceout_b {\n 0% {\n -webkit-transform: translateY(0); }\n 20% {\n opacity: 1;\n -webkit-transform: translateY(-20px); }\n 100% {\n opacity: 0;\n -webkit-transform: translateY(100px); } }\n\n@-moz-keyframes bounceout_b {\n 0% {\n -moz-transform: translateY(0); }\n 20% {\n opacity: 1;\n -moz-transform: translateY(-20px); }\n 100% {\n opacity: 0;\n -moz-transform: translateY(100px); } }\n\n@-ms-keyframes bounceout_b {\n 0% {\n -ms-transform: translateY(0); }\n 20% {\n opacity: 1;\n -ms-transform: translateY(-20px); }\n 100% {\n opacity: 0;\n -ms-transform: translateY(100px); } }\n\n@keyframes bounceout_b {\n 0% {\n transform: translateY(0); }\n 20% {\n opacity: 1;\n transform: translateY(-20px); }\n 100% {\n opacity: 0;\n transform: translateY(100px); } }\n\n/* 弹出-向左 */\n@-webkit-keyframes bounceout_l {\n 0% {\n -webkit-transform: translateX(0); }\n 20% {\n opacity: 1;\n -webkit-transform: translateX(20px); }\n 100% {\n opacity: 0;\n -webkit-transform: translateX(-100px); } }\n\n@-moz-keyframes bounceout_l {\n 0% {\n -moz-transform: translateX(0); }\n 20% {\n opacity: 1;\n -moz-transform: translateX(20px); }\n 100% {\n opacity: 0;\n -moz-transform: translateX(-100px); } }\n\n@-ms-keyframes bounceout_l {\n 0% {\n -ms-transform: translateX(0); }\n 20% {\n opacity: 1;\n -ms-transform: translateX(20px); }\n 100% {\n opacity: 0;\n -ms-transform: translateX(-100px); } }\n\n@keyframes bounceout_l {\n 0% {\n transform: translateX(0); }\n 20% {\n opacity: 1;\n transform: translateX(20px); }\n 100% {\n opacity: 0;\n transform: translateX(-200px); } }\n\n/* 转入 */\n@-webkit-keyframes rotatein {\n 0% {\n opacity: 0;\n -webkit-transform: rotate(-200deg); }\n 100% {\n opacity: 1;\n -webkit-transform: rotate(0); } }\n\n@-moz-keyframes rotatein {\n 0% {\n opacity: 0;\n -moz-transform: rotate(-200deg); }\n 100% {\n opacity: 1;\n -moz-transform: rotate(0); } }\n\n@-ms-keyframes rotatein {\n 0% {\n opacity: 0;\n -ms-transform: rotate(-200deg); }\n 100% {\n opacity: 1;\n -ms-transform: rotate(0); } }\n\n@keyframes rotatein {\n 0% {\n opacity: 0;\n transform: rotate(-200deg); }\n 100% {\n opacity: 1;\n transform: rotate(0); } }\n\n/* 转入-从左上 */\n@-webkit-keyframes rotatein_lt {\n 0% {\n -webkit-transform-origin: left bottom;\n -webkit-transform: rotate(-90deg);\n opacity: 0; }\n 100% {\n -webkit-transform-origin: left bottom;\n -webkit-transform: rotate(0);\n opacity: 1; } }\n\n@-moz-keyframes rotatein_lt {\n 0% {\n -moz-transform-origin: left bottom;\n -moz-transform: rotate(-90deg);\n opacity: 0; }\n 100% {\n -moz-transform-origin: left bottom;\n -moz-transform: rotate(0);\n opacity: 1; } }\n\n@-ms-keyframes rotatein_lt {\n 0% {\n -ms-transform-origin: left bottom;\n -ms-transform: rotate(-90deg);\n opacity: 0; }\n 100% {\n -ms-transform-origin: left bottom;\n -ms-transform: rotate(0);\n opacity: 1; } }\n\n@keyframes rotatein_lt {\n 0% {\n transform-origin: left bottom;\n transform: rotate(-90deg);\n opacity: 0; }\n 100% {\n transform-origin: left bottom;\n transform: rotate(0);\n opacity: 1; } }\n\n/* 转入-从左下 */\n@-webkit-keyframes rotateineft_b {\n 0% {\n -webkit-transform-origin: left bottom;\n -webkit-transform: rotate(90deg);\n opacity: 0; }\n 100% {\n -webkit-transform-origin: left bottom;\n -webkit-transform: rotate(0);\n opacity: 1; } }\n\n@-moz-keyframes rotateineft_b {\n 0% {\n -moz-transform-origin: left bottom;\n -moz-transform: rotate(90deg);\n opacity: 0; }\n 100% {\n -moz-transform-origin: left bottom;\n -moz-transform: rotate(0);\n opacity: 1; } }\n\n@-ms-keyframes rotateineft_b {\n 0% {\n -ms-transform-origin: left bottom;\n -ms-transform: rotate(90deg);\n opacity: 0; }\n 100% {\n -ms-transform-origin: left bottom;\n -ms-transform: rotate(0);\n opacity: 1; } }\n\n@keyframes rotateineft_b {\n 0% {\n transform-origin: left bottom;\n transform: rotate(90deg);\n opacity: 0; }\n 100% {\n transform-origin: left bottom;\n transform: rotate(0);\n opacity: 1; } }\n\n/* 转入-从右上 */\n@-webkit-keyframes rotatein_rt {\n 0% {\n -webkit-transform-origin: right bottom;\n -webkit-transform: rotate(90deg);\n opacity: 0; }\n 100% {\n -webkit-transform-origin: right bottom;\n -webkit-transform: rotate(0);\n opacity: 1; } }\n\n@-moz-keyframes rotatein_rt {\n 0% {\n -moz-transform-origin: right bottom;\n -moz-transform: rotate(90deg);\n opacity: 0; }\n 100% {\n -moz-transform-origin: right bottom;\n -moz-transform: rotate(0);\n opacity: 1; } }\n\n@-ms-keyframes rotatein_rt {\n 0% {\n -ms-transform-origin: right bottom;\n -ms-transform: rotate(90deg);\n opacity: 0; }\n 100% {\n -ms-transform-origin: right bottom;\n -ms-transform: rotate(0);\n opacity: 1; } }\n\n@keyframes rotatein_rt {\n 0% {\n transform-origin: right bottom;\n transform: rotate(90deg);\n opacity: 0; }\n 100% {\n transform-origin: right bottom;\n transform: rotate(0);\n opacity: 1; } }\n\n/* 转入-从右下*/\n@-webkit-keyframes rotatein_rb {\n 0% {\n -webkit-transform-origin: right bottom;\n -webkit-transform: rotate(-90deg);\n opacity: 0; }\n 100% {\n -webkit-transform-origin: right bottom;\n -webkit-transform: rotate(0);\n opacity: 1; } }\n\n@-moz-keyframes rotatein_rb {\n 0% {\n -moz-transform-origin: right bottom;\n -moz-transform: rotate(-90deg);\n opacity: 0; }\n 100% {\n -moz-transform-origin: right bottom;\n -moz-transform: rotate(0);\n opacity: 1; } }\n\n@-ms-keyframes rotatein_rb {\n 0% {\n -ms-transform-origin: right bottom;\n -ms-transform: rotate(-90deg);\n opacity: 0; }\n 100% {\n -ms-transform-origin: right bottom;\n -ms-transform: rotate(0);\n opacity: 1; } }\n\n@keyframes rotatein_rb {\n 0% {\n transform-origin: right bottom;\n transform: rotate(-90deg);\n opacity: 0; }\n 100% {\n transform-origin: right bottom;\n transform: rotate(0);\n opacity: 1; } }\n\n/* 转出 */\n@-webkit-keyframes rotateout {\n 0% {\n -webkit-transform-origin: center center;\n -webkit-transform: rotate(0);\n opacity: 1; }\n 100% {\n -webkit-transform-origin: center center;\n -webkit-transform: rotate(200deg);\n opacity: 0; } }\n\n@-moz-keyframes rotateout {\n 0% {\n -moz-transform-origin: center center;\n -moz-transform: rotate(0);\n opacity: 1; }\n 100% {\n -moz-transform-origin: center center;\n -moz-transform: rotate(200deg);\n opacity: 0; } }\n\n@-ms-keyframes rotateout {\n 0% {\n -ms-transform-origin: center center;\n -ms-transform: rotate(0);\n opacity: 1; }\n 100% {\n -ms-transform-origin: center center;\n -ms-transform: rotate(200deg);\n opacity: 0; } }\n\n@keyframes rotateout {\n 0% {\n transform-origin: center center;\n transform: rotate(0);\n opacity: 1; }\n 100% {\n transform-origin: center center;\n transform: rotate(200deg);\n opacity: 0; } }\n\n/* 转出-向左上 */\n@-webkit-keyframes rotateout_lt {\n 0% {\n -webkit-transform-origin: left bottom;\n -webkit-transform: rotate(0);\n opacity: 1; }\n 100% {\n -webkit-transform-origin: left bottom;\n -webkit-transform: rotate(-90deg);\n opacity: 0; } }\n\n@-moz-keyframes rotateout_lt {\n 0% {\n -moz-transform-origin: left bottom;\n -moz-transform: rotate(0);\n opacity: 1; }\n 100% {\n -moz-transform-origin: left bottom;\n -moz-transform: rotate(-90deg);\n opacity: 0; } }\n\n@-ms-keyframes rotateout_lt {\n 0% {\n -ms-transform-origin: left bottom;\n -ms-transform: rotate(0);\n opacity: 1; }\n 100% {\n -ms-transform-origin: left bottom;\n -ms-transform: rotate(-90deg);\n opacity: 0; } }\n\n@keyframes rotateout_lt {\n 0% {\n transform-origin: left bottom;\n transform: rotate(0);\n opacity: 1; }\n 100% {\n transform-origin: left bottom;\n transform: rotate(-90deg);\n opacity: 0; } }\n\n/* 转出-向左下 */\n@-webkit-keyframes rotateout_lb {\n 0% {\n -webkit-transform-origin: left bottom;\n -webkit-transform: rotate(0);\n opacity: 1; }\n 100% {\n -webkit-transform-origin: left bottom;\n -webkit-transform: rotate(90deg);\n opacity: 0; } }\n\n@-moz-keyframes rotateout_lb {\n 0% {\n -moz-transform-origin: left bottom;\n -moz-transform: rotate(0);\n opacity: 1; }\n 100% {\n -moz-transform-origin: left bottom;\n -moz-transform: rotate(90deg);\n opacity: 0; } }\n\n@-ms-keyframes rotateout_lb {\n 0% {\n -ms-transform-origin: left bottom;\n -ms-transform: rotate(0);\n opacity: 1; }\n 100% {\n -ms-transform-origin: left bottom;\n -ms-transform: rotate(90deg);\n opacity: 0; } }\n\n@keyframes rotateout_lb {\n 0% {\n transform-origin: left bottom;\n transform: rotate(0);\n opacity: 1; }\n 100% {\n transform-origin: left bottom;\n transform: rotate(90deg);\n opacity: 0; } }\n\n/* 转出-向右上 */\n@-webkit-keyframes rotateout_rt {\n 0% {\n -webkit-transform-origin: right bottom;\n -webkit-transform: rotate(0);\n opacity: 1; }\n 100% {\n -webkit-transform-origin: right bottom;\n -webkit-transform: rotate(90deg);\n opacity: 0; } }\n\n@-moz-keyframes rotateout_rt {\n 0% {\n -moz-transform-origin: right bottom;\n -moz-transform: rotate(0);\n opacity: 1; }\n 100% {\n -moz-transform-origin: right bottom;\n -moz-transform: rotate(90deg);\n opacity: 0; } }\n\n@-ms-keyframes rotateout_rt {\n 0% {\n -ms-transform-origin: right bottom;\n -ms-transform: rotate(0);\n opacity: 1; }\n 100% {\n -ms-transform-origin: right bottom;\n -ms-transform: rotate(90deg);\n opacity: 0; } }\n\n@keyframes rotateout_rt {\n 0% {\n transform-origin: right bottom;\n transform: rotate(0);\n opacity: 1; }\n 100% {\n transform-origin: right bottom;\n transform: rotate(90deg);\n opacity: 0; } }\n\n/* 转出-向右下 */\n@-webkit-keyframes rotateoutBR {\n 0% {\n -webkit-transform-origin: right bottom;\n -webkit-transform: rotate(0);\n opacity: 1; }\n 100% {\n -webkit-transform-origin: right bottom;\n -webkit-transform: rotate(-90deg);\n opacity: 0; } }\n\n@-moz-keyframes rotateoutBR {\n 0% {\n -moz-transform-origin: right bottom;\n -moz-transform: rotate(0);\n opacity: 1; }\n 100% {\n -moz-transform-origin: right bottom;\n -moz-transform: rotate(-90deg);\n opacity: 0; } }\n\n@-ms-keyframes rotateoutBR {\n 0% {\n -ms-transform-origin: right bottom;\n -ms-transform: rotate(0);\n opacity: 1; }\n 100% {\n -ms-transform-origin: right bottom;\n -ms-transform: rotate(-90deg);\n opacity: 0; } }\n\n@keyframes rotateoutBR {\n 0% {\n transform-origin: right bottom;\n transform: rotate(0);\n opacity: 1; }\n 100% {\n transform-origin: right bottom;\n transform: rotate(-90deg);\n opacity: 0; } }\n\n/* 翻转 */\n@-webkit-keyframes flip {\n 0% {\n -webkit-transform: perspective(400px) rotateY(0);\n -webkit-animation-timing-function: ease-out; }\n 40% {\n -webkit-transform: perspective(400px) translateZ(150px) rotateY(170deg);\n -webkit-animation-timing-function: ease-out; }\n 50% {\n -webkit-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);\n -webkit-animation-timing-function: ease-in; }\n 80% {\n -webkit-transform: perspective(400px) rotateY(360deg) scale(0.95);\n -webkit-animation-timing-function: ease-in; }\n 100% {\n -webkit-transform: perspective(400px) scale(1);\n -webkit-animation-timing-function: ease-in; } }\n\n@-moz-keyframes flip {\n 0% {\n -moz-transform: perspective(400px) rotateY(0);\n -moz-animation-timing-function: ease-out; }\n 40% {\n -moz-transform: perspective(400px) translateZ(150px) rotateY(170deg);\n -moz-animation-timing-function: ease-out; }\n 50% {\n -moz-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);\n -moz-animation-timing-function: ease-in; }\n 80% {\n -moz-transform: perspective(400px) rotateY(360deg) scale(0.95);\n -moz-animation-timing-function: ease-in; }\n 100% {\n -moz-transform: perspective(400px) scale(1);\n -moz-animation-timing-function: ease-in; } }\n\n@-ms-keyframes flip {\n 0% {\n -ms-transform: perspective(400px) rotateY(0);\n -ms-animation-timing-function: ease-out; }\n 40% {\n -ms-transform: perspective(400px) translateZ(150px) rotateY(170deg);\n -ms-animation-timing-function: ease-out; }\n 50% {\n -ms-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);\n -ms-animation-timing-function: ease-in; }\n 80% {\n -ms-transform: perspective(400px) rotateY(360deg) scale(0.95);\n -ms-animation-timing-function: ease-in; }\n 100% {\n -ms-transform: perspective(400px) scale(1);\n -ms-animation-timing-function: ease-in; } }\n\n@keyframes flip {\n 0% {\n transform: perspective(400px) rotateY(0);\n animation-timing-function: ease-out; }\n 40% {\n transform: perspective(400px) translateZ(150px) rotateY(170deg);\n animation-timing-function: ease-out; }\n 50% {\n transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);\n animation-timing-function: ease-in; }\n 80% {\n transform: perspective(400px) rotateY(360deg) scale(0.95);\n animation-timing-function: ease-in; }\n 100% {\n transform: perspective(400px) scale(1);\n animation-timing-function: ease-in; } }\n\n/* 翻入-X轴 */\n@-webkit-keyframes flipin_x {\n 0% {\n -webkit-transform: perspective(400px) rotateX(90deg);\n opacity: 0; }\n 40% {\n -webkit-transform: perspective(400px) rotateX(-10deg); }\n 70% {\n -webkit-transform: perspective(400px) rotateX(10deg); }\n 100% {\n -webkit-transform: perspective(400px) rotateX(0);\n opacity: 1; } }\n\n@-moz-keyframes flipin_x {\n 0% {\n -moz-transform: perspective(400px) rotateX(90deg);\n opacity: 0; }\n 40% {\n -moz-transform: perspective(400px) rotateX(-10deg); }\n 70% {\n -moz-transform: perspective(400px) rotateX(10deg); }\n 100% {\n -moz-transform: perspective(400px) rotateX(0);\n opacity: 1; } }\n\n@-ms-keyframes flipin_x {\n 0% {\n -ms-transform: perspective(400px) rotateX(90deg);\n opacity: 0; }\n 40% {\n -ms-transform: perspective(400px) rotateX(-10deg); }\n 70% {\n -ms-transform: perspective(400px) rotateX(10deg); }\n 100% {\n -ms-transform: perspective(400px) rotateX(0);\n opacity: 1; } }\n\n@keyframes flipin_x {\n 0% {\n transform: perspective(400px) rotateX(90deg);\n opacity: 0; }\n 40% {\n transform: perspective(400px) rotateX(-10deg); }\n 70% {\n transform: perspective(400px) rotateX(10deg); }\n 100% {\n transform: perspective(400px) rotateX(0);\n opacity: 1; } }\n\n/* 翻入-Y轴 */\n@-webkit-keyframes flipin_y {\n 0% {\n -webkit-transform: perspective(400px) rotateY(90deg);\n opacity: 0; }\n 40% {\n -webkit-transform: perspective(400px) rotateY(-10deg); }\n 70% {\n -webkit-transform: perspective(400px) rotateY(10deg); }\n 100% {\n -webkit-transform: perspective(400px) rotateY(0);\n opacity: 1; } }\n\n@-moz-keyframes flipin_y {\n 0% {\n -moz-transform: perspective(400px) rotateY(90deg);\n opacity: 0; }\n 40% {\n -moz-transform: perspective(400px) rotateY(-10deg); }\n 70% {\n -moz-transform: perspective(400px) rotateY(10deg); }\n 100% {\n -moz-transform: perspective(400px) rotateY(0);\n opacity: 1; } }\n\n@-ms-keyframes flipin_y {\n 0% {\n -ms-transform: perspective(400px) rotateY(90deg);\n opacity: 0; }\n 40% {\n -ms-transform: perspective(400px) rotateY(-10deg); }\n 70% {\n -ms-transform: perspective(400px) rotateY(10deg); }\n 100% {\n -ms-transform: perspective(400px) rotateY(0);\n opacity: 1; } }\n\n@keyframes flipin_y {\n 0% {\n transform: perspective(400px) rotateY(90deg);\n opacity: 0; }\n 40% {\n transform: perspective(400px) rotateY(-10deg); }\n 70% {\n transform: perspective(400px) rotateY(10deg); }\n 100% {\n transform: perspective(400px) rotateY(0);\n opacity: 1; } }\n\n/* 翻出-X轴 */\n@-webkit-keyframes flipout_x {\n 0% {\n -webkit-transform: perspective(400px) rotateX(0);\n opacity: 1; }\n 100% {\n -webkit-transform: perspective(400px) rotateX(90deg);\n opacity: 0; } }\n\n@-moz-keyframes flipout_x {\n 0% {\n -moz-transform: perspective(400px) rotateX(0);\n opacity: 1; }\n 100% {\n -moz-transform: perspective(400px) rotateX(90deg);\n opacity: 0; } }\n\n@-ms-keyframes flipout_x {\n 0% {\n -ms-transform: perspective(400px) rotateX(0);\n opacity: 1; }\n 100% {\n -ms-transform: perspective(400px) rotateX(90deg);\n opacity: 0; } }\n\n@keyframes flipout_x {\n 0% {\n transform: perspective(400px) rotateX(0);\n opacity: 1; }\n 100% {\n transform: perspective(400px) rotateX(90deg);\n opacity: 0; } }\n\n/* 翻出-Y轴 */\n@-webkit-keyframes flipout_y {\n 0% {\n -webkit-transform: perspective(400px) rotateY(0);\n opacity: 1; }\n 100% {\n -webkit-transform: perspective(400px) rotateY(90deg);\n opacity: 0; } }\n\n@-moz-keyframes flipout_y {\n 0% {\n -moz-transform: perspective(400px) rotateY(0);\n opacity: 1; }\n 100% {\n -moz-transform: perspective(400px) rotateY(90deg);\n opacity: 0; } }\n\n@-ms-keyframes flipout_y {\n 0% {\n -ms-transform: perspective(400px) rotateY(0);\n opacity: 1; }\n 100% {\n -ms-transform: perspective(400px) rotateY(90deg);\n opacity: 0; } }\n\n@keyframes flipout_y {\n 0% {\n transform: perspective(400px) rotateY(0);\n opacity: 1; }\n 100% {\n transform: perspective(400px) rotateY(90deg);\n opacity: 0; } }\n\n/* 闪烁 */\n@-webkit-keyframes flash {\n 0%,\n 50%,\n 100% {\n opacity: 1; }\n 25%,\n 75% {\n opacity: 0; } }\n\n@-moz-keyframes flash {\n 0%,\n 50%,\n 100% {\n opacity: 1; }\n 25%,\n 75% {\n opacity: 0; } }\n\n@-ms-keyframes flash {\n 0%,\n 50%,\n 100% {\n opacity: 1; }\n 25%,\n 75% {\n opacity: 0; } }\n\n@keyframes flash {\n 0%,\n 50%,\n 100% {\n opacity: 1; }\n 25%,\n 75% {\n opacity: 0; } }\n\n/* 震颤 */\n@-webkit-keyframes shake {\n 0%,\n 100% {\n -webkit-transform: translateX(0); }\n 10%,\n 30%,\n 50%,\n 70%,\n 90% {\n -webkit-transform: translateX(-10px); }\n 20%,\n 40%,\n 60%,\n 80% {\n -webkit-transform: translateX(10px); } }\n\n@-moz-keyframes shake {\n 0%,\n 100% {\n -moz-transform: translateX(0); }\n 10%,\n 30%,\n 50%,\n 70%,\n 90% {\n -moz-transform: translateX(-10px); }\n 20%,\n 40%,\n 60%,\n 80% {\n -moz-transform: translateX(10px); } }\n\n@-ms-keyframes shake {\n 0%,\n 100% {\n -ms-transform: translateX(0); }\n 10%,\n 30%,\n 50%,\n 70%,\n 90% {\n -ms-transform: translateX(-10px); }\n 20%,\n 40%,\n 60%,\n 80% {\n -ms-transform: translateX(10px); } }\n\n@keyframes shake {\n 0%,\n 100% {\n transform: translateX(0); }\n 10%,\n 30%,\n 50%,\n 70%,\n 90% {\n transform: translateX(-10px); }\n 20%,\n 40%,\n 60%,\n 80% {\n transform: translateX(10px); } }\n\n/* 摇摆 */\n@-webkit-keyframes swing {\n 20% {\n -webkit-transform: rotate(15deg); }\n 40% {\n -webkit-transform: rotate(-10deg); }\n 60% {\n -webkit-transform: rotate(5deg); }\n 80% {\n -webkit-transform: rotate(-5deg); }\n 100% {\n -webkit-transform: rotate(0); } }\n\n@-moz-keyframes swing {\n 20% {\n -moz-transform: rotate(15deg); }\n 40% {\n -moz-transform: rotate(-10deg); }\n 60% {\n -moz-transform: rotate(5deg); }\n 80% {\n -moz-transform: rotate(-5deg); }\n 100% {\n -moz-transform: rotate(0); } }\n\n@-ms-keyframes swing {\n 20% {\n -ms-transform: rotate(15deg); }\n 40% {\n -ms-transform: rotate(-10deg); }\n 60% {\n -ms-transform: rotate(5deg); }\n 80% {\n -ms-transform: rotate(-5deg); }\n 100% {\n -ms-transform: rotate(0); } }\n\n@keyframes swing {\n 20% {\n transform: rotate(15deg); }\n 40% {\n transform: rotate(-10deg); }\n 60% {\n transform: rotate(5deg); }\n 80% {\n transform: rotate(-5deg); }\n 100% {\n transform: rotate(0); } }\n\n/* 摇晃 */\n@-webkit-keyframes wobble {\n 0% {\n -webkit-transform: translateX(0); }\n 15% {\n -webkit-transform: translateX(-100px) rotate(-5deg); }\n 30% {\n -webkit-transform: translateX(80px) rotate(3deg); }\n 45% {\n -webkit-transform: translateX(-65px) rotate(-3deg); }\n 60% {\n -webkit-transform: translateX(40px) rotate(2deg); }\n 75% {\n -webkit-transform: translateX(-20px) rotate(-1deg); }\n 100% {\n -webkit-transform: translateX(0); } }\n\n@-moz-keyframes wobble {\n 0% {\n -moz-transform: translateX(0); }\n 15% {\n -moz-transform: translateX(-100px) rotate(-5deg); }\n 30% {\n -moz-transform: translateX(80px) rotate(3deg); }\n 45% {\n -moz-transform: translateX(-65px) rotate(-3deg); }\n 60% {\n -moz-transform: translateX(40px) rotate(2deg); }\n 75% {\n -moz-transform: translateX(-20px) rotate(-1deg); }\n 100% {\n -moz-transform: translateX(0); } }\n\n@-ms-keyframes wobble {\n 0% {\n -ms-transform: translateX(0); }\n 15% {\n -ms-transform: translateX(-100px) rotate(-5deg); }\n 30% {\n -ms-transform: translateX(80px) rotate(3deg); }\n 45% {\n -ms-transform: translateX(-65px) rotate(-3deg); }\n 60% {\n -ms-transform: translateX(40px) rotate(2deg); }\n 75% {\n -ms-transform: translateX(-20px) rotate(-1deg); }\n 100% {\n -ms-transform: translateX(0); } }\n\n@keyframes wobble {\n 0% {\n transform: translateX(0); }\n 15% {\n transform: translateX(-100px) rotate(-5deg); }\n 30% {\n transform: translateX(80px) rotate(3deg); }\n 45% {\n transform: translateX(-65px) rotate(-3deg); }\n 60% {\n transform: translateX(40px) rotate(2deg); }\n 75% {\n transform: translateX(-20px) rotate(-1deg); }\n 100% {\n transform: translateX(0); } }\n\n/* 震铃 */\n@-webkit-keyframes ring {\n 0% {\n -webkit-transform: scale(1); }\n 10%,\n 20% {\n -webkit-transform: scale(0.9) rotate(-3deg); }\n 30%,\n 50%,\n 70%,\n 90% {\n -webkit-transform: scale(1.1) rotate(3deg); }\n 40%,\n 60%,\n 80% {\n -webkit-transform: scale(1.1) rotate(-3deg); }\n 100% {\n -webkit-transform: scale(1) rotate(0); } }\n\n@-moz-keyframes ring {\n 0% {\n -moz-transform: scale(1); }\n 10%,\n 20% {\n -moz-transform: scale(0.9) rotate(-3deg); }\n 30%,\n 50%,\n 70%,\n 90% {\n -moz-transform: scale(1.1) rotate(3deg); }\n 40%,\n 60%,\n 80% {\n -moz-transform: scale(1.1) rotate(-3deg); }\n 100% {\n -moz-transform: scale(1) rotate(0); } }\n\n@-ms-keyframes ring {\n 0% {\n -ms-transform: scale(1); }\n 10%,\n 20% {\n -ms-transform: scale(0.9) rotate(-3deg); }\n 30%,\n 50%,\n 70%,\n 90% {\n -ms-transform: scale(1.1) rotate(3deg); }\n 40%,\n 60%,\n 80% {\n -ms-transform: scale(1.1) rotate(-3deg); }\n 100% {\n -ms-transform: scale(1) rotate(0); } }\n\n@keyframes ring {\n 0% {\n transform: scale(1); }\n 10%,\n 20% {\n transform: scale(0.9) rotate(-3deg); }\n 30%,\n 50%,\n 70%,\n 90% {\n transform: scale(1.1) rotate(3deg); }\n 40%,\n 60%,\n 80% {\n transform: scale(1.1) rotate(-3deg); }\n 100% {\n transform: scale(1) rotate(0); } }\n\n.f-zindex-1 {\n z-index: 100; }\n\n.f-zindex-2 {\n z-index: 200; }\n\n.f-zindex-3 {\n z-index: 300; }\n\n.f-zindex-4 {\n z-index: 400; }\n\n.f-zindex-5 {\n z-index: 500; }\n\n.f-zindex-6 {\n z-index: 600; }\n\n.f-zindex-7 {\n z-index: 700; }\n\n.f-zindex-8 {\n z-index: 800; }\n\n.f-zindex-9 {\n z-index: 900; }\n\n.f-zindex-10 {\n z-index: 1000; }\n\n/*两个极限zIndex*/\n.f-zindex-infinitesimal {\n z-index: -999999999; }\n\n.f-zindex-infinity {\n z-index: 999999999; }\n\n/*\n* @Author: zhongjiahao\n* @Date: 2016-09-07 11:43:06\n* @Last Modified by: wuzhe\n* @Last Modified time: 2016-12-06 16:35\n*/\n.u-icon {\n display: inline-block; }\n .u-icon[class*=\"cus-bitian\"] {\n width: 5px;\n height: 5px;\n vertical-align: middle; }\n .u-icon[class*=\"pc-sys-sun\"] {\n width: 52px;\n height: 52px; }\n .u-icon[class*=\"pc-sys-add\"], .u-icon[class*=\"pc-sys-close\"], .u-icon[class*=\"pc-sys-guanbi\"] {\n width: 14px;\n height: 14px; }\n .u-icon[class*=\"pc-sys-dropdownmin\"] {\n width: 6px;\n height: 5px; }\n .u-icon[class*=\"pc-sys-dropdownmax\"] {\n width: 10px;\n height: 8px; }\n .u-icon[class*=\"pc-sys-no-data\"] {\n width: 138px;\n height: 33px; }\n .u-icon[class*=\"pc-sys-changgui-nomal\"], .u-icon[class*=\"pc-sys-zhuyi-nomal\"], .u-icon[class*=\"pc-sys-zhengque-nomal\"], .u-icon[class*=\"pc-sys-wenhao-nomal\"], .u-icon[class*=\"pc-sys-tishi-nomal\"], .u-icon[class*=\"pc-sys-cuowu-nomal\"] {\n width: 24px;\n height: 24px; }\n .u-icon[class*=\"pc-sys-changgui-nomal-small\"], .u-icon[class*=\"pc-sys-zhuyi-nomal-small\"], .u-icon[class*=\"pc-sys-zhengque-nomal-small\"], .u-icon[class*=\"pc-sys-wenhao-nomal-small\"], .u-icon[class*=\"pc-sys-tishi-nomal-small\"], .u-icon[class*=\"pc-sys-cuowu-nomal-small\"], .u-icon[class*=\"pc-sys-foldup\"], .u-icon[class*=\"pc-sys-spread\"], .u-icon[class*=\"pc-sys-shouqi\"], .u-icon[class*=\"pc-sys-sousuo\"], .u-icon[class*=\"pc-sys-zhankai\"], .u-icon[class*=\"pc-sys-Pencil\"] {\n width: 16px;\n height: 16px; }\n .u-icon[class*=\"pc-sys-Checkbox\"] {\n width: 18px;\n height: 18px; }\n .u-icon[class*=\"pc-sys-Checkbox-active\"] {\n height: 12px; }\n .u-icon[class*=\"pc-sys-tuozhuai\"] {\n width: 9px;\n height: 9px; }\n .u-icon[class*=\"pc-sys-hand-svg\"] {\n width: 16px;\n height: 11px; }\n .u-icon[class*=\"pc-sys-backward\"], .u-icon[class*=\"pc-sys-Forward\"] {\n width: 5px;\n height: 8px; }\n .u-icon[class*=\"pc-sys-arrowup\"], .u-icon[class*=\"pc-sys-arrowdown\"] {\n width: 11px;\n height: 6px; }\n .u-icon[class*=\"pc-sys-arrowleft\"], .u-icon[class*=\"pc-sys-arrowleftM7\"], .u-icon[class*=\"pc-sys-arrowright\"] {\n width: 5px;\n height: 10px; }\n .u-icon[class*=\"pc-sys-arrowdownM7\"] {\n width: 10px;\n height: 5px; }\n .u-icon[class*=\"pc-sys-arrowup2\"], .u-icon[class*=\"pc-sys-arrowdown2\"] {\n width: 8px;\n height: 7px; }\n .u-icon[class*=\"pc-sys-Forward2\"], .u-icon[class*=\"pc-sys-backward2\"] {\n width: 9px;\n height: 8px; }\n .u-icon[class*=\"pc-sys-Singlebox\"] {\n width: 18px;\n height: 18px; }\n .u-icon[class*=\"pc-sys-seqdown\"], .u-icon[class*=\"pc-sys-sequencedown\"], .u-icon[class*=\"pc-sys-sequenceup\"] {\n width: 5px;\n height: 4px; }\n .u-icon[class*=\"pc-sys-Pencil\"] {\n cursor: pointer; }\n .u-icon.sys-icon-close {\n cursor: pointer; }\n .u-icon.sys-icon-close:before {\n color: #acb7bf; }\n .u-icon.sys-icon-close:hover:before {\n color: #cc2929; }\n .u-icon.sys-icon-add {\n color: #1687d9;\n cursor: pointer; }\n .u-icon.empty-icon {\n width: 117px;\n height: 118px;\n background: url(" + __webpack_require__(311) + ") no-repeat;\n background-repeat: no-repeat; }\n .u-icon.file-sprite, .u-icon.file-aac, .u-icon.file-ape, .u-icon.file-asf, .u-icon.file-avi, .u-icon.file-doc, .u-icon.file-docx, .u-icon.file-exe, .u-icon.file-file, .u-icon.file-flac, .u-icon.file-flv, .u-icon.file-folder, .u-icon.file-folder2, .u-icon.file-gif, .u-icon.file-image, .u-icon.file-jpeg, .u-icon.file-jpg, .u-icon.file-m4a, .u-icon.file-m4v, .u-icon.file-mkv, .u-icon.file-mmap, .u-icon.file-mov, .u-icon.file-mp3, .u-icon.file-mp4, .u-icon.file-mpeg, .u-icon.file-mpg, .u-icon.file-music, .u-icon.file-none, .u-icon.file-ogg, .u-icon.file-pdf, .u-icon.file-pic, .u-icon.file-png, .u-icon.file-ppt, .u-icon.file-pptx, .u-icon.file-rar, .u-icon.file-rm, .u-icon.file-rmvb, .u-icon.file-tif, .u-icon.file-ts, .u-icon.file-txt, .u-icon.file-video, .u-icon.file-wav, .u-icon.file-wma, .u-icon.file-wmv, .u-icon.file-xls, .u-icon.file-xlsx, .u-icon.file-zip {\n background: url(" + __webpack_require__(312) + ") no-repeat;\n background-repeat: no-repeat; }\n .u-icon.file-aac {\n background-position: 0 -1296px;\n height: 60px;\n width: 60px; }\n .u-icon.file-ape {\n background-position: 0 -1416px;\n height: 60px;\n width: 60px; }\n .u-icon.file-asf {\n background-position: 0 -876px;\n height: 60px;\n width: 60px; }\n .u-icon.file-avi {\n background-position: 0 -1236px;\n height: 60px;\n width: 60px; }\n .u-icon.file-doc {\n background-position: 0 -2196px;\n height: 60px;\n width: 60px; }\n .u-icon.file-docx {\n background-position: 0 -1536px;\n height: 60px;\n width: 60px; }\n .u-icon.file-exe {\n background-position: 0 -1896px;\n height: 60px;\n width: 60px; }\n .u-icon.file-file {\n background-position: 0 -192px;\n height: 48px;\n width: 48px; }\n .u-icon.file-flac {\n background-position: 0 -1596px;\n height: 60px;\n width: 60px; }\n .u-icon.file-flv {\n background-position: 0 -1956px;\n height: 60px;\n width: 60px; }\n .u-icon.file-folder {\n background-position: 0 -144px;\n height: 48px;\n width: 48px; }\n .u-icon.file-folder2 {\n background-position: 0 -2556px;\n height: 32px;\n width: 46px; }\n .u-icon.file-gif {\n background-position: 0 -588px;\n height: 48px;\n width: 48px; }\n .u-icon.file-image {\n background-position: 0 -540px;\n height: 48px;\n width: 48px; }\n .u-icon.file-jpeg {\n background-position: 0 -384px;\n height: 48px;\n width: 48px; }\n .u-icon.file-jpg {\n background-position: 0 -432px;\n height: 48px;\n width: 48px; }\n .u-icon.file-m4a {\n background-position: 0 -1776px;\n height: 60px;\n width: 59px; }\n .u-icon.file-m4v {\n background-position: 0 -996px;\n height: 60px;\n width: 60px; }\n .u-icon.file-mkv {\n background-position: 0 -936px;\n height: 60px;\n width: 60px; }\n .u-icon.file-mmap {\n background-position: 0 -240px;\n height: 48px;\n width: 48px; }\n .u-icon.file-mov {\n background-position: 0 -816px;\n height: 60px;\n width: 60px; }\n .u-icon.file-mp3 {\n background-position: 0 -1476px;\n height: 60px;\n width: 60px; }\n .u-icon.file-mp4 {\n background-position: 0 -1056px;\n height: 60px;\n width: 60px; }\n .u-icon.file-mpeg {\n background-position: 0 -480px;\n height: 60px;\n width: 60px; }\n .u-icon.file-mpg {\n background-position: 0 -636px;\n height: 60px;\n width: 60px; }\n .u-icon.file-music {\n background-position: 0 -48px;\n height: 48px;\n width: 48px; }\n .u-icon.file-none {\n background-position: 0 -2016px;\n height: 60px;\n width: 60px; }\n .u-icon.file-ogg {\n background-position: 0 -1356px;\n height: 60px;\n width: 60px; }\n .u-icon.file-pdf {\n background-position: 0 -2316px;\n height: 60px;\n width: 60px; }\n .u-icon.file-pic {\n background-position: 0 0;\n height: 48px;\n width: 48px; }\n .u-icon.file-png {\n background-position: 0 -288px;\n height: 48px;\n width: 48px; }\n .u-icon.file-ppt {\n background-position: 0 -2256px;\n height: 60px;\n width: 60px; }\n .u-icon.file-pptx {\n background-position: 0 -1656px;\n height: 60px;\n width: 60px; }\n .u-icon.file-rar {\n background-position: 0 -2436px;\n height: 60px;\n width: 60px; }\n .u-icon.file-rm {\n background-position: 0 -2076px;\n height: 60px;\n width: 60px; }\n .u-icon.file-rmvb {\n background-position: 0 -696px;\n height: 60px;\n width: 60px; }\n .u-icon.file-tif {\n background-position: 0 -336px;\n height: 48px;\n width: 48px; }\n .u-icon.file-ts {\n background-position: 0 -1836px;\n height: 60px;\n width: 60px; }\n .u-icon.file-txt {\n background-position: 0 -2496px;\n height: 60px;\n width: 60px; }\n .u-icon.file-video {\n background-position: 0 -96px;\n height: 48px;\n width: 48px; }\n .u-icon.file-wav {\n background-position: 0 -1176px;\n height: 60px;\n width: 60px; }\n .u-icon.file-wma {\n background-position: 0 -1116px;\n height: 60px;\n width: 60px; }\n .u-icon.file-wmv {\n background-position: 0 -756px;\n height: 60px;\n width: 60px; }\n .u-icon.file-xls {\n background-position: 0 -2136px;\n height: 60px;\n width: 60px; }\n .u-icon.file-xlsx {\n background-position: 0 -1716px;\n height: 60px;\n width: 60px; }\n .u-icon.file-zip {\n background-position: 0 -2376px;\n height: 60px;\n width: 60px; }\n\n/*\n* @Author: zhongjiahao\n* @Date: 2016-09-06 16:13:30\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-18 17:48:12\n*/\n.form-group {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box; }\n .form-group__title {\n margin: 10px 0px;\n margin: 0.625rem 0rem;\n line-height: 0px;\n line-height: 0rem;\n border-bottom: 1px solid #e4ebf0; }\n .form-group__title .form-group__text {\n display: inline-block;\n padding: 0px 10px;\n padding: 0rem 0.625rem;\n width: auto;\n font-size: 12px;\n font-size: 0.75rem;\n line-height: 20px;\n line-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n color: #3D5566;\n border-radius: 2px 2px 0px 0px;\n border-radius: 0.125rem 0.125rem 0rem 0rem;\n background-color: #e4ebf0; }\n .form-group .form-group__tags {\n display: inline-block;\n width: 30px;\n width: 1.875rem;\n height: 30px;\n height: 1.875rem;\n color: #fff;\n line-height: 30px;\n line-height: 1.875rem;\n text-align: center;\n border-radius: 47px;\n border-radius: 2.9375rem;\n margin-right: 10px;\n margin-right: 0.625rem; }\n .form-group .form-group__tags .form-group__tags_is-big {\n height: 50px;\n height: 3.125rem;\n width: 50px;\n width: 3.125rem;\n line-height: 50px;\n line-height: 3.125rem;\n font-size: 32px;\n font-size: 2rem; }\n\n.form-item {\n position: relative;\n margin-bottom: 10px;\n margin-bottom: 0.625rem;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box; }\n .form-item_is-static {\n margin-bottom: 10px;\n margin-bottom: 0.625rem;\n border-bottom: 1px solid #e4ebf0; }\n .form-item_is-static .form-item__control {\n min-height: 24px;\n min-height: 1.5rem; }\n .form-item_is-static .form-item__control .form-item__multi-list {\n border-bottom: 0px; }\n .form-item_is-static .form-item__control .form-item__text {\n margin-top: 0;\n margin-bottom: 0;\n color: #021726; }\n .form-item_is-static .form-item__control .form-item__link {\n margin-left: 5px;\n margin-left: 0.3125rem;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .form-item_is-static .form-item__control .form-item__link:hover {\n outline: 0;\n color: #1687d9;\n text-decoration: underline; }\n .form-item_is-static .form-item__control .sys-icon-cus-bianji {\n color: #BCC8D1; }\n .form-item_is-static .form-item__control:hover .sys-icon-cus-bianji {\n color: #3D5566; }\n .form-item_is-static .form-item__control .sys-icon-cus-bianji:hover {\n color: #1687d9;\n cursor: pointer; }\n .form-item_is-static .form-item__avatar-item {\n margin-bottom: 5px;\n margin-bottom: 0.3125rem;\n margin-right: 5px;\n margin-right: 0.3125rem;\n line-height: 0px;\n line-height: 0rem; }\n .form-item_is-static .form-item__avatar-item .form-item__text {\n vertical-align: middle; }\n .form-item_is-hidden-tips {\n position: absolute;\n width: calc(100% - 20px);\n line-height: 28px;\n height: 28px;\n margin-left: 5px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: transparent;\n cursor: text;\n font-size: 12px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", SimSun, STHeitiSC, sans-serif; }\n .form-item__title {\n position: relative;\n max-width: 100%;\n vertical-align: middle;\n font-size: 12px;\n font-size: 0.75rem;\n line-height: 20px;\n line-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n color: #3D5566;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .form-item__title .form-item__text {\n font-size: inherit;\n line-height: inherit;\n font-family: inherit;\n text-indent: 5px;\n text-indent: 0.3125rem;\n max-width: inherit;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: middle; }\n .form-item__text {\n display: inline-block;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .form-item__control {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n min-height: 25px;\n min-height: 1.5625rem; }\n .form-item__control .list_is-edit-status {\n max-height: 131px;\n overflow-y: auto;\n overflow-x: hidden; }\n .form-item__control.form-item__control_is-active .form-item__bottom-line {\n left: 0;\n width: 100%;\n background-color: #1687d9;\n transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s; }\n .form-item__control.form-item__control_is-active .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-nomal-svg {\n display: none; }\n .form-item__control.form-item__control_is-active .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-active-svg {\n display: inline-block; }\n .form-item__control.form-item__control_has-info .form-item__explain {\n color: #1687d9; }\n .form-item__control.form-item__control_has-info .form-item__bottom-line {\n bottom: 20px;\n bottom: 1.25rem; }\n .form-item__control.form-item__control_has-info .u-textarea .form-item__bottom-line {\n bottom: 0; }\n .form-item__control.form-item__control_has-error [type=\"text\"]:focus + .form-item__bottom-line {\n background-color: #cc2929; }\n .form-item__control.form-item__control_has-error .u-input {\n max-width: 100% !important;\n height: 30px; }\n .form-item__control.form-item__control_has-error .u-textarea__element:focus + .form-item__bottom-line {\n background-color: #cc2929; }\n .form-item__control.form-item__control_has-error .form-item__bottom-line {\n background-color: #cc2929; }\n .form-item__control.form-item__control_has-error .form-item__explain {\n color: #cc2929; }\n .form-item__control.form-item__control_is-readonly .u-input {\n /*border-bottom-color: #fff;*/ }\n .form-item__control.form-item__control_is-readonly [type=\"text\"]:focus + .form-item__bottom-line,\n .form-item__control.form-item__control_is-readonly .u-textarea__element:focus + .form-item__bottom-line {\n width: 0; }\n .form-item__control .u-radio,\n .form-item__control .u-checkbox {\n margin-left: 5px;\n margin-left: 0.3125rem;\n margin-right: 15px;\n margin-right: 0.9375rem;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box; }\n .form-item__control .u-radio {\n -webkit-box-sizing: content-box;\n -moz-box-sizing: content-box;\n box-sizing: content-box; }\n .form-item__control [type=\"text\"]:focus + .form-item__bottom-line,\n .form-item__control .u-textarea__element:focus + .form-item__bottom-line {\n left: 0;\n width: 100%;\n background-color: #1687d9;\n transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s; }\n .form-item__control [type=\"text\"]:focus + .form-item__bottom-line .form-item + .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-nomal-svg,\n .form-item__control .u-textarea__element:focus + .form-item__bottom-line .form-item + .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-nomal-svg {\n display: none; }\n .form-item__control [type=\"text\"]:focus + .form-item__bottom-line .form-item + .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-active-svg,\n .form-item__control .u-textarea__element:focus + .form-item__bottom-line .form-item + .u-textarea__tuozhuai-icon .pc-sys-tuozhuai-active-svg {\n display: inline-block; }\n .form-item__control .form-item__bottom-line {\n position: absolute;\n left: 50%;\n bottom: 0;\n width: 0;\n height: 2px; }\n .form-item__explain {\n display: block;\n width: 100%;\n min-height: 20px;\n min-height: 1.25rem;\n font-size: 12px;\n font-size: 0.75rem;\n line-height: 20px;\n line-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n margin-left: 5px;\n margin-left: 0.3125rem; }\n .form-item__label {\n display: inline-block;\n padding-top: 15px;\n padding-top: 0.9375rem;\n padding-bottom: 10px;\n padding-bottom: 0.625rem;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .form-item__right-icon {\n display: flex;\n align-items: center;\n position: absolute;\n top: 5px;\n top: 0.3125rem;\n right: 5px;\n right: 0.3125rem; }\n .form-item__right-icon i + i {\n margin-left: 5px;\n margin-left: 0.3125rem; }\n .form-item__right-icon .pc-sys-arrowdown-nomal-svg {\n margin-top: 4px;\n margin-top: 0.25rem;\n cursor: pointer; }\n .form-item__right-icon .sys-icon-close + .pc-sys-arrowdown-nomal-svg {\n margin-top: 0px;\n margin-top: 0rem; }\n .form-item__multi-list {\n width: 100%;\n padding-left: 5px;\n padding-left: 0.3125rem;\n border-bottom: 1px solid #e4ebf0;\n cursor: pointer;\n min-height: 24px;\n padding-right: 20px; }\n .form-item__multi-list .form-item__multi-item {\n height: 24px;\n height: 1.5rem;\n padding-left: 0px;\n padding-left: 0rem;\n padding-right: 10px;\n padding-right: 0.625rem;\n margin-right: 5px;\n margin-right: 0.3125rem;\n margin-bottom: 0px;\n margin-bottom: 0rem;\n border-radius: 2px;\n border-radius: 0.125rem;\n cursor: default;\n max-width: 100%; }\n .form-item__multi-list .form-item__multi-item .form-item__text {\n max-width: calc(100% - 19px);\n margin-right: 5px;\n margin-right: 0.3125rem;\n color: #021726;\n vertical-align: top;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .form-item__multi-list .form-item__multi-item .sys-icon-close, .form-item__multi-list .form-item__multi-item .sys-icon-cus-renyuan, .form-item__multi-list .form-item__multi-item .sys-icon-cus-chengshi {\n font-size: 14px;\n font-size: 0.875rem;\n vertical-align: middle; }\n .form-item__multi-list .form-item__multi-item .sys-icon-cus-renyuan {\n color: #1687d9; }\n .form-item__editable {\n padding-right: 20px; }\n .form-item__help .sys-icon-cus-bangzhu {\n font-size: 14px;\n margin-left: 5px;\n vertical-align: middle;\n color: #005999;\n opacity: 0.5; }\n .form-item .user-select-items li {\n margin-right: 0px;\n margin-right: 0rem;\n color: #005999; }\n .form-item .user-select-items li .form-item__text {\n color: #005999; }\n .form-item .area-select-items li {\n margin-right: 0px;\n margin-right: 0rem; }\n .form-item .area-select-items li .sys-icon-cus-chengshi {\n color: #BCC8D1; }\n\n/*\n* @Author: zhongjiahao\n* @Date: 2016-09-06 16:07:29\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-12-06 15:32:45\n*/\n.u-input {\n border: transparent;\n width: 100%;\n height: 28px;\n padding: 0px 5px 0px 5px;\n padding: 0rem 0.3125rem 0rem 0.3125rem;\n outline: transparent;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n color: #021726; }\n .u-input::placeholder {\n color: #BCC8D1;\n opacity: 1; }\n .u-input:disabled {\n background-color: #e4ebf0;\n cursor: not-allowed; }\n\n[type=\"text\"]::-ms-clear {\n display: none; }\n\n::-webkit-input-placeholder {\n /* WebKit browsers */\n color: #BCC8D1;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n:-moz-placeholder {\n /* Mozilla Firefox 4 to 18 */\n color: #BCC8D1;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n::-moz-placeholder {\n /* Mozilla Firefox 19+ */\n color: #BCC8D1;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n:-ms-input-placeholder {\n /* Internet Explorer 10+ */\n color: #BCC8D1;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n\n/*\n* @Author: zhongjiahao\n* @Date: 2016-09-07 17:06:14\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-15 15:42:49\n*/\n.btn {\n position: relative;\n z-index: 6;\n display: inline-block;\n outline: transparent;\n border: 1px solid transparent;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n margin: 10px 0px;\n margin: 0.625rem 0rem;\n padding: 0;\n text-align: center;\n vertical-align: middle;\n cursor: pointer;\n background: 0 0;\n background-clip: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .btn .ripple {\n display: block;\n position: absolute;\n border: 0 solid rgba(0, 0, 0, 0.2);\n border-radius: 50% !important;\n opacity: .3;\n pointer-events: none;\n opacity: 1; }\n .btn.btn_has-icon {\n font-size: 0; }\n .btn.btn_has-icon .btn__text {\n vertical-align: middle;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .btn.btn_has-icon .u-icon {\n vertical-align: middle; }\n .btn.btn_has-icon .btn__text + .u-icon {\n margin-left: 5px;\n margin-left: 0.3125rem; }\n .btn.btn_has-icon .u-icon + .btn__text {\n margin-left: 5px;\n margin-left: 0.3125rem; }\n .btn.btn_default {\n min-width: 70px;\n min-width: 4.375rem;\n padding: 4px 15px;\n padding: 0.25rem 0.9375rem;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n background-color: #1687d9;\n color: #fff;\n border-radius: 2px;\n border-radius: 0.125rem;\n box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.3); }\n .btn.btn_default:hover {\n box-shadow: 0 0.1875rem 0.3125rem rgba(0, 0, 0, 0.3);\n transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s; }\n .btn.btn_default .btn__text {\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .btn.btn_default.btn_is-active {\n background-color: #005999;\n box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.3);\n transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s; }\n .btn.btn_default:disabled, .btn.btn_default.btn_is-disabled {\n box-shadow: none;\n background-color: #1687d9;\n opacity: .6;\n cursor: not-allowed; }\n .btn.btn_weaken {\n min-width: 70px;\n min-width: 4.375rem;\n padding: 4px 15px;\n padding: 0.25rem 0.9375rem;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n background-color: #f5f8fa;\n color: #021726;\n border-radius: 2px;\n border-radius: 0.125rem;\n box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.3); }\n .btn.btn_weaken:hover {\n box-shadow: 0 0.1875rem 0.3125rem rgba(0, 0, 0, 0.3);\n transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s; }\n .btn.btn_weaken .btn__text {\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .btn.btn_weaken.btn_is-active {\n background-color: #f5f8fa;\n box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);\n transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s; }\n .btn.btn_weaken:disabled, .btn.btn_weaken.btn_is-disabled {\n box-shadow: none;\n background-color: #f5f8fa;\n color: #021726;\n cursor: not-allowed; }\n .btn.btn_sm {\n min-width: 50px;\n min-width: 3.125rem;\n padding: 2px 10px;\n padding: 0.125rem 0.625rem;\n font-size: 12px;\n font-size: 0.75rem;\n line-height: 20px;\n line-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .btn.btn_sm .btn__text {\n font-size: 12px;\n font-size: 0.75rem;\n line-height: 20px;\n line-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .btn.btn_block {\n display: block;\n width: 100%;\n font-size: 20px;\n font-size: 1.25rem;\n line-height: 36px;\n line-height: 2.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .btn.btn-icon {\n display: inline-block;\n padding: 0;\n min-width: auto;\n width: 34px;\n width: 2.125rem;\n height: 34px;\n height: 2.125rem;\n text-align: center;\n vertical-align: middle;\n text-decoration: none;\n text-rendering: auto; }\n\n/*\n* @Author: xiaosiyu\n* @Date: 2016-09-23 16:11:30\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-12-06 15:31:43\n*/\n.search {\n position: relative;\n -webkit-box-sizing: content-box;\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n margin: 10px 0px;\n margin: 0.625rem 0rem;\n width: 100%;\n border-bottom: 1px solid #E4EBF0; }\n .search [type=\"text\"]::-ms-clear {\n display: none; }\n .search__control {\n position: absolute;\n top: 50%;\n left: 50%;\n font-size: 0;\n line-height: 24px;\n line-height: 1.5rem;\n pointer-events: none;\n transform: translate(-50%, -50%); }\n .search__control .search__icon {\n display: inline-block;\n margin-right: 10px;\n margin-right: 0.625rem;\n color: #BCC8D1;\n font-size: 18px;\n font-size: 1.125rem;\n transform: translateY(0.125rem); }\n .search__control .search__placeholder {\n display: inline-block;\n padding: 5px 0px;\n padding: 0.3125rem 0rem;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n color: #BCC8D1; }\n .search__bottom-line {\n display: block;\n position: absolute;\n left: 50%;\n top: 33px;\n top: 2.0625rem;\n width: 0;\n height: 2px;\n height: 0.125rem;\n background-color: #1687d9;\n transition: left ease-in-out .15s, width ease-in-out .15s; }\n .search__clear-icon {\n position: absolute;\n top: 10px;\n top: 0.625rem;\n right: 5px;\n right: 0.3125rem;\n line-height: 0; }\n .search_is-disabled {\n background-color: #e4ebf0;\n cursor: no-drop; }\n .search__input {\n display: block;\n padding: 5px 0px;\n padding: 0.3125rem 0rem;\n border: none;\n line-height: 24px;\n line-height: 1.5rem;\n text-indent: 30px;\n text-indent: 1.875rem; }\n .search__input:focus + .search__control {\n left: 0.3125rem !important;\n transform: translate(0, -50%);\n transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s; }\n .search__input:focus + .search__control .search__icon {\n color: #1687d9; }\n .search__input:focus + .search__control + .search__bottom-line {\n left: 0;\n width: 100%;\n transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s; }\n\n.search_is-active .search__bottom-line {\n left: 0;\n width: 100%;\n transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s, width cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s; }\n\n.search_is-active .search__control {\n left: 0.3125rem !important;\n transform: translate(0, -50%);\n transition: left cubic-bezier(0.66, 1.65, 0.23, 0.87) 0.35s; }\n .search_is-active .search__control .search__icon {\n color: #1687d9; }\n\n.search_has-value .search__control {\n left: 0.3125rem !important;\n transform: translate(0, -50%); }\n\n/*\n* @Author: zhongjiahao\n* @Date: 2016-09-13 16:07:23\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-15 16:15:47\n*/\n.u-radio,\n.u-checkbox {\n display: inline-block; }\n .u-radio + .form-item__explain,\n .u-checkbox + .form-item__explain {\n bottom: -25px;\n bottom: -1.5625rem; }\n .u-radio [type=\"radio\"],\n .u-radio [type=\"checkbox\"],\n .u-checkbox [type=\"radio\"],\n .u-checkbox [type=\"checkbox\"] {\n position: absolute;\n margin: -1px;\n margin: -0.0625rem;\n padding: 0;\n border: 0;\n width: 1px;\n width: 0.0625rem;\n height: 1px;\n height: 0.0625rem;\n clip: rect(0 0 0 0);\n overflow: hidden; }\n .u-radio .u-radio__label,\n .u-radio .u-checkbox__label,\n .u-checkbox .u-radio__label,\n .u-checkbox .u-checkbox__label {\n display: inline-block;\n font-size: 0; }\n .u-radio .form-item__label,\n .u-checkbox .form-item__label {\n display: inline-block;\n margin-bottom: 0;\n padding: 0;\n font-size: 14px;\n font-size: 0.875rem;\n line-height: 24px;\n line-height: 1.5rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n vertical-align: middle; }\n\n.u-radio [type=\"radio\"]:checked + .u-radio__label .u-radio__icon {\n border-color: #1687d9; }\n .u-radio [type=\"radio\"]:checked + .u-radio__label .u-radio__icon:after {\n content: \"\";\n display: inline-block;\n margin: 2px;\n margin: 0.125rem;\n width: 10px;\n width: 0.625rem;\n height: 10px;\n height: 0.625rem;\n border-radius: 50%;\n background-color: #1687d9;\n vertical-align: top;\n transition: width .2s ease, height .2s ease, margin .2s ease; }\n\n.u-radio [type=\"radio\"]:disabled + .u-radio__label .u-radio__icon {\n border-color: #BCC8D1; }\n .u-radio [type=\"radio\"]:disabled + .u-radio__label .u-radio__icon:after {\n background-color: #BCC8D1; }\n\n.u-radio .u-radio__icon {\n box-sizing: initial;\n margin-right: 5px;\n margin-right: 0.3125rem;\n width: 14px;\n width: 0.875rem;\n height: 14px;\n height: 0.875rem;\n border: 0.125rem solid #96d0fa;\n border-radius: 50%;\n vertical-align: middle; }\n .u-radio .u-radio__icon:after {\n content: \"\";\n display: inline-block;\n margin: 8px;\n margin: 0.5rem;\n width: 0;\n height: 0;\n border-radius: 50%;\n background-color: #1687d9;\n vertical-align: top;\n transition: width .2s ease, height .2s ease, margin .2s ease; }\n .u-radio .u-radio__icon:hover {\n border-color: #1687d9; }\n\n.u-checkbox [type=\"checkbox\"] + .u-checkbox__label .pc-sys-Checkbox-nomal-svg {\n width: 14px;\n width: 0.875rem;\n height: 14px;\n height: 0.875rem;\n border: 1px solid #96d0fa;\n box-sizing: border-box;\n background: none;\n opacity: 0.8;\n border-radius: 2px;\n animation: checkToDft 0.2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }\n .u-checkbox [type=\"checkbox\"] + .u-checkbox__label .pc-sys-Checkbox-nomal-svg:hover {\n border-color: #1687d9; }\n\n.u-checkbox [type=\"checkbox\"] + .u-checkbox__label .pc-sys-Checkbox-active-svg {\n display: none;\n opacity: 0; }\n\n.u-checkbox [type=\"checkbox\"] + .u-checkbox__label .pc-sys-Checkbox-active-disabled-svg {\n display: none; }\n\n.u-checkbox [type=\"checkbox\"]:checked + .u-checkbox__label .pc-sys-Checkbox-nomal-svg {\n display: none;\n opacity: 0; }\n\n.u-checkbox [type=\"checkbox\"]:checked + .u-checkbox__label .pc-sys-Checkbox-active-svg {\n background-size: 100%;\n display: inline-block;\n opacity: 1;\n animation: dftToCheck 0.2s cubic-bezier(0.66, 1.65, 0.23, 0.87) forwards; }\n\n.u-checkbox [type=\"checkbox\"]:disabled:checked + .u-checkbox__label [class*=\"pc-sys-Checkbox\"],\n.u-checkbox [type=\"checkbox\"]:checked:disabled + .u-checkbox__label [class*=\"pc-sys-Checkbox\"] {\n display: none; }\n\n.u-checkbox [type=\"checkbox\"]:disabled:checked + .u-checkbox__label .pc-sys-Checkbox-active-disabled-svg,\n.u-checkbox [type=\"checkbox\"]:checked:disabled + .u-checkbox__label .pc-sys-Checkbox-active-disabled-svg {\n display: inline-block; }\n\n.u-checkbox [type=\"checkbox\"]:disabled + .u-checkbox__label [class*=\"pc-sys-Checkbox\"] {\n display: none; }\n\n.u-checkbox [type=\"checkbox\"]:disabled + .u-checkbox__label .pc-sys-Checkbox-nomal-svg {\n display: inline-block;\n border-color: #BCC8D1; }\n\n.u-checkbox .u-checkbox__icon {\n display: inline-block;\n margin-right: 5px;\n margin-right: 0.3125rem;\n font-size: 0;\n line-height: 0;\n vertical-align: middle; }\n\n@keyframes dftToCheck {\n 0% {\n transform: rotate(45deg); }\n 100% {\n transform: rotate(0deg); } }\n\n@keyframes checkToDft {\n 0% {\n transform: rotate(-45deg); }\n 100% {\n transform: rotate(0deg); } }\n\n/*\n* @Author: xiaosiyu\n* @Date: 2016-09-23 16:11:30\n* @Last Modified by: zhongjiahao\n* @Last Modified time: 2016-11-15 16:05:07\n*/\n.dropdown {\n z-index: 99;\n position: absolute;\n border-radius: 2px;\n border-radius: 0.125rem;\n background-color: #fff;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.3);\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box; }\n .dropdown__list {\n position: relative;\n max-height: 300px;\n max-height: 18.75rem;\n width: 170px;\n width: 10.625rem;\n overflow-x: hidden;\n overflow-y: auto;\n color: #021726;\n opacity: 1; }\n .dropdown__item {\n padding: 5px 15px;\n padding: 0.3125rem 0.9375rem;\n width: 100%;\n cursor: pointer;\n font-size: 12px;\n font-size: 0.75rem;\n line-height: 20px;\n line-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n opacity: 1;\n transition-duration: 0.2s;\n transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1); }\n .dropdown__highlight {\n position: absolute;\n top: 0;\n width: 170px;\n width: 10.625rem;\n height: 30px;\n height: 1.875rem;\n z-index: -2; }\n .dropdown.dropdown_has-search .dropdown__container {\n width: 100%; }\n .dropdown.dropdown_has-search .search {\n margin-top: 0;\n margin-left: auto;\n margin-right: auto;\n width: calc(100% - 30px); }\n .dropdown.dropdown_has-search .dropdown__list {\n width: 100%;\n max-height: 400px;\n max-height: 25rem; }\n .dropdown.dropdown_has-search .dropdown__item {\n padding-top: 10px;\n padding-top: 0.625rem;\n padding-bottom: 10px;\n padding-bottom: 0.625rem;\n line-height: 0;\n box-sizing: border-box; }\n .dropdown.dropdown_has-search .dropdown__highlight {\n width: 100%; }\n .dropdown.dropdown_has-search .dropdown__text {\n font-size: 12px;\n font-size: 0.75rem;\n line-height: 20px;\n line-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .dropdown.dropdown_has-search .dropdown__text em {\n color: #36434D;\n height: 20px;\n border-radius: 2px;\n background: rgba(228, 166, 0, 0.2);\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-style: normal; }\n .dropdown.dropdown_has-search .dropdown__footer {\n padding-right: 15px;\n padding-right: 0.9375rem;\n margin: 5px 0;\n text-align: right; }\n .dropdown.dropdown_has-search .u-checkbox .u-checkbox__icon {\n cursor: pointer; }\n .dropdown.dropdown_has-search .u-checkbox .u-checkbox__label {\n margin-top: 0; }\n .dropdown.dropdown_has-search .u-checkbox .form-item__label {\n font-size: 12px;\n font-size: 0.75rem;\n line-height: 20px;\n line-height: 1.25rem;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n", ""]);
|
30229 |
|
30230 | // exports
|
30231 |
|
30232 |
|
30233 | /***/ }),
|
30234 | /* 311 */
|
30235 | /***/ (function(module, exports, __webpack_require__) {
|
30236 |
|
30237 | module.exports = __webpack_require__.p + "885c8195f76a3e75e80bef39eb38e58d.png";
|
30238 |
|
30239 | /***/ }),
|
30240 | /* 312 */
|
30241 | /***/ (function(module, exports, __webpack_require__) {
|
30242 |
|
30243 | module.exports = __webpack_require__.p + "50f93a3f4ee972dc0e62c11c391f5df9.png";
|
30244 |
|
30245 | /***/ }),
|
30246 | /* 313 */
|
30247 | /***/ (function(module, exports, __webpack_require__) {
|
30248 |
|
30249 | 'use strict';
|
30250 |
|
30251 | Object.defineProperty(exports, "__esModule", {
|
30252 | value: true
|
30253 | });
|
30254 | exports.default = undefined;
|
30255 |
|
30256 | var _extends2 = __webpack_require__(5);
|
30257 |
|
30258 | var _extends3 = _interopRequireDefault(_extends2);
|
30259 |
|
30260 | var _classCallCheck2 = __webpack_require__(42);
|
30261 |
|
30262 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
30263 |
|
30264 | var _possibleConstructorReturn2 = __webpack_require__(43);
|
30265 |
|
30266 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
30267 |
|
30268 | var _inherits2 = __webpack_require__(78);
|
30269 |
|
30270 | var _inherits3 = _interopRequireDefault(_inherits2);
|
30271 |
|
30272 | var _react = __webpack_require__(86);
|
30273 |
|
30274 | var _react2 = _interopRequireDefault(_react);
|
30275 |
|
30276 | var _search = __webpack_require__(299);
|
30277 |
|
30278 | var _search2 = _interopRequireDefault(_search);
|
30279 |
|
30280 | var _selectedList = __webpack_require__(314);
|
30281 |
|
30282 | var _selectedList2 = _interopRequireDefault(_selectedList);
|
30283 |
|
30284 | var _baseButton = __webpack_require__(284);
|
30285 |
|
30286 | var _baseButton2 = _interopRequireDefault(_baseButton);
|
30287 |
|
30288 | var _es6PromiseDebounce = __webpack_require__(276);
|
30289 |
|
30290 | var _es6PromiseDebounce2 = _interopRequireDefault(_es6PromiseDebounce);
|
30291 |
|
30292 | var _constant = __webpack_require__(277);
|
30293 |
|
30294 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
30295 |
|
30296 | var FindAll_pop = function (_Component) {
|
30297 | (0, _inherits3.default)(FindAll_pop, _Component);
|
30298 |
|
30299 | function FindAll_pop(props) {
|
30300 | (0, _classCallCheck3.default)(this, FindAll_pop);
|
30301 |
|
30302 | var _this = (0, _possibleConstructorReturn3.default)(this, _Component.call(this, props));
|
30303 |
|
30304 | _this.debounceChange = function (e) {
|
30305 | e.event.persist();
|
30306 | _this.onChange(e);
|
30307 | };
|
30308 |
|
30309 | _this.onChange = function (event) {
|
30310 | _this.props.self.handleChange(event);
|
30311 | };
|
30312 |
|
30313 | _this.onChange = (0, _es6PromiseDebounce2.default)(_this.onChange, 300);
|
30314 | return _this;
|
30315 | }
|
30316 |
|
30317 | FindAll_pop.prototype.render = function render() {
|
30318 | var _props = this.props,
|
30319 | self = _props.self,
|
30320 | popUl = _props.popUl,
|
30321 | single = _props.single,
|
30322 | findAll_cancle = _props.findAll_cancle,
|
30323 | findAll_submit = _props.findAll_submit;
|
30324 | var _self$state = self.state,
|
30325 | searchValue = _self$state.searchValue,
|
30326 | hasCount = _self$state.hasCount,
|
30327 | resultsData = _self$state.resultsData;
|
30328 | var totalCount = self.props.totalCount;
|
30329 |
|
30330 | var selected__Data = {
|
30331 | totalCount: totalCount,
|
30332 | hasCount: hasCount,
|
30333 | resultsData: resultsData,
|
30334 | clearResultsData: self.clearResultsData
|
30335 | };
|
30336 | var isSingle_select = single ? 'single_select' : 'muti_select';
|
30337 | var closeBtn_style = single ? 'closeBtn_single' : 'closeBtn';
|
30338 | return _react2.default.createElement(
|
30339 | 'div',
|
30340 | { className: 'searchContainer', onKeyDown: self.handleKeyDown },
|
30341 | _react2.default.createElement(
|
30342 | 'div',
|
30343 | { className: isSingle_select },
|
30344 | _react2.default.createElement(_search2.default, (0, _extends3.default)({}, (0, _constant.getSearchData)(searchValue, false, false), { onChange: this.debounceChange })),
|
30345 | popUl
|
30346 | ),
|
30347 | single ? '' : _react2.default.createElement(_selectedList2.default, selected__Data),
|
30348 | _react2.default.createElement(
|
30349 | 'div',
|
30350 | { className: 'findAll_footer' },
|
30351 | _react2.default.createElement(
|
30352 | 'div',
|
30353 | { className: closeBtn_style },
|
30354 | _react2.default.createElement(_baseButton2.default, (0, _constant.getBtnData)("weaken", 'default', '取消', findAll_cancle))
|
30355 | ),
|
30356 | single ? '' : _react2.default.createElement(
|
30357 | 'div',
|
30358 | { className: 'submitBtn' },
|
30359 | _react2.default.createElement(_baseButton2.default, (0, _constant.getBtnData)("default", 'default', '确定', findAll_submit))
|
30360 | )
|
30361 | )
|
30362 | );
|
30363 | };
|
30364 |
|
30365 | return FindAll_pop;
|
30366 | }(_react.Component);
|
30367 |
|
30368 | exports.default = FindAll_pop;
|
30369 | module.exports = exports['default'];
|
30370 |
|
30371 | /***/ }),
|
30372 | /* 314 */
|
30373 | /***/ (function(module, exports, __webpack_require__) {
|
30374 |
|
30375 | 'use strict';
|
30376 |
|
30377 | Object.defineProperty(exports, "__esModule", {
|
30378 | value: true
|
30379 | });
|
30380 |
|
30381 | 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; }; }();
|
30382 |
|
30383 | var _react = __webpack_require__(86);
|
30384 |
|
30385 | var _react2 = _interopRequireDefault(_react);
|
30386 |
|
30387 | var _reactDom = __webpack_require__(243);
|
30388 |
|
30389 | var _commonFunc = __webpack_require__(252);
|
30390 |
|
30391 | var _resultsTip = __webpack_require__(315);
|
30392 |
|
30393 | var _resultsTip2 = _interopRequireDefault(_resultsTip);
|
30394 |
|
30395 | var _resultsUl = __webpack_require__(316);
|
30396 |
|
30397 | var _resultsUl2 = _interopRequireDefault(_resultsUl);
|
30398 |
|
30399 | __webpack_require__(318);
|
30400 |
|
30401 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
30402 |
|
30403 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
30404 |
|
30405 | 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; }
|
30406 |
|
30407 | 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; } /* eslint-disable */
|
30408 |
|
30409 |
|
30410 | var SelectedList = function (_Component) {
|
30411 | _inherits(SelectedList, _Component);
|
30412 |
|
30413 | function SelectedList(props) {
|
30414 | _classCallCheck(this, SelectedList);
|
30415 |
|
30416 | return _possibleConstructorReturn(this, (SelectedList.__proto__ || Object.getPrototypeOf(SelectedList)).call(this, props));
|
30417 | }
|
30418 |
|
30419 | _createClass(SelectedList, [{
|
30420 | key: 'render',
|
30421 | value: function render() {
|
30422 | var _props = this.props,
|
30423 | resultsData = _props.resultsData,
|
30424 | nullText = _props.nullText;
|
30425 |
|
30426 | return _react2.default.createElement(
|
30427 | 'div',
|
30428 | { className: 'selected-list' },
|
30429 | _react2.default.createElement(_resultsTip2.default, this.props),
|
30430 | resultsData.length == 0 ? _react2.default.createElement(
|
30431 | 'div',
|
30432 | { className: 'selected-list__results-content_null' },
|
30433 | _react2.default.createElement(
|
30434 | 'span',
|
30435 | { className: 'selected-list__results_nullText' },
|
30436 | (0, _commonFunc.decode)(nullText)
|
30437 | )
|
30438 | ) : _react2.default.createElement(
|
30439 | 'div',
|
30440 | { className: 'selected-list__results-content' },
|
30441 | _react2.default.createElement(_resultsUl2.default, this.props)
|
30442 | )
|
30443 | );
|
30444 | }
|
30445 | }]);
|
30446 |
|
30447 | return SelectedList;
|
30448 | }(_react.Component);
|
30449 |
|
30450 | SelectedList.defaultProps = {
|
30451 | nullText: "请在左侧选择",
|
30452 | titleText: "已选",
|
30453 | openCount: true
|
30454 | };
|
30455 | exports.default = SelectedList;
|
30456 |
|
30457 | /***/ }),
|
30458 | /* 315 */
|
30459 | /***/ (function(module, exports, __webpack_require__) {
|
30460 |
|
30461 | 'use strict';
|
30462 |
|
30463 | Object.defineProperty(exports, "__esModule", {
|
30464 | value: true
|
30465 | });
|
30466 |
|
30467 | 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; }; }();
|
30468 |
|
30469 | var _react = __webpack_require__(86);
|
30470 |
|
30471 | var _react2 = _interopRequireDefault(_react);
|
30472 |
|
30473 | var _reactDom = __webpack_require__(243);
|
30474 |
|
30475 | var _commonFunc = __webpack_require__(252);
|
30476 |
|
30477 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
30478 |
|
30479 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
30480 |
|
30481 | 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; }
|
30482 |
|
30483 | 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; } /* eslint-disable */
|
30484 |
|
30485 |
|
30486 | var ResultsTip = function (_Component) {
|
30487 | _inherits(ResultsTip, _Component);
|
30488 |
|
30489 | function ResultsTip(props) {
|
30490 | _classCallCheck(this, ResultsTip);
|
30491 |
|
30492 | var _this = _possibleConstructorReturn(this, (ResultsTip.__proto__ || Object.getPrototypeOf(ResultsTip)).call(this, props));
|
30493 |
|
30494 | _this.clearClick = function (event) {
|
30495 | event.stopPropagation();
|
30496 | if (_this.props.hasCount == 0) return;
|
30497 | _this.props.clearResultsData();
|
30498 | };
|
30499 |
|
30500 | return _this;
|
30501 | }
|
30502 |
|
30503 | _createClass(ResultsTip, [{
|
30504 | key: 'render',
|
30505 | value: function render() {
|
30506 | var _props = this.props,
|
30507 | hasCount = _props.hasCount,
|
30508 | totalCount = _props.totalCount,
|
30509 | openCount = _props.openCount,
|
30510 | titleText = _props.titleText;
|
30511 |
|
30512 | var _clearClass = hasCount == 0 ? 'selected-list__text_is-disabled' : 'selected-list__text_is-active';
|
30513 | return _react2.default.createElement(
|
30514 | 'p',
|
30515 | { className: 'selected-list__results-tip' },
|
30516 | _react2.default.createElement(
|
30517 | 'span',
|
30518 | { className: 'selected-list__text' },
|
30519 | (0, _commonFunc.decode)(titleText)
|
30520 | ),
|
30521 | _react2.default.createElement(
|
30522 | 'span',
|
30523 | { className: 'selected-list__text', style: { display: openCount ? "" : "none" } },
|
30524 | hasCount + (totalCount == undefined ? '' : '/')
|
30525 | ),
|
30526 | _react2.default.createElement(
|
30527 | 'span',
|
30528 | { className: 'selected-list__text', style: { display: openCount ? "" : "none" } },
|
30529 | totalCount
|
30530 | ),
|
30531 | _react2.default.createElement(
|
30532 | 'a',
|
30533 | { href: 'javascript:void(0)', className: "selected-list__text " + _clearClass, onClick: this.clearClick },
|
30534 | '\u6E05\u7A7A'
|
30535 | )
|
30536 | );
|
30537 | }
|
30538 | }]);
|
30539 |
|
30540 | return ResultsTip;
|
30541 | }(_react.Component);
|
30542 |
|
30543 | exports.default = ResultsTip;
|
30544 |
|
30545 | /***/ }),
|
30546 | /* 316 */
|
30547 | /***/ (function(module, exports, __webpack_require__) {
|
30548 |
|
30549 | 'use strict';
|
30550 |
|
30551 | Object.defineProperty(exports, "__esModule", {
|
30552 | value: true
|
30553 | });
|
30554 |
|
30555 | 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; }; }();
|
30556 |
|
30557 | var _react = __webpack_require__(86);
|
30558 |
|
30559 | var _react2 = _interopRequireDefault(_react);
|
30560 |
|
30561 | var _reactDom = __webpack_require__(243);
|
30562 |
|
30563 | var _resultsItem = __webpack_require__(317);
|
30564 |
|
30565 | var _resultsItem2 = _interopRequireDefault(_resultsItem);
|
30566 |
|
30567 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
30568 |
|
30569 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
30570 |
|
30571 | 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; }
|
30572 |
|
30573 | 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; } /* eslint-disable */
|
30574 |
|
30575 |
|
30576 | var Selected_List = function (_Component) {
|
30577 | _inherits(Selected_List, _Component);
|
30578 |
|
30579 | function Selected_List(props) {
|
30580 | _classCallCheck(this, Selected_List);
|
30581 |
|
30582 | var _this = _possibleConstructorReturn(this, (Selected_List.__proto__ || Object.getPrototypeOf(Selected_List)).call(this, props));
|
30583 |
|
30584 | _this.clearItem = function (event) {
|
30585 | event.stopPropagation();
|
30586 | var node = event.target;
|
30587 | _this.props.clearResultsData(parseInt(node.getAttribute('data-index')));
|
30588 | };
|
30589 |
|
30590 | return _this;
|
30591 | }
|
30592 | // 删除icon 事件Handler
|
30593 |
|
30594 |
|
30595 | _createClass(Selected_List, [{
|
30596 | key: 'render',
|
30597 | value: function render() {
|
30598 | var _this2 = this;
|
30599 |
|
30600 | var resultsData = this.props.resultsData;
|
30601 |
|
30602 | return _react2.default.createElement(
|
30603 | 'ul',
|
30604 | { className: 'selected-list__list f-cf' },
|
30605 | resultsData.map(function (i, index) {
|
30606 | return _react2.default.createElement(_resultsItem2.default, { index: index, key: index, name: i.name, pname: i.pname, clearItem: _this2.clearItem });
|
30607 | })
|
30608 | );
|
30609 | }
|
30610 | }]);
|
30611 |
|
30612 | return Selected_List;
|
30613 | }(_react.Component);
|
30614 |
|
30615 | exports.default = Selected_List;
|
30616 |
|
30617 | /***/ }),
|
30618 | /* 317 */
|
30619 | /***/ (function(module, exports, __webpack_require__) {
|
30620 |
|
30621 | 'use strict';
|
30622 |
|
30623 | Object.defineProperty(exports, "__esModule", {
|
30624 | value: true
|
30625 | });
|
30626 |
|
30627 | 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; }; }();
|
30628 |
|
30629 | var _react = __webpack_require__(86);
|
30630 |
|
30631 | var _react2 = _interopRequireDefault(_react);
|
30632 |
|
30633 | var _reactDom = __webpack_require__(243);
|
30634 |
|
30635 | var _commonFunc = __webpack_require__(252);
|
30636 |
|
30637 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
30638 |
|
30639 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
30640 |
|
30641 | 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; }
|
30642 |
|
30643 | 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; } /* eslint-disable */
|
30644 |
|
30645 |
|
30646 | var Selected_Item = function (_Component) {
|
30647 | _inherits(Selected_Item, _Component);
|
30648 |
|
30649 | function Selected_Item(props) {
|
30650 | _classCallCheck(this, Selected_Item);
|
30651 |
|
30652 | var _this = _possibleConstructorReturn(this, (Selected_Item.__proto__ || Object.getPrototypeOf(Selected_Item)).call(this, props));
|
30653 |
|
30654 | _this.mouseOver = function () {
|
30655 | _this.setState({ hover: true });
|
30656 | };
|
30657 |
|
30658 | _this.mouseOut = function () {
|
30659 | _this.setState({ hover: false });
|
30660 | };
|
30661 |
|
30662 | _this.clearItem = function (event) {
|
30663 | _this.setState({ hover: false });
|
30664 | _this.props.clearItem(event);
|
30665 | };
|
30666 |
|
30667 | _this.state = {
|
30668 | hover: false
|
30669 | };
|
30670 | return _this;
|
30671 | }
|
30672 |
|
30673 | _createClass(Selected_Item, [{
|
30674 | key: 'render',
|
30675 | value: function render() {
|
30676 | var _props = this.props,
|
30677 | name = _props.name,
|
30678 | pname = _props.pname,
|
30679 | index = _props.index;
|
30680 |
|
30681 | return _react2.default.createElement(
|
30682 | 'li',
|
30683 | { className: 'selected-list__item', key: index },
|
30684 | _react2.default.createElement(
|
30685 | 'span',
|
30686 | { className: 'selected-list__text' },
|
30687 | (0, _commonFunc.decode)(name)
|
30688 | ),
|
30689 | pname ? _react2.default.createElement(
|
30690 | 'span',
|
30691 | { className: 'selected-list__text parent_text' },
|
30692 | '(' + (0, _commonFunc.decode)(pname) + ')'
|
30693 | ) : '',
|
30694 | _react2.default.createElement('i', { className: "u-icon sys-icon-close " + (this.state.hover ? ' icon-close_is-active' : ''), onMouseOver: this.mouseOver, onMouseOut: this.mouseOut, 'data-index': index, onClick: this.clearItem })
|
30695 | );
|
30696 | }
|
30697 | }]);
|
30698 |
|
30699 | return Selected_Item;
|
30700 | }(_react.Component);
|
30701 |
|
30702 | exports.default = Selected_Item;
|
30703 |
|
30704 | /***/ }),
|
30705 | /* 318 */
|
30706 | /***/ (function(module, exports, __webpack_require__) {
|
30707 |
|
30708 | // style-loader: Adds some css to the DOM by adding a <style> tag
|
30709 |
|
30710 | // load the styles
|
30711 | var content = __webpack_require__(319);
|
30712 | if(typeof content === 'string') content = [[module.id, content, '']];
|
30713 | // add the styles to the DOM
|
30714 | var update = __webpack_require__(248)(content, {});
|
30715 | if(content.locals) module.exports = content.locals;
|
30716 | // Hot Module Replacement
|
30717 | if(false) {
|
30718 | // When the styles change, update the <style> tags
|
30719 | if(!content.locals) {
|
30720 | module.hot.accept("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss", function() {
|
30721 | var newContent = require("!!../../../css-loader/index.js!../../../sass-loader/index.js!./index.scss");
|
30722 | if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
30723 | update(newContent);
|
30724 | });
|
30725 | }
|
30726 | // When the module is disposed, remove the <style> tags
|
30727 | module.hot.dispose(function() { update(); });
|
30728 | }
|
30729 |
|
30730 | /***/ }),
|
30731 | /* 319 */
|
30732 | /***/ (function(module, exports, __webpack_require__) {
|
30733 |
|
30734 | exports = module.exports = __webpack_require__(246)();
|
30735 | // imports
|
30736 |
|
30737 |
|
30738 | // module
|
30739 | exports.push([module.id, ".selected-list {\n width: 30%;\n height: calc(100% - 102px);\n border-left: 1px solid #E4EBF0;\n padding: 0 20px 0 20px;\n box-sizing: border-box;\n position: absolute;\n right: 0;\n top: 20px; }\n .selected-list .icon-close_is-active:before {\n color: #cc2929 !important; }\n .selected-list .sys-icon-close:before {\n color: #acb7bf; }\n .selected-list .selected-list__results-tip {\n display: inline-block;\n margin: 0;\n width: 100%; }\n .selected-list .selected-list__results-tip a {\n outline: 0;\n cursor: pointer;\n text-decoration: none; }\n .selected-list .selected-list__results-tip .selected-list__text {\n color: #3d5566;\n font-size: 12px;\n line-height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif; }\n .selected-list .selected-list__results-tip .selected-list__text:first-child {\n margin-right: 5px; }\n .selected-list .selected-list__results-tip .selected-list__text:last-child {\n float: right;\n margin-top: 3px; }\n .selected-list .selected-list__results-tip .selected-list__text_is-disabled {\n color: #acb7bf;\n cursor: not-allowed; }\n .selected-list .selected-list__results-tip .selected-list__text_is-active {\n color: #005999; }\n .selected-list .selected-list__results-tip .selected-list__text_is-active:hover {\n color: #1587d9; }\n .selected-list .selected-list__results-content {\n margin-top: 10px;\n height: calc(100% - 53px);\n overflow-y: auto;\n word-break: break-all; }\n .selected-list .selected-list__results-content .selected-list__item {\n float: left;\n margin-right: 10px;\n margin-bottom: 10px;\n font-size: 12px;\n line-height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n font-size: 0; }\n .selected-list .selected-list__results-content .selected-list__item .selected-list__text {\n font-size: 12px;\n line-height: 20px;\n font-family: \"Helvetica Neue\", Tahoma, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", STHeitiSC, sans-serif;\n vertical-align: middle;\n word-break: break-all; }\n .selected-list .selected-list__results-content .selected-list__item .parent_text {\n color: #66757F; }\n .selected-list .selected-list__results-content .selected-list__item .sys-icon-close {\n margin-left: 5px;\n font-size: 14px;\n vertical-align: middle;\n cursor: pointer; }\n .selected-list .selected-list__results-content_null {\n color: #E4EBF0;\n font-size: 20px;\n line-height: calc(100% - 44px);\n height: calc(100% - 44px);\n text-align: center; }\n .selected-list .selected-list__results-content_null .selected-list__results_nullText {\n width: 160px;\n position: absolute;\n top: calc(50% - 10px);\n left: calc(50% - 80px); }\n", ""]);
|
30740 |
|
30741 | // exports
|
30742 |
|
30743 |
|
30744 | /***/ })
|
30745 | /******/ ])
|
30746 | });
|
30747 | ; |
\ | No newline at end of file |