UNPKG

15 kBJavaScriptView Raw
1module.exports =
2/******/ (function(modules) { // webpackBootstrap
3/******/ // The module cache
4/******/ var installedModules = {};
5
6/******/ // The require function
7/******/ function __webpack_require__(moduleId) {
8
9/******/ // Check if module is in cache
10/******/ if(installedModules[moduleId])
11/******/ return installedModules[moduleId].exports;
12
13/******/ // Create a new module (and put it into the cache)
14/******/ var module = installedModules[moduleId] = {
15/******/ exports: {},
16/******/ id: moduleId,
17/******/ loaded: false
18/******/ };
19
20/******/ // Execute the module function
21/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
23/******/ // Flag the module as loaded
24/******/ module.loaded = true;
25
26/******/ // Return the exports of the module
27/******/ return module.exports;
28/******/ }
29
30
31/******/ // expose the modules object (__webpack_modules__)
32/******/ __webpack_require__.m = modules;
33
34/******/ // expose the module cache
35/******/ __webpack_require__.c = installedModules;
36
37/******/ // __webpack_public_path__
38/******/ __webpack_require__.p = "/";
39
40/******/ // Load entry module and return exports
41/******/ return __webpack_require__(0);
42/******/ })
43/************************************************************************/
44/******/ ([
45/* 0 */
46/***/ function(module, exports, __webpack_require__) {
47
48 "use strict";
49
50 var React = __webpack_require__(1);
51 var cx = __webpack_require__(2);
52
53 var api = __webpack_require__(3);
54
55 module.exports = React.createClass({
56 displayName: "exports",
57
58 componentWillMount: function componentWillMount() {
59 __webpack_require__(5);
60 },
61 componentDidMount: function componentDidMount() {
62 api.on("show", this.toggleTooltip);
63 api.on("hide", this.toggleTooltip);
64 window.addEventListener("mousemove", this.mouseMove, false);
65 },
66 componentWillUnmount: function componentWillUnmount() {
67 api.off("show", this.toggleTooltip);
68 api.off("hide", this.toggleTooltip);
69 window.removeEventListener("mousemove", this.mouseMove, false);
70 },
71 getInitialState: function getInitialState() {
72 return {
73 x: 0,
74 y: 0,
75 text: api.text
76 };
77 },
78 toggleTooltip: function toggleTooltip(text) {
79 this.setState({
80 text: text
81 });
82 },
83 mouseMove: function mouseMove(event) {
84 this.setState({
85 x: event.clientX,
86 y: event.clientY + 20
87 });
88 },
89 render: function render() {
90 return React.createElement(
91 "div",
92 { className: cx("component-tooltip", { show: this.state.text }), style: { left: this.state.x, top: this.state.y } },
93 this.state.text
94 );
95 }
96 });
97 module.exports.api = api;
98
99/***/ },
100/* 1 */
101/***/ function(module, exports) {
102
103 module.exports = require("react");
104
105/***/ },
106/* 2 */
107/***/ function(module, exports) {
108
109 module.exports = require("classnames");
110
111/***/ },
112/* 3 */
113/***/ function(module, exports, __webpack_require__) {
114
115 "use strict";
116
117 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; }; }();
118
119 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
120
121 var Events = __webpack_require__(4);
122
123 var TooltipApi = function () {
124 function TooltipApi() {
125 _classCallCheck(this, TooltipApi);
126
127 this.text = null;
128 }
129
130 _createClass(TooltipApi, [{
131 key: "showTooltip",
132 value: function showTooltip(text) {
133 this.text = text;
134 this.trigger("show", text);
135 }
136 }, {
137 key: "hideTooltip",
138 value: function hideTooltip() {
139 this.text = null;
140 this.trigger("hide");
141 }
142 }]);
143
144 return TooltipApi;
145 }();
146
147 var api = new TooltipApi();
148 Events.createEmitter(api);
149 module.exports = api;
150
151/***/ },
152/* 4 */
153/***/ function(module, exports) {
154
155 module.exports = require("ampersand-events");
156
157/***/ },
158/* 5 */
159/***/ function(module, exports, __webpack_require__) {
160
161 // style-loader: Adds some css to the DOM by adding a <style> tag
162
163 // load the styles
164 var content = __webpack_require__(6);
165 if(typeof content === 'string') content = [[module.id, content, '']];
166 // add the styles to the DOM
167 var update = __webpack_require__(8)(content, {});
168 if(content.locals) module.exports = content.locals;
169 // Hot Module Replacement
170 if(false) {
171 // When the styles change, update the <style> tags
172 if(!content.locals) {
173 module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/sass-loader/index.js!./style.scss", function() {
174 var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/sass-loader/index.js!./style.scss");
175 if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
176 update(newContent);
177 });
178 }
179 // When the module is disposed, remove the <style> tags
180 module.hot.dispose(function() { update(); });
181 }
182
183/***/ },
184/* 6 */
185/***/ function(module, exports, __webpack_require__) {
186
187 exports = module.exports = __webpack_require__(7)();
188 // imports
189
190
191 // module
192 exports.push([module.id, ".component-tooltip {\n height: 20px;\n position: fixed;\n padding: 5px 10px 0px;\n z-index: 5000;\n pointer-events: none;\n white-space: nowrap;\n background-color: white;\n color: #14083f;\n text-transform: uppercase;\n font-size: 10px;\n letter-spacing: 0.05em;\n box-shadow: 0px 0px 5px 4px rgba(0, 0, 0, 0.25);\n opacity: 0;\n transition: opacity 0.05s; }\n .component-tooltip.show {\n opacity: 1; }\n", ""]);
193
194 // exports
195
196
197/***/ },
198/* 7 */
199/***/ function(module, exports) {
200
201 /*
202 MIT License http://www.opensource.org/licenses/mit-license.php
203 Author Tobias Koppers @sokra
204 */
205 // css base code, injected by the css-loader
206 module.exports = function() {
207 var list = [];
208
209 // return the list of modules as css string
210 list.toString = function toString() {
211 var result = [];
212 for(var i = 0; i < this.length; i++) {
213 var item = this[i];
214 if(item[2]) {
215 result.push("@media " + item[2] + "{" + item[1] + "}");
216 } else {
217 result.push(item[1]);
218 }
219 }
220 return result.join("");
221 };
222
223 // import a list of modules into the list
224 list.i = function(modules, mediaQuery) {
225 if(typeof modules === "string")
226 modules = [[null, modules, ""]];
227 var alreadyImportedModules = {};
228 for(var i = 0; i < this.length; i++) {
229 var id = this[i][0];
230 if(typeof id === "number")
231 alreadyImportedModules[id] = true;
232 }
233 for(i = 0; i < modules.length; i++) {
234 var item = modules[i];
235 // skip already imported module
236 // this implementation is not 100% perfect for weird media query combinations
237 // when a module is imported multiple times with different media queries.
238 // I hope this will never occur (Hey this way we have smaller bundles)
239 if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
240 if(mediaQuery && !item[2]) {
241 item[2] = mediaQuery;
242 } else if(mediaQuery) {
243 item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
244 }
245 list.push(item);
246 }
247 }
248 };
249 return list;
250 };
251
252
253/***/ },
254/* 8 */
255/***/ function(module, exports, __webpack_require__) {
256
257 /*
258 MIT License http://www.opensource.org/licenses/mit-license.php
259 Author Tobias Koppers @sokra
260 */
261 var stylesInDom = {},
262 memoize = function(fn) {
263 var memo;
264 return function () {
265 if (typeof memo === "undefined") memo = fn.apply(this, arguments);
266 return memo;
267 };
268 },
269 isOldIE = memoize(function() {
270 return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
271 }),
272 getHeadElement = memoize(function () {
273 return document.head || document.getElementsByTagName("head")[0];
274 }),
275 singletonElement = null,
276 singletonCounter = 0,
277 styleElementsInsertedAtTop = [];
278
279 module.exports = function(list, options) {
280 if(false) {
281 if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
282 }
283
284 options = options || {};
285 // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
286 // tags it will allow on a page
287 if (typeof options.singleton === "undefined") options.singleton = isOldIE();
288
289 // By default, add <style> tags to the bottom of <head>.
290 if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
291
292 var styles = listToStyles(list);
293 addStylesToDom(styles, options);
294
295 return function update(newList) {
296 var mayRemove = [];
297 for(var i = 0; i < styles.length; i++) {
298 var item = styles[i];
299 var domStyle = stylesInDom[item.id];
300 domStyle.refs--;
301 mayRemove.push(domStyle);
302 }
303 if(newList) {
304 var newStyles = listToStyles(newList);
305 addStylesToDom(newStyles, options);
306 }
307 for(var i = 0; i < mayRemove.length; i++) {
308 var domStyle = mayRemove[i];
309 if(domStyle.refs === 0) {
310 for(var j = 0; j < domStyle.parts.length; j++)
311 domStyle.parts[j]();
312 delete stylesInDom[domStyle.id];
313 }
314 }
315 };
316 }
317
318 function addStylesToDom(styles, options) {
319 for(var i = 0; i < styles.length; i++) {
320 var item = styles[i];
321 var domStyle = stylesInDom[item.id];
322 if(domStyle) {
323 domStyle.refs++;
324 for(var j = 0; j < domStyle.parts.length; j++) {
325 domStyle.parts[j](item.parts[j]);
326 }
327 for(; j < item.parts.length; j++) {
328 domStyle.parts.push(addStyle(item.parts[j], options));
329 }
330 } else {
331 var parts = [];
332 for(var j = 0; j < item.parts.length; j++) {
333 parts.push(addStyle(item.parts[j], options));
334 }
335 stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
336 }
337 }
338 }
339
340 function listToStyles(list) {
341 var styles = [];
342 var newStyles = {};
343 for(var i = 0; i < list.length; i++) {
344 var item = list[i];
345 var id = item[0];
346 var css = item[1];
347 var media = item[2];
348 var sourceMap = item[3];
349 var part = {css: css, media: media, sourceMap: sourceMap};
350 if(!newStyles[id])
351 styles.push(newStyles[id] = {id: id, parts: [part]});
352 else
353 newStyles[id].parts.push(part);
354 }
355 return styles;
356 }
357
358 function insertStyleElement(options, styleElement) {
359 var head = getHeadElement();
360 var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
361 if (options.insertAt === "top") {
362 if(!lastStyleElementInsertedAtTop) {
363 head.insertBefore(styleElement, head.firstChild);
364 } else if(lastStyleElementInsertedAtTop.nextSibling) {
365 head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
366 } else {
367 head.appendChild(styleElement);
368 }
369 styleElementsInsertedAtTop.push(styleElement);
370 } else if (options.insertAt === "bottom") {
371 head.appendChild(styleElement);
372 } else {
373 throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
374 }
375 }
376
377 function removeStyleElement(styleElement) {
378 styleElement.parentNode.removeChild(styleElement);
379 var idx = styleElementsInsertedAtTop.indexOf(styleElement);
380 if(idx >= 0) {
381 styleElementsInsertedAtTop.splice(idx, 1);
382 }
383 }
384
385 function createStyleElement(options) {
386 var styleElement = document.createElement("style");
387 styleElement.type = "text/css";
388 insertStyleElement(options, styleElement);
389 return styleElement;
390 }
391
392 function createLinkElement(options) {
393 var linkElement = document.createElement("link");
394 linkElement.rel = "stylesheet";
395 insertStyleElement(options, linkElement);
396 return linkElement;
397 }
398
399 function addStyle(obj, options) {
400 var styleElement, update, remove;
401
402 if (options.singleton) {
403 var styleIndex = singletonCounter++;
404 styleElement = singletonElement || (singletonElement = createStyleElement(options));
405 update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
406 remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
407 } else if(obj.sourceMap &&
408 typeof URL === "function" &&
409 typeof URL.createObjectURL === "function" &&
410 typeof URL.revokeObjectURL === "function" &&
411 typeof Blob === "function" &&
412 typeof btoa === "function") {
413 styleElement = createLinkElement(options);
414 update = updateLink.bind(null, styleElement);
415 remove = function() {
416 removeStyleElement(styleElement);
417 if(styleElement.href)
418 URL.revokeObjectURL(styleElement.href);
419 };
420 } else {
421 styleElement = createStyleElement(options);
422 update = applyToTag.bind(null, styleElement);
423 remove = function() {
424 removeStyleElement(styleElement);
425 };
426 }
427
428 update(obj);
429
430 return function updateStyle(newObj) {
431 if(newObj) {
432 if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
433 return;
434 update(obj = newObj);
435 } else {
436 remove();
437 }
438 };
439 }
440
441 var replaceText = (function () {
442 var textStore = [];
443
444 return function (index, replacement) {
445 textStore[index] = replacement;
446 return textStore.filter(Boolean).join('\n');
447 };
448 })();
449
450 function applyToSingletonTag(styleElement, index, remove, obj) {
451 var css = remove ? "" : obj.css;
452
453 if (styleElement.styleSheet) {
454 styleElement.styleSheet.cssText = replaceText(index, css);
455 } else {
456 var cssNode = document.createTextNode(css);
457 var childNodes = styleElement.childNodes;
458 if (childNodes[index]) styleElement.removeChild(childNodes[index]);
459 if (childNodes.length) {
460 styleElement.insertBefore(cssNode, childNodes[index]);
461 } else {
462 styleElement.appendChild(cssNode);
463 }
464 }
465 }
466
467 function applyToTag(styleElement, obj) {
468 var css = obj.css;
469 var media = obj.media;
470
471 if(media) {
472 styleElement.setAttribute("media", media)
473 }
474
475 if(styleElement.styleSheet) {
476 styleElement.styleSheet.cssText = css;
477 } else {
478 while(styleElement.firstChild) {
479 styleElement.removeChild(styleElement.firstChild);
480 }
481 styleElement.appendChild(document.createTextNode(css));
482 }
483 }
484
485 function updateLink(linkElement, obj) {
486 var css = obj.css;
487 var sourceMap = obj.sourceMap;
488
489 if(sourceMap) {
490 // http://stackoverflow.com/a/26603875
491 css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
492 }
493
494 var blob = new Blob([css], { type: "text/css" });
495
496 var oldSrc = linkElement.href;
497
498 linkElement.href = URL.createObjectURL(blob);
499
500 if(oldSrc)
501 URL.revokeObjectURL(oldSrc);
502 }
503
504
505/***/ }
506/******/ ]);
\No newline at end of file