1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | (function webpackUniversalModuleDefinition(root, factory) {
|
9 | if(typeof exports === 'object' && typeof module === 'object')
|
10 | module.exports = factory();
|
11 | else if(typeof define === 'function' && define.amd)
|
12 | define("@material/radio", [], factory);
|
13 | else if(typeof exports === 'object')
|
14 | exports["radio"] = factory();
|
15 | else
|
16 | root["mdc"] = root["mdc"] || {}, root["mdc"]["radio"] = factory();
|
17 | })(this, function() {
|
18 | return (function(modules) {
|
19 |
|
20 | var installedModules = {};
|
21 |
|
22 |
|
23 | function __webpack_require__(moduleId) {
|
24 |
|
25 |
|
26 | if(installedModules[moduleId]) {
|
27 | return installedModules[moduleId].exports;
|
28 | }
|
29 |
|
30 | var module = installedModules[moduleId] = {
|
31 | i: moduleId,
|
32 | l: false,
|
33 | exports: {}
|
34 | };
|
35 |
|
36 |
|
37 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
38 |
|
39 |
|
40 | module.l = true;
|
41 |
|
42 |
|
43 | return module.exports;
|
44 | }
|
45 |
|
46 |
|
47 |
|
48 | __webpack_require__.m = modules;
|
49 |
|
50 |
|
51 | __webpack_require__.c = installedModules;
|
52 |
|
53 |
|
54 | __webpack_require__.d = function(exports, name, getter) {
|
55 | if(!__webpack_require__.o(exports, name)) {
|
56 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
57 | }
|
58 | };
|
59 |
|
60 |
|
61 | __webpack_require__.r = function(exports) {
|
62 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
63 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
64 | }
|
65 | Object.defineProperty(exports, '__esModule', { value: true });
|
66 | };
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | __webpack_require__.t = function(value, mode) {
|
74 | if(mode & 1) value = __webpack_require__(value);
|
75 | if(mode & 8) return value;
|
76 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
77 | var ns = Object.create(null);
|
78 | __webpack_require__.r(ns);
|
79 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
80 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
81 | return ns;
|
82 | };
|
83 |
|
84 |
|
85 | __webpack_require__.n = function(module) {
|
86 | var getter = module && module.__esModule ?
|
87 | function getDefault() { return module['default']; } :
|
88 | function getModuleExports() { return module; };
|
89 | __webpack_require__.d(getter, 'a', getter);
|
90 | return getter;
|
91 | };
|
92 |
|
93 |
|
94 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
95 |
|
96 |
|
97 | __webpack_require__.p = "";
|
98 |
|
99 |
|
100 |
|
101 | return __webpack_require__(__webpack_require__.s = "./packages/mdc-radio/index.ts");
|
102 | })
|
103 |
|
104 | ({
|
105 |
|
106 | "./packages/mdc-base/component.ts":
|
107 |
|
108 |
|
109 |
|
110 |
|
111 | (function(module, exports, __webpack_require__) {
|
112 |
|
113 | "use strict";
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 | var __read = this && this.__read || function (o, n) {
|
139 | var m = typeof Symbol === "function" && o[Symbol.iterator];
|
140 | if (!m) return o;
|
141 | var i = m.call(o),
|
142 | r,
|
143 | ar = [],
|
144 | e;
|
145 | try {
|
146 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
147 | ar.push(r.value);
|
148 | }
|
149 | } catch (error) {
|
150 | e = { error: error };
|
151 | } finally {
|
152 | try {
|
153 | if (r && !r.done && (m = i["return"])) m.call(i);
|
154 | } finally {
|
155 | if (e) throw e.error;
|
156 | }
|
157 | }
|
158 | return ar;
|
159 | };
|
160 | var __spreadArray = this && this.__spreadArray || function (to, from) {
|
161 | for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {
|
162 | to[j] = from[i];
|
163 | }return to;
|
164 | };
|
165 | Object.defineProperty(exports, "__esModule", { value: true });
|
166 | exports.MDCComponent = void 0;
|
167 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
168 | var MDCComponent = function () {
|
169 | function MDCComponent(root, foundation) {
|
170 | var args = [];
|
171 | for (var _i = 2; _i < arguments.length; _i++) {
|
172 | args[_i - 2] = arguments[_i];
|
173 | }
|
174 | this.root = root;
|
175 | this.initialize.apply(this, __spreadArray([], __read(args)));
|
176 |
|
177 |
|
178 |
|
179 | this.foundation = foundation === undefined ? this.getDefaultFoundation() : foundation;
|
180 | this.foundation.init();
|
181 | this.initialSyncWithDOM();
|
182 | }
|
183 | MDCComponent.attachTo = function (root) {
|
184 |
|
185 |
|
186 |
|
187 |
|
188 | return new MDCComponent(root, new foundation_1.MDCFoundation({}));
|
189 | };
|
190 |
|
191 | MDCComponent.prototype.initialize = function () {
|
192 | var _args = [];
|
193 | for (var _i = 0; _i < arguments.length; _i++) {
|
194 | _args[_i] = arguments[_i];
|
195 | }
|
196 |
|
197 |
|
198 |
|
199 | };
|
200 | MDCComponent.prototype.getDefaultFoundation = function () {
|
201 |
|
202 |
|
203 | throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class');
|
204 | };
|
205 | MDCComponent.prototype.initialSyncWithDOM = function () {
|
206 |
|
207 |
|
208 |
|
209 |
|
210 | };
|
211 | MDCComponent.prototype.destroy = function () {
|
212 |
|
213 |
|
214 | this.foundation.destroy();
|
215 | };
|
216 | MDCComponent.prototype.listen = function (evtType, handler, options) {
|
217 | this.root.addEventListener(evtType, handler, options);
|
218 | };
|
219 | MDCComponent.prototype.unlisten = function (evtType, handler, options) {
|
220 | this.root.removeEventListener(evtType, handler, options);
|
221 | };
|
222 | |
223 |
|
224 |
|
225 | MDCComponent.prototype.emit = function (evtType, evtData, shouldBubble) {
|
226 | if (shouldBubble === void 0) {
|
227 | shouldBubble = false;
|
228 | }
|
229 | var evt;
|
230 | if (typeof CustomEvent === 'function') {
|
231 | evt = new CustomEvent(evtType, {
|
232 | bubbles: shouldBubble,
|
233 | detail: evtData
|
234 | });
|
235 | } else {
|
236 | evt = document.createEvent('CustomEvent');
|
237 | evt.initCustomEvent(evtType, shouldBubble, false, evtData);
|
238 | }
|
239 | this.root.dispatchEvent(evt);
|
240 | };
|
241 | return MDCComponent;
|
242 | }();
|
243 | exports.MDCComponent = MDCComponent;
|
244 |
|
245 | exports.default = MDCComponent;
|
246 |
|
247 | }),
|
248 |
|
249 | "./packages/mdc-base/foundation.ts":
|
250 |
|
251 |
|
252 |
|
253 |
|
254 | (function(module, exports, __webpack_require__) {
|
255 |
|
256 | "use strict";
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 | Object.defineProperty(exports, "__esModule", { value: true });
|
282 | exports.MDCFoundation = void 0;
|
283 | var MDCFoundation = function () {
|
284 | function MDCFoundation(adapter) {
|
285 | if (adapter === void 0) {
|
286 | adapter = {};
|
287 | }
|
288 | this.adapter = adapter;
|
289 | }
|
290 | Object.defineProperty(MDCFoundation, "cssClasses", {
|
291 | get: function get() {
|
292 |
|
293 |
|
294 | return {};
|
295 | },
|
296 | enumerable: false,
|
297 | configurable: true
|
298 | });
|
299 | Object.defineProperty(MDCFoundation, "strings", {
|
300 | get: function get() {
|
301 |
|
302 |
|
303 | return {};
|
304 | },
|
305 | enumerable: false,
|
306 | configurable: true
|
307 | });
|
308 | Object.defineProperty(MDCFoundation, "numbers", {
|
309 | get: function get() {
|
310 |
|
311 |
|
312 | return {};
|
313 | },
|
314 | enumerable: false,
|
315 | configurable: true
|
316 | });
|
317 | Object.defineProperty(MDCFoundation, "defaultAdapter", {
|
318 | get: function get() {
|
319 |
|
320 |
|
321 |
|
322 | return {};
|
323 | },
|
324 | enumerable: false,
|
325 | configurable: true
|
326 | });
|
327 | MDCFoundation.prototype.init = function () {
|
328 |
|
329 | };
|
330 | MDCFoundation.prototype.destroy = function () {
|
331 |
|
332 | };
|
333 | return MDCFoundation;
|
334 | }();
|
335 | exports.MDCFoundation = MDCFoundation;
|
336 |
|
337 | exports.default = MDCFoundation;
|
338 |
|
339 | }),
|
340 |
|
341 | "./packages/mdc-dom/events.ts":
|
342 |
|
343 |
|
344 |
|
345 |
|
346 | (function(module, exports, __webpack_require__) {
|
347 |
|
348 | "use strict";
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 | Object.defineProperty(exports, "__esModule", { value: true });
|
374 | exports.applyPassive = void 0;
|
375 |
|
376 |
|
377 |
|
378 |
|
379 | function applyPassive(globalObj) {
|
380 | if (globalObj === void 0) {
|
381 | globalObj = window;
|
382 | }
|
383 | return supportsPassiveOption(globalObj) ? { passive: true } : false;
|
384 | }
|
385 | exports.applyPassive = applyPassive;
|
386 | function supportsPassiveOption(globalObj) {
|
387 | if (globalObj === void 0) {
|
388 | globalObj = window;
|
389 | }
|
390 |
|
391 |
|
392 | var passiveSupported = false;
|
393 | try {
|
394 | var options = {
|
395 |
|
396 |
|
397 | get passive() {
|
398 | passiveSupported = true;
|
399 | return false;
|
400 | }
|
401 | };
|
402 | var handler = function handler() {};
|
403 | globalObj.document.addEventListener('test', handler, options);
|
404 | globalObj.document.removeEventListener('test', handler, options);
|
405 | } catch (err) {
|
406 | passiveSupported = false;
|
407 | }
|
408 | return passiveSupported;
|
409 | }
|
410 |
|
411 | }),
|
412 |
|
413 | "./packages/mdc-dom/ponyfill.ts":
|
414 |
|
415 |
|
416 |
|
417 |
|
418 | (function(module, exports, __webpack_require__) {
|
419 |
|
420 | "use strict";
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 | Object.defineProperty(exports, "__esModule", { value: true });
|
446 | exports.estimateScrollWidth = exports.matches = exports.closest = void 0;
|
447 |
|
448 |
|
449 |
|
450 |
|
451 | function closest(element, selector) {
|
452 | if (element.closest) {
|
453 | return element.closest(selector);
|
454 | }
|
455 | var el = element;
|
456 | while (el) {
|
457 | if (matches(el, selector)) {
|
458 | return el;
|
459 | }
|
460 | el = el.parentElement;
|
461 | }
|
462 | return null;
|
463 | }
|
464 | exports.closest = closest;
|
465 | function matches(element, selector) {
|
466 | var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
|
467 | return nativeMatches.call(element, selector);
|
468 | }
|
469 | exports.matches = matches;
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 | function estimateScrollWidth(element) {
|
479 |
|
480 |
|
481 |
|
482 |
|
483 | var htmlEl = element;
|
484 | if (htmlEl.offsetParent !== null) {
|
485 | return htmlEl.scrollWidth;
|
486 | }
|
487 | var clone = htmlEl.cloneNode(true);
|
488 | clone.style.setProperty('position', 'absolute');
|
489 | clone.style.setProperty('transform', 'translate(-9999px, -9999px)');
|
490 | document.documentElement.appendChild(clone);
|
491 | var scrollWidth = clone.scrollWidth;
|
492 | document.documentElement.removeChild(clone);
|
493 | return scrollWidth;
|
494 | }
|
495 | exports.estimateScrollWidth = estimateScrollWidth;
|
496 |
|
497 | }),
|
498 |
|
499 | "./packages/mdc-radio/adapter.ts":
|
500 |
|
501 |
|
502 |
|
503 |
|
504 | (function(module, exports, __webpack_require__) {
|
505 |
|
506 | "use strict";
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 | Object.defineProperty(exports, "__esModule", { value: true });
|
532 |
|
533 | }),
|
534 |
|
535 | "./packages/mdc-radio/component.ts":
|
536 |
|
537 |
|
538 |
|
539 |
|
540 | (function(module, exports, __webpack_require__) {
|
541 |
|
542 | "use strict";
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 | var __extends = this && this.__extends || function () {
|
568 | var _extendStatics = function extendStatics(d, b) {
|
569 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
570 | d.__proto__ = b;
|
571 | } || function (d, b) {
|
572 | for (var p in b) {
|
573 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
574 | }
|
575 | };
|
576 | return _extendStatics(d, b);
|
577 | };
|
578 | return function (d, b) {
|
579 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
580 | _extendStatics(d, b);
|
581 | function __() {
|
582 | this.constructor = d;
|
583 | }
|
584 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
585 | };
|
586 | }();
|
587 | var __assign = this && this.__assign || function () {
|
588 | __assign = Object.assign || function (t) {
|
589 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
590 | s = arguments[i];
|
591 | for (var p in s) {
|
592 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
593 | }
|
594 | }
|
595 | return t;
|
596 | };
|
597 | return __assign.apply(this, arguments);
|
598 | };
|
599 | Object.defineProperty(exports, "__esModule", { value: true });
|
600 | exports.MDCRadio = void 0;
|
601 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
602 | var events_1 = __webpack_require__( "./packages/mdc-dom/events.ts");
|
603 | var component_2 = __webpack_require__( "./packages/mdc-ripple/component.ts");
|
604 | var foundation_1 = __webpack_require__( "./packages/mdc-ripple/foundation.ts");
|
605 | var foundation_2 = __webpack_require__( "./packages/mdc-radio/foundation.ts");
|
606 | var MDCRadio = function (_super) {
|
607 | __extends(MDCRadio, _super);
|
608 | function MDCRadio() {
|
609 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
610 | _this.rippleSurface = _this.createRipple();
|
611 | return _this;
|
612 | }
|
613 | MDCRadio.attachTo = function (root) {
|
614 | return new MDCRadio(root);
|
615 | };
|
616 | Object.defineProperty(MDCRadio.prototype, "checked", {
|
617 | get: function get() {
|
618 | return this.nativeControl.checked;
|
619 | },
|
620 | set: function set(checked) {
|
621 | this.nativeControl.checked = checked;
|
622 | },
|
623 | enumerable: false,
|
624 | configurable: true
|
625 | });
|
626 | Object.defineProperty(MDCRadio.prototype, "disabled", {
|
627 | get: function get() {
|
628 | return this.nativeControl.disabled;
|
629 | },
|
630 | set: function set(disabled) {
|
631 | this.foundation.setDisabled(disabled);
|
632 | },
|
633 | enumerable: false,
|
634 | configurable: true
|
635 | });
|
636 | Object.defineProperty(MDCRadio.prototype, "value", {
|
637 | get: function get() {
|
638 | return this.nativeControl.value;
|
639 | },
|
640 | set: function set(value) {
|
641 | this.nativeControl.value = value;
|
642 | },
|
643 | enumerable: false,
|
644 | configurable: true
|
645 | });
|
646 | Object.defineProperty(MDCRadio.prototype, "ripple", {
|
647 | get: function get() {
|
648 | return this.rippleSurface;
|
649 | },
|
650 | enumerable: false,
|
651 | configurable: true
|
652 | });
|
653 | MDCRadio.prototype.destroy = function () {
|
654 | this.rippleSurface.destroy();
|
655 | _super.prototype.destroy.call(this);
|
656 | };
|
657 | MDCRadio.prototype.getDefaultFoundation = function () {
|
658 | var _this = this;
|
659 |
|
660 |
|
661 | var adapter = {
|
662 | addClass: function addClass(className) {
|
663 | return _this.root.classList.add(className);
|
664 | },
|
665 | removeClass: function removeClass(className) {
|
666 | return _this.root.classList.remove(className);
|
667 | },
|
668 | setNativeControlDisabled: function setNativeControlDisabled(disabled) {
|
669 | return _this.nativeControl.disabled = disabled;
|
670 | }
|
671 | };
|
672 | return new foundation_2.MDCRadioFoundation(adapter);
|
673 | };
|
674 | MDCRadio.prototype.createRipple = function () {
|
675 | var _this = this;
|
676 |
|
677 |
|
678 |
|
679 | var adapter = __assign(__assign({}, component_2.MDCRipple.createAdapter(this)), { registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
680 | _this.nativeControl.addEventListener(evtType, handler, events_1.applyPassive());
|
681 | }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
682 | _this.nativeControl.removeEventListener(evtType, handler, events_1.applyPassive());
|
683 | },
|
684 |
|
685 |
|
686 | isSurfaceActive: function isSurfaceActive() {
|
687 | return false;
|
688 | }, isUnbounded: function isUnbounded() {
|
689 | return true;
|
690 | } });
|
691 |
|
692 | return new component_2.MDCRipple(this.root, new foundation_1.MDCRippleFoundation(adapter));
|
693 | };
|
694 | Object.defineProperty(MDCRadio.prototype, "nativeControl", {
|
695 | get: function get() {
|
696 | var NATIVE_CONTROL_SELECTOR = foundation_2.MDCRadioFoundation.strings.NATIVE_CONTROL_SELECTOR;
|
697 | var el = this.root.querySelector(NATIVE_CONTROL_SELECTOR);
|
698 | if (!el) {
|
699 | throw new Error("Radio component requires a " + NATIVE_CONTROL_SELECTOR + " element");
|
700 | }
|
701 | return el;
|
702 | },
|
703 | enumerable: false,
|
704 | configurable: true
|
705 | });
|
706 | return MDCRadio;
|
707 | }(component_1.MDCComponent);
|
708 | exports.MDCRadio = MDCRadio;
|
709 |
|
710 | }),
|
711 |
|
712 | "./packages/mdc-radio/constants.ts":
|
713 |
|
714 |
|
715 |
|
716 |
|
717 | (function(module, exports, __webpack_require__) {
|
718 |
|
719 | "use strict";
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 |
|
742 |
|
743 |
|
744 | Object.defineProperty(exports, "__esModule", { value: true });
|
745 | exports.cssClasses = exports.strings = void 0;
|
746 | var strings = {
|
747 | NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control'
|
748 | };
|
749 | exports.strings = strings;
|
750 | var cssClasses = {
|
751 | DISABLED: 'mdc-radio--disabled',
|
752 | ROOT: 'mdc-radio'
|
753 | };
|
754 | exports.cssClasses = cssClasses;
|
755 |
|
756 | }),
|
757 |
|
758 | "./packages/mdc-radio/foundation.ts":
|
759 |
|
760 |
|
761 |
|
762 |
|
763 | (function(module, exports, __webpack_require__) {
|
764 |
|
765 | "use strict";
|
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 |
|
786 |
|
787 |
|
788 |
|
789 |
|
790 | var __extends = this && this.__extends || function () {
|
791 | var _extendStatics = function extendStatics(d, b) {
|
792 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
793 | d.__proto__ = b;
|
794 | } || function (d, b) {
|
795 | for (var p in b) {
|
796 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
797 | }
|
798 | };
|
799 | return _extendStatics(d, b);
|
800 | };
|
801 | return function (d, b) {
|
802 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
803 | _extendStatics(d, b);
|
804 | function __() {
|
805 | this.constructor = d;
|
806 | }
|
807 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
808 | };
|
809 | }();
|
810 | var __assign = this && this.__assign || function () {
|
811 | __assign = Object.assign || function (t) {
|
812 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
813 | s = arguments[i];
|
814 | for (var p in s) {
|
815 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
816 | }
|
817 | }
|
818 | return t;
|
819 | };
|
820 | return __assign.apply(this, arguments);
|
821 | };
|
822 | Object.defineProperty(exports, "__esModule", { value: true });
|
823 | exports.MDCRadioFoundation = void 0;
|
824 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
825 | var constants_1 = __webpack_require__( "./packages/mdc-radio/constants.ts");
|
826 | var MDCRadioFoundation = function (_super) {
|
827 | __extends(MDCRadioFoundation, _super);
|
828 | function MDCRadioFoundation(adapter) {
|
829 | return _super.call(this, __assign(__assign({}, MDCRadioFoundation.defaultAdapter), adapter)) || this;
|
830 | }
|
831 | Object.defineProperty(MDCRadioFoundation, "cssClasses", {
|
832 | get: function get() {
|
833 | return constants_1.cssClasses;
|
834 | },
|
835 | enumerable: false,
|
836 | configurable: true
|
837 | });
|
838 | Object.defineProperty(MDCRadioFoundation, "strings", {
|
839 | get: function get() {
|
840 | return constants_1.strings;
|
841 | },
|
842 | enumerable: false,
|
843 | configurable: true
|
844 | });
|
845 | Object.defineProperty(MDCRadioFoundation, "defaultAdapter", {
|
846 | get: function get() {
|
847 | return {
|
848 | addClass: function addClass() {
|
849 | return undefined;
|
850 | },
|
851 | removeClass: function removeClass() {
|
852 | return undefined;
|
853 | },
|
854 | setNativeControlDisabled: function setNativeControlDisabled() {
|
855 | return undefined;
|
856 | }
|
857 | };
|
858 | },
|
859 | enumerable: false,
|
860 | configurable: true
|
861 | });
|
862 | MDCRadioFoundation.prototype.setDisabled = function (disabled) {
|
863 | var DISABLED = MDCRadioFoundation.cssClasses.DISABLED;
|
864 | this.adapter.setNativeControlDisabled(disabled);
|
865 | if (disabled) {
|
866 | this.adapter.addClass(DISABLED);
|
867 | } else {
|
868 | this.adapter.removeClass(DISABLED);
|
869 | }
|
870 | };
|
871 | return MDCRadioFoundation;
|
872 | }(foundation_1.MDCFoundation);
|
873 | exports.MDCRadioFoundation = MDCRadioFoundation;
|
874 |
|
875 | exports.default = MDCRadioFoundation;
|
876 |
|
877 | }),
|
878 |
|
879 | "./packages/mdc-radio/index.ts":
|
880 |
|
881 |
|
882 |
|
883 |
|
884 | (function(module, exports, __webpack_require__) {
|
885 |
|
886 | "use strict";
|
887 |
|
888 |
|
889 |
|
890 |
|
891 |
|
892 |
|
893 |
|
894 |
|
895 |
|
896 |
|
897 |
|
898 |
|
899 |
|
900 |
|
901 |
|
902 |
|
903 |
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 | var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
912 | if (k2 === undefined) k2 = k;
|
913 | Object.defineProperty(o, k2, { enumerable: true, get: function get() {
|
914 | return m[k];
|
915 | } });
|
916 | } : function (o, m, k, k2) {
|
917 | if (k2 === undefined) k2 = k;
|
918 | o[k2] = m[k];
|
919 | });
|
920 | var __exportStar = this && this.__exportStar || function (m, exports) {
|
921 | for (var p in m) {
|
922 | if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
923 | }
|
924 | };
|
925 | Object.defineProperty(exports, "__esModule", { value: true });
|
926 | __exportStar(__webpack_require__( "./packages/mdc-radio/adapter.ts"), exports);
|
927 | __exportStar(__webpack_require__( "./packages/mdc-radio/component.ts"), exports);
|
928 | __exportStar(__webpack_require__( "./packages/mdc-radio/constants.ts"), exports);
|
929 | __exportStar(__webpack_require__( "./packages/mdc-radio/foundation.ts"), exports);
|
930 |
|
931 | }),
|
932 |
|
933 | "./packages/mdc-ripple/component.ts":
|
934 |
|
935 |
|
936 |
|
937 |
|
938 | (function(module, exports, __webpack_require__) {
|
939 |
|
940 | "use strict";
|
941 |
|
942 |
|
943 |
|
944 |
|
945 |
|
946 |
|
947 |
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 | var __extends = this && this.__extends || function () {
|
966 | var _extendStatics = function extendStatics(d, b) {
|
967 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
968 | d.__proto__ = b;
|
969 | } || function (d, b) {
|
970 | for (var p in b) {
|
971 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
972 | }
|
973 | };
|
974 | return _extendStatics(d, b);
|
975 | };
|
976 | return function (d, b) {
|
977 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
978 | _extendStatics(d, b);
|
979 | function __() {
|
980 | this.constructor = d;
|
981 | }
|
982 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
983 | };
|
984 | }();
|
985 | var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
986 | if (k2 === undefined) k2 = k;
|
987 | Object.defineProperty(o, k2, { enumerable: true, get: function get() {
|
988 | return m[k];
|
989 | } });
|
990 | } : function (o, m, k, k2) {
|
991 | if (k2 === undefined) k2 = k;
|
992 | o[k2] = m[k];
|
993 | });
|
994 | var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
995 | Object.defineProperty(o, "default", { enumerable: true, value: v });
|
996 | } : function (o, v) {
|
997 | o["default"] = v;
|
998 | });
|
999 | var __importStar = this && this.__importStar || function (mod) {
|
1000 | if (mod && mod.__esModule) return mod;
|
1001 | var result = {};
|
1002 | if (mod != null) for (var k in mod) {
|
1003 | if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
1004 | }__setModuleDefault(result, mod);
|
1005 | return result;
|
1006 | };
|
1007 | Object.defineProperty(exports, "__esModule", { value: true });
|
1008 | exports.MDCRipple = void 0;
|
1009 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
1010 | var events_1 = __webpack_require__( "./packages/mdc-dom/events.ts");
|
1011 | var ponyfill_1 = __webpack_require__( "./packages/mdc-dom/ponyfill.ts");
|
1012 | var foundation_1 = __webpack_require__( "./packages/mdc-ripple/foundation.ts");
|
1013 | var util = __importStar(__webpack_require__( "./packages/mdc-ripple/util.ts"));
|
1014 | var MDCRipple = function (_super) {
|
1015 | __extends(MDCRipple, _super);
|
1016 | function MDCRipple() {
|
1017 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
1018 | _this.disabled = false;
|
1019 | return _this;
|
1020 | }
|
1021 | MDCRipple.attachTo = function (root, opts) {
|
1022 | if (opts === void 0) {
|
1023 | opts = {
|
1024 | isUnbounded: undefined
|
1025 | };
|
1026 | }
|
1027 | var ripple = new MDCRipple(root);
|
1028 |
|
1029 | if (opts.isUnbounded !== undefined) {
|
1030 | ripple.unbounded = opts.isUnbounded;
|
1031 | }
|
1032 | return ripple;
|
1033 | };
|
1034 | MDCRipple.createAdapter = function (instance) {
|
1035 | return {
|
1036 | addClass: function addClass(className) {
|
1037 | return instance.root.classList.add(className);
|
1038 | },
|
1039 | browserSupportsCssVars: function browserSupportsCssVars() {
|
1040 | return util.supportsCssVariables(window);
|
1041 | },
|
1042 | computeBoundingRect: function computeBoundingRect() {
|
1043 | return instance.root.getBoundingClientRect();
|
1044 | },
|
1045 | containsEventTarget: function containsEventTarget(target) {
|
1046 | return instance.root.contains(target);
|
1047 | },
|
1048 | deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) {
|
1049 | return document.documentElement.removeEventListener(evtType, handler, events_1.applyPassive());
|
1050 | },
|
1051 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
1052 | return instance.root.removeEventListener(evtType, handler, events_1.applyPassive());
|
1053 | },
|
1054 | deregisterResizeHandler: function deregisterResizeHandler(handler) {
|
1055 | return window.removeEventListener('resize', handler);
|
1056 | },
|
1057 | getWindowPageOffset: function getWindowPageOffset() {
|
1058 | return { x: window.pageXOffset, y: window.pageYOffset };
|
1059 | },
|
1060 | isSurfaceActive: function isSurfaceActive() {
|
1061 | return ponyfill_1.matches(instance.root, ':active');
|
1062 | },
|
1063 | isSurfaceDisabled: function isSurfaceDisabled() {
|
1064 | return Boolean(instance.disabled);
|
1065 | },
|
1066 | isUnbounded: function isUnbounded() {
|
1067 | return Boolean(instance.unbounded);
|
1068 | },
|
1069 | registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) {
|
1070 | return document.documentElement.addEventListener(evtType, handler, events_1.applyPassive());
|
1071 | },
|
1072 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
1073 | return instance.root.addEventListener(evtType, handler, events_1.applyPassive());
|
1074 | },
|
1075 | registerResizeHandler: function registerResizeHandler(handler) {
|
1076 | return window.addEventListener('resize', handler);
|
1077 | },
|
1078 | removeClass: function removeClass(className) {
|
1079 | return instance.root.classList.remove(className);
|
1080 | },
|
1081 | updateCssVariable: function updateCssVariable(varName, value) {
|
1082 | return instance.root.style.setProperty(varName, value);
|
1083 | }
|
1084 | };
|
1085 | };
|
1086 | Object.defineProperty(MDCRipple.prototype, "unbounded", {
|
1087 | get: function get() {
|
1088 | return Boolean(this.isUnbounded);
|
1089 | },
|
1090 | set: function set(unbounded) {
|
1091 | this.isUnbounded = Boolean(unbounded);
|
1092 | this.setUnbounded();
|
1093 | },
|
1094 | enumerable: false,
|
1095 | configurable: true
|
1096 | });
|
1097 | MDCRipple.prototype.activate = function () {
|
1098 | this.foundation.activate();
|
1099 | };
|
1100 | MDCRipple.prototype.deactivate = function () {
|
1101 | this.foundation.deactivate();
|
1102 | };
|
1103 | MDCRipple.prototype.layout = function () {
|
1104 | this.foundation.layout();
|
1105 | };
|
1106 | MDCRipple.prototype.getDefaultFoundation = function () {
|
1107 | return new foundation_1.MDCRippleFoundation(MDCRipple.createAdapter(this));
|
1108 | };
|
1109 | MDCRipple.prototype.initialSyncWithDOM = function () {
|
1110 | var root = this.root;
|
1111 | this.isUnbounded = 'mdcRippleIsUnbounded' in root.dataset;
|
1112 | };
|
1113 | |
1114 |
|
1115 |
|
1116 |
|
1117 |
|
1118 |
|
1119 | MDCRipple.prototype.setUnbounded = function () {
|
1120 | this.foundation.setUnbounded(Boolean(this.isUnbounded));
|
1121 | };
|
1122 | return MDCRipple;
|
1123 | }(component_1.MDCComponent);
|
1124 | exports.MDCRipple = MDCRipple;
|
1125 |
|
1126 | }),
|
1127 |
|
1128 | "./packages/mdc-ripple/constants.ts":
|
1129 |
|
1130 |
|
1131 |
|
1132 |
|
1133 | (function(module, exports, __webpack_require__) {
|
1134 |
|
1135 | "use strict";
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
|
1149 |
|
1150 |
|
1151 |
|
1152 |
|
1153 |
|
1154 |
|
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 | Object.defineProperty(exports, "__esModule", { value: true });
|
1161 | exports.numbers = exports.strings = exports.cssClasses = void 0;
|
1162 | exports.cssClasses = {
|
1163 |
|
1164 |
|
1165 |
|
1166 | BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',
|
1167 | FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',
|
1168 | FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation',
|
1169 | ROOT: 'mdc-ripple-upgraded',
|
1170 | UNBOUNDED: 'mdc-ripple-upgraded--unbounded'
|
1171 | };
|
1172 | exports.strings = {
|
1173 | VAR_FG_SCALE: '--mdc-ripple-fg-scale',
|
1174 | VAR_FG_SIZE: '--mdc-ripple-fg-size',
|
1175 | VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end',
|
1176 | VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',
|
1177 | VAR_LEFT: '--mdc-ripple-left',
|
1178 | VAR_TOP: '--mdc-ripple-top'
|
1179 | };
|
1180 | exports.numbers = {
|
1181 | DEACTIVATION_TIMEOUT_MS: 225,
|
1182 | FG_DEACTIVATION_MS: 150,
|
1183 | INITIAL_ORIGIN_SCALE: 0.6,
|
1184 | PADDING: 10,
|
1185 | TAP_DELAY_MS: 300 };
|
1186 |
|
1187 | }),
|
1188 |
|
1189 | "./packages/mdc-ripple/foundation.ts":
|
1190 |
|
1191 |
|
1192 |
|
1193 |
|
1194 | (function(module, exports, __webpack_require__) {
|
1195 |
|
1196 | "use strict";
|
1197 |
|
1198 |
|
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 | var __extends = this && this.__extends || function () {
|
1222 | var _extendStatics = function extendStatics(d, b) {
|
1223 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
1224 | d.__proto__ = b;
|
1225 | } || function (d, b) {
|
1226 | for (var p in b) {
|
1227 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
1228 | }
|
1229 | };
|
1230 | return _extendStatics(d, b);
|
1231 | };
|
1232 | return function (d, b) {
|
1233 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
1234 | _extendStatics(d, b);
|
1235 | function __() {
|
1236 | this.constructor = d;
|
1237 | }
|
1238 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
1239 | };
|
1240 | }();
|
1241 | var __assign = this && this.__assign || function () {
|
1242 | __assign = Object.assign || function (t) {
|
1243 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
1244 | s = arguments[i];
|
1245 | for (var p in s) {
|
1246 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
1247 | }
|
1248 | }
|
1249 | return t;
|
1250 | };
|
1251 | return __assign.apply(this, arguments);
|
1252 | };
|
1253 | var __values = this && this.__values || function (o) {
|
1254 | var s = typeof Symbol === "function" && Symbol.iterator,
|
1255 | m = s && o[s],
|
1256 | i = 0;
|
1257 | if (m) return m.call(o);
|
1258 | if (o && typeof o.length === "number") return {
|
1259 | next: function next() {
|
1260 | if (o && i >= o.length) o = void 0;
|
1261 | return { value: o && o[i++], done: !o };
|
1262 | }
|
1263 | };
|
1264 | throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
1265 | };
|
1266 | Object.defineProperty(exports, "__esModule", { value: true });
|
1267 | exports.MDCRippleFoundation = void 0;
|
1268 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
1269 | var constants_1 = __webpack_require__( "./packages/mdc-ripple/constants.ts");
|
1270 | var util_1 = __webpack_require__( "./packages/mdc-ripple/util.ts");
|
1271 |
|
1272 | var ACTIVATION_EVENT_TYPES = ['touchstart', 'pointerdown', 'mousedown', 'keydown'];
|
1273 |
|
1274 | var POINTER_DEACTIVATION_EVENT_TYPES = ['touchend', 'pointerup', 'mouseup', 'contextmenu'];
|
1275 |
|
1276 | var activatedTargets = [];
|
1277 | var MDCRippleFoundation = function (_super) {
|
1278 | __extends(MDCRippleFoundation, _super);
|
1279 | function MDCRippleFoundation(adapter) {
|
1280 | var _this = _super.call(this, __assign(__assign({}, MDCRippleFoundation.defaultAdapter), adapter)) || this;
|
1281 | _this.activationAnimationHasEnded = false;
|
1282 | _this.activationTimer = 0;
|
1283 | _this.fgDeactivationRemovalTimer = 0;
|
1284 | _this.fgScale = '0';
|
1285 | _this.frame = { width: 0, height: 0 };
|
1286 | _this.initialSize = 0;
|
1287 | _this.layoutFrame = 0;
|
1288 | _this.maxRadius = 0;
|
1289 | _this.unboundedCoords = { left: 0, top: 0 };
|
1290 | _this.activationState = _this.defaultActivationState();
|
1291 | _this.activationTimerCallback = function () {
|
1292 | _this.activationAnimationHasEnded = true;
|
1293 | _this.runDeactivationUXLogicIfReady();
|
1294 | };
|
1295 | _this.activateHandler = function (e) {
|
1296 | _this.activateImpl(e);
|
1297 | };
|
1298 | _this.deactivateHandler = function () {
|
1299 | _this.deactivateImpl();
|
1300 | };
|
1301 | _this.focusHandler = function () {
|
1302 | _this.handleFocus();
|
1303 | };
|
1304 | _this.blurHandler = function () {
|
1305 | _this.handleBlur();
|
1306 | };
|
1307 | _this.resizeHandler = function () {
|
1308 | _this.layout();
|
1309 | };
|
1310 | return _this;
|
1311 | }
|
1312 | Object.defineProperty(MDCRippleFoundation, "cssClasses", {
|
1313 | get: function get() {
|
1314 | return constants_1.cssClasses;
|
1315 | },
|
1316 | enumerable: false,
|
1317 | configurable: true
|
1318 | });
|
1319 | Object.defineProperty(MDCRippleFoundation, "strings", {
|
1320 | get: function get() {
|
1321 | return constants_1.strings;
|
1322 | },
|
1323 | enumerable: false,
|
1324 | configurable: true
|
1325 | });
|
1326 | Object.defineProperty(MDCRippleFoundation, "numbers", {
|
1327 | get: function get() {
|
1328 | return constants_1.numbers;
|
1329 | },
|
1330 | enumerable: false,
|
1331 | configurable: true
|
1332 | });
|
1333 | Object.defineProperty(MDCRippleFoundation, "defaultAdapter", {
|
1334 | get: function get() {
|
1335 | return {
|
1336 | addClass: function addClass() {
|
1337 | return undefined;
|
1338 | },
|
1339 | browserSupportsCssVars: function browserSupportsCssVars() {
|
1340 | return true;
|
1341 | },
|
1342 | computeBoundingRect: function computeBoundingRect() {
|
1343 | return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 };
|
1344 | },
|
1345 | containsEventTarget: function containsEventTarget() {
|
1346 | return true;
|
1347 | },
|
1348 | deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() {
|
1349 | return undefined;
|
1350 | },
|
1351 | deregisterInteractionHandler: function deregisterInteractionHandler() {
|
1352 | return undefined;
|
1353 | },
|
1354 | deregisterResizeHandler: function deregisterResizeHandler() {
|
1355 | return undefined;
|
1356 | },
|
1357 | getWindowPageOffset: function getWindowPageOffset() {
|
1358 | return { x: 0, y: 0 };
|
1359 | },
|
1360 | isSurfaceActive: function isSurfaceActive() {
|
1361 | return true;
|
1362 | },
|
1363 | isSurfaceDisabled: function isSurfaceDisabled() {
|
1364 | return true;
|
1365 | },
|
1366 | isUnbounded: function isUnbounded() {
|
1367 | return true;
|
1368 | },
|
1369 | registerDocumentInteractionHandler: function registerDocumentInteractionHandler() {
|
1370 | return undefined;
|
1371 | },
|
1372 | registerInteractionHandler: function registerInteractionHandler() {
|
1373 | return undefined;
|
1374 | },
|
1375 | registerResizeHandler: function registerResizeHandler() {
|
1376 | return undefined;
|
1377 | },
|
1378 | removeClass: function removeClass() {
|
1379 | return undefined;
|
1380 | },
|
1381 | updateCssVariable: function updateCssVariable() {
|
1382 | return undefined;
|
1383 | }
|
1384 | };
|
1385 | },
|
1386 | enumerable: false,
|
1387 | configurable: true
|
1388 | });
|
1389 | MDCRippleFoundation.prototype.init = function () {
|
1390 | var _this = this;
|
1391 | var supportsPressRipple = this.supportsPressRipple();
|
1392 | this.registerRootHandlers(supportsPressRipple);
|
1393 | if (supportsPressRipple) {
|
1394 | var _a = MDCRippleFoundation.cssClasses,
|
1395 | ROOT_1 = _a.ROOT,
|
1396 | UNBOUNDED_1 = _a.UNBOUNDED;
|
1397 | requestAnimationFrame(function () {
|
1398 | _this.adapter.addClass(ROOT_1);
|
1399 | if (_this.adapter.isUnbounded()) {
|
1400 | _this.adapter.addClass(UNBOUNDED_1);
|
1401 |
|
1402 | _this.layoutInternal();
|
1403 | }
|
1404 | });
|
1405 | }
|
1406 | };
|
1407 | MDCRippleFoundation.prototype.destroy = function () {
|
1408 | var _this = this;
|
1409 | if (this.supportsPressRipple()) {
|
1410 | if (this.activationTimer) {
|
1411 | clearTimeout(this.activationTimer);
|
1412 | this.activationTimer = 0;
|
1413 | this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);
|
1414 | }
|
1415 | if (this.fgDeactivationRemovalTimer) {
|
1416 | clearTimeout(this.fgDeactivationRemovalTimer);
|
1417 | this.fgDeactivationRemovalTimer = 0;
|
1418 | this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);
|
1419 | }
|
1420 | var _a = MDCRippleFoundation.cssClasses,
|
1421 | ROOT_2 = _a.ROOT,
|
1422 | UNBOUNDED_2 = _a.UNBOUNDED;
|
1423 | requestAnimationFrame(function () {
|
1424 | _this.adapter.removeClass(ROOT_2);
|
1425 | _this.adapter.removeClass(UNBOUNDED_2);
|
1426 | _this.removeCssVars();
|
1427 | });
|
1428 | }
|
1429 | this.deregisterRootHandlers();
|
1430 | this.deregisterDeactivationHandlers();
|
1431 | };
|
1432 | |
1433 |
|
1434 |
|
1435 | MDCRippleFoundation.prototype.activate = function (evt) {
|
1436 | this.activateImpl(evt);
|
1437 | };
|
1438 | MDCRippleFoundation.prototype.deactivate = function () {
|
1439 | this.deactivateImpl();
|
1440 | };
|
1441 | MDCRippleFoundation.prototype.layout = function () {
|
1442 | var _this = this;
|
1443 | if (this.layoutFrame) {
|
1444 | cancelAnimationFrame(this.layoutFrame);
|
1445 | }
|
1446 | this.layoutFrame = requestAnimationFrame(function () {
|
1447 | _this.layoutInternal();
|
1448 | _this.layoutFrame = 0;
|
1449 | });
|
1450 | };
|
1451 | MDCRippleFoundation.prototype.setUnbounded = function (unbounded) {
|
1452 | var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;
|
1453 | if (unbounded) {
|
1454 | this.adapter.addClass(UNBOUNDED);
|
1455 | } else {
|
1456 | this.adapter.removeClass(UNBOUNDED);
|
1457 | }
|
1458 | };
|
1459 | MDCRippleFoundation.prototype.handleFocus = function () {
|
1460 | var _this = this;
|
1461 | requestAnimationFrame(function () {
|
1462 | return _this.adapter.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
|
1463 | });
|
1464 | };
|
1465 | MDCRippleFoundation.prototype.handleBlur = function () {
|
1466 | var _this = this;
|
1467 | requestAnimationFrame(function () {
|
1468 | return _this.adapter.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
|
1469 | });
|
1470 | };
|
1471 | |
1472 |
|
1473 |
|
1474 |
|
1475 |
|
1476 |
|
1477 | MDCRippleFoundation.prototype.supportsPressRipple = function () {
|
1478 | return this.adapter.browserSupportsCssVars();
|
1479 | };
|
1480 | MDCRippleFoundation.prototype.defaultActivationState = function () {
|
1481 | return {
|
1482 | activationEvent: undefined,
|
1483 | hasDeactivationUXRun: false,
|
1484 | isActivated: false,
|
1485 | isProgrammatic: false,
|
1486 | wasActivatedByPointer: false,
|
1487 | wasElementMadeActive: false
|
1488 | };
|
1489 | };
|
1490 | |
1491 |
|
1492 |
|
1493 | MDCRippleFoundation.prototype.registerRootHandlers = function (supportsPressRipple) {
|
1494 | var e_1, _a;
|
1495 | if (supportsPressRipple) {
|
1496 | try {
|
1497 | for (var ACTIVATION_EVENT_TYPES_1 = __values(ACTIVATION_EVENT_TYPES), ACTIVATION_EVENT_TYPES_1_1 = ACTIVATION_EVENT_TYPES_1.next(); !ACTIVATION_EVENT_TYPES_1_1.done; ACTIVATION_EVENT_TYPES_1_1 = ACTIVATION_EVENT_TYPES_1.next()) {
|
1498 | var evtType = ACTIVATION_EVENT_TYPES_1_1.value;
|
1499 | this.adapter.registerInteractionHandler(evtType, this.activateHandler);
|
1500 | }
|
1501 | } catch (e_1_1) {
|
1502 | e_1 = { error: e_1_1 };
|
1503 | } finally {
|
1504 | try {
|
1505 | if (ACTIVATION_EVENT_TYPES_1_1 && !ACTIVATION_EVENT_TYPES_1_1.done && (_a = ACTIVATION_EVENT_TYPES_1.return)) _a.call(ACTIVATION_EVENT_TYPES_1);
|
1506 | } finally {
|
1507 | if (e_1) throw e_1.error;
|
1508 | }
|
1509 | }
|
1510 | if (this.adapter.isUnbounded()) {
|
1511 | this.adapter.registerResizeHandler(this.resizeHandler);
|
1512 | }
|
1513 | }
|
1514 | this.adapter.registerInteractionHandler('focus', this.focusHandler);
|
1515 | this.adapter.registerInteractionHandler('blur', this.blurHandler);
|
1516 | };
|
1517 | MDCRippleFoundation.prototype.registerDeactivationHandlers = function (evt) {
|
1518 | var e_2, _a;
|
1519 | if (evt.type === 'keydown') {
|
1520 | this.adapter.registerInteractionHandler('keyup', this.deactivateHandler);
|
1521 | } else {
|
1522 | try {
|
1523 | for (var POINTER_DEACTIVATION_EVENT_TYPES_1 = __values(POINTER_DEACTIVATION_EVENT_TYPES), POINTER_DEACTIVATION_EVENT_TYPES_1_1 = POINTER_DEACTIVATION_EVENT_TYPES_1.next(); !POINTER_DEACTIVATION_EVENT_TYPES_1_1.done; POINTER_DEACTIVATION_EVENT_TYPES_1_1 = POINTER_DEACTIVATION_EVENT_TYPES_1.next()) {
|
1524 | var evtType = POINTER_DEACTIVATION_EVENT_TYPES_1_1.value;
|
1525 | this.adapter.registerDocumentInteractionHandler(evtType, this.deactivateHandler);
|
1526 | }
|
1527 | } catch (e_2_1) {
|
1528 | e_2 = { error: e_2_1 };
|
1529 | } finally {
|
1530 | try {
|
1531 | if (POINTER_DEACTIVATION_EVENT_TYPES_1_1 && !POINTER_DEACTIVATION_EVENT_TYPES_1_1.done && (_a = POINTER_DEACTIVATION_EVENT_TYPES_1.return)) _a.call(POINTER_DEACTIVATION_EVENT_TYPES_1);
|
1532 | } finally {
|
1533 | if (e_2) throw e_2.error;
|
1534 | }
|
1535 | }
|
1536 | }
|
1537 | };
|
1538 | MDCRippleFoundation.prototype.deregisterRootHandlers = function () {
|
1539 | var e_3, _a;
|
1540 | try {
|
1541 | for (var ACTIVATION_EVENT_TYPES_2 = __values(ACTIVATION_EVENT_TYPES), ACTIVATION_EVENT_TYPES_2_1 = ACTIVATION_EVENT_TYPES_2.next(); !ACTIVATION_EVENT_TYPES_2_1.done; ACTIVATION_EVENT_TYPES_2_1 = ACTIVATION_EVENT_TYPES_2.next()) {
|
1542 | var evtType = ACTIVATION_EVENT_TYPES_2_1.value;
|
1543 | this.adapter.deregisterInteractionHandler(evtType, this.activateHandler);
|
1544 | }
|
1545 | } catch (e_3_1) {
|
1546 | e_3 = { error: e_3_1 };
|
1547 | } finally {
|
1548 | try {
|
1549 | if (ACTIVATION_EVENT_TYPES_2_1 && !ACTIVATION_EVENT_TYPES_2_1.done && (_a = ACTIVATION_EVENT_TYPES_2.return)) _a.call(ACTIVATION_EVENT_TYPES_2);
|
1550 | } finally {
|
1551 | if (e_3) throw e_3.error;
|
1552 | }
|
1553 | }
|
1554 | this.adapter.deregisterInteractionHandler('focus', this.focusHandler);
|
1555 | this.adapter.deregisterInteractionHandler('blur', this.blurHandler);
|
1556 | if (this.adapter.isUnbounded()) {
|
1557 | this.adapter.deregisterResizeHandler(this.resizeHandler);
|
1558 | }
|
1559 | };
|
1560 | MDCRippleFoundation.prototype.deregisterDeactivationHandlers = function () {
|
1561 | var e_4, _a;
|
1562 | this.adapter.deregisterInteractionHandler('keyup', this.deactivateHandler);
|
1563 | try {
|
1564 | for (var POINTER_DEACTIVATION_EVENT_TYPES_2 = __values(POINTER_DEACTIVATION_EVENT_TYPES), POINTER_DEACTIVATION_EVENT_TYPES_2_1 = POINTER_DEACTIVATION_EVENT_TYPES_2.next(); !POINTER_DEACTIVATION_EVENT_TYPES_2_1.done; POINTER_DEACTIVATION_EVENT_TYPES_2_1 = POINTER_DEACTIVATION_EVENT_TYPES_2.next()) {
|
1565 | var evtType = POINTER_DEACTIVATION_EVENT_TYPES_2_1.value;
|
1566 | this.adapter.deregisterDocumentInteractionHandler(evtType, this.deactivateHandler);
|
1567 | }
|
1568 | } catch (e_4_1) {
|
1569 | e_4 = { error: e_4_1 };
|
1570 | } finally {
|
1571 | try {
|
1572 | if (POINTER_DEACTIVATION_EVENT_TYPES_2_1 && !POINTER_DEACTIVATION_EVENT_TYPES_2_1.done && (_a = POINTER_DEACTIVATION_EVENT_TYPES_2.return)) _a.call(POINTER_DEACTIVATION_EVENT_TYPES_2);
|
1573 | } finally {
|
1574 | if (e_4) throw e_4.error;
|
1575 | }
|
1576 | }
|
1577 | };
|
1578 | MDCRippleFoundation.prototype.removeCssVars = function () {
|
1579 | var _this = this;
|
1580 | var rippleStrings = MDCRippleFoundation.strings;
|
1581 | var keys = Object.keys(rippleStrings);
|
1582 | keys.forEach(function (key) {
|
1583 | if (key.indexOf('VAR_') === 0) {
|
1584 | _this.adapter.updateCssVariable(rippleStrings[key], null);
|
1585 | }
|
1586 | });
|
1587 | };
|
1588 | MDCRippleFoundation.prototype.activateImpl = function (evt) {
|
1589 | var _this = this;
|
1590 | if (this.adapter.isSurfaceDisabled()) {
|
1591 | return;
|
1592 | }
|
1593 | var activationState = this.activationState;
|
1594 | if (activationState.isActivated) {
|
1595 | return;
|
1596 | }
|
1597 |
|
1598 | var previousActivationEvent = this.previousActivationEvent;
|
1599 | var isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type;
|
1600 | if (isSameInteraction) {
|
1601 | return;
|
1602 | }
|
1603 | activationState.isActivated = true;
|
1604 | activationState.isProgrammatic = evt === undefined;
|
1605 | activationState.activationEvent = evt;
|
1606 | activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown');
|
1607 | var hasActivatedChild = evt !== undefined && activatedTargets.length > 0 && activatedTargets.some(function (target) {
|
1608 | return _this.adapter.containsEventTarget(target);
|
1609 | });
|
1610 | if (hasActivatedChild) {
|
1611 |
|
1612 | this.resetActivationState();
|
1613 | return;
|
1614 | }
|
1615 | if (evt !== undefined) {
|
1616 | activatedTargets.push(evt.target);
|
1617 | this.registerDeactivationHandlers(evt);
|
1618 | }
|
1619 | activationState.wasElementMadeActive = this.checkElementMadeActive(evt);
|
1620 | if (activationState.wasElementMadeActive) {
|
1621 | this.animateActivation();
|
1622 | }
|
1623 | requestAnimationFrame(function () {
|
1624 |
|
1625 | activatedTargets = [];
|
1626 | if (!activationState.wasElementMadeActive && evt !== undefined && (evt.key === ' ' || evt.keyCode === 32)) {
|
1627 |
|
1628 |
|
1629 |
|
1630 |
|
1631 |
|
1632 |
|
1633 | activationState.wasElementMadeActive = _this.checkElementMadeActive(evt);
|
1634 | if (activationState.wasElementMadeActive) {
|
1635 | _this.animateActivation();
|
1636 | }
|
1637 | }
|
1638 | if (!activationState.wasElementMadeActive) {
|
1639 |
|
1640 | _this.activationState = _this.defaultActivationState();
|
1641 | }
|
1642 | });
|
1643 | };
|
1644 | MDCRippleFoundation.prototype.checkElementMadeActive = function (evt) {
|
1645 | return evt !== undefined && evt.type === 'keydown' ? this.adapter.isSurfaceActive() : true;
|
1646 | };
|
1647 | MDCRippleFoundation.prototype.animateActivation = function () {
|
1648 | var _this = this;
|
1649 | var _a = MDCRippleFoundation.strings,
|
1650 | VAR_FG_TRANSLATE_START = _a.VAR_FG_TRANSLATE_START,
|
1651 | VAR_FG_TRANSLATE_END = _a.VAR_FG_TRANSLATE_END;
|
1652 | var _b = MDCRippleFoundation.cssClasses,
|
1653 | FG_DEACTIVATION = _b.FG_DEACTIVATION,
|
1654 | FG_ACTIVATION = _b.FG_ACTIVATION;
|
1655 | var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
|
1656 | this.layoutInternal();
|
1657 | var translateStart = '';
|
1658 | var translateEnd = '';
|
1659 | if (!this.adapter.isUnbounded()) {
|
1660 | var _c = this.getFgTranslationCoordinates(),
|
1661 | startPoint = _c.startPoint,
|
1662 | endPoint = _c.endPoint;
|
1663 | translateStart = startPoint.x + "px, " + startPoint.y + "px";
|
1664 | translateEnd = endPoint.x + "px, " + endPoint.y + "px";
|
1665 | }
|
1666 | this.adapter.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
|
1667 | this.adapter.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
|
1668 |
|
1669 | clearTimeout(this.activationTimer);
|
1670 | clearTimeout(this.fgDeactivationRemovalTimer);
|
1671 | this.rmBoundedActivationClasses();
|
1672 | this.adapter.removeClass(FG_DEACTIVATION);
|
1673 |
|
1674 | this.adapter.computeBoundingRect();
|
1675 | this.adapter.addClass(FG_ACTIVATION);
|
1676 | this.activationTimer = setTimeout(function () {
|
1677 | _this.activationTimerCallback();
|
1678 | }, DEACTIVATION_TIMEOUT_MS);
|
1679 | };
|
1680 | MDCRippleFoundation.prototype.getFgTranslationCoordinates = function () {
|
1681 | var _a = this.activationState,
|
1682 | activationEvent = _a.activationEvent,
|
1683 | wasActivatedByPointer = _a.wasActivatedByPointer;
|
1684 | var startPoint;
|
1685 | if (wasActivatedByPointer) {
|
1686 | startPoint = util_1.getNormalizedEventCoords(activationEvent, this.adapter.getWindowPageOffset(), this.adapter.computeBoundingRect());
|
1687 | } else {
|
1688 | startPoint = {
|
1689 | x: this.frame.width / 2,
|
1690 | y: this.frame.height / 2
|
1691 | };
|
1692 | }
|
1693 |
|
1694 | startPoint = {
|
1695 | x: startPoint.x - this.initialSize / 2,
|
1696 | y: startPoint.y - this.initialSize / 2
|
1697 | };
|
1698 | var endPoint = {
|
1699 | x: this.frame.width / 2 - this.initialSize / 2,
|
1700 | y: this.frame.height / 2 - this.initialSize / 2
|
1701 | };
|
1702 | return { startPoint: startPoint, endPoint: endPoint };
|
1703 | };
|
1704 | MDCRippleFoundation.prototype.runDeactivationUXLogicIfReady = function () {
|
1705 | var _this = this;
|
1706 |
|
1707 |
|
1708 | var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
|
1709 | var _a = this.activationState,
|
1710 | hasDeactivationUXRun = _a.hasDeactivationUXRun,
|
1711 | isActivated = _a.isActivated;
|
1712 | var activationHasEnded = hasDeactivationUXRun || !isActivated;
|
1713 | if (activationHasEnded && this.activationAnimationHasEnded) {
|
1714 | this.rmBoundedActivationClasses();
|
1715 | this.adapter.addClass(FG_DEACTIVATION);
|
1716 | this.fgDeactivationRemovalTimer = setTimeout(function () {
|
1717 | _this.adapter.removeClass(FG_DEACTIVATION);
|
1718 | }, constants_1.numbers.FG_DEACTIVATION_MS);
|
1719 | }
|
1720 | };
|
1721 | MDCRippleFoundation.prototype.rmBoundedActivationClasses = function () {
|
1722 | var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
|
1723 | this.adapter.removeClass(FG_ACTIVATION);
|
1724 | this.activationAnimationHasEnded = false;
|
1725 | this.adapter.computeBoundingRect();
|
1726 | };
|
1727 | MDCRippleFoundation.prototype.resetActivationState = function () {
|
1728 | var _this = this;
|
1729 | this.previousActivationEvent = this.activationState.activationEvent;
|
1730 | this.activationState = this.defaultActivationState();
|
1731 |
|
1732 |
|
1733 | setTimeout(function () {
|
1734 | return _this.previousActivationEvent = undefined;
|
1735 | }, MDCRippleFoundation.numbers.TAP_DELAY_MS);
|
1736 | };
|
1737 | MDCRippleFoundation.prototype.deactivateImpl = function () {
|
1738 | var _this = this;
|
1739 | var activationState = this.activationState;
|
1740 |
|
1741 | if (!activationState.isActivated) {
|
1742 | return;
|
1743 | }
|
1744 | var state = __assign({}, activationState);
|
1745 | if (activationState.isProgrammatic) {
|
1746 | requestAnimationFrame(function () {
|
1747 | _this.animateDeactivation(state);
|
1748 | });
|
1749 | this.resetActivationState();
|
1750 | } else {
|
1751 | this.deregisterDeactivationHandlers();
|
1752 | requestAnimationFrame(function () {
|
1753 | _this.activationState.hasDeactivationUXRun = true;
|
1754 | _this.animateDeactivation(state);
|
1755 | _this.resetActivationState();
|
1756 | });
|
1757 | }
|
1758 | };
|
1759 | MDCRippleFoundation.prototype.animateDeactivation = function (_a) {
|
1760 | var wasActivatedByPointer = _a.wasActivatedByPointer,
|
1761 | wasElementMadeActive = _a.wasElementMadeActive;
|
1762 | if (wasActivatedByPointer || wasElementMadeActive) {
|
1763 | this.runDeactivationUXLogicIfReady();
|
1764 | }
|
1765 | };
|
1766 | MDCRippleFoundation.prototype.layoutInternal = function () {
|
1767 | var _this = this;
|
1768 | this.frame = this.adapter.computeBoundingRect();
|
1769 | var maxDim = Math.max(this.frame.height, this.frame.width);
|
1770 |
|
1771 |
|
1772 |
|
1773 |
|
1774 |
|
1775 |
|
1776 | var getBoundedRadius = function getBoundedRadius() {
|
1777 | var hypotenuse = Math.sqrt(Math.pow(_this.frame.width, 2) + Math.pow(_this.frame.height, 2));
|
1778 | return hypotenuse + MDCRippleFoundation.numbers.PADDING;
|
1779 | };
|
1780 | this.maxRadius = this.adapter.isUnbounded() ? maxDim : getBoundedRadius();
|
1781 |
|
1782 | var initialSize = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);
|
1783 |
|
1784 | if (this.adapter.isUnbounded() && initialSize % 2 !== 0) {
|
1785 | this.initialSize = initialSize - 1;
|
1786 | } else {
|
1787 | this.initialSize = initialSize;
|
1788 | }
|
1789 | this.fgScale = "" + this.maxRadius / this.initialSize;
|
1790 | this.updateLayoutCssVars();
|
1791 | };
|
1792 | MDCRippleFoundation.prototype.updateLayoutCssVars = function () {
|
1793 | var _a = MDCRippleFoundation.strings,
|
1794 | VAR_FG_SIZE = _a.VAR_FG_SIZE,
|
1795 | VAR_LEFT = _a.VAR_LEFT,
|
1796 | VAR_TOP = _a.VAR_TOP,
|
1797 | VAR_FG_SCALE = _a.VAR_FG_SCALE;
|
1798 | this.adapter.updateCssVariable(VAR_FG_SIZE, this.initialSize + "px");
|
1799 | this.adapter.updateCssVariable(VAR_FG_SCALE, this.fgScale);
|
1800 | if (this.adapter.isUnbounded()) {
|
1801 | this.unboundedCoords = {
|
1802 | left: Math.round(this.frame.width / 2 - this.initialSize / 2),
|
1803 | top: Math.round(this.frame.height / 2 - this.initialSize / 2)
|
1804 | };
|
1805 | this.adapter.updateCssVariable(VAR_LEFT, this.unboundedCoords.left + "px");
|
1806 | this.adapter.updateCssVariable(VAR_TOP, this.unboundedCoords.top + "px");
|
1807 | }
|
1808 | };
|
1809 | return MDCRippleFoundation;
|
1810 | }(foundation_1.MDCFoundation);
|
1811 | exports.MDCRippleFoundation = MDCRippleFoundation;
|
1812 |
|
1813 | exports.default = MDCRippleFoundation;
|
1814 |
|
1815 | }),
|
1816 |
|
1817 | "./packages/mdc-ripple/util.ts":
|
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 | (function(module, exports, __webpack_require__) {
|
1823 |
|
1824 | "use strict";
|
1825 |
|
1826 |
|
1827 | Object.defineProperty(exports, "__esModule", { value: true });
|
1828 | exports.getNormalizedEventCoords = exports.supportsCssVariables = void 0;
|
1829 |
|
1830 |
|
1831 |
|
1832 |
|
1833 | var supportsCssVariables_;
|
1834 | function supportsCssVariables(windowObj, forceRefresh) {
|
1835 | if (forceRefresh === void 0) {
|
1836 | forceRefresh = false;
|
1837 | }
|
1838 | var CSS = windowObj.CSS;
|
1839 | var supportsCssVars = supportsCssVariables_;
|
1840 | if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {
|
1841 | return supportsCssVariables_;
|
1842 | }
|
1843 | var supportsFunctionPresent = CSS && typeof CSS.supports === 'function';
|
1844 | if (!supportsFunctionPresent) {
|
1845 | return false;
|
1846 | }
|
1847 | var explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes');
|
1848 |
|
1849 |
|
1850 | var weAreFeatureDetectingSafari10plus = CSS.supports('(--css-vars: yes)') && CSS.supports('color', '#00000000');
|
1851 | supportsCssVars = explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus;
|
1852 | if (!forceRefresh) {
|
1853 | supportsCssVariables_ = supportsCssVars;
|
1854 | }
|
1855 | return supportsCssVars;
|
1856 | }
|
1857 | exports.supportsCssVariables = supportsCssVariables;
|
1858 | function getNormalizedEventCoords(evt, pageOffset, clientRect) {
|
1859 | if (!evt) {
|
1860 | return { x: 0, y: 0 };
|
1861 | }
|
1862 | var x = pageOffset.x,
|
1863 | y = pageOffset.y;
|
1864 | var documentX = x + clientRect.left;
|
1865 | var documentY = y + clientRect.top;
|
1866 | var normalizedX;
|
1867 | var normalizedY;
|
1868 |
|
1869 | if (evt.type === 'touchstart') {
|
1870 | var touchEvent = evt;
|
1871 | normalizedX = touchEvent.changedTouches[0].pageX - documentX;
|
1872 | normalizedY = touchEvent.changedTouches[0].pageY - documentY;
|
1873 | } else {
|
1874 | var mouseEvent = evt;
|
1875 | normalizedX = mouseEvent.pageX - documentX;
|
1876 | normalizedY = mouseEvent.pageY - documentY;
|
1877 | }
|
1878 | return { x: normalizedX, y: normalizedY };
|
1879 | }
|
1880 | exports.getNormalizedEventCoords = getNormalizedEventCoords;
|
1881 |
|
1882 | })
|
1883 |
|
1884 | });
|
1885 | });
|
1886 |
|
\ | No newline at end of file |