1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | (function webpackUniversalModuleDefinition(root, factory) {
|
9 | if (typeof exports === "object" && typeof module === "object") module.exports = factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (typeof exports === "object") exports["mdc"] = factory(); else root["mdc"] = factory();
|
10 | })(this, function() {
|
11 | return function(modules) {
|
12 | var installedModules = {};
|
13 | function __webpack_require__(moduleId) {
|
14 | if (installedModules[moduleId]) {
|
15 | return installedModules[moduleId].exports;
|
16 | }
|
17 | var module = installedModules[moduleId] = {
|
18 | i: moduleId,
|
19 | l: false,
|
20 | exports: {}
|
21 | };
|
22 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
23 | module.l = true;
|
24 | return module.exports;
|
25 | }
|
26 | __webpack_require__.m = modules;
|
27 | __webpack_require__.c = installedModules;
|
28 | __webpack_require__.d = function(exports, name, getter) {
|
29 | if (!__webpack_require__.o(exports, name)) {
|
30 | Object.defineProperty(exports, name, {
|
31 | configurable: false,
|
32 | enumerable: true,
|
33 | get: getter
|
34 | });
|
35 | }
|
36 | };
|
37 | __webpack_require__.n = function(module) {
|
38 | var getter = module && module.__esModule ? function getDefault() {
|
39 | return module["default"];
|
40 | } : function getModuleExports() {
|
41 | return module;
|
42 | };
|
43 | __webpack_require__.d(getter, "a", getter);
|
44 | return getter;
|
45 | };
|
46 | __webpack_require__.o = function(object, property) {
|
47 | return Object.prototype.hasOwnProperty.call(object, property);
|
48 | };
|
49 | __webpack_require__.p = "";
|
50 | return __webpack_require__(__webpack_require__.s = 78);
|
51 | }([ function(module, exports, __webpack_require__) {
|
52 | "use strict";
|
53 | Object.defineProperty(exports, "__esModule", {
|
54 | value: true
|
55 | });
|
56 | var MDCFoundation = function() {
|
57 | function MDCFoundation(adapter) {
|
58 | if (adapter === void 0) {
|
59 | adapter = {};
|
60 | }
|
61 | this.adapter_ = adapter;
|
62 | }
|
63 | Object.defineProperty(MDCFoundation, "cssClasses", {
|
64 | get: function get() {
|
65 | return {};
|
66 | },
|
67 | enumerable: true,
|
68 | configurable: true
|
69 | });
|
70 | Object.defineProperty(MDCFoundation, "strings", {
|
71 | get: function get() {
|
72 | return {};
|
73 | },
|
74 | enumerable: true,
|
75 | configurable: true
|
76 | });
|
77 | Object.defineProperty(MDCFoundation, "numbers", {
|
78 | get: function get() {
|
79 | return {};
|
80 | },
|
81 | enumerable: true,
|
82 | configurable: true
|
83 | });
|
84 | Object.defineProperty(MDCFoundation, "defaultAdapter", {
|
85 | get: function get() {
|
86 | return {};
|
87 | },
|
88 | enumerable: true,
|
89 | configurable: true
|
90 | });
|
91 | MDCFoundation.prototype.init = function() {};
|
92 | MDCFoundation.prototype.destroy = function() {};
|
93 | return MDCFoundation;
|
94 | }();
|
95 | exports.MDCFoundation = MDCFoundation;
|
96 | exports.default = MDCFoundation;
|
97 | }, function(module, exports, __webpack_require__) {
|
98 | "use strict";
|
99 | var __read = this && this.__read || function(o, n) {
|
100 | var m = typeof Symbol === "function" && o[Symbol.iterator];
|
101 | if (!m) return o;
|
102 | var i = m.call(o), r, ar = [], e;
|
103 | try {
|
104 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
105 | ar.push(r.value);
|
106 | }
|
107 | } catch (error) {
|
108 | e = {
|
109 | error: error
|
110 | };
|
111 | } finally {
|
112 | try {
|
113 | if (r && !r.done && (m = i["return"])) m.call(i);
|
114 | } finally {
|
115 | if (e) throw e.error;
|
116 | }
|
117 | }
|
118 | return ar;
|
119 | };
|
120 | var __spread = this && this.__spread || function() {
|
121 | for (var ar = [], i = 0; i < arguments.length; i++) {
|
122 | ar = ar.concat(__read(arguments[i]));
|
123 | }
|
124 | return ar;
|
125 | };
|
126 | Object.defineProperty(exports, "__esModule", {
|
127 | value: true
|
128 | });
|
129 | var foundation_1 = __webpack_require__(0);
|
130 | var MDCComponent = function() {
|
131 | function MDCComponent(root, foundation) {
|
132 | var args = [];
|
133 | for (var _i = 2; _i < arguments.length; _i++) {
|
134 | args[_i - 2] = arguments[_i];
|
135 | }
|
136 | this.root_ = root;
|
137 | this.initialize.apply(this, __spread(args));
|
138 | this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation;
|
139 | this.foundation_.init();
|
140 | this.initialSyncWithDOM();
|
141 | }
|
142 | MDCComponent.attachTo = function(root) {
|
143 | return new MDCComponent(root, new foundation_1.MDCFoundation({}));
|
144 | };
|
145 | MDCComponent.prototype.initialize = function() {
|
146 | var _args = [];
|
147 | for (var _i = 0; _i < arguments.length; _i++) {
|
148 | _args[_i] = arguments[_i];
|
149 | }
|
150 | };
|
151 | MDCComponent.prototype.getDefaultFoundation = function() {
|
152 | throw new Error("Subclasses must override getDefaultFoundation to return a properly configured " + "foundation class");
|
153 | };
|
154 | MDCComponent.prototype.initialSyncWithDOM = function() {};
|
155 | MDCComponent.prototype.destroy = function() {
|
156 | this.foundation_.destroy();
|
157 | };
|
158 | MDCComponent.prototype.listen = function(evtType, handler) {
|
159 | this.root_.addEventListener(evtType, handler);
|
160 | };
|
161 | MDCComponent.prototype.unlisten = function(evtType, handler) {
|
162 | this.root_.removeEventListener(evtType, handler);
|
163 | };
|
164 | MDCComponent.prototype.emit = function(evtType, evtData, shouldBubble) {
|
165 | if (shouldBubble === void 0) {
|
166 | shouldBubble = false;
|
167 | }
|
168 | var evt;
|
169 | if (typeof CustomEvent === "function") {
|
170 | evt = new CustomEvent(evtType, {
|
171 | bubbles: shouldBubble,
|
172 | detail: evtData
|
173 | });
|
174 | } else {
|
175 | evt = document.createEvent("CustomEvent");
|
176 | evt.initCustomEvent(evtType, shouldBubble, false, evtData);
|
177 | }
|
178 | this.root_.dispatchEvent(evt);
|
179 | };
|
180 | return MDCComponent;
|
181 | }();
|
182 | exports.MDCComponent = MDCComponent;
|
183 | exports.default = MDCComponent;
|
184 | }, function(module, exports, __webpack_require__) {
|
185 | "use strict";
|
186 | var __extends = this && this.__extends || function() {
|
187 | var _extendStatics = function extendStatics(d, b) {
|
188 | _extendStatics = Object.setPrototypeOf || {
|
189 | __proto__: []
|
190 | } instanceof Array && function(d, b) {
|
191 | d.__proto__ = b;
|
192 | } || function(d, b) {
|
193 | for (var p in b) {
|
194 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
195 | }
|
196 | };
|
197 | return _extendStatics(d, b);
|
198 | };
|
199 | return function(d, b) {
|
200 | _extendStatics(d, b);
|
201 | function __() {
|
202 | this.constructor = d;
|
203 | }
|
204 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
205 | };
|
206 | }();
|
207 | var __importStar = this && this.__importStar || function(mod) {
|
208 | if (mod && mod.__esModule) return mod;
|
209 | var result = {};
|
210 | if (mod != null) for (var k in mod) {
|
211 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
212 | }
|
213 | result["default"] = mod;
|
214 | return result;
|
215 | };
|
216 | Object.defineProperty(exports, "__esModule", {
|
217 | value: true
|
218 | });
|
219 | var component_1 = __webpack_require__(1);
|
220 | var ponyfill_1 = __webpack_require__(3);
|
221 | var foundation_1 = __webpack_require__(4);
|
222 | var util = __importStar(__webpack_require__(11));
|
223 | var MDCRipple = function(_super) {
|
224 | __extends(MDCRipple, _super);
|
225 | function MDCRipple() {
|
226 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
227 | _this.disabled = false;
|
228 | return _this;
|
229 | }
|
230 | MDCRipple.attachTo = function(root, opts) {
|
231 | if (opts === void 0) {
|
232 | opts = {
|
233 | isUnbounded: undefined
|
234 | };
|
235 | }
|
236 | var ripple = new MDCRipple(root);
|
237 | if (opts.isUnbounded !== undefined) {
|
238 | ripple.unbounded = opts.isUnbounded;
|
239 | }
|
240 | return ripple;
|
241 | };
|
242 | MDCRipple.createAdapter = function(instance) {
|
243 | return {
|
244 | addClass: function addClass(className) {
|
245 | return instance.root_.classList.add(className);
|
246 | },
|
247 | browserSupportsCssVars: function browserSupportsCssVars() {
|
248 | return util.supportsCssVariables(window);
|
249 | },
|
250 | computeBoundingRect: function computeBoundingRect() {
|
251 | return instance.root_.getBoundingClientRect();
|
252 | },
|
253 | containsEventTarget: function containsEventTarget(target) {
|
254 | return instance.root_.contains(target);
|
255 | },
|
256 | deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) {
|
257 | return document.documentElement.removeEventListener(evtType, handler, util.applyPassive());
|
258 | },
|
259 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
260 | return instance.root_.removeEventListener(evtType, handler, util.applyPassive());
|
261 | },
|
262 | deregisterResizeHandler: function deregisterResizeHandler(handler) {
|
263 | return window.removeEventListener("resize", handler);
|
264 | },
|
265 | getWindowPageOffset: function getWindowPageOffset() {
|
266 | return {
|
267 | x: window.pageXOffset,
|
268 | y: window.pageYOffset
|
269 | };
|
270 | },
|
271 | isSurfaceActive: function isSurfaceActive() {
|
272 | return ponyfill_1.matches(instance.root_, ":active");
|
273 | },
|
274 | isSurfaceDisabled: function isSurfaceDisabled() {
|
275 | return Boolean(instance.disabled);
|
276 | },
|
277 | isUnbounded: function isUnbounded() {
|
278 | return Boolean(instance.unbounded);
|
279 | },
|
280 | registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) {
|
281 | return document.documentElement.addEventListener(evtType, handler, util.applyPassive());
|
282 | },
|
283 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
284 | return instance.root_.addEventListener(evtType, handler, util.applyPassive());
|
285 | },
|
286 | registerResizeHandler: function registerResizeHandler(handler) {
|
287 | return window.addEventListener("resize", handler);
|
288 | },
|
289 | removeClass: function removeClass(className) {
|
290 | return instance.root_.classList.remove(className);
|
291 | },
|
292 | updateCssVariable: function updateCssVariable(varName, value) {
|
293 | return instance.root_.style.setProperty(varName, value);
|
294 | }
|
295 | };
|
296 | };
|
297 | Object.defineProperty(MDCRipple.prototype, "unbounded", {
|
298 | get: function get() {
|
299 | return Boolean(this.unbounded_);
|
300 | },
|
301 | set: function set(unbounded) {
|
302 | this.unbounded_ = Boolean(unbounded);
|
303 | this.setUnbounded_();
|
304 | },
|
305 | enumerable: true,
|
306 | configurable: true
|
307 | });
|
308 | MDCRipple.prototype.activate = function() {
|
309 | this.foundation_.activate();
|
310 | };
|
311 | MDCRipple.prototype.deactivate = function() {
|
312 | this.foundation_.deactivate();
|
313 | };
|
314 | MDCRipple.prototype.layout = function() {
|
315 | this.foundation_.layout();
|
316 | };
|
317 | MDCRipple.prototype.getDefaultFoundation = function() {
|
318 | return new foundation_1.MDCRippleFoundation(MDCRipple.createAdapter(this));
|
319 | };
|
320 | MDCRipple.prototype.initialSyncWithDOM = function() {
|
321 | var root = this.root_;
|
322 | this.unbounded = "mdcRippleIsUnbounded" in root.dataset;
|
323 | };
|
324 | MDCRipple.prototype.setUnbounded_ = function() {
|
325 | this.foundation_.setUnbounded(Boolean(this.unbounded_));
|
326 | };
|
327 | return MDCRipple;
|
328 | }(component_1.MDCComponent);
|
329 | exports.MDCRipple = MDCRipple;
|
330 | }, function(module, exports, __webpack_require__) {
|
331 | "use strict";
|
332 | Object.defineProperty(exports, "__esModule", {
|
333 | value: true
|
334 | });
|
335 | function closest(element, selector) {
|
336 | if (element.closest) {
|
337 | return element.closest(selector);
|
338 | }
|
339 | var el = element;
|
340 | while (el) {
|
341 | if (matches(el, selector)) {
|
342 | return el;
|
343 | }
|
344 | el = el.parentElement;
|
345 | }
|
346 | return null;
|
347 | }
|
348 | exports.closest = closest;
|
349 | function matches(element, selector) {
|
350 | var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
|
351 | return nativeMatches.call(element, selector);
|
352 | }
|
353 | exports.matches = matches;
|
354 | }, function(module, exports, __webpack_require__) {
|
355 | "use strict";
|
356 | var __extends = this && this.__extends || function() {
|
357 | var _extendStatics = function extendStatics(d, b) {
|
358 | _extendStatics = Object.setPrototypeOf || {
|
359 | __proto__: []
|
360 | } instanceof Array && function(d, b) {
|
361 | d.__proto__ = b;
|
362 | } || function(d, b) {
|
363 | for (var p in b) {
|
364 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
365 | }
|
366 | };
|
367 | return _extendStatics(d, b);
|
368 | };
|
369 | return function(d, b) {
|
370 | _extendStatics(d, b);
|
371 | function __() {
|
372 | this.constructor = d;
|
373 | }
|
374 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
375 | };
|
376 | }();
|
377 | var __assign = this && this.__assign || function() {
|
378 | __assign = Object.assign || function(t) {
|
379 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
380 | s = arguments[i];
|
381 | for (var p in s) {
|
382 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
383 | }
|
384 | }
|
385 | return t;
|
386 | };
|
387 | return __assign.apply(this, arguments);
|
388 | };
|
389 | Object.defineProperty(exports, "__esModule", {
|
390 | value: true
|
391 | });
|
392 | var foundation_1 = __webpack_require__(0);
|
393 | var constants_1 = __webpack_require__(83);
|
394 | var util_1 = __webpack_require__(11);
|
395 | var ACTIVATION_EVENT_TYPES = [ "touchstart", "pointerdown", "mousedown", "keydown" ];
|
396 | var POINTER_DEACTIVATION_EVENT_TYPES = [ "touchend", "pointerup", "mouseup", "contextmenu" ];
|
397 | var activatedTargets = [];
|
398 | var MDCRippleFoundation = function(_super) {
|
399 | __extends(MDCRippleFoundation, _super);
|
400 | function MDCRippleFoundation(adapter) {
|
401 | var _this = _super.call(this, __assign({}, MDCRippleFoundation.defaultAdapter, adapter)) || this;
|
402 | _this.activationAnimationHasEnded_ = false;
|
403 | _this.activationTimer_ = 0;
|
404 | _this.fgDeactivationRemovalTimer_ = 0;
|
405 | _this.fgScale_ = "0";
|
406 | _this.frame_ = {
|
407 | width: 0,
|
408 | height: 0
|
409 | };
|
410 | _this.initialSize_ = 0;
|
411 | _this.layoutFrame_ = 0;
|
412 | _this.maxRadius_ = 0;
|
413 | _this.unboundedCoords_ = {
|
414 | left: 0,
|
415 | top: 0
|
416 | };
|
417 | _this.activationState_ = _this.defaultActivationState_();
|
418 | _this.activationTimerCallback_ = function() {
|
419 | _this.activationAnimationHasEnded_ = true;
|
420 | _this.runDeactivationUXLogicIfReady_();
|
421 | };
|
422 | _this.activateHandler_ = function(e) {
|
423 | return _this.activate_(e);
|
424 | };
|
425 | _this.deactivateHandler_ = function() {
|
426 | return _this.deactivate_();
|
427 | };
|
428 | _this.focusHandler_ = function() {
|
429 | return _this.handleFocus();
|
430 | };
|
431 | _this.blurHandler_ = function() {
|
432 | return _this.handleBlur();
|
433 | };
|
434 | _this.resizeHandler_ = function() {
|
435 | return _this.layout();
|
436 | };
|
437 | return _this;
|
438 | }
|
439 | Object.defineProperty(MDCRippleFoundation, "cssClasses", {
|
440 | get: function get() {
|
441 | return constants_1.cssClasses;
|
442 | },
|
443 | enumerable: true,
|
444 | configurable: true
|
445 | });
|
446 | Object.defineProperty(MDCRippleFoundation, "strings", {
|
447 | get: function get() {
|
448 | return constants_1.strings;
|
449 | },
|
450 | enumerable: true,
|
451 | configurable: true
|
452 | });
|
453 | Object.defineProperty(MDCRippleFoundation, "numbers", {
|
454 | get: function get() {
|
455 | return constants_1.numbers;
|
456 | },
|
457 | enumerable: true,
|
458 | configurable: true
|
459 | });
|
460 | Object.defineProperty(MDCRippleFoundation, "defaultAdapter", {
|
461 | get: function get() {
|
462 | return {
|
463 | addClass: function addClass() {
|
464 | return undefined;
|
465 | },
|
466 | browserSupportsCssVars: function browserSupportsCssVars() {
|
467 | return true;
|
468 | },
|
469 | computeBoundingRect: function computeBoundingRect() {
|
470 | return {
|
471 | top: 0,
|
472 | right: 0,
|
473 | bottom: 0,
|
474 | left: 0,
|
475 | width: 0,
|
476 | height: 0
|
477 | };
|
478 | },
|
479 | containsEventTarget: function containsEventTarget() {
|
480 | return true;
|
481 | },
|
482 | deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() {
|
483 | return undefined;
|
484 | },
|
485 | deregisterInteractionHandler: function deregisterInteractionHandler() {
|
486 | return undefined;
|
487 | },
|
488 | deregisterResizeHandler: function deregisterResizeHandler() {
|
489 | return undefined;
|
490 | },
|
491 | getWindowPageOffset: function getWindowPageOffset() {
|
492 | return {
|
493 | x: 0,
|
494 | y: 0
|
495 | };
|
496 | },
|
497 | isSurfaceActive: function isSurfaceActive() {
|
498 | return true;
|
499 | },
|
500 | isSurfaceDisabled: function isSurfaceDisabled() {
|
501 | return true;
|
502 | },
|
503 | isUnbounded: function isUnbounded() {
|
504 | return true;
|
505 | },
|
506 | registerDocumentInteractionHandler: function registerDocumentInteractionHandler() {
|
507 | return undefined;
|
508 | },
|
509 | registerInteractionHandler: function registerInteractionHandler() {
|
510 | return undefined;
|
511 | },
|
512 | registerResizeHandler: function registerResizeHandler() {
|
513 | return undefined;
|
514 | },
|
515 | removeClass: function removeClass() {
|
516 | return undefined;
|
517 | },
|
518 | updateCssVariable: function updateCssVariable() {
|
519 | return undefined;
|
520 | }
|
521 | };
|
522 | },
|
523 | enumerable: true,
|
524 | configurable: true
|
525 | });
|
526 | MDCRippleFoundation.prototype.init = function() {
|
527 | var _this = this;
|
528 | var supportsPressRipple = this.supportsPressRipple_();
|
529 | this.registerRootHandlers_(supportsPressRipple);
|
530 | if (supportsPressRipple) {
|
531 | var _a = MDCRippleFoundation.cssClasses, ROOT_1 = _a.ROOT, UNBOUNDED_1 = _a.UNBOUNDED;
|
532 | requestAnimationFrame(function() {
|
533 | _this.adapter_.addClass(ROOT_1);
|
534 | if (_this.adapter_.isUnbounded()) {
|
535 | _this.adapter_.addClass(UNBOUNDED_1);
|
536 | _this.layoutInternal_();
|
537 | }
|
538 | });
|
539 | }
|
540 | };
|
541 | MDCRippleFoundation.prototype.destroy = function() {
|
542 | var _this = this;
|
543 | if (this.supportsPressRipple_()) {
|
544 | if (this.activationTimer_) {
|
545 | clearTimeout(this.activationTimer_);
|
546 | this.activationTimer_ = 0;
|
547 | this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);
|
548 | }
|
549 | if (this.fgDeactivationRemovalTimer_) {
|
550 | clearTimeout(this.fgDeactivationRemovalTimer_);
|
551 | this.fgDeactivationRemovalTimer_ = 0;
|
552 | this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);
|
553 | }
|
554 | var _a = MDCRippleFoundation.cssClasses, ROOT_2 = _a.ROOT, UNBOUNDED_2 = _a.UNBOUNDED;
|
555 | requestAnimationFrame(function() {
|
556 | _this.adapter_.removeClass(ROOT_2);
|
557 | _this.adapter_.removeClass(UNBOUNDED_2);
|
558 | _this.removeCssVars_();
|
559 | });
|
560 | }
|
561 | this.deregisterRootHandlers_();
|
562 | this.deregisterDeactivationHandlers_();
|
563 | };
|
564 | MDCRippleFoundation.prototype.activate = function(evt) {
|
565 | this.activate_(evt);
|
566 | };
|
567 | MDCRippleFoundation.prototype.deactivate = function() {
|
568 | this.deactivate_();
|
569 | };
|
570 | MDCRippleFoundation.prototype.layout = function() {
|
571 | var _this = this;
|
572 | if (this.layoutFrame_) {
|
573 | cancelAnimationFrame(this.layoutFrame_);
|
574 | }
|
575 | this.layoutFrame_ = requestAnimationFrame(function() {
|
576 | _this.layoutInternal_();
|
577 | _this.layoutFrame_ = 0;
|
578 | });
|
579 | };
|
580 | MDCRippleFoundation.prototype.setUnbounded = function(unbounded) {
|
581 | var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;
|
582 | if (unbounded) {
|
583 | this.adapter_.addClass(UNBOUNDED);
|
584 | } else {
|
585 | this.adapter_.removeClass(UNBOUNDED);
|
586 | }
|
587 | };
|
588 | MDCRippleFoundation.prototype.handleFocus = function() {
|
589 | var _this = this;
|
590 | requestAnimationFrame(function() {
|
591 | return _this.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
|
592 | });
|
593 | };
|
594 | MDCRippleFoundation.prototype.handleBlur = function() {
|
595 | var _this = this;
|
596 | requestAnimationFrame(function() {
|
597 | return _this.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
|
598 | });
|
599 | };
|
600 | MDCRippleFoundation.prototype.supportsPressRipple_ = function() {
|
601 | return this.adapter_.browserSupportsCssVars();
|
602 | };
|
603 | MDCRippleFoundation.prototype.defaultActivationState_ = function() {
|
604 | return {
|
605 | activationEvent: undefined,
|
606 | hasDeactivationUXRun: false,
|
607 | isActivated: false,
|
608 | isProgrammatic: false,
|
609 | wasActivatedByPointer: false,
|
610 | wasElementMadeActive: false
|
611 | };
|
612 | };
|
613 | MDCRippleFoundation.prototype.registerRootHandlers_ = function(supportsPressRipple) {
|
614 | var _this = this;
|
615 | if (supportsPressRipple) {
|
616 | ACTIVATION_EVENT_TYPES.forEach(function(evtType) {
|
617 | _this.adapter_.registerInteractionHandler(evtType, _this.activateHandler_);
|
618 | });
|
619 | if (this.adapter_.isUnbounded()) {
|
620 | this.adapter_.registerResizeHandler(this.resizeHandler_);
|
621 | }
|
622 | }
|
623 | this.adapter_.registerInteractionHandler("focus", this.focusHandler_);
|
624 | this.adapter_.registerInteractionHandler("blur", this.blurHandler_);
|
625 | };
|
626 | MDCRippleFoundation.prototype.registerDeactivationHandlers_ = function(evt) {
|
627 | var _this = this;
|
628 | if (evt.type === "keydown") {
|
629 | this.adapter_.registerInteractionHandler("keyup", this.deactivateHandler_);
|
630 | } else {
|
631 | POINTER_DEACTIVATION_EVENT_TYPES.forEach(function(evtType) {
|
632 | _this.adapter_.registerDocumentInteractionHandler(evtType, _this.deactivateHandler_);
|
633 | });
|
634 | }
|
635 | };
|
636 | MDCRippleFoundation.prototype.deregisterRootHandlers_ = function() {
|
637 | var _this = this;
|
638 | ACTIVATION_EVENT_TYPES.forEach(function(evtType) {
|
639 | _this.adapter_.deregisterInteractionHandler(evtType, _this.activateHandler_);
|
640 | });
|
641 | this.adapter_.deregisterInteractionHandler("focus", this.focusHandler_);
|
642 | this.adapter_.deregisterInteractionHandler("blur", this.blurHandler_);
|
643 | if (this.adapter_.isUnbounded()) {
|
644 | this.adapter_.deregisterResizeHandler(this.resizeHandler_);
|
645 | }
|
646 | };
|
647 | MDCRippleFoundation.prototype.deregisterDeactivationHandlers_ = function() {
|
648 | var _this = this;
|
649 | this.adapter_.deregisterInteractionHandler("keyup", this.deactivateHandler_);
|
650 | POINTER_DEACTIVATION_EVENT_TYPES.forEach(function(evtType) {
|
651 | _this.adapter_.deregisterDocumentInteractionHandler(evtType, _this.deactivateHandler_);
|
652 | });
|
653 | };
|
654 | MDCRippleFoundation.prototype.removeCssVars_ = function() {
|
655 | var _this = this;
|
656 | var rippleStrings = MDCRippleFoundation.strings;
|
657 | var keys = Object.keys(rippleStrings);
|
658 | keys.forEach(function(key) {
|
659 | if (key.indexOf("VAR_") === 0) {
|
660 | _this.adapter_.updateCssVariable(rippleStrings[key], null);
|
661 | }
|
662 | });
|
663 | };
|
664 | MDCRippleFoundation.prototype.activate_ = function(evt) {
|
665 | var _this = this;
|
666 | if (this.adapter_.isSurfaceDisabled()) {
|
667 | return;
|
668 | }
|
669 | var activationState = this.activationState_;
|
670 | if (activationState.isActivated) {
|
671 | return;
|
672 | }
|
673 | var previousActivationEvent = this.previousActivationEvent_;
|
674 | var isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type;
|
675 | if (isSameInteraction) {
|
676 | return;
|
677 | }
|
678 | activationState.isActivated = true;
|
679 | activationState.isProgrammatic = evt === undefined;
|
680 | activationState.activationEvent = evt;
|
681 | activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (evt.type === "mousedown" || evt.type === "touchstart" || evt.type === "pointerdown");
|
682 | var hasActivatedChild = evt !== undefined && activatedTargets.length > 0 && activatedTargets.some(function(target) {
|
683 | return _this.adapter_.containsEventTarget(target);
|
684 | });
|
685 | if (hasActivatedChild) {
|
686 | this.resetActivationState_();
|
687 | return;
|
688 | }
|
689 | if (evt !== undefined) {
|
690 | activatedTargets.push(evt.target);
|
691 | this.registerDeactivationHandlers_(evt);
|
692 | }
|
693 | activationState.wasElementMadeActive = this.checkElementMadeActive_(evt);
|
694 | if (activationState.wasElementMadeActive) {
|
695 | this.animateActivation_();
|
696 | }
|
697 | requestAnimationFrame(function() {
|
698 | activatedTargets = [];
|
699 | if (!activationState.wasElementMadeActive && evt !== undefined && (evt.key === " " || evt.keyCode === 32)) {
|
700 | activationState.wasElementMadeActive = _this.checkElementMadeActive_(evt);
|
701 | if (activationState.wasElementMadeActive) {
|
702 | _this.animateActivation_();
|
703 | }
|
704 | }
|
705 | if (!activationState.wasElementMadeActive) {
|
706 | _this.activationState_ = _this.defaultActivationState_();
|
707 | }
|
708 | });
|
709 | };
|
710 | MDCRippleFoundation.prototype.checkElementMadeActive_ = function(evt) {
|
711 | return evt !== undefined && evt.type === "keydown" ? this.adapter_.isSurfaceActive() : true;
|
712 | };
|
713 | MDCRippleFoundation.prototype.animateActivation_ = function() {
|
714 | var _this = this;
|
715 | var _a = MDCRippleFoundation.strings, VAR_FG_TRANSLATE_START = _a.VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END = _a.VAR_FG_TRANSLATE_END;
|
716 | var _b = MDCRippleFoundation.cssClasses, FG_DEACTIVATION = _b.FG_DEACTIVATION, FG_ACTIVATION = _b.FG_ACTIVATION;
|
717 | var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
|
718 | this.layoutInternal_();
|
719 | var translateStart = "";
|
720 | var translateEnd = "";
|
721 | if (!this.adapter_.isUnbounded()) {
|
722 | var _c = this.getFgTranslationCoordinates_(), startPoint = _c.startPoint, endPoint = _c.endPoint;
|
723 | translateStart = startPoint.x + "px, " + startPoint.y + "px";
|
724 | translateEnd = endPoint.x + "px, " + endPoint.y + "px";
|
725 | }
|
726 | this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
|
727 | this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
|
728 | clearTimeout(this.activationTimer_);
|
729 | clearTimeout(this.fgDeactivationRemovalTimer_);
|
730 | this.rmBoundedActivationClasses_();
|
731 | this.adapter_.removeClass(FG_DEACTIVATION);
|
732 | this.adapter_.computeBoundingRect();
|
733 | this.adapter_.addClass(FG_ACTIVATION);
|
734 | this.activationTimer_ = setTimeout(function() {
|
735 | return _this.activationTimerCallback_();
|
736 | }, DEACTIVATION_TIMEOUT_MS);
|
737 | };
|
738 | MDCRippleFoundation.prototype.getFgTranslationCoordinates_ = function() {
|
739 | var _a = this.activationState_, activationEvent = _a.activationEvent, wasActivatedByPointer = _a.wasActivatedByPointer;
|
740 | var startPoint;
|
741 | if (wasActivatedByPointer) {
|
742 | startPoint = util_1.getNormalizedEventCoords(activationEvent, this.adapter_.getWindowPageOffset(), this.adapter_.computeBoundingRect());
|
743 | } else {
|
744 | startPoint = {
|
745 | x: this.frame_.width / 2,
|
746 | y: this.frame_.height / 2
|
747 | };
|
748 | }
|
749 | startPoint = {
|
750 | x: startPoint.x - this.initialSize_ / 2,
|
751 | y: startPoint.y - this.initialSize_ / 2
|
752 | };
|
753 | var endPoint = {
|
754 | x: this.frame_.width / 2 - this.initialSize_ / 2,
|
755 | y: this.frame_.height / 2 - this.initialSize_ / 2
|
756 | };
|
757 | return {
|
758 | startPoint: startPoint,
|
759 | endPoint: endPoint
|
760 | };
|
761 | };
|
762 | MDCRippleFoundation.prototype.runDeactivationUXLogicIfReady_ = function() {
|
763 | var _this = this;
|
764 | var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
|
765 | var _a = this.activationState_, hasDeactivationUXRun = _a.hasDeactivationUXRun, isActivated = _a.isActivated;
|
766 | var activationHasEnded = hasDeactivationUXRun || !isActivated;
|
767 | if (activationHasEnded && this.activationAnimationHasEnded_) {
|
768 | this.rmBoundedActivationClasses_();
|
769 | this.adapter_.addClass(FG_DEACTIVATION);
|
770 | this.fgDeactivationRemovalTimer_ = setTimeout(function() {
|
771 | _this.adapter_.removeClass(FG_DEACTIVATION);
|
772 | }, constants_1.numbers.FG_DEACTIVATION_MS);
|
773 | }
|
774 | };
|
775 | MDCRippleFoundation.prototype.rmBoundedActivationClasses_ = function() {
|
776 | var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
|
777 | this.adapter_.removeClass(FG_ACTIVATION);
|
778 | this.activationAnimationHasEnded_ = false;
|
779 | this.adapter_.computeBoundingRect();
|
780 | };
|
781 | MDCRippleFoundation.prototype.resetActivationState_ = function() {
|
782 | var _this = this;
|
783 | this.previousActivationEvent_ = this.activationState_.activationEvent;
|
784 | this.activationState_ = this.defaultActivationState_();
|
785 | setTimeout(function() {
|
786 | return _this.previousActivationEvent_ = undefined;
|
787 | }, MDCRippleFoundation.numbers.TAP_DELAY_MS);
|
788 | };
|
789 | MDCRippleFoundation.prototype.deactivate_ = function() {
|
790 | var _this = this;
|
791 | var activationState = this.activationState_;
|
792 | if (!activationState.isActivated) {
|
793 | return;
|
794 | }
|
795 | var state = __assign({}, activationState);
|
796 | if (activationState.isProgrammatic) {
|
797 | requestAnimationFrame(function() {
|
798 | return _this.animateDeactivation_(state);
|
799 | });
|
800 | this.resetActivationState_();
|
801 | } else {
|
802 | this.deregisterDeactivationHandlers_();
|
803 | requestAnimationFrame(function() {
|
804 | _this.activationState_.hasDeactivationUXRun = true;
|
805 | _this.animateDeactivation_(state);
|
806 | _this.resetActivationState_();
|
807 | });
|
808 | }
|
809 | };
|
810 | MDCRippleFoundation.prototype.animateDeactivation_ = function(_a) {
|
811 | var wasActivatedByPointer = _a.wasActivatedByPointer, wasElementMadeActive = _a.wasElementMadeActive;
|
812 | if (wasActivatedByPointer || wasElementMadeActive) {
|
813 | this.runDeactivationUXLogicIfReady_();
|
814 | }
|
815 | };
|
816 | MDCRippleFoundation.prototype.layoutInternal_ = function() {
|
817 | var _this = this;
|
818 | this.frame_ = this.adapter_.computeBoundingRect();
|
819 | var maxDim = Math.max(this.frame_.height, this.frame_.width);
|
820 | var getBoundedRadius = function getBoundedRadius() {
|
821 | var hypotenuse = Math.sqrt(Math.pow(_this.frame_.width, 2) + Math.pow(_this.frame_.height, 2));
|
822 | return hypotenuse + MDCRippleFoundation.numbers.PADDING;
|
823 | };
|
824 | this.maxRadius_ = this.adapter_.isUnbounded() ? maxDim : getBoundedRadius();
|
825 | this.initialSize_ = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);
|
826 | this.fgScale_ = "" + this.maxRadius_ / this.initialSize_;
|
827 | this.updateLayoutCssVars_();
|
828 | };
|
829 | MDCRippleFoundation.prototype.updateLayoutCssVars_ = function() {
|
830 | var _a = MDCRippleFoundation.strings, VAR_FG_SIZE = _a.VAR_FG_SIZE, VAR_LEFT = _a.VAR_LEFT, VAR_TOP = _a.VAR_TOP, VAR_FG_SCALE = _a.VAR_FG_SCALE;
|
831 | this.adapter_.updateCssVariable(VAR_FG_SIZE, this.initialSize_ + "px");
|
832 | this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_);
|
833 | if (this.adapter_.isUnbounded()) {
|
834 | this.unboundedCoords_ = {
|
835 | left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2),
|
836 | top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2)
|
837 | };
|
838 | this.adapter_.updateCssVariable(VAR_LEFT, this.unboundedCoords_.left + "px");
|
839 | this.adapter_.updateCssVariable(VAR_TOP, this.unboundedCoords_.top + "px");
|
840 | }
|
841 | };
|
842 | return MDCRippleFoundation;
|
843 | }(foundation_1.MDCFoundation);
|
844 | exports.MDCRippleFoundation = MDCRippleFoundation;
|
845 | exports.default = MDCRippleFoundation;
|
846 | }, function(module, exports, __webpack_require__) {
|
847 | "use strict";
|
848 | var __extends = this && this.__extends || function() {
|
849 | var _extendStatics = function extendStatics(d, b) {
|
850 | _extendStatics = Object.setPrototypeOf || {
|
851 | __proto__: []
|
852 | } instanceof Array && function(d, b) {
|
853 | d.__proto__ = b;
|
854 | } || function(d, b) {
|
855 | for (var p in b) {
|
856 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
857 | }
|
858 | };
|
859 | return _extendStatics(d, b);
|
860 | };
|
861 | return function(d, b) {
|
862 | _extendStatics(d, b);
|
863 | function __() {
|
864 | this.constructor = d;
|
865 | }
|
866 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
867 | };
|
868 | }();
|
869 | var __assign = this && this.__assign || function() {
|
870 | __assign = Object.assign || function(t) {
|
871 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
872 | s = arguments[i];
|
873 | for (var p in s) {
|
874 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
875 | }
|
876 | }
|
877 | return t;
|
878 | };
|
879 | return __assign.apply(this, arguments);
|
880 | };
|
881 | Object.defineProperty(exports, "__esModule", {
|
882 | value: true
|
883 | });
|
884 | var foundation_1 = __webpack_require__(0);
|
885 | var constants_1 = __webpack_require__(35);
|
886 | var ELEMENTS_KEY_ALLOWED_IN = [ "input", "button", "textarea", "select" ];
|
887 | function isNumberArray(selectedIndex) {
|
888 | return selectedIndex instanceof Array;
|
889 | }
|
890 | var MDCListFoundation = function(_super) {
|
891 | __extends(MDCListFoundation, _super);
|
892 | function MDCListFoundation(adapter) {
|
893 | var _this = _super.call(this, __assign({}, MDCListFoundation.defaultAdapter, adapter)) || this;
|
894 | _this.wrapFocus_ = false;
|
895 | _this.isVertical_ = true;
|
896 | _this.isSingleSelectionList_ = false;
|
897 | _this.selectedIndex_ = constants_1.numbers.UNSET_INDEX;
|
898 | _this.focusedItemIndex_ = constants_1.numbers.UNSET_INDEX;
|
899 | _this.useActivatedClass_ = false;
|
900 | _this.ariaCurrentAttrValue_ = null;
|
901 | _this.isCheckboxList_ = false;
|
902 | _this.isRadioList_ = false;
|
903 | return _this;
|
904 | }
|
905 | Object.defineProperty(MDCListFoundation, "strings", {
|
906 | get: function get() {
|
907 | return constants_1.strings;
|
908 | },
|
909 | enumerable: true,
|
910 | configurable: true
|
911 | });
|
912 | Object.defineProperty(MDCListFoundation, "cssClasses", {
|
913 | get: function get() {
|
914 | return constants_1.cssClasses;
|
915 | },
|
916 | enumerable: true,
|
917 | configurable: true
|
918 | });
|
919 | Object.defineProperty(MDCListFoundation, "numbers", {
|
920 | get: function get() {
|
921 | return constants_1.numbers;
|
922 | },
|
923 | enumerable: true,
|
924 | configurable: true
|
925 | });
|
926 | Object.defineProperty(MDCListFoundation, "defaultAdapter", {
|
927 | get: function get() {
|
928 | return {
|
929 | addClassForElementIndex: function addClassForElementIndex() {
|
930 | return undefined;
|
931 | },
|
932 | focusItemAtIndex: function focusItemAtIndex() {
|
933 | return undefined;
|
934 | },
|
935 | getAttributeForElementIndex: function getAttributeForElementIndex() {
|
936 | return null;
|
937 | },
|
938 | getFocusedElementIndex: function getFocusedElementIndex() {
|
939 | return 0;
|
940 | },
|
941 | getListItemCount: function getListItemCount() {
|
942 | return 0;
|
943 | },
|
944 | hasCheckboxAtIndex: function hasCheckboxAtIndex() {
|
945 | return false;
|
946 | },
|
947 | hasRadioAtIndex: function hasRadioAtIndex() {
|
948 | return false;
|
949 | },
|
950 | isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex() {
|
951 | return false;
|
952 | },
|
953 | isFocusInsideList: function isFocusInsideList() {
|
954 | return false;
|
955 | },
|
956 | isRootFocused: function isRootFocused() {
|
957 | return false;
|
958 | },
|
959 | notifyAction: function notifyAction() {
|
960 | return undefined;
|
961 | },
|
962 | removeClassForElementIndex: function removeClassForElementIndex() {
|
963 | return undefined;
|
964 | },
|
965 | setAttributeForElementIndex: function setAttributeForElementIndex() {
|
966 | return undefined;
|
967 | },
|
968 | setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex() {
|
969 | return undefined;
|
970 | },
|
971 | setTabIndexForListItemChildren: function setTabIndexForListItemChildren() {
|
972 | return undefined;
|
973 | }
|
974 | };
|
975 | },
|
976 | enumerable: true,
|
977 | configurable: true
|
978 | });
|
979 | MDCListFoundation.prototype.layout = function() {
|
980 | if (this.adapter_.getListItemCount() === 0) {
|
981 | return;
|
982 | }
|
983 | if (this.adapter_.hasCheckboxAtIndex(0)) {
|
984 | this.isCheckboxList_ = true;
|
985 | } else if (this.adapter_.hasRadioAtIndex(0)) {
|
986 | this.isRadioList_ = true;
|
987 | }
|
988 | };
|
989 | MDCListFoundation.prototype.setWrapFocus = function(value) {
|
990 | this.wrapFocus_ = value;
|
991 | };
|
992 | MDCListFoundation.prototype.setVerticalOrientation = function(value) {
|
993 | this.isVertical_ = value;
|
994 | };
|
995 | MDCListFoundation.prototype.setSingleSelection = function(value) {
|
996 | this.isSingleSelectionList_ = value;
|
997 | };
|
998 | MDCListFoundation.prototype.setUseActivatedClass = function(useActivated) {
|
999 | this.useActivatedClass_ = useActivated;
|
1000 | };
|
1001 | MDCListFoundation.prototype.getSelectedIndex = function() {
|
1002 | return this.selectedIndex_;
|
1003 | };
|
1004 | MDCListFoundation.prototype.setSelectedIndex = function(index) {
|
1005 | if (!this.isIndexValid_(index)) {
|
1006 | return;
|
1007 | }
|
1008 | if (this.isCheckboxList_) {
|
1009 | this.setCheckboxAtIndex_(index);
|
1010 | } else if (this.isRadioList_) {
|
1011 | this.setRadioAtIndex_(index);
|
1012 | } else {
|
1013 | this.setSingleSelectionAtIndex_(index);
|
1014 | }
|
1015 | };
|
1016 | MDCListFoundation.prototype.handleFocusIn = function(_, listItemIndex) {
|
1017 | if (listItemIndex >= 0) {
|
1018 | this.adapter_.setTabIndexForListItemChildren(listItemIndex, "0");
|
1019 | }
|
1020 | };
|
1021 | MDCListFoundation.prototype.handleFocusOut = function(_, listItemIndex) {
|
1022 | var _this = this;
|
1023 | if (listItemIndex >= 0) {
|
1024 | this.adapter_.setTabIndexForListItemChildren(listItemIndex, "-1");
|
1025 | }
|
1026 | setTimeout(function() {
|
1027 | if (!_this.adapter_.isFocusInsideList()) {
|
1028 | _this.setTabindexToFirstSelectedItem_();
|
1029 | }
|
1030 | }, 0);
|
1031 | };
|
1032 | MDCListFoundation.prototype.handleKeydown = function(evt, isRootListItem, listItemIndex) {
|
1033 | var isArrowLeft = evt.key === "ArrowLeft" || evt.keyCode === 37;
|
1034 | var isArrowUp = evt.key === "ArrowUp" || evt.keyCode === 38;
|
1035 | var isArrowRight = evt.key === "ArrowRight" || evt.keyCode === 39;
|
1036 | var isArrowDown = evt.key === "ArrowDown" || evt.keyCode === 40;
|
1037 | var isHome = evt.key === "Home" || evt.keyCode === 36;
|
1038 | var isEnd = evt.key === "End" || evt.keyCode === 35;
|
1039 | var isEnter = evt.key === "Enter" || evt.keyCode === 13;
|
1040 | var isSpace = evt.key === "Space" || evt.keyCode === 32;
|
1041 | if (this.adapter_.isRootFocused()) {
|
1042 | if (isArrowUp || isEnd) {
|
1043 | evt.preventDefault();
|
1044 | this.focusLastElement();
|
1045 | } else if (isArrowDown || isHome) {
|
1046 | evt.preventDefault();
|
1047 | this.focusFirstElement();
|
1048 | }
|
1049 | return;
|
1050 | }
|
1051 | var currentIndex = this.adapter_.getFocusedElementIndex();
|
1052 | if (currentIndex === -1) {
|
1053 | currentIndex = listItemIndex;
|
1054 | if (currentIndex < 0) {
|
1055 | return;
|
1056 | }
|
1057 | }
|
1058 | var nextIndex;
|
1059 | if (this.isVertical_ && isArrowDown || !this.isVertical_ && isArrowRight) {
|
1060 | this.preventDefaultEvent_(evt);
|
1061 | nextIndex = this.focusNextElement(currentIndex);
|
1062 | } else if (this.isVertical_ && isArrowUp || !this.isVertical_ && isArrowLeft) {
|
1063 | this.preventDefaultEvent_(evt);
|
1064 | nextIndex = this.focusPrevElement(currentIndex);
|
1065 | } else if (isHome) {
|
1066 | this.preventDefaultEvent_(evt);
|
1067 | nextIndex = this.focusFirstElement();
|
1068 | } else if (isEnd) {
|
1069 | this.preventDefaultEvent_(evt);
|
1070 | nextIndex = this.focusLastElement();
|
1071 | } else if (isEnter || isSpace) {
|
1072 | if (isRootListItem) {
|
1073 | var target = evt.target;
|
1074 | if (target && target.tagName === "A" && isEnter) {
|
1075 | return;
|
1076 | }
|
1077 | this.preventDefaultEvent_(evt);
|
1078 | if (this.isSelectableList_()) {
|
1079 | this.setSelectedIndexOnAction_(currentIndex);
|
1080 | }
|
1081 | this.adapter_.notifyAction(currentIndex);
|
1082 | }
|
1083 | }
|
1084 | this.focusedItemIndex_ = currentIndex;
|
1085 | if (nextIndex !== undefined) {
|
1086 | this.setTabindexAtIndex_(nextIndex);
|
1087 | this.focusedItemIndex_ = nextIndex;
|
1088 | }
|
1089 | };
|
1090 | MDCListFoundation.prototype.handleClick = function(index, toggleCheckbox) {
|
1091 | if (index === constants_1.numbers.UNSET_INDEX) {
|
1092 | return;
|
1093 | }
|
1094 | if (this.isSelectableList_()) {
|
1095 | this.setSelectedIndexOnAction_(index, toggleCheckbox);
|
1096 | }
|
1097 | this.adapter_.notifyAction(index);
|
1098 | this.setTabindexAtIndex_(index);
|
1099 | this.focusedItemIndex_ = index;
|
1100 | };
|
1101 | MDCListFoundation.prototype.focusNextElement = function(index) {
|
1102 | var count = this.adapter_.getListItemCount();
|
1103 | var nextIndex = index + 1;
|
1104 | if (nextIndex >= count) {
|
1105 | if (this.wrapFocus_) {
|
1106 | nextIndex = 0;
|
1107 | } else {
|
1108 | return index;
|
1109 | }
|
1110 | }
|
1111 | this.adapter_.focusItemAtIndex(nextIndex);
|
1112 | return nextIndex;
|
1113 | };
|
1114 | MDCListFoundation.prototype.focusPrevElement = function(index) {
|
1115 | var prevIndex = index - 1;
|
1116 | if (prevIndex < 0) {
|
1117 | if (this.wrapFocus_) {
|
1118 | prevIndex = this.adapter_.getListItemCount() - 1;
|
1119 | } else {
|
1120 | return index;
|
1121 | }
|
1122 | }
|
1123 | this.adapter_.focusItemAtIndex(prevIndex);
|
1124 | return prevIndex;
|
1125 | };
|
1126 | MDCListFoundation.prototype.focusFirstElement = function() {
|
1127 | this.adapter_.focusItemAtIndex(0);
|
1128 | return 0;
|
1129 | };
|
1130 | MDCListFoundation.prototype.focusLastElement = function() {
|
1131 | var lastIndex = this.adapter_.getListItemCount() - 1;
|
1132 | this.adapter_.focusItemAtIndex(lastIndex);
|
1133 | return lastIndex;
|
1134 | };
|
1135 | MDCListFoundation.prototype.preventDefaultEvent_ = function(evt) {
|
1136 | var target = evt.target;
|
1137 | var tagName = ("" + target.tagName).toLowerCase();
|
1138 | if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
|
1139 | evt.preventDefault();
|
1140 | }
|
1141 | };
|
1142 | MDCListFoundation.prototype.setSingleSelectionAtIndex_ = function(index) {
|
1143 | if (this.selectedIndex_ === index) {
|
1144 | return;
|
1145 | }
|
1146 | var selectedClassName = constants_1.cssClasses.LIST_ITEM_SELECTED_CLASS;
|
1147 | if (this.useActivatedClass_) {
|
1148 | selectedClassName = constants_1.cssClasses.LIST_ITEM_ACTIVATED_CLASS;
|
1149 | }
|
1150 | if (this.selectedIndex_ !== constants_1.numbers.UNSET_INDEX) {
|
1151 | this.adapter_.removeClassForElementIndex(this.selectedIndex_, selectedClassName);
|
1152 | }
|
1153 | this.adapter_.addClassForElementIndex(index, selectedClassName);
|
1154 | this.setAriaForSingleSelectionAtIndex_(index);
|
1155 | this.selectedIndex_ = index;
|
1156 | };
|
1157 | MDCListFoundation.prototype.setAriaForSingleSelectionAtIndex_ = function(index) {
|
1158 | if (this.selectedIndex_ === constants_1.numbers.UNSET_INDEX) {
|
1159 | this.ariaCurrentAttrValue_ = this.adapter_.getAttributeForElementIndex(index, constants_1.strings.ARIA_CURRENT);
|
1160 | }
|
1161 | var isAriaCurrent = this.ariaCurrentAttrValue_ !== null;
|
1162 | var ariaAttribute = isAriaCurrent ? constants_1.strings.ARIA_CURRENT : constants_1.strings.ARIA_SELECTED;
|
1163 | if (this.selectedIndex_ !== constants_1.numbers.UNSET_INDEX) {
|
1164 | this.adapter_.setAttributeForElementIndex(this.selectedIndex_, ariaAttribute, "false");
|
1165 | }
|
1166 | var ariaAttributeValue = isAriaCurrent ? this.ariaCurrentAttrValue_ : "true";
|
1167 | this.adapter_.setAttributeForElementIndex(index, ariaAttribute, ariaAttributeValue);
|
1168 | };
|
1169 | MDCListFoundation.prototype.setRadioAtIndex_ = function(index) {
|
1170 | this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, true);
|
1171 | if (this.selectedIndex_ !== constants_1.numbers.UNSET_INDEX) {
|
1172 | this.adapter_.setAttributeForElementIndex(this.selectedIndex_, constants_1.strings.ARIA_CHECKED, "false");
|
1173 | }
|
1174 | this.adapter_.setAttributeForElementIndex(index, constants_1.strings.ARIA_CHECKED, "true");
|
1175 | this.selectedIndex_ = index;
|
1176 | };
|
1177 | MDCListFoundation.prototype.setCheckboxAtIndex_ = function(index) {
|
1178 | for (var i = 0; i < this.adapter_.getListItemCount(); i++) {
|
1179 | var isChecked = false;
|
1180 | if (index.indexOf(i) >= 0) {
|
1181 | isChecked = true;
|
1182 | }
|
1183 | this.adapter_.setCheckedCheckboxOrRadioAtIndex(i, isChecked);
|
1184 | this.adapter_.setAttributeForElementIndex(i, constants_1.strings.ARIA_CHECKED, isChecked ? "true" : "false");
|
1185 | }
|
1186 | this.selectedIndex_ = index;
|
1187 | };
|
1188 | MDCListFoundation.prototype.setTabindexAtIndex_ = function(index) {
|
1189 | if (this.focusedItemIndex_ === constants_1.numbers.UNSET_INDEX && index !== 0) {
|
1190 | this.adapter_.setAttributeForElementIndex(0, "tabindex", "-1");
|
1191 | } else if (this.focusedItemIndex_ >= 0 && this.focusedItemIndex_ !== index) {
|
1192 | this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_, "tabindex", "-1");
|
1193 | }
|
1194 | this.adapter_.setAttributeForElementIndex(index, "tabindex", "0");
|
1195 | };
|
1196 | MDCListFoundation.prototype.isSelectableList_ = function() {
|
1197 | return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_;
|
1198 | };
|
1199 | MDCListFoundation.prototype.setTabindexToFirstSelectedItem_ = function() {
|
1200 | var targetIndex = 0;
|
1201 | if (this.isSelectableList_()) {
|
1202 | if (typeof this.selectedIndex_ === "number" && this.selectedIndex_ !== constants_1.numbers.UNSET_INDEX) {
|
1203 | targetIndex = this.selectedIndex_;
|
1204 | } else if (isNumberArray(this.selectedIndex_) && this.selectedIndex_.length > 0) {
|
1205 | targetIndex = this.selectedIndex_.reduce(function(currentIndex, minIndex) {
|
1206 | return Math.min(currentIndex, minIndex);
|
1207 | });
|
1208 | }
|
1209 | }
|
1210 | this.setTabindexAtIndex_(targetIndex);
|
1211 | };
|
1212 | MDCListFoundation.prototype.isIndexValid_ = function(index) {
|
1213 | var _this = this;
|
1214 | if (index instanceof Array) {
|
1215 | if (!this.isCheckboxList_) {
|
1216 | throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");
|
1217 | }
|
1218 | if (index.length === 0) {
|
1219 | return true;
|
1220 | } else {
|
1221 | return index.some(function(i) {
|
1222 | return _this.isIndexInRange_(i);
|
1223 | });
|
1224 | }
|
1225 | } else if (typeof index === "number") {
|
1226 | if (this.isCheckboxList_) {
|
1227 | throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: " + index);
|
1228 | }
|
1229 | return this.isIndexInRange_(index);
|
1230 | } else {
|
1231 | return false;
|
1232 | }
|
1233 | };
|
1234 | MDCListFoundation.prototype.isIndexInRange_ = function(index) {
|
1235 | var listSize = this.adapter_.getListItemCount();
|
1236 | return index >= 0 && index < listSize;
|
1237 | };
|
1238 | MDCListFoundation.prototype.setSelectedIndexOnAction_ = function(index, toggleCheckbox) {
|
1239 | if (toggleCheckbox === void 0) {
|
1240 | toggleCheckbox = true;
|
1241 | }
|
1242 | if (this.isCheckboxList_) {
|
1243 | this.toggleCheckboxAtIndex_(index, toggleCheckbox);
|
1244 | } else {
|
1245 | this.setSelectedIndex(index);
|
1246 | }
|
1247 | };
|
1248 | MDCListFoundation.prototype.toggleCheckboxAtIndex_ = function(index, toggleCheckbox) {
|
1249 | var isChecked = this.adapter_.isCheckboxCheckedAtIndex(index);
|
1250 | if (toggleCheckbox) {
|
1251 | isChecked = !isChecked;
|
1252 | this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked);
|
1253 | }
|
1254 | this.adapter_.setAttributeForElementIndex(index, constants_1.strings.ARIA_CHECKED, isChecked ? "true" : "false");
|
1255 | var selectedIndexes = this.selectedIndex_ === constants_1.numbers.UNSET_INDEX ? [] : this.selectedIndex_.slice();
|
1256 | if (isChecked) {
|
1257 | selectedIndexes.push(index);
|
1258 | } else {
|
1259 | selectedIndexes = selectedIndexes.filter(function(i) {
|
1260 | return i !== index;
|
1261 | });
|
1262 | }
|
1263 | this.selectedIndex_ = selectedIndexes;
|
1264 | };
|
1265 | return MDCListFoundation;
|
1266 | }(foundation_1.MDCFoundation);
|
1267 | exports.MDCListFoundation = MDCListFoundation;
|
1268 | exports.default = MDCListFoundation;
|
1269 | }, function(module, exports, __webpack_require__) {
|
1270 | "use strict";
|
1271 | Object.defineProperty(exports, "__esModule", {
|
1272 | value: true
|
1273 | });
|
1274 | var cssClasses = {
|
1275 | ANCHOR: "mdc-menu-surface--anchor",
|
1276 | ANIMATING_CLOSED: "mdc-menu-surface--animating-closed",
|
1277 | ANIMATING_OPEN: "mdc-menu-surface--animating-open",
|
1278 | FIXED: "mdc-menu-surface--fixed",
|
1279 | OPEN: "mdc-menu-surface--open",
|
1280 | ROOT: "mdc-menu-surface"
|
1281 | };
|
1282 | exports.cssClasses = cssClasses;
|
1283 | var strings = {
|
1284 | CLOSED_EVENT: "MDCMenuSurface:closed",
|
1285 | OPENED_EVENT: "MDCMenuSurface:opened",
|
1286 | FOCUSABLE_ELEMENTS: [ "button:not(:disabled)", '[href]:not([aria-disabled="true"])', "input:not(:disabled)", "select:not(:disabled)", "textarea:not(:disabled)", '[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])' ].join(", ")
|
1287 | };
|
1288 | exports.strings = strings;
|
1289 | var numbers = {
|
1290 | TRANSITION_OPEN_DURATION: 120,
|
1291 | TRANSITION_CLOSE_DURATION: 75,
|
1292 | MARGIN_TO_EDGE: 32,
|
1293 | ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: .67
|
1294 | };
|
1295 | exports.numbers = numbers;
|
1296 | var CornerBit;
|
1297 | (function(CornerBit) {
|
1298 | CornerBit[CornerBit["BOTTOM"] = 1] = "BOTTOM";
|
1299 | CornerBit[CornerBit["CENTER"] = 2] = "CENTER";
|
1300 | CornerBit[CornerBit["RIGHT"] = 4] = "RIGHT";
|
1301 | CornerBit[CornerBit["FLIP_RTL"] = 8] = "FLIP_RTL";
|
1302 | })(CornerBit || (CornerBit = {}));
|
1303 | exports.CornerBit = CornerBit;
|
1304 | var Corner;
|
1305 | (function(Corner) {
|
1306 | Corner[Corner["TOP_LEFT"] = 0] = "TOP_LEFT";
|
1307 | Corner[Corner["TOP_RIGHT"] = 4] = "TOP_RIGHT";
|
1308 | Corner[Corner["BOTTOM_LEFT"] = 1] = "BOTTOM_LEFT";
|
1309 | Corner[Corner["BOTTOM_RIGHT"] = 5] = "BOTTOM_RIGHT";
|
1310 | Corner[Corner["TOP_START"] = 8] = "TOP_START";
|
1311 | Corner[Corner["TOP_END"] = 12] = "TOP_END";
|
1312 | Corner[Corner["BOTTOM_START"] = 9] = "BOTTOM_START";
|
1313 | Corner[Corner["BOTTOM_END"] = 13] = "BOTTOM_END";
|
1314 | })(Corner || (Corner = {}));
|
1315 | exports.Corner = Corner;
|
1316 | }, function(module, exports, __webpack_require__) {
|
1317 | "use strict";
|
1318 | Object.defineProperty(exports, "__esModule", {
|
1319 | value: true
|
1320 | });
|
1321 | var cssClasses = {
|
1322 | FIXED_CLASS: "mdc-top-app-bar--fixed",
|
1323 | FIXED_SCROLLED_CLASS: "mdc-top-app-bar--fixed-scrolled",
|
1324 | SHORT_CLASS: "mdc-top-app-bar--short",
|
1325 | SHORT_COLLAPSED_CLASS: "mdc-top-app-bar--short-collapsed",
|
1326 | SHORT_HAS_ACTION_ITEM_CLASS: "mdc-top-app-bar--short-has-action-item"
|
1327 | };
|
1328 | exports.cssClasses = cssClasses;
|
1329 | var numbers = {
|
1330 | DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100,
|
1331 | MAX_TOP_APP_BAR_HEIGHT: 128
|
1332 | };
|
1333 | exports.numbers = numbers;
|
1334 | var strings = {
|
1335 | ACTION_ITEM_SELECTOR: ".mdc-top-app-bar__action-item",
|
1336 | NAVIGATION_EVENT: "MDCTopAppBar:nav",
|
1337 | NAVIGATION_ICON_SELECTOR: ".mdc-top-app-bar__navigation-icon",
|
1338 | ROOT_SELECTOR: ".mdc-top-app-bar",
|
1339 | TITLE_SELECTOR: ".mdc-top-app-bar__title"
|
1340 | };
|
1341 | exports.strings = strings;
|
1342 | }, function(module, exports, __webpack_require__) {
|
1343 | "use strict";
|
1344 | var __extends = this && this.__extends || function() {
|
1345 | var _extendStatics = function extendStatics(d, b) {
|
1346 | _extendStatics = Object.setPrototypeOf || {
|
1347 | __proto__: []
|
1348 | } instanceof Array && function(d, b) {
|
1349 | d.__proto__ = b;
|
1350 | } || function(d, b) {
|
1351 | for (var p in b) {
|
1352 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
1353 | }
|
1354 | };
|
1355 | return _extendStatics(d, b);
|
1356 | };
|
1357 | return function(d, b) {
|
1358 | _extendStatics(d, b);
|
1359 | function __() {
|
1360 | this.constructor = d;
|
1361 | }
|
1362 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
1363 | };
|
1364 | }();
|
1365 | var __assign = this && this.__assign || function() {
|
1366 | __assign = Object.assign || function(t) {
|
1367 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
1368 | s = arguments[i];
|
1369 | for (var p in s) {
|
1370 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
1371 | }
|
1372 | }
|
1373 | return t;
|
1374 | };
|
1375 | return __assign.apply(this, arguments);
|
1376 | };
|
1377 | var __values = this && this.__values || function(o) {
|
1378 | var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
1379 | if (m) return m.call(o);
|
1380 | return {
|
1381 | next: function next() {
|
1382 | if (o && i >= o.length) o = void 0;
|
1383 | return {
|
1384 | value: o && o[i++],
|
1385 | done: !o
|
1386 | };
|
1387 | }
|
1388 | };
|
1389 | };
|
1390 | Object.defineProperty(exports, "__esModule", {
|
1391 | value: true
|
1392 | });
|
1393 | var foundation_1 = __webpack_require__(0);
|
1394 | var constants_1 = __webpack_require__(6);
|
1395 | var MDCMenuSurfaceFoundation = function(_super) {
|
1396 | __extends(MDCMenuSurfaceFoundation, _super);
|
1397 | function MDCMenuSurfaceFoundation(adapter) {
|
1398 | var _this = _super.call(this, __assign({}, MDCMenuSurfaceFoundation.defaultAdapter, adapter)) || this;
|
1399 | _this.isOpen_ = false;
|
1400 | _this.isQuickOpen_ = false;
|
1401 | _this.isHoistedElement_ = false;
|
1402 | _this.isFixedPosition_ = false;
|
1403 | _this.openAnimationEndTimerId_ = 0;
|
1404 | _this.closeAnimationEndTimerId_ = 0;
|
1405 | _this.animationRequestId_ = 0;
|
1406 | _this.anchorCorner_ = constants_1.Corner.TOP_START;
|
1407 | _this.anchorMargin_ = {
|
1408 | top: 0,
|
1409 | right: 0,
|
1410 | bottom: 0,
|
1411 | left: 0
|
1412 | };
|
1413 | _this.position_ = {
|
1414 | x: 0,
|
1415 | y: 0
|
1416 | };
|
1417 | return _this;
|
1418 | }
|
1419 | Object.defineProperty(MDCMenuSurfaceFoundation, "cssClasses", {
|
1420 | get: function get() {
|
1421 | return constants_1.cssClasses;
|
1422 | },
|
1423 | enumerable: true,
|
1424 | configurable: true
|
1425 | });
|
1426 | Object.defineProperty(MDCMenuSurfaceFoundation, "strings", {
|
1427 | get: function get() {
|
1428 | return constants_1.strings;
|
1429 | },
|
1430 | enumerable: true,
|
1431 | configurable: true
|
1432 | });
|
1433 | Object.defineProperty(MDCMenuSurfaceFoundation, "numbers", {
|
1434 | get: function get() {
|
1435 | return constants_1.numbers;
|
1436 | },
|
1437 | enumerable: true,
|
1438 | configurable: true
|
1439 | });
|
1440 | Object.defineProperty(MDCMenuSurfaceFoundation, "Corner", {
|
1441 | get: function get() {
|
1442 | return constants_1.Corner;
|
1443 | },
|
1444 | enumerable: true,
|
1445 | configurable: true
|
1446 | });
|
1447 | Object.defineProperty(MDCMenuSurfaceFoundation, "defaultAdapter", {
|
1448 | get: function get() {
|
1449 | return {
|
1450 | addClass: function addClass() {
|
1451 | return undefined;
|
1452 | },
|
1453 | removeClass: function removeClass() {
|
1454 | return undefined;
|
1455 | },
|
1456 | hasClass: function hasClass() {
|
1457 | return false;
|
1458 | },
|
1459 | hasAnchor: function hasAnchor() {
|
1460 | return false;
|
1461 | },
|
1462 | isElementInContainer: function isElementInContainer() {
|
1463 | return false;
|
1464 | },
|
1465 | isFocused: function isFocused() {
|
1466 | return false;
|
1467 | },
|
1468 | isFirstElementFocused: function isFirstElementFocused() {
|
1469 | return false;
|
1470 | },
|
1471 | isLastElementFocused: function isLastElementFocused() {
|
1472 | return false;
|
1473 | },
|
1474 | isRtl: function isRtl() {
|
1475 | return false;
|
1476 | },
|
1477 | getInnerDimensions: function getInnerDimensions() {
|
1478 | return {
|
1479 | height: 0,
|
1480 | width: 0
|
1481 | };
|
1482 | },
|
1483 | getAnchorDimensions: function getAnchorDimensions() {
|
1484 | return null;
|
1485 | },
|
1486 | getWindowDimensions: function getWindowDimensions() {
|
1487 | return {
|
1488 | height: 0,
|
1489 | width: 0
|
1490 | };
|
1491 | },
|
1492 | getBodyDimensions: function getBodyDimensions() {
|
1493 | return {
|
1494 | height: 0,
|
1495 | width: 0
|
1496 | };
|
1497 | },
|
1498 | getWindowScroll: function getWindowScroll() {
|
1499 | return {
|
1500 | x: 0,
|
1501 | y: 0
|
1502 | };
|
1503 | },
|
1504 | setPosition: function setPosition() {
|
1505 | return undefined;
|
1506 | },
|
1507 | setMaxHeight: function setMaxHeight() {
|
1508 | return undefined;
|
1509 | },
|
1510 | setTransformOrigin: function setTransformOrigin() {
|
1511 | return undefined;
|
1512 | },
|
1513 | saveFocus: function saveFocus() {
|
1514 | return undefined;
|
1515 | },
|
1516 | restoreFocus: function restoreFocus() {
|
1517 | return undefined;
|
1518 | },
|
1519 | focusFirstElement: function focusFirstElement() {
|
1520 | return undefined;
|
1521 | },
|
1522 | focusLastElement: function focusLastElement() {
|
1523 | return undefined;
|
1524 | },
|
1525 | notifyClose: function notifyClose() {
|
1526 | return undefined;
|
1527 | },
|
1528 | notifyOpen: function notifyOpen() {
|
1529 | return undefined;
|
1530 | }
|
1531 | };
|
1532 | },
|
1533 | enumerable: true,
|
1534 | configurable: true
|
1535 | });
|
1536 | MDCMenuSurfaceFoundation.prototype.init = function() {
|
1537 | var _a = MDCMenuSurfaceFoundation.cssClasses, ROOT = _a.ROOT, OPEN = _a.OPEN;
|
1538 | if (!this.adapter_.hasClass(ROOT)) {
|
1539 | throw new Error(ROOT + " class required in root element.");
|
1540 | }
|
1541 | if (this.adapter_.hasClass(OPEN)) {
|
1542 | this.isOpen_ = true;
|
1543 | }
|
1544 | };
|
1545 | MDCMenuSurfaceFoundation.prototype.destroy = function() {
|
1546 | clearTimeout(this.openAnimationEndTimerId_);
|
1547 | clearTimeout(this.closeAnimationEndTimerId_);
|
1548 | cancelAnimationFrame(this.animationRequestId_);
|
1549 | };
|
1550 | MDCMenuSurfaceFoundation.prototype.setAnchorCorner = function(corner) {
|
1551 | this.anchorCorner_ = corner;
|
1552 | };
|
1553 | MDCMenuSurfaceFoundation.prototype.setAnchorMargin = function(margin) {
|
1554 | this.anchorMargin_.top = margin.top || 0;
|
1555 | this.anchorMargin_.right = margin.right || 0;
|
1556 | this.anchorMargin_.bottom = margin.bottom || 0;
|
1557 | this.anchorMargin_.left = margin.left || 0;
|
1558 | };
|
1559 | MDCMenuSurfaceFoundation.prototype.setIsHoisted = function(isHoisted) {
|
1560 | this.isHoistedElement_ = isHoisted;
|
1561 | };
|
1562 | MDCMenuSurfaceFoundation.prototype.setFixedPosition = function(isFixedPosition) {
|
1563 | this.isFixedPosition_ = isFixedPosition;
|
1564 | };
|
1565 | MDCMenuSurfaceFoundation.prototype.setAbsolutePosition = function(x, y) {
|
1566 | this.position_.x = this.isFinite_(x) ? x : 0;
|
1567 | this.position_.y = this.isFinite_(y) ? y : 0;
|
1568 | };
|
1569 | MDCMenuSurfaceFoundation.prototype.setQuickOpen = function(quickOpen) {
|
1570 | this.isQuickOpen_ = quickOpen;
|
1571 | };
|
1572 | MDCMenuSurfaceFoundation.prototype.isOpen = function() {
|
1573 | return this.isOpen_;
|
1574 | };
|
1575 | MDCMenuSurfaceFoundation.prototype.open = function() {
|
1576 | var _this = this;
|
1577 | this.adapter_.saveFocus();
|
1578 | if (!this.isQuickOpen_) {
|
1579 | this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
|
1580 | }
|
1581 | this.animationRequestId_ = requestAnimationFrame(function() {
|
1582 | _this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
|
1583 | _this.dimensions_ = _this.adapter_.getInnerDimensions();
|
1584 | _this.autoPosition_();
|
1585 | if (_this.isQuickOpen_) {
|
1586 | _this.adapter_.notifyOpen();
|
1587 | } else {
|
1588 | _this.openAnimationEndTimerId_ = setTimeout(function() {
|
1589 | _this.openAnimationEndTimerId_ = 0;
|
1590 | _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
|
1591 | _this.adapter_.notifyOpen();
|
1592 | }, constants_1.numbers.TRANSITION_OPEN_DURATION);
|
1593 | }
|
1594 | });
|
1595 | this.isOpen_ = true;
|
1596 | };
|
1597 | MDCMenuSurfaceFoundation.prototype.close = function() {
|
1598 | var _this = this;
|
1599 | if (!this.isQuickOpen_) {
|
1600 | this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
|
1601 | }
|
1602 | requestAnimationFrame(function() {
|
1603 | _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
|
1604 | if (_this.isQuickOpen_) {
|
1605 | _this.adapter_.notifyClose();
|
1606 | } else {
|
1607 | _this.closeAnimationEndTimerId_ = setTimeout(function() {
|
1608 | _this.closeAnimationEndTimerId_ = 0;
|
1609 | _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
|
1610 | _this.adapter_.notifyClose();
|
1611 | }, constants_1.numbers.TRANSITION_CLOSE_DURATION);
|
1612 | }
|
1613 | });
|
1614 | this.isOpen_ = false;
|
1615 | this.maybeRestoreFocus_();
|
1616 | };
|
1617 | MDCMenuSurfaceFoundation.prototype.handleBodyClick = function(evt) {
|
1618 | var el = evt.target;
|
1619 | if (this.adapter_.isElementInContainer(el)) {
|
1620 | return;
|
1621 | }
|
1622 | this.close();
|
1623 | };
|
1624 | MDCMenuSurfaceFoundation.prototype.handleKeydown = function(evt) {
|
1625 | var keyCode = evt.keyCode, key = evt.key, shiftKey = evt.shiftKey;
|
1626 | var isEscape = key === "Escape" || keyCode === 27;
|
1627 | var isTab = key === "Tab" || keyCode === 9;
|
1628 | if (isEscape) {
|
1629 | this.close();
|
1630 | } else if (isTab) {
|
1631 | if (this.adapter_.isLastElementFocused() && !shiftKey) {
|
1632 | this.adapter_.focusFirstElement();
|
1633 | evt.preventDefault();
|
1634 | } else if (this.adapter_.isFirstElementFocused() && shiftKey) {
|
1635 | this.adapter_.focusLastElement();
|
1636 | evt.preventDefault();
|
1637 | }
|
1638 | }
|
1639 | };
|
1640 | MDCMenuSurfaceFoundation.prototype.autoPosition_ = function() {
|
1641 | var _a;
|
1642 | this.measurements_ = this.getAutoLayoutMeasurements_();
|
1643 | var corner = this.getOriginCorner_();
|
1644 | var maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight_(corner);
|
1645 | var verticalAlignment = this.hasBit_(corner, constants_1.CornerBit.BOTTOM) ? "bottom" : "top";
|
1646 | var horizontalAlignment = this.hasBit_(corner, constants_1.CornerBit.RIGHT) ? "right" : "left";
|
1647 | var horizontalOffset = this.getHorizontalOriginOffset_(corner);
|
1648 | var verticalOffset = this.getVerticalOriginOffset_(corner);
|
1649 | var _b = this.measurements_, anchorSize = _b.anchorSize, surfaceSize = _b.surfaceSize;
|
1650 | var position = (_a = {}, _a[horizontalAlignment] = horizontalOffset, _a[verticalAlignment] = verticalOffset,
|
1651 | _a);
|
1652 | if (anchorSize.width / surfaceSize.width > constants_1.numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {
|
1653 | horizontalAlignment = "center";
|
1654 | }
|
1655 | if (this.isHoistedElement_ || this.isFixedPosition_) {
|
1656 | this.adjustPositionForHoistedElement_(position);
|
1657 | }
|
1658 | this.adapter_.setTransformOrigin(horizontalAlignment + " " + verticalAlignment);
|
1659 | this.adapter_.setPosition(position);
|
1660 | this.adapter_.setMaxHeight(maxMenuSurfaceHeight ? maxMenuSurfaceHeight + "px" : "");
|
1661 | };
|
1662 | MDCMenuSurfaceFoundation.prototype.getAutoLayoutMeasurements_ = function() {
|
1663 | var anchorRect = this.adapter_.getAnchorDimensions();
|
1664 | var bodySize = this.adapter_.getBodyDimensions();
|
1665 | var viewportSize = this.adapter_.getWindowDimensions();
|
1666 | var windowScroll = this.adapter_.getWindowScroll();
|
1667 | if (!anchorRect) {
|
1668 | anchorRect = {
|
1669 | top: this.position_.y,
|
1670 | right: this.position_.x,
|
1671 | bottom: this.position_.y,
|
1672 | left: this.position_.x,
|
1673 | width: 0,
|
1674 | height: 0
|
1675 | };
|
1676 | }
|
1677 | return {
|
1678 | anchorSize: anchorRect,
|
1679 | bodySize: bodySize,
|
1680 | surfaceSize: this.dimensions_,
|
1681 | viewportDistance: {
|
1682 | top: anchorRect.top,
|
1683 | right: viewportSize.width - anchorRect.right,
|
1684 | bottom: viewportSize.height - anchorRect.bottom,
|
1685 | left: anchorRect.left
|
1686 | },
|
1687 | viewportSize: viewportSize,
|
1688 | windowScroll: windowScroll
|
1689 | };
|
1690 | };
|
1691 | MDCMenuSurfaceFoundation.prototype.getOriginCorner_ = function() {
|
1692 | var corner = constants_1.Corner.TOP_LEFT;
|
1693 | var _a = this.measurements_, viewportDistance = _a.viewportDistance, anchorSize = _a.anchorSize, surfaceSize = _a.surfaceSize;
|
1694 | var isBottomAligned = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.BOTTOM);
|
1695 | var availableTop = isBottomAligned ? viewportDistance.top + anchorSize.height + this.anchorMargin_.bottom : viewportDistance.top + this.anchorMargin_.top;
|
1696 | var availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom : viewportDistance.bottom + anchorSize.height - this.anchorMargin_.top;
|
1697 | var topOverflow = surfaceSize.height - availableTop;
|
1698 | var bottomOverflow = surfaceSize.height - availableBottom;
|
1699 | if (bottomOverflow > 0 && topOverflow < bottomOverflow) {
|
1700 | corner = this.setBit_(corner, constants_1.CornerBit.BOTTOM);
|
1701 | }
|
1702 | var isRtl = this.adapter_.isRtl();
|
1703 | var isFlipRtl = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.FLIP_RTL);
|
1704 | var avoidHorizontalOverlap = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.RIGHT);
|
1705 | var isAlignedRight = avoidHorizontalOverlap && !isRtl || !avoidHorizontalOverlap && isFlipRtl && isRtl;
|
1706 | var availableLeft = isAlignedRight ? viewportDistance.left + anchorSize.width + this.anchorMargin_.right : viewportDistance.left + this.anchorMargin_.left;
|
1707 | var availableRight = isAlignedRight ? viewportDistance.right - this.anchorMargin_.right : viewportDistance.right + anchorSize.width - this.anchorMargin_.left;
|
1708 | var leftOverflow = surfaceSize.width - availableLeft;
|
1709 | var rightOverflow = surfaceSize.width - availableRight;
|
1710 | if (leftOverflow < 0 && isAlignedRight && isRtl || avoidHorizontalOverlap && !isAlignedRight && leftOverflow < 0 || rightOverflow > 0 && leftOverflow < rightOverflow) {
|
1711 | corner = this.setBit_(corner, constants_1.CornerBit.RIGHT);
|
1712 | }
|
1713 | return corner;
|
1714 | };
|
1715 | MDCMenuSurfaceFoundation.prototype.getMenuSurfaceMaxHeight_ = function(corner) {
|
1716 | var viewportDistance = this.measurements_.viewportDistance;
|
1717 | var maxHeight = 0;
|
1718 | var isBottomAligned = this.hasBit_(corner, constants_1.CornerBit.BOTTOM);
|
1719 | var isBottomAnchored = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.BOTTOM);
|
1720 | var MARGIN_TO_EDGE = MDCMenuSurfaceFoundation.numbers.MARGIN_TO_EDGE;
|
1721 | if (isBottomAligned) {
|
1722 | maxHeight = viewportDistance.top + this.anchorMargin_.top - MARGIN_TO_EDGE;
|
1723 | if (!isBottomAnchored) {
|
1724 | maxHeight += this.measurements_.anchorSize.height;
|
1725 | }
|
1726 | } else {
|
1727 | maxHeight = viewportDistance.bottom - this.anchorMargin_.bottom + this.measurements_.anchorSize.height - MARGIN_TO_EDGE;
|
1728 | if (isBottomAnchored) {
|
1729 | maxHeight -= this.measurements_.anchorSize.height;
|
1730 | }
|
1731 | }
|
1732 | return maxHeight;
|
1733 | };
|
1734 | MDCMenuSurfaceFoundation.prototype.getHorizontalOriginOffset_ = function(corner) {
|
1735 | var anchorSize = this.measurements_.anchorSize;
|
1736 | var isRightAligned = this.hasBit_(corner, constants_1.CornerBit.RIGHT);
|
1737 | var avoidHorizontalOverlap = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.RIGHT);
|
1738 | if (isRightAligned) {
|
1739 | var rightOffset = avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin_.left : this.anchorMargin_.right;
|
1740 | if (this.isHoistedElement_ || this.isFixedPosition_) {
|
1741 | return rightOffset - (this.measurements_.viewportSize.width - this.measurements_.bodySize.width);
|
1742 | }
|
1743 | return rightOffset;
|
1744 | }
|
1745 | return avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin_.right : this.anchorMargin_.left;
|
1746 | };
|
1747 | MDCMenuSurfaceFoundation.prototype.getVerticalOriginOffset_ = function(corner) {
|
1748 | var anchorSize = this.measurements_.anchorSize;
|
1749 | var isBottomAligned = this.hasBit_(corner, constants_1.CornerBit.BOTTOM);
|
1750 | var avoidVerticalOverlap = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.BOTTOM);
|
1751 | var y = 0;
|
1752 | if (isBottomAligned) {
|
1753 | y = avoidVerticalOverlap ? anchorSize.height - this.anchorMargin_.top : -this.anchorMargin_.bottom;
|
1754 | } else {
|
1755 | y = avoidVerticalOverlap ? anchorSize.height + this.anchorMargin_.bottom : this.anchorMargin_.top;
|
1756 | }
|
1757 | return y;
|
1758 | };
|
1759 | MDCMenuSurfaceFoundation.prototype.adjustPositionForHoistedElement_ = function(position) {
|
1760 | var e_1, _a;
|
1761 | var _b = this.measurements_, windowScroll = _b.windowScroll, viewportDistance = _b.viewportDistance;
|
1762 | var props = Object.keys(position);
|
1763 | try {
|
1764 | for (var props_1 = __values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {
|
1765 | var prop = props_1_1.value;
|
1766 | var value = position[prop] || 0;
|
1767 | value += viewportDistance[prop];
|
1768 | if (!this.isFixedPosition_) {
|
1769 | if (prop === "top") {
|
1770 | value += windowScroll.y;
|
1771 | } else if (prop === "bottom") {
|
1772 | value -= windowScroll.y;
|
1773 | } else if (prop === "left") {
|
1774 | value += windowScroll.x;
|
1775 | } else {
|
1776 | value -= windowScroll.x;
|
1777 | }
|
1778 | }
|
1779 | position[prop] = value;
|
1780 | }
|
1781 | } catch (e_1_1) {
|
1782 | e_1 = {
|
1783 | error: e_1_1
|
1784 | };
|
1785 | } finally {
|
1786 | try {
|
1787 | if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);
|
1788 | } finally {
|
1789 | if (e_1) throw e_1.error;
|
1790 | }
|
1791 | }
|
1792 | };
|
1793 | MDCMenuSurfaceFoundation.prototype.maybeRestoreFocus_ = function() {
|
1794 | var isRootFocused = this.adapter_.isFocused();
|
1795 | var childHasFocus = document.activeElement && this.adapter_.isElementInContainer(document.activeElement);
|
1796 | if (isRootFocused || childHasFocus) {
|
1797 | this.adapter_.restoreFocus();
|
1798 | }
|
1799 | };
|
1800 | MDCMenuSurfaceFoundation.prototype.hasBit_ = function(corner, bit) {
|
1801 | return Boolean(corner & bit);
|
1802 | };
|
1803 | MDCMenuSurfaceFoundation.prototype.setBit_ = function(corner, bit) {
|
1804 | return corner | bit;
|
1805 | };
|
1806 | MDCMenuSurfaceFoundation.prototype.isFinite_ = function(num) {
|
1807 | return typeof num === "number" && isFinite(num);
|
1808 | };
|
1809 | return MDCMenuSurfaceFoundation;
|
1810 | }(foundation_1.MDCFoundation);
|
1811 | exports.MDCMenuSurfaceFoundation = MDCMenuSurfaceFoundation;
|
1812 | exports.default = MDCMenuSurfaceFoundation;
|
1813 | }, function(module, exports, __webpack_require__) {
|
1814 | "use strict";
|
1815 | var __extends = this && this.__extends || function() {
|
1816 | var _extendStatics = function extendStatics(d, b) {
|
1817 | _extendStatics = Object.setPrototypeOf || {
|
1818 | __proto__: []
|
1819 | } instanceof Array && function(d, b) {
|
1820 | d.__proto__ = b;
|
1821 | } || function(d, b) {
|
1822 | for (var p in b) {
|
1823 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
1824 | }
|
1825 | };
|
1826 | return _extendStatics(d, b);
|
1827 | };
|
1828 | return function(d, b) {
|
1829 | _extendStatics(d, b);
|
1830 | function __() {
|
1831 | this.constructor = d;
|
1832 | }
|
1833 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
1834 | };
|
1835 | }();
|
1836 | var __assign = this && this.__assign || function() {
|
1837 | __assign = Object.assign || function(t) {
|
1838 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
1839 | s = arguments[i];
|
1840 | for (var p in s) {
|
1841 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
1842 | }
|
1843 | }
|
1844 | return t;
|
1845 | };
|
1846 | return __assign.apply(this, arguments);
|
1847 | };
|
1848 | Object.defineProperty(exports, "__esModule", {
|
1849 | value: true
|
1850 | });
|
1851 | var foundation_1 = __webpack_require__(0);
|
1852 | var constants_1 = __webpack_require__(144);
|
1853 | var MDCTabIndicatorFoundation = function(_super) {
|
1854 | __extends(MDCTabIndicatorFoundation, _super);
|
1855 | function MDCTabIndicatorFoundation(adapter) {
|
1856 | return _super.call(this, __assign({}, MDCTabIndicatorFoundation.defaultAdapter, adapter)) || this;
|
1857 | }
|
1858 | Object.defineProperty(MDCTabIndicatorFoundation, "cssClasses", {
|
1859 | get: function get() {
|
1860 | return constants_1.cssClasses;
|
1861 | },
|
1862 | enumerable: true,
|
1863 | configurable: true
|
1864 | });
|
1865 | Object.defineProperty(MDCTabIndicatorFoundation, "strings", {
|
1866 | get: function get() {
|
1867 | return constants_1.strings;
|
1868 | },
|
1869 | enumerable: true,
|
1870 | configurable: true
|
1871 | });
|
1872 | Object.defineProperty(MDCTabIndicatorFoundation, "defaultAdapter", {
|
1873 | get: function get() {
|
1874 | return {
|
1875 | addClass: function addClass() {
|
1876 | return undefined;
|
1877 | },
|
1878 | removeClass: function removeClass() {
|
1879 | return undefined;
|
1880 | },
|
1881 | computeContentClientRect: function computeContentClientRect() {
|
1882 | return {
|
1883 | top: 0,
|
1884 | right: 0,
|
1885 | bottom: 0,
|
1886 | left: 0,
|
1887 | width: 0,
|
1888 | height: 0
|
1889 | };
|
1890 | },
|
1891 | setContentStyleProperty: function setContentStyleProperty() {
|
1892 | return undefined;
|
1893 | }
|
1894 | };
|
1895 | },
|
1896 | enumerable: true,
|
1897 | configurable: true
|
1898 | });
|
1899 | MDCTabIndicatorFoundation.prototype.computeContentClientRect = function() {
|
1900 | return this.adapter_.computeContentClientRect();
|
1901 | };
|
1902 | return MDCTabIndicatorFoundation;
|
1903 | }(foundation_1.MDCFoundation);
|
1904 | exports.MDCTabIndicatorFoundation = MDCTabIndicatorFoundation;
|
1905 | exports.default = MDCTabIndicatorFoundation;
|
1906 | }, function(module, exports, __webpack_require__) {
|
1907 | "use strict";
|
1908 | Object.defineProperty(exports, "__esModule", {
|
1909 | value: true
|
1910 | });
|
1911 | var cssPropertyNameMap = {
|
1912 | animation: {
|
1913 | prefixed: "-webkit-animation",
|
1914 | standard: "animation"
|
1915 | },
|
1916 | transform: {
|
1917 | prefixed: "-webkit-transform",
|
1918 | standard: "transform"
|
1919 | },
|
1920 | transition: {
|
1921 | prefixed: "-webkit-transition",
|
1922 | standard: "transition"
|
1923 | }
|
1924 | };
|
1925 | var jsEventTypeMap = {
|
1926 | animationend: {
|
1927 | cssProperty: "animation",
|
1928 | prefixed: "webkitAnimationEnd",
|
1929 | standard: "animationend"
|
1930 | },
|
1931 | animationiteration: {
|
1932 | cssProperty: "animation",
|
1933 | prefixed: "webkitAnimationIteration",
|
1934 | standard: "animationiteration"
|
1935 | },
|
1936 | animationstart: {
|
1937 | cssProperty: "animation",
|
1938 | prefixed: "webkitAnimationStart",
|
1939 | standard: "animationstart"
|
1940 | },
|
1941 | transitionend: {
|
1942 | cssProperty: "transition",
|
1943 | prefixed: "webkitTransitionEnd",
|
1944 | standard: "transitionend"
|
1945 | }
|
1946 | };
|
1947 | function isWindow(windowObj) {
|
1948 | return Boolean(windowObj.document) && typeof windowObj.document.createElement === "function";
|
1949 | }
|
1950 | function getCorrectPropertyName(windowObj, cssProperty) {
|
1951 | if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {
|
1952 | var el = windowObj.document.createElement("div");
|
1953 | var _a = cssPropertyNameMap[cssProperty], standard = _a.standard, prefixed = _a.prefixed;
|
1954 | var isStandard = standard in el.style;
|
1955 | return isStandard ? standard : prefixed;
|
1956 | }
|
1957 | return cssProperty;
|
1958 | }
|
1959 | exports.getCorrectPropertyName = getCorrectPropertyName;
|
1960 | function getCorrectEventName(windowObj, eventType) {
|
1961 | if (isWindow(windowObj) && eventType in jsEventTypeMap) {
|
1962 | var el = windowObj.document.createElement("div");
|
1963 | var _a = jsEventTypeMap[eventType], standard = _a.standard, prefixed = _a.prefixed, cssProperty = _a.cssProperty;
|
1964 | var isStandard = cssProperty in el.style;
|
1965 | return isStandard ? standard : prefixed;
|
1966 | }
|
1967 | return eventType;
|
1968 | }
|
1969 | exports.getCorrectEventName = getCorrectEventName;
|
1970 | }, function(module, exports, __webpack_require__) {
|
1971 | "use strict";
|
1972 | Object.defineProperty(exports, "__esModule", {
|
1973 | value: true
|
1974 | });
|
1975 | var supportsCssVariables_;
|
1976 | var supportsPassive_;
|
1977 | function detectEdgePseudoVarBug(windowObj) {
|
1978 | var document = windowObj.document;
|
1979 | var node = document.createElement("div");
|
1980 | node.className = "mdc-ripple-surface--test-edge-var-bug";
|
1981 | document.body.appendChild(node);
|
1982 | var computedStyle = windowObj.getComputedStyle(node);
|
1983 | var hasPseudoVarBug = computedStyle !== null && computedStyle.borderTopStyle === "solid";
|
1984 | if (node.parentNode) {
|
1985 | node.parentNode.removeChild(node);
|
1986 | }
|
1987 | return hasPseudoVarBug;
|
1988 | }
|
1989 | function supportsCssVariables(windowObj, forceRefresh) {
|
1990 | if (forceRefresh === void 0) {
|
1991 | forceRefresh = false;
|
1992 | }
|
1993 | var CSS = windowObj.CSS;
|
1994 | var supportsCssVars = supportsCssVariables_;
|
1995 | if (typeof supportsCssVariables_ === "boolean" && !forceRefresh) {
|
1996 | return supportsCssVariables_;
|
1997 | }
|
1998 | var supportsFunctionPresent = CSS && typeof CSS.supports === "function";
|
1999 | if (!supportsFunctionPresent) {
|
2000 | return false;
|
2001 | }
|
2002 | var explicitlySupportsCssVars = CSS.supports("--css-vars", "yes");
|
2003 | var weAreFeatureDetectingSafari10plus = CSS.supports("(--css-vars: yes)") && CSS.supports("color", "#00000000");
|
2004 | if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) {
|
2005 | supportsCssVars = !detectEdgePseudoVarBug(windowObj);
|
2006 | } else {
|
2007 | supportsCssVars = false;
|
2008 | }
|
2009 | if (!forceRefresh) {
|
2010 | supportsCssVariables_ = supportsCssVars;
|
2011 | }
|
2012 | return supportsCssVars;
|
2013 | }
|
2014 | exports.supportsCssVariables = supportsCssVariables;
|
2015 | function applyPassive(globalObj, forceRefresh) {
|
2016 | if (globalObj === void 0) {
|
2017 | globalObj = window;
|
2018 | }
|
2019 | if (forceRefresh === void 0) {
|
2020 | forceRefresh = false;
|
2021 | }
|
2022 | if (supportsPassive_ === undefined || forceRefresh) {
|
2023 | var isSupported_1 = false;
|
2024 | try {
|
2025 | globalObj.document.addEventListener("test", function() {
|
2026 | return undefined;
|
2027 | }, {
|
2028 | get passive() {
|
2029 | isSupported_1 = true;
|
2030 | return isSupported_1;
|
2031 | }
|
2032 | });
|
2033 | } catch (e) {}
|
2034 | supportsPassive_ = isSupported_1;
|
2035 | }
|
2036 | return supportsPassive_ ? {
|
2037 | passive: true
|
2038 | } : false;
|
2039 | }
|
2040 | exports.applyPassive = applyPassive;
|
2041 | function getNormalizedEventCoords(evt, pageOffset, clientRect) {
|
2042 | if (!evt) {
|
2043 | return {
|
2044 | x: 0,
|
2045 | y: 0
|
2046 | };
|
2047 | }
|
2048 | var x = pageOffset.x, y = pageOffset.y;
|
2049 | var documentX = x + clientRect.left;
|
2050 | var documentY = y + clientRect.top;
|
2051 | var normalizedX;
|
2052 | var normalizedY;
|
2053 | if (evt.type === "touchstart") {
|
2054 | var touchEvent = evt;
|
2055 | normalizedX = touchEvent.changedTouches[0].pageX - documentX;
|
2056 | normalizedY = touchEvent.changedTouches[0].pageY - documentY;
|
2057 | } else {
|
2058 | var mouseEvent = evt;
|
2059 | normalizedX = mouseEvent.pageX - documentX;
|
2060 | normalizedY = mouseEvent.pageY - documentY;
|
2061 | }
|
2062 | return {
|
2063 | x: normalizedX,
|
2064 | y: normalizedY
|
2065 | };
|
2066 | }
|
2067 | exports.getNormalizedEventCoords = getNormalizedEventCoords;
|
2068 | }, function(module, exports, __webpack_require__) {
|
2069 | "use strict";
|
2070 | var __extends = this && this.__extends || function() {
|
2071 | var _extendStatics = function extendStatics(d, b) {
|
2072 | _extendStatics = Object.setPrototypeOf || {
|
2073 | __proto__: []
|
2074 | } instanceof Array && function(d, b) {
|
2075 | d.__proto__ = b;
|
2076 | } || function(d, b) {
|
2077 | for (var p in b) {
|
2078 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
2079 | }
|
2080 | };
|
2081 | return _extendStatics(d, b);
|
2082 | };
|
2083 | return function(d, b) {
|
2084 | _extendStatics(d, b);
|
2085 | function __() {
|
2086 | this.constructor = d;
|
2087 | }
|
2088 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
2089 | };
|
2090 | }();
|
2091 | var __assign = this && this.__assign || function() {
|
2092 | __assign = Object.assign || function(t) {
|
2093 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
2094 | s = arguments[i];
|
2095 | for (var p in s) {
|
2096 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
2097 | }
|
2098 | }
|
2099 | return t;
|
2100 | };
|
2101 | return __assign.apply(this, arguments);
|
2102 | };
|
2103 | Object.defineProperty(exports, "__esModule", {
|
2104 | value: true
|
2105 | });
|
2106 | var foundation_1 = __webpack_require__(0);
|
2107 | var constants_1 = __webpack_require__(29);
|
2108 | var emptyClientRect = {
|
2109 | bottom: 0,
|
2110 | height: 0,
|
2111 | left: 0,
|
2112 | right: 0,
|
2113 | top: 0,
|
2114 | width: 0
|
2115 | };
|
2116 | var MDCChipFoundation = function(_super) {
|
2117 | __extends(MDCChipFoundation, _super);
|
2118 | function MDCChipFoundation(adapter) {
|
2119 | var _this = _super.call(this, __assign({}, MDCChipFoundation.defaultAdapter, adapter)) || this;
|
2120 | _this.shouldRemoveOnTrailingIconClick_ = true;
|
2121 | return _this;
|
2122 | }
|
2123 | Object.defineProperty(MDCChipFoundation, "strings", {
|
2124 | get: function get() {
|
2125 | return constants_1.strings;
|
2126 | },
|
2127 | enumerable: true,
|
2128 | configurable: true
|
2129 | });
|
2130 | Object.defineProperty(MDCChipFoundation, "cssClasses", {
|
2131 | get: function get() {
|
2132 | return constants_1.cssClasses;
|
2133 | },
|
2134 | enumerable: true,
|
2135 | configurable: true
|
2136 | });
|
2137 | Object.defineProperty(MDCChipFoundation, "defaultAdapter", {
|
2138 | get: function get() {
|
2139 | return {
|
2140 | addClass: function addClass() {
|
2141 | return undefined;
|
2142 | },
|
2143 | addClassToLeadingIcon: function addClassToLeadingIcon() {
|
2144 | return undefined;
|
2145 | },
|
2146 | eventTargetHasClass: function eventTargetHasClass() {
|
2147 | return false;
|
2148 | },
|
2149 | getCheckmarkBoundingClientRect: function getCheckmarkBoundingClientRect() {
|
2150 | return emptyClientRect;
|
2151 | },
|
2152 | getComputedStyleValue: function getComputedStyleValue() {
|
2153 | return "";
|
2154 | },
|
2155 | getRootBoundingClientRect: function getRootBoundingClientRect() {
|
2156 | return emptyClientRect;
|
2157 | },
|
2158 | hasClass: function hasClass() {
|
2159 | return false;
|
2160 | },
|
2161 | hasLeadingIcon: function hasLeadingIcon() {
|
2162 | return false;
|
2163 | },
|
2164 | notifyInteraction: function notifyInteraction() {
|
2165 | return undefined;
|
2166 | },
|
2167 | notifyRemoval: function notifyRemoval() {
|
2168 | return undefined;
|
2169 | },
|
2170 | notifySelection: function notifySelection() {
|
2171 | return undefined;
|
2172 | },
|
2173 | notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {
|
2174 | return undefined;
|
2175 | },
|
2176 | removeClass: function removeClass() {
|
2177 | return undefined;
|
2178 | },
|
2179 | removeClassFromLeadingIcon: function removeClassFromLeadingIcon() {
|
2180 | return undefined;
|
2181 | },
|
2182 | setStyleProperty: function setStyleProperty() {
|
2183 | return undefined;
|
2184 | }
|
2185 | };
|
2186 | },
|
2187 | enumerable: true,
|
2188 | configurable: true
|
2189 | });
|
2190 | MDCChipFoundation.prototype.isSelected = function() {
|
2191 | return this.adapter_.hasClass(constants_1.cssClasses.SELECTED);
|
2192 | };
|
2193 | MDCChipFoundation.prototype.setSelected = function(selected) {
|
2194 | if (selected) {
|
2195 | this.adapter_.addClass(constants_1.cssClasses.SELECTED);
|
2196 | } else {
|
2197 | this.adapter_.removeClass(constants_1.cssClasses.SELECTED);
|
2198 | }
|
2199 | this.adapter_.notifySelection(selected);
|
2200 | };
|
2201 | MDCChipFoundation.prototype.getShouldRemoveOnTrailingIconClick = function() {
|
2202 | return this.shouldRemoveOnTrailingIconClick_;
|
2203 | };
|
2204 | MDCChipFoundation.prototype.setShouldRemoveOnTrailingIconClick = function(shouldRemove) {
|
2205 | this.shouldRemoveOnTrailingIconClick_ = shouldRemove;
|
2206 | };
|
2207 | MDCChipFoundation.prototype.getDimensions = function() {
|
2208 | var _this = this;
|
2209 | var getRootRect = function getRootRect() {
|
2210 | return _this.adapter_.getRootBoundingClientRect();
|
2211 | };
|
2212 | var getCheckmarkRect = function getCheckmarkRect() {
|
2213 | return _this.adapter_.getCheckmarkBoundingClientRect();
|
2214 | };
|
2215 | if (!this.adapter_.hasLeadingIcon()) {
|
2216 | var checkmarkRect = getCheckmarkRect();
|
2217 | if (checkmarkRect) {
|
2218 | var rootRect = getRootRect();
|
2219 | return {
|
2220 | bottom: rootRect.bottom,
|
2221 | height: rootRect.height,
|
2222 | left: rootRect.left,
|
2223 | right: rootRect.right,
|
2224 | top: rootRect.top,
|
2225 | width: rootRect.width + checkmarkRect.height
|
2226 | };
|
2227 | }
|
2228 | }
|
2229 | return getRootRect();
|
2230 | };
|
2231 | MDCChipFoundation.prototype.beginExit = function() {
|
2232 | this.adapter_.addClass(constants_1.cssClasses.CHIP_EXIT);
|
2233 | };
|
2234 | MDCChipFoundation.prototype.handleInteraction = function(evt) {
|
2235 | var isEnter = evt.key === "Enter" || evt.keyCode === 13;
|
2236 | if (evt.type === "click" || isEnter) {
|
2237 | this.adapter_.notifyInteraction();
|
2238 | }
|
2239 | };
|
2240 | MDCChipFoundation.prototype.handleTransitionEnd = function(evt) {
|
2241 | var _this = this;
|
2242 | if (this.adapter_.eventTargetHasClass(evt.target, constants_1.cssClasses.CHIP_EXIT)) {
|
2243 | if (evt.propertyName === "width") {
|
2244 | this.adapter_.notifyRemoval();
|
2245 | } else if (evt.propertyName === "opacity") {
|
2246 | var chipWidth_1 = this.adapter_.getComputedStyleValue("width");
|
2247 | requestAnimationFrame(function() {
|
2248 | _this.adapter_.setStyleProperty("width", chipWidth_1);
|
2249 | _this.adapter_.setStyleProperty("padding", "0");
|
2250 | _this.adapter_.setStyleProperty("margin", "0");
|
2251 | requestAnimationFrame(function() {
|
2252 | _this.adapter_.setStyleProperty("width", "0");
|
2253 | });
|
2254 | });
|
2255 | }
|
2256 | return;
|
2257 | }
|
2258 | if (evt.propertyName !== "opacity") {
|
2259 | return;
|
2260 | }
|
2261 | if (this.adapter_.eventTargetHasClass(evt.target, constants_1.cssClasses.LEADING_ICON) && this.adapter_.hasClass(constants_1.cssClasses.SELECTED)) {
|
2262 | this.adapter_.addClassToLeadingIcon(constants_1.cssClasses.HIDDEN_LEADING_ICON);
|
2263 | } else if (this.adapter_.eventTargetHasClass(evt.target, constants_1.cssClasses.CHECKMARK) && !this.adapter_.hasClass(constants_1.cssClasses.SELECTED)) {
|
2264 | this.adapter_.removeClassFromLeadingIcon(constants_1.cssClasses.HIDDEN_LEADING_ICON);
|
2265 | }
|
2266 | };
|
2267 | MDCChipFoundation.prototype.handleTrailingIconInteraction = function(evt) {
|
2268 | var isEnter = evt.key === "Enter" || evt.keyCode === 13;
|
2269 | evt.stopPropagation();
|
2270 | if (evt.type === "click" || isEnter) {
|
2271 | this.adapter_.notifyTrailingIconInteraction();
|
2272 | if (this.shouldRemoveOnTrailingIconClick_) {
|
2273 | this.beginExit();
|
2274 | }
|
2275 | }
|
2276 | };
|
2277 | return MDCChipFoundation;
|
2278 | }(foundation_1.MDCFoundation);
|
2279 | exports.MDCChipFoundation = MDCChipFoundation;
|
2280 | exports.default = MDCChipFoundation;
|
2281 | }, function(module, exports, __webpack_require__) {
|
2282 | "use strict";
|
2283 | var __extends = this && this.__extends || function() {
|
2284 | var _extendStatics = function extendStatics(d, b) {
|
2285 | _extendStatics = Object.setPrototypeOf || {
|
2286 | __proto__: []
|
2287 | } instanceof Array && function(d, b) {
|
2288 | d.__proto__ = b;
|
2289 | } || function(d, b) {
|
2290 | for (var p in b) {
|
2291 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
2292 | }
|
2293 | };
|
2294 | return _extendStatics(d, b);
|
2295 | };
|
2296 | return function(d, b) {
|
2297 | _extendStatics(d, b);
|
2298 | function __() {
|
2299 | this.constructor = d;
|
2300 | }
|
2301 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
2302 | };
|
2303 | }();
|
2304 | Object.defineProperty(exports, "__esModule", {
|
2305 | value: true
|
2306 | });
|
2307 | var component_1 = __webpack_require__(1);
|
2308 | var ponyfill_1 = __webpack_require__(3);
|
2309 | var constants_1 = __webpack_require__(35);
|
2310 | var foundation_1 = __webpack_require__(5);
|
2311 | var MDCList = function(_super) {
|
2312 | __extends(MDCList, _super);
|
2313 | function MDCList() {
|
2314 | return _super !== null && _super.apply(this, arguments) || this;
|
2315 | }
|
2316 | Object.defineProperty(MDCList.prototype, "vertical", {
|
2317 | set: function set(value) {
|
2318 | this.foundation_.setVerticalOrientation(value);
|
2319 | },
|
2320 | enumerable: true,
|
2321 | configurable: true
|
2322 | });
|
2323 | Object.defineProperty(MDCList.prototype, "listElements", {
|
2324 | get: function get() {
|
2325 | return [].slice.call(this.root_.querySelectorAll("." + constants_1.cssClasses.LIST_ITEM_CLASS));
|
2326 | },
|
2327 | enumerable: true,
|
2328 | configurable: true
|
2329 | });
|
2330 | Object.defineProperty(MDCList.prototype, "wrapFocus", {
|
2331 | set: function set(value) {
|
2332 | this.foundation_.setWrapFocus(value);
|
2333 | },
|
2334 | enumerable: true,
|
2335 | configurable: true
|
2336 | });
|
2337 | Object.defineProperty(MDCList.prototype, "singleSelection", {
|
2338 | set: function set(isSingleSelectionList) {
|
2339 | this.foundation_.setSingleSelection(isSingleSelectionList);
|
2340 | },
|
2341 | enumerable: true,
|
2342 | configurable: true
|
2343 | });
|
2344 | Object.defineProperty(MDCList.prototype, "selectedIndex", {
|
2345 | get: function get() {
|
2346 | return this.foundation_.getSelectedIndex();
|
2347 | },
|
2348 | set: function set(index) {
|
2349 | this.foundation_.setSelectedIndex(index);
|
2350 | },
|
2351 | enumerable: true,
|
2352 | configurable: true
|
2353 | });
|
2354 | MDCList.attachTo = function(root) {
|
2355 | return new MDCList(root);
|
2356 | };
|
2357 | MDCList.prototype.initialSyncWithDOM = function() {
|
2358 | this.handleClick_ = this.handleClickEvent_.bind(this);
|
2359 | this.handleKeydown_ = this.handleKeydownEvent_.bind(this);
|
2360 | this.focusInEventListener_ = this.handleFocusInEvent_.bind(this);
|
2361 | this.focusOutEventListener_ = this.handleFocusOutEvent_.bind(this);
|
2362 | this.listen("keydown", this.handleKeydown_);
|
2363 | this.listen("click", this.handleClick_);
|
2364 | this.listen("focusin", this.focusInEventListener_);
|
2365 | this.listen("focusout", this.focusOutEventListener_);
|
2366 | this.layout();
|
2367 | this.initializeListType();
|
2368 | };
|
2369 | MDCList.prototype.destroy = function() {
|
2370 | this.unlisten("keydown", this.handleKeydown_);
|
2371 | this.unlisten("click", this.handleClick_);
|
2372 | this.unlisten("focusin", this.focusInEventListener_);
|
2373 | this.unlisten("focusout", this.focusOutEventListener_);
|
2374 | };
|
2375 | MDCList.prototype.layout = function() {
|
2376 | var direction = this.root_.getAttribute(constants_1.strings.ARIA_ORIENTATION);
|
2377 | this.vertical = direction !== constants_1.strings.ARIA_ORIENTATION_HORIZONTAL;
|
2378 | [].slice.call(this.root_.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(el) {
|
2379 | el.setAttribute("tabindex", "-1");
|
2380 | });
|
2381 | [].slice.call(this.root_.querySelectorAll(constants_1.strings.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(el) {
|
2382 | return el.setAttribute("tabindex", "-1");
|
2383 | });
|
2384 | this.foundation_.layout();
|
2385 | };
|
2386 | MDCList.prototype.initializeListType = function() {
|
2387 | var _this = this;
|
2388 | var checkboxListItems = this.root_.querySelectorAll(constants_1.strings.ARIA_ROLE_CHECKBOX_SELECTOR);
|
2389 | var singleSelectedListItem = this.root_.querySelector("\n ." + constants_1.cssClasses.LIST_ITEM_ACTIVATED_CLASS + ",\n ." + constants_1.cssClasses.LIST_ITEM_SELECTED_CLASS + "\n ");
|
2390 | var radioSelectedListItem = this.root_.querySelector(constants_1.strings.ARIA_CHECKED_RADIO_SELECTOR);
|
2391 | if (checkboxListItems.length) {
|
2392 | var preselectedItems = this.root_.querySelectorAll(constants_1.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);
|
2393 | this.selectedIndex = [].map.call(preselectedItems, function(listItem) {
|
2394 | return _this.listElements.indexOf(listItem);
|
2395 | });
|
2396 | } else if (singleSelectedListItem) {
|
2397 | if (singleSelectedListItem.classList.contains(constants_1.cssClasses.LIST_ITEM_ACTIVATED_CLASS)) {
|
2398 | this.foundation_.setUseActivatedClass(true);
|
2399 | }
|
2400 | this.singleSelection = true;
|
2401 | this.selectedIndex = this.listElements.indexOf(singleSelectedListItem);
|
2402 | } else if (radioSelectedListItem) {
|
2403 | this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);
|
2404 | }
|
2405 | };
|
2406 | MDCList.prototype.getDefaultFoundation = function() {
|
2407 | var _this = this;
|
2408 | var adapter = {
|
2409 | addClassForElementIndex: function addClassForElementIndex(index, className) {
|
2410 | var element = _this.listElements[index];
|
2411 | if (element) {
|
2412 | element.classList.add(className);
|
2413 | }
|
2414 | },
|
2415 | focusItemAtIndex: function focusItemAtIndex(index) {
|
2416 | var element = _this.listElements[index];
|
2417 | if (element) {
|
2418 | element.focus();
|
2419 | }
|
2420 | },
|
2421 | getAttributeForElementIndex: function getAttributeForElementIndex(index, attr) {
|
2422 | return _this.listElements[index].getAttribute(attr);
|
2423 | },
|
2424 | getFocusedElementIndex: function getFocusedElementIndex() {
|
2425 | return _this.listElements.indexOf(document.activeElement);
|
2426 | },
|
2427 | getListItemCount: function getListItemCount() {
|
2428 | return _this.listElements.length;
|
2429 | },
|
2430 | hasCheckboxAtIndex: function hasCheckboxAtIndex(index) {
|
2431 | var listItem = _this.listElements[index];
|
2432 | return !!listItem.querySelector(constants_1.strings.CHECKBOX_SELECTOR);
|
2433 | },
|
2434 | hasRadioAtIndex: function hasRadioAtIndex(index) {
|
2435 | var listItem = _this.listElements[index];
|
2436 | return !!listItem.querySelector(constants_1.strings.RADIO_SELECTOR);
|
2437 | },
|
2438 | isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex(index) {
|
2439 | var listItem = _this.listElements[index];
|
2440 | var toggleEl = listItem.querySelector(constants_1.strings.CHECKBOX_SELECTOR);
|
2441 | return toggleEl.checked;
|
2442 | },
|
2443 | isFocusInsideList: function isFocusInsideList() {
|
2444 | return _this.root_.contains(document.activeElement);
|
2445 | },
|
2446 | isRootFocused: function isRootFocused() {
|
2447 | return document.activeElement === _this.root_;
|
2448 | },
|
2449 | notifyAction: function notifyAction(index) {
|
2450 | _this.emit(constants_1.strings.ACTION_EVENT, {
|
2451 | index: index
|
2452 | }, true);
|
2453 | },
|
2454 | removeClassForElementIndex: function removeClassForElementIndex(index, className) {
|
2455 | var element = _this.listElements[index];
|
2456 | if (element) {
|
2457 | element.classList.remove(className);
|
2458 | }
|
2459 | },
|
2460 | setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) {
|
2461 | var element = _this.listElements[index];
|
2462 | if (element) {
|
2463 | element.setAttribute(attr, value);
|
2464 | }
|
2465 | },
|
2466 | setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) {
|
2467 | var listItem = _this.listElements[index];
|
2468 | var toggleEl = listItem.querySelector(constants_1.strings.CHECKBOX_RADIO_SELECTOR);
|
2469 | toggleEl.checked = isChecked;
|
2470 | var event = document.createEvent("Event");
|
2471 | event.initEvent("change", true, true);
|
2472 | toggleEl.dispatchEvent(event);
|
2473 | },
|
2474 | setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {
|
2475 | var element = _this.listElements[listItemIndex];
|
2476 | var listItemChildren = [].slice.call(element.querySelectorAll(constants_1.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));
|
2477 | listItemChildren.forEach(function(el) {
|
2478 | return el.setAttribute("tabindex", tabIndexValue);
|
2479 | });
|
2480 | }
|
2481 | };
|
2482 | return new foundation_1.MDCListFoundation(adapter);
|
2483 | };
|
2484 | MDCList.prototype.getListItemIndex_ = function(evt) {
|
2485 | var eventTarget = evt.target;
|
2486 | var nearestParent = ponyfill_1.closest(eventTarget, "." + constants_1.cssClasses.LIST_ITEM_CLASS + ", ." + constants_1.cssClasses.ROOT);
|
2487 | if (nearestParent && ponyfill_1.matches(nearestParent, "." + constants_1.cssClasses.LIST_ITEM_CLASS)) {
|
2488 | return this.listElements.indexOf(nearestParent);
|
2489 | }
|
2490 | return -1;
|
2491 | };
|
2492 | MDCList.prototype.handleFocusInEvent_ = function(evt) {
|
2493 | var index = this.getListItemIndex_(evt);
|
2494 | this.foundation_.handleFocusIn(evt, index);
|
2495 | };
|
2496 | MDCList.prototype.handleFocusOutEvent_ = function(evt) {
|
2497 | var index = this.getListItemIndex_(evt);
|
2498 | this.foundation_.handleFocusOut(evt, index);
|
2499 | };
|
2500 | MDCList.prototype.handleKeydownEvent_ = function(evt) {
|
2501 | var index = this.getListItemIndex_(evt);
|
2502 | var target = evt.target;
|
2503 | this.foundation_.handleKeydown(evt, target.classList.contains(constants_1.cssClasses.LIST_ITEM_CLASS), index);
|
2504 | };
|
2505 | MDCList.prototype.handleClickEvent_ = function(evt) {
|
2506 | var index = this.getListItemIndex_(evt);
|
2507 | var target = evt.target;
|
2508 | var toggleCheckbox = !ponyfill_1.matches(target, constants_1.strings.CHECKBOX_RADIO_SELECTOR);
|
2509 | this.foundation_.handleClick(index, toggleCheckbox);
|
2510 | };
|
2511 | return MDCList;
|
2512 | }(component_1.MDCComponent);
|
2513 | exports.MDCList = MDCList;
|
2514 | }, function(module, exports, __webpack_require__) {
|
2515 | "use strict";
|
2516 | var __extends = this && this.__extends || function() {
|
2517 | var _extendStatics = function extendStatics(d, b) {
|
2518 | _extendStatics = Object.setPrototypeOf || {
|
2519 | __proto__: []
|
2520 | } instanceof Array && function(d, b) {
|
2521 | d.__proto__ = b;
|
2522 | } || function(d, b) {
|
2523 | for (var p in b) {
|
2524 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
2525 | }
|
2526 | };
|
2527 | return _extendStatics(d, b);
|
2528 | };
|
2529 | return function(d, b) {
|
2530 | _extendStatics(d, b);
|
2531 | function __() {
|
2532 | this.constructor = d;
|
2533 | }
|
2534 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
2535 | };
|
2536 | }();
|
2537 | var __assign = this && this.__assign || function() {
|
2538 | __assign = Object.assign || function(t) {
|
2539 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
2540 | s = arguments[i];
|
2541 | for (var p in s) {
|
2542 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
2543 | }
|
2544 | }
|
2545 | return t;
|
2546 | };
|
2547 | return __assign.apply(this, arguments);
|
2548 | };
|
2549 | Object.defineProperty(exports, "__esModule", {
|
2550 | value: true
|
2551 | });
|
2552 | var foundation_1 = __webpack_require__(0);
|
2553 | var constants_1 = __webpack_require__(101);
|
2554 | var MDCDismissibleDrawerFoundation = function(_super) {
|
2555 | __extends(MDCDismissibleDrawerFoundation, _super);
|
2556 | function MDCDismissibleDrawerFoundation(adapter) {
|
2557 | var _this = _super.call(this, __assign({}, MDCDismissibleDrawerFoundation.defaultAdapter, adapter)) || this;
|
2558 | _this.animationFrame_ = 0;
|
2559 | _this.animationTimer_ = 0;
|
2560 | return _this;
|
2561 | }
|
2562 | Object.defineProperty(MDCDismissibleDrawerFoundation, "strings", {
|
2563 | get: function get() {
|
2564 | return constants_1.strings;
|
2565 | },
|
2566 | enumerable: true,
|
2567 | configurable: true
|
2568 | });
|
2569 | Object.defineProperty(MDCDismissibleDrawerFoundation, "cssClasses", {
|
2570 | get: function get() {
|
2571 | return constants_1.cssClasses;
|
2572 | },
|
2573 | enumerable: true,
|
2574 | configurable: true
|
2575 | });
|
2576 | Object.defineProperty(MDCDismissibleDrawerFoundation, "defaultAdapter", {
|
2577 | get: function get() {
|
2578 | return {
|
2579 | addClass: function addClass() {
|
2580 | return undefined;
|
2581 | },
|
2582 | removeClass: function removeClass() {
|
2583 | return undefined;
|
2584 | },
|
2585 | hasClass: function hasClass() {
|
2586 | return false;
|
2587 | },
|
2588 | elementHasClass: function elementHasClass() {
|
2589 | return false;
|
2590 | },
|
2591 | notifyClose: function notifyClose() {
|
2592 | return undefined;
|
2593 | },
|
2594 | notifyOpen: function notifyOpen() {
|
2595 | return undefined;
|
2596 | },
|
2597 | saveFocus: function saveFocus() {
|
2598 | return undefined;
|
2599 | },
|
2600 | restoreFocus: function restoreFocus() {
|
2601 | return undefined;
|
2602 | },
|
2603 | focusActiveNavigationItem: function focusActiveNavigationItem() {
|
2604 | return undefined;
|
2605 | },
|
2606 | trapFocus: function trapFocus() {
|
2607 | return undefined;
|
2608 | },
|
2609 | releaseFocus: function releaseFocus() {
|
2610 | return undefined;
|
2611 | }
|
2612 | };
|
2613 | },
|
2614 | enumerable: true,
|
2615 | configurable: true
|
2616 | });
|
2617 | MDCDismissibleDrawerFoundation.prototype.destroy = function() {
|
2618 | if (this.animationFrame_) {
|
2619 | cancelAnimationFrame(this.animationFrame_);
|
2620 | }
|
2621 | if (this.animationTimer_) {
|
2622 | clearTimeout(this.animationTimer_);
|
2623 | }
|
2624 | };
|
2625 | MDCDismissibleDrawerFoundation.prototype.open = function() {
|
2626 | var _this = this;
|
2627 | if (this.isOpen() || this.isOpening() || this.isClosing()) {
|
2628 | return;
|
2629 | }
|
2630 | this.adapter_.addClass(constants_1.cssClasses.OPEN);
|
2631 | this.adapter_.addClass(constants_1.cssClasses.ANIMATE);
|
2632 | this.runNextAnimationFrame_(function() {
|
2633 | _this.adapter_.addClass(constants_1.cssClasses.OPENING);
|
2634 | });
|
2635 | this.adapter_.saveFocus();
|
2636 | };
|
2637 | MDCDismissibleDrawerFoundation.prototype.close = function() {
|
2638 | if (!this.isOpen() || this.isOpening() || this.isClosing()) {
|
2639 | return;
|
2640 | }
|
2641 | this.adapter_.addClass(constants_1.cssClasses.CLOSING);
|
2642 | };
|
2643 | MDCDismissibleDrawerFoundation.prototype.isOpen = function() {
|
2644 | return this.adapter_.hasClass(constants_1.cssClasses.OPEN);
|
2645 | };
|
2646 | MDCDismissibleDrawerFoundation.prototype.isOpening = function() {
|
2647 | return this.adapter_.hasClass(constants_1.cssClasses.OPENING) || this.adapter_.hasClass(constants_1.cssClasses.ANIMATE);
|
2648 | };
|
2649 | MDCDismissibleDrawerFoundation.prototype.isClosing = function() {
|
2650 | return this.adapter_.hasClass(constants_1.cssClasses.CLOSING);
|
2651 | };
|
2652 | MDCDismissibleDrawerFoundation.prototype.handleKeydown = function(evt) {
|
2653 | var keyCode = evt.keyCode, key = evt.key;
|
2654 | var isEscape = key === "Escape" || keyCode === 27;
|
2655 | if (isEscape) {
|
2656 | this.close();
|
2657 | }
|
2658 | };
|
2659 | MDCDismissibleDrawerFoundation.prototype.handleTransitionEnd = function(evt) {
|
2660 | var OPENING = constants_1.cssClasses.OPENING, CLOSING = constants_1.cssClasses.CLOSING, OPEN = constants_1.cssClasses.OPEN, ANIMATE = constants_1.cssClasses.ANIMATE, ROOT = constants_1.cssClasses.ROOT;
|
2661 | var isRootElement = this.isElement_(evt.target) && this.adapter_.elementHasClass(evt.target, ROOT);
|
2662 | if (!isRootElement) {
|
2663 | return;
|
2664 | }
|
2665 | if (this.isClosing()) {
|
2666 | this.adapter_.removeClass(OPEN);
|
2667 | this.closed_();
|
2668 | this.adapter_.restoreFocus();
|
2669 | this.adapter_.notifyClose();
|
2670 | } else {
|
2671 | this.adapter_.focusActiveNavigationItem();
|
2672 | this.opened_();
|
2673 | this.adapter_.notifyOpen();
|
2674 | }
|
2675 | this.adapter_.removeClass(ANIMATE);
|
2676 | this.adapter_.removeClass(OPENING);
|
2677 | this.adapter_.removeClass(CLOSING);
|
2678 | };
|
2679 | MDCDismissibleDrawerFoundation.prototype.opened_ = function() {};
|
2680 | MDCDismissibleDrawerFoundation.prototype.closed_ = function() {};
|
2681 | MDCDismissibleDrawerFoundation.prototype.runNextAnimationFrame_ = function(callback) {
|
2682 | var _this = this;
|
2683 | cancelAnimationFrame(this.animationFrame_);
|
2684 | this.animationFrame_ = requestAnimationFrame(function() {
|
2685 | _this.animationFrame_ = 0;
|
2686 | clearTimeout(_this.animationTimer_);
|
2687 | _this.animationTimer_ = setTimeout(callback, 0);
|
2688 | });
|
2689 | };
|
2690 | MDCDismissibleDrawerFoundation.prototype.isElement_ = function(element) {
|
2691 | return Boolean(element.classList);
|
2692 | };
|
2693 | return MDCDismissibleDrawerFoundation;
|
2694 | }(foundation_1.MDCFoundation);
|
2695 | exports.MDCDismissibleDrawerFoundation = MDCDismissibleDrawerFoundation;
|
2696 | exports.default = MDCDismissibleDrawerFoundation;
|
2697 | }, function(module, exports, __webpack_require__) {
|
2698 | "use strict";
|
2699 | var __extends = this && this.__extends || function() {
|
2700 | var _extendStatics = function extendStatics(d, b) {
|
2701 | _extendStatics = Object.setPrototypeOf || {
|
2702 | __proto__: []
|
2703 | } instanceof Array && function(d, b) {
|
2704 | d.__proto__ = b;
|
2705 | } || function(d, b) {
|
2706 | for (var p in b) {
|
2707 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
2708 | }
|
2709 | };
|
2710 | return _extendStatics(d, b);
|
2711 | };
|
2712 | return function(d, b) {
|
2713 | _extendStatics(d, b);
|
2714 | function __() {
|
2715 | this.constructor = d;
|
2716 | }
|
2717 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
2718 | };
|
2719 | }();
|
2720 | Object.defineProperty(exports, "__esModule", {
|
2721 | value: true
|
2722 | });
|
2723 | var component_1 = __webpack_require__(1);
|
2724 | var foundation_1 = __webpack_require__(16);
|
2725 | var MDCFloatingLabel = function(_super) {
|
2726 | __extends(MDCFloatingLabel, _super);
|
2727 | function MDCFloatingLabel() {
|
2728 | return _super !== null && _super.apply(this, arguments) || this;
|
2729 | }
|
2730 | MDCFloatingLabel.attachTo = function(root) {
|
2731 | return new MDCFloatingLabel(root);
|
2732 | };
|
2733 | MDCFloatingLabel.prototype.shake = function(shouldShake) {
|
2734 | this.foundation_.shake(shouldShake);
|
2735 | };
|
2736 | MDCFloatingLabel.prototype.float = function(shouldFloat) {
|
2737 | this.foundation_.float(shouldFloat);
|
2738 | };
|
2739 | MDCFloatingLabel.prototype.getWidth = function() {
|
2740 | return this.foundation_.getWidth();
|
2741 | };
|
2742 | MDCFloatingLabel.prototype.getDefaultFoundation = function() {
|
2743 | var _this = this;
|
2744 | var adapter = {
|
2745 | addClass: function addClass(className) {
|
2746 | return _this.root_.classList.add(className);
|
2747 | },
|
2748 | removeClass: function removeClass(className) {
|
2749 | return _this.root_.classList.remove(className);
|
2750 | },
|
2751 | getWidth: function getWidth() {
|
2752 | return _this.root_.scrollWidth;
|
2753 | },
|
2754 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
2755 | return _this.listen(evtType, handler);
|
2756 | },
|
2757 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
2758 | return _this.unlisten(evtType, handler);
|
2759 | }
|
2760 | };
|
2761 | return new foundation_1.MDCFloatingLabelFoundation(adapter);
|
2762 | };
|
2763 | return MDCFloatingLabel;
|
2764 | }(component_1.MDCComponent);
|
2765 | exports.MDCFloatingLabel = MDCFloatingLabel;
|
2766 | }, function(module, exports, __webpack_require__) {
|
2767 | "use strict";
|
2768 | var __extends = this && this.__extends || function() {
|
2769 | var _extendStatics = function extendStatics(d, b) {
|
2770 | _extendStatics = Object.setPrototypeOf || {
|
2771 | __proto__: []
|
2772 | } instanceof Array && function(d, b) {
|
2773 | d.__proto__ = b;
|
2774 | } || function(d, b) {
|
2775 | for (var p in b) {
|
2776 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
2777 | }
|
2778 | };
|
2779 | return _extendStatics(d, b);
|
2780 | };
|
2781 | return function(d, b) {
|
2782 | _extendStatics(d, b);
|
2783 | function __() {
|
2784 | this.constructor = d;
|
2785 | }
|
2786 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
2787 | };
|
2788 | }();
|
2789 | var __assign = this && this.__assign || function() {
|
2790 | __assign = Object.assign || function(t) {
|
2791 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
2792 | s = arguments[i];
|
2793 | for (var p in s) {
|
2794 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
2795 | }
|
2796 | }
|
2797 | return t;
|
2798 | };
|
2799 | return __assign.apply(this, arguments);
|
2800 | };
|
2801 | Object.defineProperty(exports, "__esModule", {
|
2802 | value: true
|
2803 | });
|
2804 | var foundation_1 = __webpack_require__(0);
|
2805 | var constants_1 = __webpack_require__(103);
|
2806 | var MDCFloatingLabelFoundation = function(_super) {
|
2807 | __extends(MDCFloatingLabelFoundation, _super);
|
2808 | function MDCFloatingLabelFoundation(adapter) {
|
2809 | var _this = _super.call(this, __assign({}, MDCFloatingLabelFoundation.defaultAdapter, adapter)) || this;
|
2810 | _this.shakeAnimationEndHandler_ = function() {
|
2811 | return _this.handleShakeAnimationEnd_();
|
2812 | };
|
2813 | return _this;
|
2814 | }
|
2815 | Object.defineProperty(MDCFloatingLabelFoundation, "cssClasses", {
|
2816 | get: function get() {
|
2817 | return constants_1.cssClasses;
|
2818 | },
|
2819 | enumerable: true,
|
2820 | configurable: true
|
2821 | });
|
2822 | Object.defineProperty(MDCFloatingLabelFoundation, "defaultAdapter", {
|
2823 | get: function get() {
|
2824 | return {
|
2825 | addClass: function addClass() {
|
2826 | return undefined;
|
2827 | },
|
2828 | removeClass: function removeClass() {
|
2829 | return undefined;
|
2830 | },
|
2831 | getWidth: function getWidth() {
|
2832 | return 0;
|
2833 | },
|
2834 | registerInteractionHandler: function registerInteractionHandler() {
|
2835 | return undefined;
|
2836 | },
|
2837 | deregisterInteractionHandler: function deregisterInteractionHandler() {
|
2838 | return undefined;
|
2839 | }
|
2840 | };
|
2841 | },
|
2842 | enumerable: true,
|
2843 | configurable: true
|
2844 | });
|
2845 | MDCFloatingLabelFoundation.prototype.init = function() {
|
2846 | this.adapter_.registerInteractionHandler("animationend", this.shakeAnimationEndHandler_);
|
2847 | };
|
2848 | MDCFloatingLabelFoundation.prototype.destroy = function() {
|
2849 | this.adapter_.deregisterInteractionHandler("animationend", this.shakeAnimationEndHandler_);
|
2850 | };
|
2851 | MDCFloatingLabelFoundation.prototype.getWidth = function() {
|
2852 | return this.adapter_.getWidth();
|
2853 | };
|
2854 | MDCFloatingLabelFoundation.prototype.shake = function(shouldShake) {
|
2855 | var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
|
2856 | if (shouldShake) {
|
2857 | this.adapter_.addClass(LABEL_SHAKE);
|
2858 | } else {
|
2859 | this.adapter_.removeClass(LABEL_SHAKE);
|
2860 | }
|
2861 | };
|
2862 | MDCFloatingLabelFoundation.prototype.float = function(shouldFloat) {
|
2863 | var _a = MDCFloatingLabelFoundation.cssClasses, LABEL_FLOAT_ABOVE = _a.LABEL_FLOAT_ABOVE, LABEL_SHAKE = _a.LABEL_SHAKE;
|
2864 | if (shouldFloat) {
|
2865 | this.adapter_.addClass(LABEL_FLOAT_ABOVE);
|
2866 | } else {
|
2867 | this.adapter_.removeClass(LABEL_FLOAT_ABOVE);
|
2868 | this.adapter_.removeClass(LABEL_SHAKE);
|
2869 | }
|
2870 | };
|
2871 | MDCFloatingLabelFoundation.prototype.handleShakeAnimationEnd_ = function() {
|
2872 | var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
|
2873 | this.adapter_.removeClass(LABEL_SHAKE);
|
2874 | };
|
2875 | return MDCFloatingLabelFoundation;
|
2876 | }(foundation_1.MDCFoundation);
|
2877 | exports.MDCFloatingLabelFoundation = MDCFloatingLabelFoundation;
|
2878 | exports.default = MDCFloatingLabelFoundation;
|
2879 | }, function(module, exports, __webpack_require__) {
|
2880 | "use strict";
|
2881 | var __extends = this && this.__extends || function() {
|
2882 | var _extendStatics = function extendStatics(d, b) {
|
2883 | _extendStatics = Object.setPrototypeOf || {
|
2884 | __proto__: []
|
2885 | } instanceof Array && function(d, b) {
|
2886 | d.__proto__ = b;
|
2887 | } || function(d, b) {
|
2888 | for (var p in b) {
|
2889 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
2890 | }
|
2891 | };
|
2892 | return _extendStatics(d, b);
|
2893 | };
|
2894 | return function(d, b) {
|
2895 | _extendStatics(d, b);
|
2896 | function __() {
|
2897 | this.constructor = d;
|
2898 | }
|
2899 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
2900 | };
|
2901 | }();
|
2902 | Object.defineProperty(exports, "__esModule", {
|
2903 | value: true
|
2904 | });
|
2905 | var component_1 = __webpack_require__(1);
|
2906 | var foundation_1 = __webpack_require__(40);
|
2907 | var MDCLineRipple = function(_super) {
|
2908 | __extends(MDCLineRipple, _super);
|
2909 | function MDCLineRipple() {
|
2910 | return _super !== null && _super.apply(this, arguments) || this;
|
2911 | }
|
2912 | MDCLineRipple.attachTo = function(root) {
|
2913 | return new MDCLineRipple(root);
|
2914 | };
|
2915 | MDCLineRipple.prototype.activate = function() {
|
2916 | this.foundation_.activate();
|
2917 | };
|
2918 | MDCLineRipple.prototype.deactivate = function() {
|
2919 | this.foundation_.deactivate();
|
2920 | };
|
2921 | MDCLineRipple.prototype.setRippleCenter = function(xCoordinate) {
|
2922 | this.foundation_.setRippleCenter(xCoordinate);
|
2923 | };
|
2924 | MDCLineRipple.prototype.getDefaultFoundation = function() {
|
2925 | var _this = this;
|
2926 | var adapter = {
|
2927 | addClass: function addClass(className) {
|
2928 | return _this.root_.classList.add(className);
|
2929 | },
|
2930 | removeClass: function removeClass(className) {
|
2931 | return _this.root_.classList.remove(className);
|
2932 | },
|
2933 | hasClass: function hasClass(className) {
|
2934 | return _this.root_.classList.contains(className);
|
2935 | },
|
2936 | setStyle: function setStyle(propertyName, value) {
|
2937 | return _this.root_.style.setProperty(propertyName, value);
|
2938 | },
|
2939 | registerEventHandler: function registerEventHandler(evtType, handler) {
|
2940 | return _this.listen(evtType, handler);
|
2941 | },
|
2942 | deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
|
2943 | return _this.unlisten(evtType, handler);
|
2944 | }
|
2945 | };
|
2946 | return new foundation_1.MDCLineRippleFoundation(adapter);
|
2947 | };
|
2948 | return MDCLineRipple;
|
2949 | }(component_1.MDCComponent);
|
2950 | exports.MDCLineRipple = MDCLineRipple;
|
2951 | }, function(module, exports, __webpack_require__) {
|
2952 | "use strict";
|
2953 | Object.defineProperty(exports, "__esModule", {
|
2954 | value: true
|
2955 | });
|
2956 | var cssClasses = {
|
2957 | MENU_SELECTED_LIST_ITEM: "mdc-menu-item--selected",
|
2958 | MENU_SELECTION_GROUP: "mdc-menu__selection-group",
|
2959 | ROOT: "mdc-menu"
|
2960 | };
|
2961 | exports.cssClasses = cssClasses;
|
2962 | var strings = {
|
2963 | ARIA_SELECTED_ATTR: "aria-selected",
|
2964 | CHECKBOX_SELECTOR: 'input[type="checkbox"]',
|
2965 | LIST_SELECTOR: ".mdc-list",
|
2966 | SELECTED_EVENT: "MDCMenu:selected"
|
2967 | };
|
2968 | exports.strings = strings;
|
2969 | var numbers = {
|
2970 | FOCUS_ROOT_INDEX: -1
|
2971 | };
|
2972 | exports.numbers = numbers;
|
2973 | var DefaultFocusState;
|
2974 | (function(DefaultFocusState) {
|
2975 | DefaultFocusState[DefaultFocusState["NONE"] = 0] = "NONE";
|
2976 | DefaultFocusState[DefaultFocusState["LIST_ROOT"] = 1] = "LIST_ROOT";
|
2977 | DefaultFocusState[DefaultFocusState["FIRST_ITEM"] = 2] = "FIRST_ITEM";
|
2978 | DefaultFocusState[DefaultFocusState["LAST_ITEM"] = 3] = "LAST_ITEM";
|
2979 | })(DefaultFocusState || (DefaultFocusState = {}));
|
2980 | exports.DefaultFocusState = DefaultFocusState;
|
2981 | }, function(module, exports, __webpack_require__) {
|
2982 | "use strict";
|
2983 | var __extends = this && this.__extends || function() {
|
2984 | var _extendStatics = function extendStatics(d, b) {
|
2985 | _extendStatics = Object.setPrototypeOf || {
|
2986 | __proto__: []
|
2987 | } instanceof Array && function(d, b) {
|
2988 | d.__proto__ = b;
|
2989 | } || function(d, b) {
|
2990 | for (var p in b) {
|
2991 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
2992 | }
|
2993 | };
|
2994 | return _extendStatics(d, b);
|
2995 | };
|
2996 | return function(d, b) {
|
2997 | _extendStatics(d, b);
|
2998 | function __() {
|
2999 | this.constructor = d;
|
3000 | }
|
3001 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
3002 | };
|
3003 | }();
|
3004 | Object.defineProperty(exports, "__esModule", {
|
3005 | value: true
|
3006 | });
|
3007 | var component_1 = __webpack_require__(1);
|
3008 | var foundation_1 = __webpack_require__(16);
|
3009 | var constants_1 = __webpack_require__(46);
|
3010 | var foundation_2 = __webpack_require__(47);
|
3011 | var MDCNotchedOutline = function(_super) {
|
3012 | __extends(MDCNotchedOutline, _super);
|
3013 | function MDCNotchedOutline() {
|
3014 | return _super !== null && _super.apply(this, arguments) || this;
|
3015 | }
|
3016 | MDCNotchedOutline.attachTo = function(root) {
|
3017 | return new MDCNotchedOutline(root);
|
3018 | };
|
3019 | MDCNotchedOutline.prototype.initialSyncWithDOM = function() {
|
3020 | this.notchElement_ = this.root_.querySelector(constants_1.strings.NOTCH_ELEMENT_SELECTOR);
|
3021 | var label = this.root_.querySelector("." + foundation_1.MDCFloatingLabelFoundation.cssClasses.ROOT);
|
3022 | if (label) {
|
3023 | label.style.transitionDuration = "0s";
|
3024 | this.root_.classList.add(constants_1.cssClasses.OUTLINE_UPGRADED);
|
3025 | requestAnimationFrame(function() {
|
3026 | label.style.transitionDuration = "";
|
3027 | });
|
3028 | } else {
|
3029 | this.root_.classList.add(constants_1.cssClasses.NO_LABEL);
|
3030 | }
|
3031 | };
|
3032 | MDCNotchedOutline.prototype.notch = function(notchWidth) {
|
3033 | this.foundation_.notch(notchWidth);
|
3034 | };
|
3035 | MDCNotchedOutline.prototype.closeNotch = function() {
|
3036 | this.foundation_.closeNotch();
|
3037 | };
|
3038 | MDCNotchedOutline.prototype.getDefaultFoundation = function() {
|
3039 | var _this = this;
|
3040 | var adapter = {
|
3041 | addClass: function addClass(className) {
|
3042 | return _this.root_.classList.add(className);
|
3043 | },
|
3044 | removeClass: function removeClass(className) {
|
3045 | return _this.root_.classList.remove(className);
|
3046 | },
|
3047 | setNotchWidthProperty: function setNotchWidthProperty(width) {
|
3048 | return _this.notchElement_.style.setProperty("width", width + "px");
|
3049 | },
|
3050 | removeNotchWidthProperty: function removeNotchWidthProperty() {
|
3051 | return _this.notchElement_.style.removeProperty("width");
|
3052 | }
|
3053 | };
|
3054 | return new foundation_2.MDCNotchedOutlineFoundation(adapter);
|
3055 | };
|
3056 | return MDCNotchedOutline;
|
3057 | }(component_1.MDCComponent);
|
3058 | exports.MDCNotchedOutline = MDCNotchedOutline;
|
3059 | }, function(module, exports, __webpack_require__) {
|
3060 | "use strict";
|
3061 | Object.defineProperty(exports, "__esModule", {
|
3062 | value: true
|
3063 | });
|
3064 | var cssClasses = {
|
3065 | CLOSING: "mdc-snackbar--closing",
|
3066 | OPEN: "mdc-snackbar--open",
|
3067 | OPENING: "mdc-snackbar--opening"
|
3068 | };
|
3069 | exports.cssClasses = cssClasses;
|
3070 | var strings = {
|
3071 | ACTION_SELECTOR: ".mdc-snackbar__action",
|
3072 | ARIA_LIVE_LABEL_TEXT_ATTR: "data-mdc-snackbar-label-text",
|
3073 | CLOSED_EVENT: "MDCSnackbar:closed",
|
3074 | CLOSING_EVENT: "MDCSnackbar:closing",
|
3075 | DISMISS_SELECTOR: ".mdc-snackbar__dismiss",
|
3076 | LABEL_SELECTOR: ".mdc-snackbar__label",
|
3077 | OPENED_EVENT: "MDCSnackbar:opened",
|
3078 | OPENING_EVENT: "MDCSnackbar:opening",
|
3079 | REASON_ACTION: "action",
|
3080 | REASON_DISMISS: "dismiss",
|
3081 | SURFACE_SELECTOR: ".mdc-snackbar__surface"
|
3082 | };
|
3083 | exports.strings = strings;
|
3084 | var numbers = {
|
3085 | DEFAULT_AUTO_DISMISS_TIMEOUT_MS: 5e3,
|
3086 | MAX_AUTO_DISMISS_TIMEOUT_MS: 1e4,
|
3087 | MIN_AUTO_DISMISS_TIMEOUT_MS: 4e3,
|
3088 | SNACKBAR_ANIMATION_CLOSE_TIME_MS: 75,
|
3089 | SNACKBAR_ANIMATION_OPEN_TIME_MS: 150,
|
3090 | ARIA_LIVE_DELAY_MS: 1e3
|
3091 | };
|
3092 | exports.numbers = numbers;
|
3093 | }, function(module, exports, __webpack_require__) {
|
3094 | "use strict";
|
3095 | Object.defineProperty(exports, "__esModule", {
|
3096 | value: true
|
3097 | });
|
3098 | var MDCTabScrollerRTL = function() {
|
3099 | function MDCTabScrollerRTL(adapter) {
|
3100 | this.adapter_ = adapter;
|
3101 | }
|
3102 | return MDCTabScrollerRTL;
|
3103 | }();
|
3104 | exports.MDCTabScrollerRTL = MDCTabScrollerRTL;
|
3105 | exports.default = MDCTabScrollerRTL;
|
3106 | }, function(module, exports, __webpack_require__) {
|
3107 | "use strict";
|
3108 | var __extends = this && this.__extends || function() {
|
3109 | var _extendStatics = function extendStatics(d, b) {
|
3110 | _extendStatics = Object.setPrototypeOf || {
|
3111 | __proto__: []
|
3112 | } instanceof Array && function(d, b) {
|
3113 | d.__proto__ = b;
|
3114 | } || function(d, b) {
|
3115 | for (var p in b) {
|
3116 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
3117 | }
|
3118 | };
|
3119 | return _extendStatics(d, b);
|
3120 | };
|
3121 | return function(d, b) {
|
3122 | _extendStatics(d, b);
|
3123 | function __() {
|
3124 | this.constructor = d;
|
3125 | }
|
3126 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
3127 | };
|
3128 | }();
|
3129 | var __assign = this && this.__assign || function() {
|
3130 | __assign = Object.assign || function(t) {
|
3131 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
3132 | s = arguments[i];
|
3133 | for (var p in s) {
|
3134 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
3135 | }
|
3136 | }
|
3137 | return t;
|
3138 | };
|
3139 | return __assign.apply(this, arguments);
|
3140 | };
|
3141 | Object.defineProperty(exports, "__esModule", {
|
3142 | value: true
|
3143 | });
|
3144 | var foundation_1 = __webpack_require__(0);
|
3145 | var constants_1 = __webpack_require__(145);
|
3146 | var MDCTabFoundation = function(_super) {
|
3147 | __extends(MDCTabFoundation, _super);
|
3148 | function MDCTabFoundation(adapter) {
|
3149 | var _this = _super.call(this, __assign({}, MDCTabFoundation.defaultAdapter, adapter)) || this;
|
3150 | _this.focusOnActivate_ = true;
|
3151 | return _this;
|
3152 | }
|
3153 | Object.defineProperty(MDCTabFoundation, "cssClasses", {
|
3154 | get: function get() {
|
3155 | return constants_1.cssClasses;
|
3156 | },
|
3157 | enumerable: true,
|
3158 | configurable: true
|
3159 | });
|
3160 | Object.defineProperty(MDCTabFoundation, "strings", {
|
3161 | get: function get() {
|
3162 | return constants_1.strings;
|
3163 | },
|
3164 | enumerable: true,
|
3165 | configurable: true
|
3166 | });
|
3167 | Object.defineProperty(MDCTabFoundation, "defaultAdapter", {
|
3168 | get: function get() {
|
3169 | return {
|
3170 | addClass: function addClass() {
|
3171 | return undefined;
|
3172 | },
|
3173 | removeClass: function removeClass() {
|
3174 | return undefined;
|
3175 | },
|
3176 | hasClass: function hasClass() {
|
3177 | return false;
|
3178 | },
|
3179 | setAttr: function setAttr() {
|
3180 | return undefined;
|
3181 | },
|
3182 | activateIndicator: function activateIndicator() {
|
3183 | return undefined;
|
3184 | },
|
3185 | deactivateIndicator: function deactivateIndicator() {
|
3186 | return undefined;
|
3187 | },
|
3188 | notifyInteracted: function notifyInteracted() {
|
3189 | return undefined;
|
3190 | },
|
3191 | getOffsetLeft: function getOffsetLeft() {
|
3192 | return 0;
|
3193 | },
|
3194 | getOffsetWidth: function getOffsetWidth() {
|
3195 | return 0;
|
3196 | },
|
3197 | getContentOffsetLeft: function getContentOffsetLeft() {
|
3198 | return 0;
|
3199 | },
|
3200 | getContentOffsetWidth: function getContentOffsetWidth() {
|
3201 | return 0;
|
3202 | },
|
3203 | focus: function focus() {
|
3204 | return undefined;
|
3205 | }
|
3206 | };
|
3207 | },
|
3208 | enumerable: true,
|
3209 | configurable: true
|
3210 | });
|
3211 | MDCTabFoundation.prototype.handleClick = function() {
|
3212 | this.adapter_.notifyInteracted();
|
3213 | };
|
3214 | MDCTabFoundation.prototype.isActive = function() {
|
3215 | return this.adapter_.hasClass(constants_1.cssClasses.ACTIVE);
|
3216 | };
|
3217 | MDCTabFoundation.prototype.setFocusOnActivate = function(focusOnActivate) {
|
3218 | this.focusOnActivate_ = focusOnActivate;
|
3219 | };
|
3220 | MDCTabFoundation.prototype.activate = function(previousIndicatorClientRect) {
|
3221 | this.adapter_.addClass(constants_1.cssClasses.ACTIVE);
|
3222 | this.adapter_.setAttr(constants_1.strings.ARIA_SELECTED, "true");
|
3223 | this.adapter_.setAttr(constants_1.strings.TABINDEX, "0");
|
3224 | this.adapter_.activateIndicator(previousIndicatorClientRect);
|
3225 | if (this.focusOnActivate_) {
|
3226 | this.adapter_.focus();
|
3227 | }
|
3228 | };
|
3229 | MDCTabFoundation.prototype.deactivate = function() {
|
3230 | if (!this.isActive()) {
|
3231 | return;
|
3232 | }
|
3233 | this.adapter_.removeClass(constants_1.cssClasses.ACTIVE);
|
3234 | this.adapter_.setAttr(constants_1.strings.ARIA_SELECTED, "false");
|
3235 | this.adapter_.setAttr(constants_1.strings.TABINDEX, "-1");
|
3236 | this.adapter_.deactivateIndicator();
|
3237 | };
|
3238 | MDCTabFoundation.prototype.computeDimensions = function() {
|
3239 | var rootWidth = this.adapter_.getOffsetWidth();
|
3240 | var rootLeft = this.adapter_.getOffsetLeft();
|
3241 | var contentWidth = this.adapter_.getContentOffsetWidth();
|
3242 | var contentLeft = this.adapter_.getContentOffsetLeft();
|
3243 | return {
|
3244 | contentLeft: rootLeft + contentLeft,
|
3245 | contentRight: rootLeft + contentLeft + contentWidth,
|
3246 | rootLeft: rootLeft,
|
3247 | rootRight: rootLeft + rootWidth
|
3248 | };
|
3249 | };
|
3250 | return MDCTabFoundation;
|
3251 | }(foundation_1.MDCFoundation);
|
3252 | exports.MDCTabFoundation = MDCTabFoundation;
|
3253 | exports.default = MDCTabFoundation;
|
3254 | }, function(module, exports, __webpack_require__) {
|
3255 | "use strict";
|
3256 | var __extends = this && this.__extends || function() {
|
3257 | var _extendStatics = function extendStatics(d, b) {
|
3258 | _extendStatics = Object.setPrototypeOf || {
|
3259 | __proto__: []
|
3260 | } instanceof Array && function(d, b) {
|
3261 | d.__proto__ = b;
|
3262 | } || function(d, b) {
|
3263 | for (var p in b) {
|
3264 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
3265 | }
|
3266 | };
|
3267 | return _extendStatics(d, b);
|
3268 | };
|
3269 | return function(d, b) {
|
3270 | _extendStatics(d, b);
|
3271 | function __() {
|
3272 | this.constructor = d;
|
3273 | }
|
3274 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
3275 | };
|
3276 | }();
|
3277 | var __assign = this && this.__assign || function() {
|
3278 | __assign = Object.assign || function(t) {
|
3279 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
3280 | s = arguments[i];
|
3281 | for (var p in s) {
|
3282 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
3283 | }
|
3284 | }
|
3285 | return t;
|
3286 | };
|
3287 | return __assign.apply(this, arguments);
|
3288 | };
|
3289 | Object.defineProperty(exports, "__esModule", {
|
3290 | value: true
|
3291 | });
|
3292 | var foundation_1 = __webpack_require__(0);
|
3293 | var constants_1 = __webpack_require__(152);
|
3294 | var MDCTextFieldCharacterCounterFoundation = function(_super) {
|
3295 | __extends(MDCTextFieldCharacterCounterFoundation, _super);
|
3296 | function MDCTextFieldCharacterCounterFoundation(adapter) {
|
3297 | return _super.call(this, __assign({}, MDCTextFieldCharacterCounterFoundation.defaultAdapter, adapter)) || this;
|
3298 | }
|
3299 | Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "cssClasses", {
|
3300 | get: function get() {
|
3301 | return constants_1.cssClasses;
|
3302 | },
|
3303 | enumerable: true,
|
3304 | configurable: true
|
3305 | });
|
3306 | Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "strings", {
|
3307 | get: function get() {
|
3308 | return constants_1.strings;
|
3309 | },
|
3310 | enumerable: true,
|
3311 | configurable: true
|
3312 | });
|
3313 | Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "defaultAdapter", {
|
3314 | get: function get() {
|
3315 | return {
|
3316 | setContent: function setContent() {
|
3317 | return undefined;
|
3318 | }
|
3319 | };
|
3320 | },
|
3321 | enumerable: true,
|
3322 | configurable: true
|
3323 | });
|
3324 | MDCTextFieldCharacterCounterFoundation.prototype.setCounterValue = function(currentLength, maxLength) {
|
3325 | currentLength = Math.min(currentLength, maxLength);
|
3326 | this.adapter_.setContent(currentLength + " / " + maxLength);
|
3327 | };
|
3328 | return MDCTextFieldCharacterCounterFoundation;
|
3329 | }(foundation_1.MDCFoundation);
|
3330 | exports.MDCTextFieldCharacterCounterFoundation = MDCTextFieldCharacterCounterFoundation;
|
3331 | exports.default = MDCTextFieldCharacterCounterFoundation;
|
3332 | }, function(module, exports, __webpack_require__) {
|
3333 | "use strict";
|
3334 | var __extends = this && this.__extends || function() {
|
3335 | var _extendStatics = function extendStatics(d, b) {
|
3336 | _extendStatics = Object.setPrototypeOf || {
|
3337 | __proto__: []
|
3338 | } instanceof Array && function(d, b) {
|
3339 | d.__proto__ = b;
|
3340 | } || function(d, b) {
|
3341 | for (var p in b) {
|
3342 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
3343 | }
|
3344 | };
|
3345 | return _extendStatics(d, b);
|
3346 | };
|
3347 | return function(d, b) {
|
3348 | _extendStatics(d, b);
|
3349 | function __() {
|
3350 | this.constructor = d;
|
3351 | }
|
3352 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
3353 | };
|
3354 | }();
|
3355 | var __assign = this && this.__assign || function() {
|
3356 | __assign = Object.assign || function(t) {
|
3357 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
3358 | s = arguments[i];
|
3359 | for (var p in s) {
|
3360 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
3361 | }
|
3362 | }
|
3363 | return t;
|
3364 | };
|
3365 | return __assign.apply(this, arguments);
|
3366 | };
|
3367 | Object.defineProperty(exports, "__esModule", {
|
3368 | value: true
|
3369 | });
|
3370 | var foundation_1 = __webpack_require__(0);
|
3371 | var constants_1 = __webpack_require__(153);
|
3372 | var MDCTextFieldHelperTextFoundation = function(_super) {
|
3373 | __extends(MDCTextFieldHelperTextFoundation, _super);
|
3374 | function MDCTextFieldHelperTextFoundation(adapter) {
|
3375 | return _super.call(this, __assign({}, MDCTextFieldHelperTextFoundation.defaultAdapter, adapter)) || this;
|
3376 | }
|
3377 | Object.defineProperty(MDCTextFieldHelperTextFoundation, "cssClasses", {
|
3378 | get: function get() {
|
3379 | return constants_1.cssClasses;
|
3380 | },
|
3381 | enumerable: true,
|
3382 | configurable: true
|
3383 | });
|
3384 | Object.defineProperty(MDCTextFieldHelperTextFoundation, "strings", {
|
3385 | get: function get() {
|
3386 | return constants_1.strings;
|
3387 | },
|
3388 | enumerable: true,
|
3389 | configurable: true
|
3390 | });
|
3391 | Object.defineProperty(MDCTextFieldHelperTextFoundation, "defaultAdapter", {
|
3392 | get: function get() {
|
3393 | return {
|
3394 | addClass: function addClass() {
|
3395 | return undefined;
|
3396 | },
|
3397 | removeClass: function removeClass() {
|
3398 | return undefined;
|
3399 | },
|
3400 | hasClass: function hasClass() {
|
3401 | return false;
|
3402 | },
|
3403 | setAttr: function setAttr() {
|
3404 | return undefined;
|
3405 | },
|
3406 | removeAttr: function removeAttr() {
|
3407 | return undefined;
|
3408 | },
|
3409 | setContent: function setContent() {
|
3410 | return undefined;
|
3411 | }
|
3412 | };
|
3413 | },
|
3414 | enumerable: true,
|
3415 | configurable: true
|
3416 | });
|
3417 | MDCTextFieldHelperTextFoundation.prototype.setContent = function(content) {
|
3418 | this.adapter_.setContent(content);
|
3419 | };
|
3420 | MDCTextFieldHelperTextFoundation.prototype.setPersistent = function(isPersistent) {
|
3421 | if (isPersistent) {
|
3422 | this.adapter_.addClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
|
3423 | } else {
|
3424 | this.adapter_.removeClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
|
3425 | }
|
3426 | };
|
3427 | MDCTextFieldHelperTextFoundation.prototype.setValidation = function(isValidation) {
|
3428 | if (isValidation) {
|
3429 | this.adapter_.addClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
|
3430 | } else {
|
3431 | this.adapter_.removeClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
|
3432 | }
|
3433 | };
|
3434 | MDCTextFieldHelperTextFoundation.prototype.showToScreenReader = function() {
|
3435 | this.adapter_.removeAttr(constants_1.strings.ARIA_HIDDEN);
|
3436 | };
|
3437 | MDCTextFieldHelperTextFoundation.prototype.setValidity = function(inputIsValid) {
|
3438 | var helperTextIsPersistent = this.adapter_.hasClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
|
3439 | var helperTextIsValidationMsg = this.adapter_.hasClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
|
3440 | var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;
|
3441 | if (validationMsgNeedsDisplay) {
|
3442 | this.adapter_.setAttr(constants_1.strings.ROLE, "alert");
|
3443 | } else {
|
3444 | this.adapter_.removeAttr(constants_1.strings.ROLE);
|
3445 | }
|
3446 | if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
|
3447 | this.hide_();
|
3448 | }
|
3449 | };
|
3450 | MDCTextFieldHelperTextFoundation.prototype.hide_ = function() {
|
3451 | this.adapter_.setAttr(constants_1.strings.ARIA_HIDDEN, "true");
|
3452 | };
|
3453 | return MDCTextFieldHelperTextFoundation;
|
3454 | }(foundation_1.MDCFoundation);
|
3455 | exports.MDCTextFieldHelperTextFoundation = MDCTextFieldHelperTextFoundation;
|
3456 | exports.default = MDCTextFieldHelperTextFoundation;
|
3457 | }, function(module, exports, __webpack_require__) {
|
3458 | "use strict";
|
3459 | var __extends = this && this.__extends || function() {
|
3460 | var _extendStatics = function extendStatics(d, b) {
|
3461 | _extendStatics = Object.setPrototypeOf || {
|
3462 | __proto__: []
|
3463 | } instanceof Array && function(d, b) {
|
3464 | d.__proto__ = b;
|
3465 | } || function(d, b) {
|
3466 | for (var p in b) {
|
3467 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
3468 | }
|
3469 | };
|
3470 | return _extendStatics(d, b);
|
3471 | };
|
3472 | return function(d, b) {
|
3473 | _extendStatics(d, b);
|
3474 | function __() {
|
3475 | this.constructor = d;
|
3476 | }
|
3477 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
3478 | };
|
3479 | }();
|
3480 | Object.defineProperty(exports, "__esModule", {
|
3481 | value: true
|
3482 | });
|
3483 | var constants_1 = __webpack_require__(7);
|
3484 | var foundation_1 = __webpack_require__(26);
|
3485 | var INITIAL_VALUE = 0;
|
3486 | var MDCTopAppBarFoundation = function(_super) {
|
3487 | __extends(MDCTopAppBarFoundation, _super);
|
3488 | function MDCTopAppBarFoundation(adapter) {
|
3489 | var _this = _super.call(this, adapter) || this;
|
3490 | _this.wasDocked_ = true;
|
3491 | _this.isDockedShowing_ = true;
|
3492 | _this.currentAppBarOffsetTop_ = 0;
|
3493 | _this.isCurrentlyBeingResized_ = false;
|
3494 | _this.resizeThrottleId_ = INITIAL_VALUE;
|
3495 | _this.resizeDebounceId_ = INITIAL_VALUE;
|
3496 | _this.lastScrollPosition_ = _this.adapter_.getViewportScrollY();
|
3497 | _this.topAppBarHeight_ = _this.adapter_.getTopAppBarHeight();
|
3498 | _this.scrollHandler_ = function() {
|
3499 | return _this.topAppBarScrollHandler_();
|
3500 | };
|
3501 | _this.resizeHandler_ = function() {
|
3502 | return _this.topAppBarResizeHandler_();
|
3503 | };
|
3504 | return _this;
|
3505 | }
|
3506 | MDCTopAppBarFoundation.prototype.destroy = function() {
|
3507 | _super.prototype.destroy.call(this);
|
3508 | this.adapter_.setStyle("top", "");
|
3509 | };
|
3510 | MDCTopAppBarFoundation.prototype.checkForUpdate_ = function() {
|
3511 | var offscreenBoundaryTop = -this.topAppBarHeight_;
|
3512 | var hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;
|
3513 | var hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;
|
3514 | var partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;
|
3515 | if (partiallyShowing) {
|
3516 | this.wasDocked_ = false;
|
3517 | } else {
|
3518 | if (!this.wasDocked_) {
|
3519 | this.wasDocked_ = true;
|
3520 | return true;
|
3521 | } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {
|
3522 | this.isDockedShowing_ = hasAnyPixelsOnscreen;
|
3523 | return true;
|
3524 | }
|
3525 | }
|
3526 | return partiallyShowing;
|
3527 | };
|
3528 | MDCTopAppBarFoundation.prototype.moveTopAppBar_ = function() {
|
3529 | if (this.checkForUpdate_()) {
|
3530 | var offset = this.currentAppBarOffsetTop_;
|
3531 | if (Math.abs(offset) >= this.topAppBarHeight_) {
|
3532 | offset = -constants_1.numbers.MAX_TOP_APP_BAR_HEIGHT;
|
3533 | }
|
3534 | this.adapter_.setStyle("top", offset + "px");
|
3535 | }
|
3536 | };
|
3537 | MDCTopAppBarFoundation.prototype.topAppBarScrollHandler_ = function() {
|
3538 | var currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);
|
3539 | var diff = currentScrollPosition - this.lastScrollPosition_;
|
3540 | this.lastScrollPosition_ = currentScrollPosition;
|
3541 | if (!this.isCurrentlyBeingResized_) {
|
3542 | this.currentAppBarOffsetTop_ -= diff;
|
3543 | if (this.currentAppBarOffsetTop_ > 0) {
|
3544 | this.currentAppBarOffsetTop_ = 0;
|
3545 | } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {
|
3546 | this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;
|
3547 | }
|
3548 | this.moveTopAppBar_();
|
3549 | }
|
3550 | };
|
3551 | MDCTopAppBarFoundation.prototype.topAppBarResizeHandler_ = function() {
|
3552 | var _this = this;
|
3553 | if (!this.resizeThrottleId_) {
|
3554 | this.resizeThrottleId_ = setTimeout(function() {
|
3555 | _this.resizeThrottleId_ = INITIAL_VALUE;
|
3556 | _this.throttledResizeHandler_();
|
3557 | }, constants_1.numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
|
3558 | }
|
3559 | this.isCurrentlyBeingResized_ = true;
|
3560 | if (this.resizeDebounceId_) {
|
3561 | clearTimeout(this.resizeDebounceId_);
|
3562 | }
|
3563 | this.resizeDebounceId_ = setTimeout(function() {
|
3564 | _this.topAppBarScrollHandler_();
|
3565 | _this.isCurrentlyBeingResized_ = false;
|
3566 | _this.resizeDebounceId_ = INITIAL_VALUE;
|
3567 | }, constants_1.numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
|
3568 | };
|
3569 | MDCTopAppBarFoundation.prototype.throttledResizeHandler_ = function() {
|
3570 | var currentHeight = this.adapter_.getTopAppBarHeight();
|
3571 | if (this.topAppBarHeight_ !== currentHeight) {
|
3572 | this.wasDocked_ = false;
|
3573 | this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;
|
3574 | this.topAppBarHeight_ = currentHeight;
|
3575 | }
|
3576 | this.topAppBarScrollHandler_();
|
3577 | };
|
3578 | return MDCTopAppBarFoundation;
|
3579 | }(foundation_1.MDCTopAppBarBaseFoundation);
|
3580 | exports.MDCTopAppBarFoundation = MDCTopAppBarFoundation;
|
3581 | exports.default = MDCTopAppBarFoundation;
|
3582 | }, function(module, exports, __webpack_require__) {
|
3583 | "use strict";
|
3584 | var __extends = this && this.__extends || function() {
|
3585 | var _extendStatics = function extendStatics(d, b) {
|
3586 | _extendStatics = Object.setPrototypeOf || {
|
3587 | __proto__: []
|
3588 | } instanceof Array && function(d, b) {
|
3589 | d.__proto__ = b;
|
3590 | } || function(d, b) {
|
3591 | for (var p in b) {
|
3592 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
3593 | }
|
3594 | };
|
3595 | return _extendStatics(d, b);
|
3596 | };
|
3597 | return function(d, b) {
|
3598 | _extendStatics(d, b);
|
3599 | function __() {
|
3600 | this.constructor = d;
|
3601 | }
|
3602 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
3603 | };
|
3604 | }();
|
3605 | var __assign = this && this.__assign || function() {
|
3606 | __assign = Object.assign || function(t) {
|
3607 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
3608 | s = arguments[i];
|
3609 | for (var p in s) {
|
3610 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
3611 | }
|
3612 | }
|
3613 | return t;
|
3614 | };
|
3615 | return __assign.apply(this, arguments);
|
3616 | };
|
3617 | Object.defineProperty(exports, "__esModule", {
|
3618 | value: true
|
3619 | });
|
3620 | var foundation_1 = __webpack_require__(0);
|
3621 | var constants_1 = __webpack_require__(7);
|
3622 | var MDCTopAppBarBaseFoundation = function(_super) {
|
3623 | __extends(MDCTopAppBarBaseFoundation, _super);
|
3624 | function MDCTopAppBarBaseFoundation(adapter) {
|
3625 | var _this = _super.call(this, __assign({}, MDCTopAppBarBaseFoundation.defaultAdapter, adapter)) || this;
|
3626 | _this.navClickHandler_ = function() {
|
3627 | return _this.adapter_.notifyNavigationIconClicked();
|
3628 | };
|
3629 | return _this;
|
3630 | }
|
3631 | Object.defineProperty(MDCTopAppBarBaseFoundation, "strings", {
|
3632 | get: function get() {
|
3633 | return constants_1.strings;
|
3634 | },
|
3635 | enumerable: true,
|
3636 | configurable: true
|
3637 | });
|
3638 | Object.defineProperty(MDCTopAppBarBaseFoundation, "cssClasses", {
|
3639 | get: function get() {
|
3640 | return constants_1.cssClasses;
|
3641 | },
|
3642 | enumerable: true,
|
3643 | configurable: true
|
3644 | });
|
3645 | Object.defineProperty(MDCTopAppBarBaseFoundation, "numbers", {
|
3646 | get: function get() {
|
3647 | return constants_1.numbers;
|
3648 | },
|
3649 | enumerable: true,
|
3650 | configurable: true
|
3651 | });
|
3652 | Object.defineProperty(MDCTopAppBarBaseFoundation, "defaultAdapter", {
|
3653 | get: function get() {
|
3654 | return {
|
3655 | addClass: function addClass() {
|
3656 | return undefined;
|
3657 | },
|
3658 | removeClass: function removeClass() {
|
3659 | return undefined;
|
3660 | },
|
3661 | hasClass: function hasClass() {
|
3662 | return false;
|
3663 | },
|
3664 | setStyle: function setStyle() {
|
3665 | return undefined;
|
3666 | },
|
3667 | getTopAppBarHeight: function getTopAppBarHeight() {
|
3668 | return 0;
|
3669 | },
|
3670 | registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler() {
|
3671 | return undefined;
|
3672 | },
|
3673 | deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler() {
|
3674 | return undefined;
|
3675 | },
|
3676 | notifyNavigationIconClicked: function notifyNavigationIconClicked() {
|
3677 | return undefined;
|
3678 | },
|
3679 | registerScrollHandler: function registerScrollHandler() {
|
3680 | return undefined;
|
3681 | },
|
3682 | deregisterScrollHandler: function deregisterScrollHandler() {
|
3683 | return undefined;
|
3684 | },
|
3685 | registerResizeHandler: function registerResizeHandler() {
|
3686 | return undefined;
|
3687 | },
|
3688 | deregisterResizeHandler: function deregisterResizeHandler() {
|
3689 | return undefined;
|
3690 | },
|
3691 | getViewportScrollY: function getViewportScrollY() {
|
3692 | return 0;
|
3693 | },
|
3694 | getTotalActionItems: function getTotalActionItems() {
|
3695 | return 0;
|
3696 | }
|
3697 | };
|
3698 | },
|
3699 | enumerable: true,
|
3700 | configurable: true
|
3701 | });
|
3702 | MDCTopAppBarBaseFoundation.prototype.init = function() {
|
3703 | this.initScrollHandler();
|
3704 | this.initResizeHandler_();
|
3705 | this.adapter_.registerNavigationIconInteractionHandler("click", this.navClickHandler_);
|
3706 | };
|
3707 | MDCTopAppBarBaseFoundation.prototype.destroy = function() {
|
3708 | this.destroyScrollHandler();
|
3709 | this.destroyResizeHandler_();
|
3710 | this.adapter_.deregisterNavigationIconInteractionHandler("click", this.navClickHandler_);
|
3711 | };
|
3712 | MDCTopAppBarBaseFoundation.prototype.initScrollHandler = function() {
|
3713 | if (this.scrollHandler_) {
|
3714 | this.adapter_.registerScrollHandler(this.scrollHandler_);
|
3715 | }
|
3716 | };
|
3717 | MDCTopAppBarBaseFoundation.prototype.destroyScrollHandler = function() {
|
3718 | if (this.scrollHandler_) {
|
3719 | this.adapter_.deregisterScrollHandler(this.scrollHandler_);
|
3720 | }
|
3721 | };
|
3722 | MDCTopAppBarBaseFoundation.prototype.initResizeHandler_ = function() {
|
3723 | if (this.resizeHandler_) {
|
3724 | this.adapter_.registerResizeHandler(this.resizeHandler_);
|
3725 | }
|
3726 | };
|
3727 | MDCTopAppBarBaseFoundation.prototype.destroyResizeHandler_ = function() {
|
3728 | if (this.resizeHandler_) {
|
3729 | this.adapter_.deregisterResizeHandler(this.resizeHandler_);
|
3730 | }
|
3731 | };
|
3732 | return MDCTopAppBarBaseFoundation;
|
3733 | }(foundation_1.MDCFoundation);
|
3734 | exports.MDCTopAppBarBaseFoundation = MDCTopAppBarBaseFoundation;
|
3735 | exports.default = MDCTopAppBarBaseFoundation;
|
3736 | }, function(module, exports, __webpack_require__) {
|
3737 | "use strict";
|
3738 | var __extends = this && this.__extends || function() {
|
3739 | var _extendStatics = function extendStatics(d, b) {
|
3740 | _extendStatics = Object.setPrototypeOf || {
|
3741 | __proto__: []
|
3742 | } instanceof Array && function(d, b) {
|
3743 | d.__proto__ = b;
|
3744 | } || function(d, b) {
|
3745 | for (var p in b) {
|
3746 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
3747 | }
|
3748 | };
|
3749 | return _extendStatics(d, b);
|
3750 | };
|
3751 | return function(d, b) {
|
3752 | _extendStatics(d, b);
|
3753 | function __() {
|
3754 | this.constructor = d;
|
3755 | }
|
3756 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
3757 | };
|
3758 | }();
|
3759 | var __assign = this && this.__assign || function() {
|
3760 | __assign = Object.assign || function(t) {
|
3761 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
3762 | s = arguments[i];
|
3763 | for (var p in s) {
|
3764 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
3765 | }
|
3766 | }
|
3767 | return t;
|
3768 | };
|
3769 | return __assign.apply(this, arguments);
|
3770 | };
|
3771 | Object.defineProperty(exports, "__esModule", {
|
3772 | value: true
|
3773 | });
|
3774 | var foundation_1 = __webpack_require__(0);
|
3775 | var constants_1 = __webpack_require__(84);
|
3776 | var MDCCheckboxFoundation = function(_super) {
|
3777 | __extends(MDCCheckboxFoundation, _super);
|
3778 | function MDCCheckboxFoundation(adapter) {
|
3779 | var _this = _super.call(this, __assign({}, MDCCheckboxFoundation.defaultAdapter, adapter)) || this;
|
3780 | _this.currentCheckState_ = constants_1.strings.TRANSITION_STATE_INIT;
|
3781 | _this.currentAnimationClass_ = "";
|
3782 | _this.animEndLatchTimer_ = 0;
|
3783 | _this.enableAnimationEndHandler_ = false;
|
3784 | return _this;
|
3785 | }
|
3786 | Object.defineProperty(MDCCheckboxFoundation, "cssClasses", {
|
3787 | get: function get() {
|
3788 | return constants_1.cssClasses;
|
3789 | },
|
3790 | enumerable: true,
|
3791 | configurable: true
|
3792 | });
|
3793 | Object.defineProperty(MDCCheckboxFoundation, "strings", {
|
3794 | get: function get() {
|
3795 | return constants_1.strings;
|
3796 | },
|
3797 | enumerable: true,
|
3798 | configurable: true
|
3799 | });
|
3800 | Object.defineProperty(MDCCheckboxFoundation, "numbers", {
|
3801 | get: function get() {
|
3802 | return constants_1.numbers;
|
3803 | },
|
3804 | enumerable: true,
|
3805 | configurable: true
|
3806 | });
|
3807 | Object.defineProperty(MDCCheckboxFoundation, "defaultAdapter", {
|
3808 | get: function get() {
|
3809 | return {
|
3810 | addClass: function addClass() {
|
3811 | return undefined;
|
3812 | },
|
3813 | forceLayout: function forceLayout() {
|
3814 | return undefined;
|
3815 | },
|
3816 | hasNativeControl: function hasNativeControl() {
|
3817 | return false;
|
3818 | },
|
3819 | isAttachedToDOM: function isAttachedToDOM() {
|
3820 | return false;
|
3821 | },
|
3822 | isChecked: function isChecked() {
|
3823 | return false;
|
3824 | },
|
3825 | isIndeterminate: function isIndeterminate() {
|
3826 | return false;
|
3827 | },
|
3828 | removeClass: function removeClass() {
|
3829 | return undefined;
|
3830 | },
|
3831 | removeNativeControlAttr: function removeNativeControlAttr() {
|
3832 | return undefined;
|
3833 | },
|
3834 | setNativeControlAttr: function setNativeControlAttr() {
|
3835 | return undefined;
|
3836 | },
|
3837 | setNativeControlDisabled: function setNativeControlDisabled() {
|
3838 | return undefined;
|
3839 | }
|
3840 | };
|
3841 | },
|
3842 | enumerable: true,
|
3843 | configurable: true
|
3844 | });
|
3845 | MDCCheckboxFoundation.prototype.init = function() {
|
3846 | this.currentCheckState_ = this.determineCheckState_();
|
3847 | this.updateAriaChecked_();
|
3848 | this.adapter_.addClass(constants_1.cssClasses.UPGRADED);
|
3849 | };
|
3850 | MDCCheckboxFoundation.prototype.destroy = function() {
|
3851 | clearTimeout(this.animEndLatchTimer_);
|
3852 | };
|
3853 | MDCCheckboxFoundation.prototype.setDisabled = function(disabled) {
|
3854 | this.adapter_.setNativeControlDisabled(disabled);
|
3855 | if (disabled) {
|
3856 | this.adapter_.addClass(constants_1.cssClasses.DISABLED);
|
3857 | } else {
|
3858 | this.adapter_.removeClass(constants_1.cssClasses.DISABLED);
|
3859 | }
|
3860 | };
|
3861 | MDCCheckboxFoundation.prototype.handleAnimationEnd = function() {
|
3862 | var _this = this;
|
3863 | if (!this.enableAnimationEndHandler_) {
|
3864 | return;
|
3865 | }
|
3866 | clearTimeout(this.animEndLatchTimer_);
|
3867 | this.animEndLatchTimer_ = setTimeout(function() {
|
3868 | _this.adapter_.removeClass(_this.currentAnimationClass_);
|
3869 | _this.enableAnimationEndHandler_ = false;
|
3870 | }, constants_1.numbers.ANIM_END_LATCH_MS);
|
3871 | };
|
3872 | MDCCheckboxFoundation.prototype.handleChange = function() {
|
3873 | this.transitionCheckState_();
|
3874 | };
|
3875 | MDCCheckboxFoundation.prototype.transitionCheckState_ = function() {
|
3876 | if (!this.adapter_.hasNativeControl()) {
|
3877 | return;
|
3878 | }
|
3879 | var oldState = this.currentCheckState_;
|
3880 | var newState = this.determineCheckState_();
|
3881 | if (oldState === newState) {
|
3882 | return;
|
3883 | }
|
3884 | this.updateAriaChecked_();
|
3885 | var TRANSITION_STATE_UNCHECKED = constants_1.strings.TRANSITION_STATE_UNCHECKED;
|
3886 | var SELECTED = constants_1.cssClasses.SELECTED;
|
3887 | if (newState === TRANSITION_STATE_UNCHECKED) {
|
3888 | this.adapter_.removeClass(SELECTED);
|
3889 | } else {
|
3890 | this.adapter_.addClass(SELECTED);
|
3891 | }
|
3892 | if (this.currentAnimationClass_.length > 0) {
|
3893 | clearTimeout(this.animEndLatchTimer_);
|
3894 | this.adapter_.forceLayout();
|
3895 | this.adapter_.removeClass(this.currentAnimationClass_);
|
3896 | }
|
3897 | this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);
|
3898 | this.currentCheckState_ = newState;
|
3899 | if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) {
|
3900 | this.adapter_.addClass(this.currentAnimationClass_);
|
3901 | this.enableAnimationEndHandler_ = true;
|
3902 | }
|
3903 | };
|
3904 | MDCCheckboxFoundation.prototype.determineCheckState_ = function() {
|
3905 | var TRANSITION_STATE_INDETERMINATE = constants_1.strings.TRANSITION_STATE_INDETERMINATE, TRANSITION_STATE_CHECKED = constants_1.strings.TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = constants_1.strings.TRANSITION_STATE_UNCHECKED;
|
3906 | if (this.adapter_.isIndeterminate()) {
|
3907 | return TRANSITION_STATE_INDETERMINATE;
|
3908 | }
|
3909 | return this.adapter_.isChecked() ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED;
|
3910 | };
|
3911 | MDCCheckboxFoundation.prototype.getTransitionAnimationClass_ = function(oldState, newState) {
|
3912 | var TRANSITION_STATE_INIT = constants_1.strings.TRANSITION_STATE_INIT, TRANSITION_STATE_CHECKED = constants_1.strings.TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = constants_1.strings.TRANSITION_STATE_UNCHECKED;
|
3913 | var _a = MDCCheckboxFoundation.cssClasses, ANIM_UNCHECKED_CHECKED = _a.ANIM_UNCHECKED_CHECKED, ANIM_UNCHECKED_INDETERMINATE = _a.ANIM_UNCHECKED_INDETERMINATE, ANIM_CHECKED_UNCHECKED = _a.ANIM_CHECKED_UNCHECKED, ANIM_CHECKED_INDETERMINATE = _a.ANIM_CHECKED_INDETERMINATE, ANIM_INDETERMINATE_CHECKED = _a.ANIM_INDETERMINATE_CHECKED, ANIM_INDETERMINATE_UNCHECKED = _a.ANIM_INDETERMINATE_UNCHECKED;
|
3914 | switch (oldState) {
|
3915 | case TRANSITION_STATE_INIT:
|
3916 | if (newState === TRANSITION_STATE_UNCHECKED) {
|
3917 | return "";
|
3918 | }
|
3919 | return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
|
3920 |
|
3921 | case TRANSITION_STATE_UNCHECKED:
|
3922 | return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;
|
3923 |
|
3924 | case TRANSITION_STATE_CHECKED:
|
3925 | return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;
|
3926 |
|
3927 | default:
|
3928 | return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
|
3929 | }
|
3930 | };
|
3931 | MDCCheckboxFoundation.prototype.updateAriaChecked_ = function() {
|
3932 | if (this.adapter_.isIndeterminate()) {
|
3933 | this.adapter_.setNativeControlAttr(constants_1.strings.ARIA_CHECKED_ATTR, constants_1.strings.ARIA_CHECKED_INDETERMINATE_VALUE);
|
3934 | } else {
|
3935 | this.adapter_.removeNativeControlAttr(constants_1.strings.ARIA_CHECKED_ATTR);
|
3936 | }
|
3937 | };
|
3938 | return MDCCheckboxFoundation;
|
3939 | }(foundation_1.MDCFoundation);
|
3940 | exports.MDCCheckboxFoundation = MDCCheckboxFoundation;
|
3941 | exports.default = MDCCheckboxFoundation;
|
3942 | }, function(module, exports, __webpack_require__) {
|
3943 | "use strict";
|
3944 | var __extends = this && this.__extends || function() {
|
3945 | var _extendStatics = function extendStatics(d, b) {
|
3946 | _extendStatics = Object.setPrototypeOf || {
|
3947 | __proto__: []
|
3948 | } instanceof Array && function(d, b) {
|
3949 | d.__proto__ = b;
|
3950 | } || function(d, b) {
|
3951 | for (var p in b) {
|
3952 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
3953 | }
|
3954 | };
|
3955 | return _extendStatics(d, b);
|
3956 | };
|
3957 | return function(d, b) {
|
3958 | _extendStatics(d, b);
|
3959 | function __() {
|
3960 | this.constructor = d;
|
3961 | }
|
3962 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
3963 | };
|
3964 | }();
|
3965 | var __assign = this && this.__assign || function() {
|
3966 | __assign = Object.assign || function(t) {
|
3967 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
3968 | s = arguments[i];
|
3969 | for (var p in s) {
|
3970 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
3971 | }
|
3972 | }
|
3973 | return t;
|
3974 | };
|
3975 | return __assign.apply(this, arguments);
|
3976 | };
|
3977 | Object.defineProperty(exports, "__esModule", {
|
3978 | value: true
|
3979 | });
|
3980 | var component_1 = __webpack_require__(1);
|
3981 | var component_2 = __webpack_require__(2);
|
3982 | var foundation_1 = __webpack_require__(4);
|
3983 | var constants_1 = __webpack_require__(29);
|
3984 | var foundation_2 = __webpack_require__(12);
|
3985 | var INTERACTION_EVENTS = [ "click", "keydown" ];
|
3986 | var MDCChip = function(_super) {
|
3987 | __extends(MDCChip, _super);
|
3988 | function MDCChip() {
|
3989 | return _super !== null && _super.apply(this, arguments) || this;
|
3990 | }
|
3991 | Object.defineProperty(MDCChip.prototype, "selected", {
|
3992 | get: function get() {
|
3993 | return this.foundation_.isSelected();
|
3994 | },
|
3995 | set: function set(selected) {
|
3996 | this.foundation_.setSelected(selected);
|
3997 | },
|
3998 | enumerable: true,
|
3999 | configurable: true
|
4000 | });
|
4001 | Object.defineProperty(MDCChip.prototype, "shouldRemoveOnTrailingIconClick", {
|
4002 | get: function get() {
|
4003 | return this.foundation_.getShouldRemoveOnTrailingIconClick();
|
4004 | },
|
4005 | set: function set(shouldRemove) {
|
4006 | this.foundation_.setShouldRemoveOnTrailingIconClick(shouldRemove);
|
4007 | },
|
4008 | enumerable: true,
|
4009 | configurable: true
|
4010 | });
|
4011 | Object.defineProperty(MDCChip.prototype, "ripple", {
|
4012 | get: function get() {
|
4013 | return this.ripple_;
|
4014 | },
|
4015 | enumerable: true,
|
4016 | configurable: true
|
4017 | });
|
4018 | Object.defineProperty(MDCChip.prototype, "id", {
|
4019 | get: function get() {
|
4020 | return this.root_.id;
|
4021 | },
|
4022 | enumerable: true,
|
4023 | configurable: true
|
4024 | });
|
4025 | MDCChip.attachTo = function(root) {
|
4026 | return new MDCChip(root);
|
4027 | };
|
4028 | MDCChip.prototype.initialize = function(rippleFactory) {
|
4029 | var _this = this;
|
4030 | if (rippleFactory === void 0) {
|
4031 | rippleFactory = function rippleFactory(el, foundation) {
|
4032 | return new component_2.MDCRipple(el, foundation);
|
4033 | };
|
4034 | }
|
4035 | this.leadingIcon_ = this.root_.querySelector(constants_1.strings.LEADING_ICON_SELECTOR);
|
4036 | this.trailingIcon_ = this.root_.querySelector(constants_1.strings.TRAILING_ICON_SELECTOR);
|
4037 | this.checkmark_ = this.root_.querySelector(constants_1.strings.CHECKMARK_SELECTOR);
|
4038 | var rippleAdapter = __assign({}, component_2.MDCRipple.createAdapter(this), {
|
4039 | computeBoundingRect: function computeBoundingRect() {
|
4040 | return _this.foundation_.getDimensions();
|
4041 | }
|
4042 | });
|
4043 | this.ripple_ = rippleFactory(this.root_, new foundation_1.MDCRippleFoundation(rippleAdapter));
|
4044 | };
|
4045 | MDCChip.prototype.initialSyncWithDOM = function() {
|
4046 | var _this = this;
|
4047 | this.handleInteraction_ = function(evt) {
|
4048 | return _this.foundation_.handleInteraction(evt);
|
4049 | };
|
4050 | this.handleTransitionEnd_ = function(evt) {
|
4051 | return _this.foundation_.handleTransitionEnd(evt);
|
4052 | };
|
4053 | this.handleTrailingIconInteraction_ = function(evt) {
|
4054 | return _this.foundation_.handleTrailingIconInteraction(evt);
|
4055 | };
|
4056 | INTERACTION_EVENTS.forEach(function(evtType) {
|
4057 | _this.listen(evtType, _this.handleInteraction_);
|
4058 | });
|
4059 | this.listen("transitionend", this.handleTransitionEnd_);
|
4060 | if (this.trailingIcon_) {
|
4061 | INTERACTION_EVENTS.forEach(function(evtType) {
|
4062 | _this.trailingIcon_.addEventListener(evtType, _this.handleTrailingIconInteraction_);
|
4063 | });
|
4064 | }
|
4065 | };
|
4066 | MDCChip.prototype.destroy = function() {
|
4067 | var _this = this;
|
4068 | this.ripple_.destroy();
|
4069 | INTERACTION_EVENTS.forEach(function(evtType) {
|
4070 | _this.unlisten(evtType, _this.handleInteraction_);
|
4071 | });
|
4072 | this.unlisten("transitionend", this.handleTransitionEnd_);
|
4073 | if (this.trailingIcon_) {
|
4074 | INTERACTION_EVENTS.forEach(function(evtType) {
|
4075 | _this.trailingIcon_.removeEventListener(evtType, _this.handleTrailingIconInteraction_);
|
4076 | });
|
4077 | }
|
4078 | _super.prototype.destroy.call(this);
|
4079 | };
|
4080 | MDCChip.prototype.beginExit = function() {
|
4081 | this.foundation_.beginExit();
|
4082 | };
|
4083 | MDCChip.prototype.getDefaultFoundation = function() {
|
4084 | var _this = this;
|
4085 | var adapter = {
|
4086 | addClass: function addClass(className) {
|
4087 | return _this.root_.classList.add(className);
|
4088 | },
|
4089 | addClassToLeadingIcon: function addClassToLeadingIcon(className) {
|
4090 | if (_this.leadingIcon_) {
|
4091 | _this.leadingIcon_.classList.add(className);
|
4092 | }
|
4093 | },
|
4094 | eventTargetHasClass: function eventTargetHasClass(target, className) {
|
4095 | return target ? target.classList.contains(className) : false;
|
4096 | },
|
4097 | getCheckmarkBoundingClientRect: function getCheckmarkBoundingClientRect() {
|
4098 | return _this.checkmark_ ? _this.checkmark_.getBoundingClientRect() : null;
|
4099 | },
|
4100 | getComputedStyleValue: function getComputedStyleValue(propertyName) {
|
4101 | return window.getComputedStyle(_this.root_).getPropertyValue(propertyName);
|
4102 | },
|
4103 | getRootBoundingClientRect: function getRootBoundingClientRect() {
|
4104 | return _this.root_.getBoundingClientRect();
|
4105 | },
|
4106 | hasClass: function hasClass(className) {
|
4107 | return _this.root_.classList.contains(className);
|
4108 | },
|
4109 | hasLeadingIcon: function hasLeadingIcon() {
|
4110 | return !!_this.leadingIcon_;
|
4111 | },
|
4112 | notifyInteraction: function notifyInteraction() {
|
4113 | return _this.emit(constants_1.strings.INTERACTION_EVENT, {
|
4114 | chipId: _this.id
|
4115 | }, true);
|
4116 | },
|
4117 | notifyRemoval: function notifyRemoval() {
|
4118 | return _this.emit(constants_1.strings.REMOVAL_EVENT, {
|
4119 | chipId: _this.id,
|
4120 | root: _this.root_
|
4121 | }, true);
|
4122 | },
|
4123 | notifySelection: function notifySelection(selected) {
|
4124 | return _this.emit(constants_1.strings.SELECTION_EVENT, {
|
4125 | chipId: _this.id,
|
4126 | selected: selected
|
4127 | }, true);
|
4128 | },
|
4129 | notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {
|
4130 | return _this.emit(constants_1.strings.TRAILING_ICON_INTERACTION_EVENT, {
|
4131 | chipId: _this.id
|
4132 | }, true);
|
4133 | },
|
4134 | removeClass: function removeClass(className) {
|
4135 | return _this.root_.classList.remove(className);
|
4136 | },
|
4137 | removeClassFromLeadingIcon: function removeClassFromLeadingIcon(className) {
|
4138 | if (_this.leadingIcon_) {
|
4139 | _this.leadingIcon_.classList.remove(className);
|
4140 | }
|
4141 | },
|
4142 | setStyleProperty: function setStyleProperty(propertyName, value) {
|
4143 | return _this.root_.style.setProperty(propertyName, value);
|
4144 | }
|
4145 | };
|
4146 | return new foundation_2.MDCChipFoundation(adapter);
|
4147 | };
|
4148 | return MDCChip;
|
4149 | }(component_1.MDCComponent);
|
4150 | exports.MDCChip = MDCChip;
|
4151 | }, function(module, exports, __webpack_require__) {
|
4152 | "use strict";
|
4153 | Object.defineProperty(exports, "__esModule", {
|
4154 | value: true
|
4155 | });
|
4156 | exports.strings = {
|
4157 | CHECKMARK_SELECTOR: ".mdc-chip__checkmark",
|
4158 | ENTRY_ANIMATION_NAME: "mdc-chip-entry",
|
4159 | INTERACTION_EVENT: "MDCChip:interaction",
|
4160 | LEADING_ICON_SELECTOR: ".mdc-chip__icon--leading",
|
4161 | REMOVAL_EVENT: "MDCChip:removal",
|
4162 | SELECTION_EVENT: "MDCChip:selection",
|
4163 | TRAILING_ICON_INTERACTION_EVENT: "MDCChip:trailingIconInteraction",
|
4164 | TRAILING_ICON_SELECTOR: ".mdc-chip__icon--trailing"
|
4165 | };
|
4166 | exports.cssClasses = {
|
4167 | CHECKMARK: "mdc-chip__checkmark",
|
4168 | CHIP_EXIT: "mdc-chip--exit",
|
4169 | HIDDEN_LEADING_ICON: "mdc-chip__icon--leading-hidden",
|
4170 | LEADING_ICON: "mdc-chip__icon--leading",
|
4171 | SELECTED: "mdc-chip--selected",
|
4172 | TRAILING_ICON: "mdc-chip__icon--trailing"
|
4173 | };
|
4174 | }, function(module, exports, __webpack_require__) {
|
4175 | "use strict";
|
4176 | var __extends = this && this.__extends || function() {
|
4177 | var _extendStatics = function extendStatics(d, b) {
|
4178 | _extendStatics = Object.setPrototypeOf || {
|
4179 | __proto__: []
|
4180 | } instanceof Array && function(d, b) {
|
4181 | d.__proto__ = b;
|
4182 | } || function(d, b) {
|
4183 | for (var p in b) {
|
4184 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
4185 | }
|
4186 | };
|
4187 | return _extendStatics(d, b);
|
4188 | };
|
4189 | return function(d, b) {
|
4190 | _extendStatics(d, b);
|
4191 | function __() {
|
4192 | this.constructor = d;
|
4193 | }
|
4194 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
4195 | };
|
4196 | }();
|
4197 | var __assign = this && this.__assign || function() {
|
4198 | __assign = Object.assign || function(t) {
|
4199 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4200 | s = arguments[i];
|
4201 | for (var p in s) {
|
4202 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
4203 | }
|
4204 | }
|
4205 | return t;
|
4206 | };
|
4207 | return __assign.apply(this, arguments);
|
4208 | };
|
4209 | Object.defineProperty(exports, "__esModule", {
|
4210 | value: true
|
4211 | });
|
4212 | var foundation_1 = __webpack_require__(0);
|
4213 | var constants_1 = __webpack_require__(89);
|
4214 | var MDCChipSetFoundation = function(_super) {
|
4215 | __extends(MDCChipSetFoundation, _super);
|
4216 | function MDCChipSetFoundation(adapter) {
|
4217 | var _this = _super.call(this, __assign({}, MDCChipSetFoundation.defaultAdapter, adapter)) || this;
|
4218 | _this.selectedChipIds_ = [];
|
4219 | return _this;
|
4220 | }
|
4221 | Object.defineProperty(MDCChipSetFoundation, "strings", {
|
4222 | get: function get() {
|
4223 | return constants_1.strings;
|
4224 | },
|
4225 | enumerable: true,
|
4226 | configurable: true
|
4227 | });
|
4228 | Object.defineProperty(MDCChipSetFoundation, "cssClasses", {
|
4229 | get: function get() {
|
4230 | return constants_1.cssClasses;
|
4231 | },
|
4232 | enumerable: true,
|
4233 | configurable: true
|
4234 | });
|
4235 | Object.defineProperty(MDCChipSetFoundation, "defaultAdapter", {
|
4236 | get: function get() {
|
4237 | return {
|
4238 | hasClass: function hasClass() {
|
4239 | return false;
|
4240 | },
|
4241 | removeChip: function removeChip() {
|
4242 | return undefined;
|
4243 | },
|
4244 | setSelected: function setSelected() {
|
4245 | return undefined;
|
4246 | }
|
4247 | };
|
4248 | },
|
4249 | enumerable: true,
|
4250 | configurable: true
|
4251 | });
|
4252 | MDCChipSetFoundation.prototype.getSelectedChipIds = function() {
|
4253 | return this.selectedChipIds_.slice();
|
4254 | };
|
4255 | MDCChipSetFoundation.prototype.select = function(chipId) {
|
4256 | if (this.selectedChipIds_.indexOf(chipId) >= 0) {
|
4257 | return;
|
4258 | }
|
4259 | if (this.adapter_.hasClass(constants_1.cssClasses.CHOICE) && this.selectedChipIds_.length > 0) {
|
4260 | var previouslySelectedChip = this.selectedChipIds_[0];
|
4261 | this.selectedChipIds_.length = 0;
|
4262 | this.adapter_.setSelected(previouslySelectedChip, false);
|
4263 | }
|
4264 | this.selectedChipIds_.push(chipId);
|
4265 | this.adapter_.setSelected(chipId, true);
|
4266 | };
|
4267 | MDCChipSetFoundation.prototype.handleChipInteraction = function(chipId) {
|
4268 | if (this.adapter_.hasClass(constants_1.cssClasses.CHOICE) || this.adapter_.hasClass(constants_1.cssClasses.FILTER)) {
|
4269 | this.toggleSelect_(chipId);
|
4270 | }
|
4271 | };
|
4272 | MDCChipSetFoundation.prototype.handleChipSelection = function(chipId, selected) {
|
4273 | var chipIsSelected = this.selectedChipIds_.indexOf(chipId) >= 0;
|
4274 | if (selected && !chipIsSelected) {
|
4275 | this.select(chipId);
|
4276 | } else if (!selected && chipIsSelected) {
|
4277 | this.deselect_(chipId);
|
4278 | }
|
4279 | };
|
4280 | MDCChipSetFoundation.prototype.handleChipRemoval = function(chipId) {
|
4281 | this.deselect_(chipId);
|
4282 | this.adapter_.removeChip(chipId);
|
4283 | };
|
4284 | MDCChipSetFoundation.prototype.deselect_ = function(chipId) {
|
4285 | var index = this.selectedChipIds_.indexOf(chipId);
|
4286 | if (index >= 0) {
|
4287 | this.selectedChipIds_.splice(index, 1);
|
4288 | this.adapter_.setSelected(chipId, false);
|
4289 | }
|
4290 | };
|
4291 | MDCChipSetFoundation.prototype.toggleSelect_ = function(chipId) {
|
4292 | if (this.selectedChipIds_.indexOf(chipId) >= 0) {
|
4293 | this.deselect_(chipId);
|
4294 | } else {
|
4295 | this.select(chipId);
|
4296 | }
|
4297 | };
|
4298 | return MDCChipSetFoundation;
|
4299 | }(foundation_1.MDCFoundation);
|
4300 | exports.MDCChipSetFoundation = MDCChipSetFoundation;
|
4301 | exports.default = MDCChipSetFoundation;
|
4302 | }, function(module, exports, __webpack_require__) {
|
4303 | "use strict";
|
4304 | var __importDefault = this && this.__importDefault || function(mod) {
|
4305 | return mod && mod.__esModule ? mod : {
|
4306 | default: mod
|
4307 | };
|
4308 | };
|
4309 | Object.defineProperty(exports, "__esModule", {
|
4310 | value: true
|
4311 | });
|
4312 | var focus_trap_1 = __importDefault(__webpack_require__(91));
|
4313 | function createFocusTrapInstance(surfaceEl, focusTrapFactory, initialFocusEl) {
|
4314 | if (focusTrapFactory === void 0) {
|
4315 | focusTrapFactory = focus_trap_1.default;
|
4316 | }
|
4317 | return focusTrapFactory(surfaceEl, {
|
4318 | clickOutsideDeactivates: true,
|
4319 | escapeDeactivates: false,
|
4320 | initialFocus: initialFocusEl
|
4321 | });
|
4322 | }
|
4323 | exports.createFocusTrapInstance = createFocusTrapInstance;
|
4324 | function isScrollable(el) {
|
4325 | return el ? el.scrollHeight > el.offsetHeight : false;
|
4326 | }
|
4327 | exports.isScrollable = isScrollable;
|
4328 | function areTopsMisaligned(els) {
|
4329 | var tops = new Set();
|
4330 | [].forEach.call(els, function(el) {
|
4331 | return tops.add(el.offsetTop);
|
4332 | });
|
4333 | return tops.size > 1;
|
4334 | }
|
4335 | exports.areTopsMisaligned = areTopsMisaligned;
|
4336 | }, function(module, exports, __webpack_require__) {
|
4337 | "use strict";
|
4338 | var __extends = this && this.__extends || function() {
|
4339 | var _extendStatics = function extendStatics(d, b) {
|
4340 | _extendStatics = Object.setPrototypeOf || {
|
4341 | __proto__: []
|
4342 | } instanceof Array && function(d, b) {
|
4343 | d.__proto__ = b;
|
4344 | } || function(d, b) {
|
4345 | for (var p in b) {
|
4346 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
4347 | }
|
4348 | };
|
4349 | return _extendStatics(d, b);
|
4350 | };
|
4351 | return function(d, b) {
|
4352 | _extendStatics(d, b);
|
4353 | function __() {
|
4354 | this.constructor = d;
|
4355 | }
|
4356 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
4357 | };
|
4358 | }();
|
4359 | var __assign = this && this.__assign || function() {
|
4360 | __assign = Object.assign || function(t) {
|
4361 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4362 | s = arguments[i];
|
4363 | for (var p in s) {
|
4364 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
4365 | }
|
4366 | }
|
4367 | return t;
|
4368 | };
|
4369 | return __assign.apply(this, arguments);
|
4370 | };
|
4371 | Object.defineProperty(exports, "__esModule", {
|
4372 | value: true
|
4373 | });
|
4374 | var foundation_1 = __webpack_require__(0);
|
4375 | var constants_1 = __webpack_require__(95);
|
4376 | var MDCDialogFoundation = function(_super) {
|
4377 | __extends(MDCDialogFoundation, _super);
|
4378 | function MDCDialogFoundation(adapter) {
|
4379 | var _this = _super.call(this, __assign({}, MDCDialogFoundation.defaultAdapter, adapter)) || this;
|
4380 | _this.isOpen_ = false;
|
4381 | _this.animationFrame_ = 0;
|
4382 | _this.animationTimer_ = 0;
|
4383 | _this.layoutFrame_ = 0;
|
4384 | _this.escapeKeyAction_ = constants_1.strings.CLOSE_ACTION;
|
4385 | _this.scrimClickAction_ = constants_1.strings.CLOSE_ACTION;
|
4386 | _this.autoStackButtons_ = true;
|
4387 | _this.areButtonsStacked_ = false;
|
4388 | return _this;
|
4389 | }
|
4390 | Object.defineProperty(MDCDialogFoundation, "cssClasses", {
|
4391 | get: function get() {
|
4392 | return constants_1.cssClasses;
|
4393 | },
|
4394 | enumerable: true,
|
4395 | configurable: true
|
4396 | });
|
4397 | Object.defineProperty(MDCDialogFoundation, "strings", {
|
4398 | get: function get() {
|
4399 | return constants_1.strings;
|
4400 | },
|
4401 | enumerable: true,
|
4402 | configurable: true
|
4403 | });
|
4404 | Object.defineProperty(MDCDialogFoundation, "numbers", {
|
4405 | get: function get() {
|
4406 | return constants_1.numbers;
|
4407 | },
|
4408 | enumerable: true,
|
4409 | configurable: true
|
4410 | });
|
4411 | Object.defineProperty(MDCDialogFoundation, "defaultAdapter", {
|
4412 | get: function get() {
|
4413 | return {
|
4414 | addBodyClass: function addBodyClass() {
|
4415 | return undefined;
|
4416 | },
|
4417 | addClass: function addClass() {
|
4418 | return undefined;
|
4419 | },
|
4420 | areButtonsStacked: function areButtonsStacked() {
|
4421 | return false;
|
4422 | },
|
4423 | clickDefaultButton: function clickDefaultButton() {
|
4424 | return undefined;
|
4425 | },
|
4426 | eventTargetMatches: function eventTargetMatches() {
|
4427 | return false;
|
4428 | },
|
4429 | getActionFromEvent: function getActionFromEvent() {
|
4430 | return "";
|
4431 | },
|
4432 | hasClass: function hasClass() {
|
4433 | return false;
|
4434 | },
|
4435 | isContentScrollable: function isContentScrollable() {
|
4436 | return false;
|
4437 | },
|
4438 | notifyClosed: function notifyClosed() {
|
4439 | return undefined;
|
4440 | },
|
4441 | notifyClosing: function notifyClosing() {
|
4442 | return undefined;
|
4443 | },
|
4444 | notifyOpened: function notifyOpened() {
|
4445 | return undefined;
|
4446 | },
|
4447 | notifyOpening: function notifyOpening() {
|
4448 | return undefined;
|
4449 | },
|
4450 | releaseFocus: function releaseFocus() {
|
4451 | return undefined;
|
4452 | },
|
4453 | removeBodyClass: function removeBodyClass() {
|
4454 | return undefined;
|
4455 | },
|
4456 | removeClass: function removeClass() {
|
4457 | return undefined;
|
4458 | },
|
4459 | reverseButtons: function reverseButtons() {
|
4460 | return undefined;
|
4461 | },
|
4462 | trapFocus: function trapFocus() {
|
4463 | return undefined;
|
4464 | }
|
4465 | };
|
4466 | },
|
4467 | enumerable: true,
|
4468 | configurable: true
|
4469 | });
|
4470 | MDCDialogFoundation.prototype.init = function() {
|
4471 | if (this.adapter_.hasClass(constants_1.cssClasses.STACKED)) {
|
4472 | this.setAutoStackButtons(false);
|
4473 | }
|
4474 | };
|
4475 | MDCDialogFoundation.prototype.destroy = function() {
|
4476 | if (this.isOpen_) {
|
4477 | this.close(constants_1.strings.DESTROY_ACTION);
|
4478 | }
|
4479 | if (this.animationTimer_) {
|
4480 | clearTimeout(this.animationTimer_);
|
4481 | this.handleAnimationTimerEnd_();
|
4482 | }
|
4483 | if (this.layoutFrame_) {
|
4484 | cancelAnimationFrame(this.layoutFrame_);
|
4485 | this.layoutFrame_ = 0;
|
4486 | }
|
4487 | };
|
4488 | MDCDialogFoundation.prototype.open = function() {
|
4489 | var _this = this;
|
4490 | this.isOpen_ = true;
|
4491 | this.adapter_.notifyOpening();
|
4492 | this.adapter_.addClass(constants_1.cssClasses.OPENING);
|
4493 | this.runNextAnimationFrame_(function() {
|
4494 | _this.adapter_.addClass(constants_1.cssClasses.OPEN);
|
4495 | _this.adapter_.addBodyClass(constants_1.cssClasses.SCROLL_LOCK);
|
4496 | _this.layout();
|
4497 | _this.animationTimer_ = setTimeout(function() {
|
4498 | _this.handleAnimationTimerEnd_();
|
4499 | _this.adapter_.trapFocus();
|
4500 | _this.adapter_.notifyOpened();
|
4501 | }, constants_1.numbers.DIALOG_ANIMATION_OPEN_TIME_MS);
|
4502 | });
|
4503 | };
|
4504 | MDCDialogFoundation.prototype.close = function(action) {
|
4505 | var _this = this;
|
4506 | if (action === void 0) {
|
4507 | action = "";
|
4508 | }
|
4509 | if (!this.isOpen_) {
|
4510 | return;
|
4511 | }
|
4512 | this.isOpen_ = false;
|
4513 | this.adapter_.notifyClosing(action);
|
4514 | this.adapter_.addClass(constants_1.cssClasses.CLOSING);
|
4515 | this.adapter_.removeClass(constants_1.cssClasses.OPEN);
|
4516 | this.adapter_.removeBodyClass(constants_1.cssClasses.SCROLL_LOCK);
|
4517 | cancelAnimationFrame(this.animationFrame_);
|
4518 | this.animationFrame_ = 0;
|
4519 | clearTimeout(this.animationTimer_);
|
4520 | this.animationTimer_ = setTimeout(function() {
|
4521 | _this.adapter_.releaseFocus();
|
4522 | _this.handleAnimationTimerEnd_();
|
4523 | _this.adapter_.notifyClosed(action);
|
4524 | }, constants_1.numbers.DIALOG_ANIMATION_CLOSE_TIME_MS);
|
4525 | };
|
4526 | MDCDialogFoundation.prototype.isOpen = function() {
|
4527 | return this.isOpen_;
|
4528 | };
|
4529 | MDCDialogFoundation.prototype.getEscapeKeyAction = function() {
|
4530 | return this.escapeKeyAction_;
|
4531 | };
|
4532 | MDCDialogFoundation.prototype.setEscapeKeyAction = function(action) {
|
4533 | this.escapeKeyAction_ = action;
|
4534 | };
|
4535 | MDCDialogFoundation.prototype.getScrimClickAction = function() {
|
4536 | return this.scrimClickAction_;
|
4537 | };
|
4538 | MDCDialogFoundation.prototype.setScrimClickAction = function(action) {
|
4539 | this.scrimClickAction_ = action;
|
4540 | };
|
4541 | MDCDialogFoundation.prototype.getAutoStackButtons = function() {
|
4542 | return this.autoStackButtons_;
|
4543 | };
|
4544 | MDCDialogFoundation.prototype.setAutoStackButtons = function(autoStack) {
|
4545 | this.autoStackButtons_ = autoStack;
|
4546 | };
|
4547 | MDCDialogFoundation.prototype.layout = function() {
|
4548 | var _this = this;
|
4549 | if (this.layoutFrame_) {
|
4550 | cancelAnimationFrame(this.layoutFrame_);
|
4551 | }
|
4552 | this.layoutFrame_ = requestAnimationFrame(function() {
|
4553 | _this.layoutInternal_();
|
4554 | _this.layoutFrame_ = 0;
|
4555 | });
|
4556 | };
|
4557 | MDCDialogFoundation.prototype.handleInteraction = function(evt) {
|
4558 | var isClick = evt.type === "click";
|
4559 | var isEnter = evt.key === "Enter" || evt.keyCode === 13;
|
4560 | var isSpace = evt.key === "Space" || evt.keyCode === 32;
|
4561 | var isScrim = this.adapter_.eventTargetMatches(evt.target, constants_1.strings.SCRIM_SELECTOR);
|
4562 | var isDefault = !this.adapter_.eventTargetMatches(evt.target, constants_1.strings.SUPPRESS_DEFAULT_PRESS_SELECTOR);
|
4563 | if (isClick && isScrim && this.scrimClickAction_ !== "") {
|
4564 | this.close(this.scrimClickAction_);
|
4565 | } else if (isClick || isSpace || isEnter) {
|
4566 | var action = this.adapter_.getActionFromEvent(evt);
|
4567 | if (action) {
|
4568 | this.close(action);
|
4569 | } else if (isEnter && isDefault) {
|
4570 | this.adapter_.clickDefaultButton();
|
4571 | }
|
4572 | }
|
4573 | };
|
4574 | MDCDialogFoundation.prototype.handleDocumentKeydown = function(evt) {
|
4575 | var isEscape = evt.key === "Escape" || evt.keyCode === 27;
|
4576 | if (isEscape && this.escapeKeyAction_ !== "") {
|
4577 | this.close(this.escapeKeyAction_);
|
4578 | }
|
4579 | };
|
4580 | MDCDialogFoundation.prototype.layoutInternal_ = function() {
|
4581 | if (this.autoStackButtons_) {
|
4582 | this.detectStackedButtons_();
|
4583 | }
|
4584 | this.detectScrollableContent_();
|
4585 | };
|
4586 | MDCDialogFoundation.prototype.handleAnimationTimerEnd_ = function() {
|
4587 | this.animationTimer_ = 0;
|
4588 | this.adapter_.removeClass(constants_1.cssClasses.OPENING);
|
4589 | this.adapter_.removeClass(constants_1.cssClasses.CLOSING);
|
4590 | };
|
4591 | MDCDialogFoundation.prototype.runNextAnimationFrame_ = function(callback) {
|
4592 | var _this = this;
|
4593 | cancelAnimationFrame(this.animationFrame_);
|
4594 | this.animationFrame_ = requestAnimationFrame(function() {
|
4595 | _this.animationFrame_ = 0;
|
4596 | clearTimeout(_this.animationTimer_);
|
4597 | _this.animationTimer_ = setTimeout(callback, 0);
|
4598 | });
|
4599 | };
|
4600 | MDCDialogFoundation.prototype.detectStackedButtons_ = function() {
|
4601 | this.adapter_.removeClass(constants_1.cssClasses.STACKED);
|
4602 | var areButtonsStacked = this.adapter_.areButtonsStacked();
|
4603 | if (areButtonsStacked) {
|
4604 | this.adapter_.addClass(constants_1.cssClasses.STACKED);
|
4605 | }
|
4606 | if (areButtonsStacked !== this.areButtonsStacked_) {
|
4607 | this.adapter_.reverseButtons();
|
4608 | this.areButtonsStacked_ = areButtonsStacked;
|
4609 | }
|
4610 | };
|
4611 | MDCDialogFoundation.prototype.detectScrollableContent_ = function() {
|
4612 | this.adapter_.removeClass(constants_1.cssClasses.SCROLLABLE);
|
4613 | if (this.adapter_.isContentScrollable()) {
|
4614 | this.adapter_.addClass(constants_1.cssClasses.SCROLLABLE);
|
4615 | }
|
4616 | };
|
4617 | return MDCDialogFoundation;
|
4618 | }(foundation_1.MDCFoundation);
|
4619 | exports.MDCDialogFoundation = MDCDialogFoundation;
|
4620 | exports.default = MDCDialogFoundation;
|
4621 | }, function(module, exports, __webpack_require__) {
|
4622 | "use strict";
|
4623 | var __importDefault = this && this.__importDefault || function(mod) {
|
4624 | return mod && mod.__esModule ? mod : {
|
4625 | default: mod
|
4626 | };
|
4627 | };
|
4628 | Object.defineProperty(exports, "__esModule", {
|
4629 | value: true
|
4630 | });
|
4631 | var focus_trap_1 = __importDefault(__webpack_require__(34));
|
4632 | function createFocusTrapInstance(surfaceEl, focusTrapFactory) {
|
4633 | if (focusTrapFactory === void 0) {
|
4634 | focusTrapFactory = focus_trap_1.default;
|
4635 | }
|
4636 | return focusTrapFactory(surfaceEl, {
|
4637 | clickOutsideDeactivates: true,
|
4638 | escapeDeactivates: false,
|
4639 | initialFocus: undefined,
|
4640 | returnFocusOnDeactivate: false
|
4641 | });
|
4642 | }
|
4643 | exports.createFocusTrapInstance = createFocusTrapInstance;
|
4644 | }, function(module, exports, __webpack_require__) {
|
4645 | var tabbable = __webpack_require__(98);
|
4646 | var xtend = __webpack_require__(99);
|
4647 | var activeFocusTraps = function() {
|
4648 | var trapQueue = [];
|
4649 | return {
|
4650 | activateTrap: function(trap) {
|
4651 | if (trapQueue.length > 0) {
|
4652 | var activeTrap = trapQueue[trapQueue.length - 1];
|
4653 | if (activeTrap !== trap) {
|
4654 | activeTrap.pause();
|
4655 | }
|
4656 | }
|
4657 | var trapIndex = trapQueue.indexOf(trap);
|
4658 | if (trapIndex === -1) {
|
4659 | trapQueue.push(trap);
|
4660 | } else {
|
4661 | trapQueue.splice(trapIndex, 1);
|
4662 | trapQueue.push(trap);
|
4663 | }
|
4664 | },
|
4665 | deactivateTrap: function(trap) {
|
4666 | var trapIndex = trapQueue.indexOf(trap);
|
4667 | if (trapIndex !== -1) {
|
4668 | trapQueue.splice(trapIndex, 1);
|
4669 | }
|
4670 | if (trapQueue.length > 0) {
|
4671 | trapQueue[trapQueue.length - 1].unpause();
|
4672 | }
|
4673 | }
|
4674 | };
|
4675 | }();
|
4676 | function focusTrap(element, userOptions) {
|
4677 | var doc = document;
|
4678 | var container = typeof element === "string" ? doc.querySelector(element) : element;
|
4679 | var config = xtend({
|
4680 | returnFocusOnDeactivate: true,
|
4681 | escapeDeactivates: true
|
4682 | }, userOptions);
|
4683 | var state = {
|
4684 | firstTabbableNode: null,
|
4685 | lastTabbableNode: null,
|
4686 | nodeFocusedBeforeActivation: null,
|
4687 | mostRecentlyFocusedNode: null,
|
4688 | active: false,
|
4689 | paused: false
|
4690 | };
|
4691 | var trap = {
|
4692 | activate: activate,
|
4693 | deactivate: deactivate,
|
4694 | pause: pause,
|
4695 | unpause: unpause
|
4696 | };
|
4697 | return trap;
|
4698 | function activate(activateOptions) {
|
4699 | if (state.active) return;
|
4700 | updateTabbableNodes();
|
4701 | state.active = true;
|
4702 | state.paused = false;
|
4703 | state.nodeFocusedBeforeActivation = doc.activeElement;
|
4704 | var onActivate = activateOptions && activateOptions.onActivate ? activateOptions.onActivate : config.onActivate;
|
4705 | if (onActivate) {
|
4706 | onActivate();
|
4707 | }
|
4708 | addListeners();
|
4709 | return trap;
|
4710 | }
|
4711 | function deactivate(deactivateOptions) {
|
4712 | if (!state.active) return;
|
4713 | removeListeners();
|
4714 | state.active = false;
|
4715 | state.paused = false;
|
4716 | activeFocusTraps.deactivateTrap(trap);
|
4717 | var onDeactivate = deactivateOptions && deactivateOptions.onDeactivate !== undefined ? deactivateOptions.onDeactivate : config.onDeactivate;
|
4718 | if (onDeactivate) {
|
4719 | onDeactivate();
|
4720 | }
|
4721 | var returnFocus = deactivateOptions && deactivateOptions.returnFocus !== undefined ? deactivateOptions.returnFocus : config.returnFocusOnDeactivate;
|
4722 | if (returnFocus) {
|
4723 | delay(function() {
|
4724 | tryFocus(state.nodeFocusedBeforeActivation);
|
4725 | });
|
4726 | }
|
4727 | return trap;
|
4728 | }
|
4729 | function pause() {
|
4730 | if (state.paused || !state.active) return;
|
4731 | state.paused = true;
|
4732 | removeListeners();
|
4733 | }
|
4734 | function unpause() {
|
4735 | if (!state.paused || !state.active) return;
|
4736 | state.paused = false;
|
4737 | updateTabbableNodes();
|
4738 | addListeners();
|
4739 | }
|
4740 | function addListeners() {
|
4741 | if (!state.active) return;
|
4742 | activeFocusTraps.activateTrap(trap);
|
4743 | delay(function() {
|
4744 | tryFocus(getInitialFocusNode());
|
4745 | });
|
4746 | doc.addEventListener("focusin", checkFocusIn, true);
|
4747 | doc.addEventListener("mousedown", checkPointerDown, {
|
4748 | capture: true,
|
4749 | passive: false
|
4750 | });
|
4751 | doc.addEventListener("touchstart", checkPointerDown, {
|
4752 | capture: true,
|
4753 | passive: false
|
4754 | });
|
4755 | doc.addEventListener("click", checkClick, {
|
4756 | capture: true,
|
4757 | passive: false
|
4758 | });
|
4759 | doc.addEventListener("keydown", checkKey, {
|
4760 | capture: true,
|
4761 | passive: false
|
4762 | });
|
4763 | return trap;
|
4764 | }
|
4765 | function removeListeners() {
|
4766 | if (!state.active) return;
|
4767 | doc.removeEventListener("focusin", checkFocusIn, true);
|
4768 | doc.removeEventListener("mousedown", checkPointerDown, true);
|
4769 | doc.removeEventListener("touchstart", checkPointerDown, true);
|
4770 | doc.removeEventListener("click", checkClick, true);
|
4771 | doc.removeEventListener("keydown", checkKey, true);
|
4772 | return trap;
|
4773 | }
|
4774 | function getNodeForOption(optionName) {
|
4775 | var optionValue = config[optionName];
|
4776 | var node = optionValue;
|
4777 | if (!optionValue) {
|
4778 | return null;
|
4779 | }
|
4780 | if (typeof optionValue === "string") {
|
4781 | node = doc.querySelector(optionValue);
|
4782 | if (!node) {
|
4783 | throw new Error("`" + optionName + "` refers to no known node");
|
4784 | }
|
4785 | }
|
4786 | if (typeof optionValue === "function") {
|
4787 | node = optionValue();
|
4788 | if (!node) {
|
4789 | throw new Error("`" + optionName + "` did not return a node");
|
4790 | }
|
4791 | }
|
4792 | return node;
|
4793 | }
|
4794 | function getInitialFocusNode() {
|
4795 | var node;
|
4796 | if (getNodeForOption("initialFocus") !== null) {
|
4797 | node = getNodeForOption("initialFocus");
|
4798 | } else if (container.contains(doc.activeElement)) {
|
4799 | node = doc.activeElement;
|
4800 | } else {
|
4801 | node = state.firstTabbableNode || getNodeForOption("fallbackFocus");
|
4802 | }
|
4803 | if (!node) {
|
4804 | throw new Error("You can't have a focus-trap without at least one focusable element");
|
4805 | }
|
4806 | return node;
|
4807 | }
|
4808 | function checkPointerDown(e) {
|
4809 | if (container.contains(e.target)) return;
|
4810 | if (config.clickOutsideDeactivates) {
|
4811 | deactivate({
|
4812 | returnFocus: !tabbable.isFocusable(e.target)
|
4813 | });
|
4814 | } else {
|
4815 | e.preventDefault();
|
4816 | }
|
4817 | }
|
4818 | function checkFocusIn(e) {
|
4819 | if (container.contains(e.target) || e.target instanceof Document) {
|
4820 | return;
|
4821 | }
|
4822 | e.stopImmediatePropagation();
|
4823 | tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
|
4824 | }
|
4825 | function checkKey(e) {
|
4826 | if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
|
4827 | e.preventDefault();
|
4828 | deactivate();
|
4829 | return;
|
4830 | }
|
4831 | if (isTabEvent(e)) {
|
4832 | checkTab(e);
|
4833 | return;
|
4834 | }
|
4835 | }
|
4836 | function checkTab(e) {
|
4837 | updateTabbableNodes();
|
4838 | if (e.shiftKey && e.target === state.firstTabbableNode) {
|
4839 | e.preventDefault();
|
4840 | tryFocus(state.lastTabbableNode);
|
4841 | return;
|
4842 | }
|
4843 | if (!e.shiftKey && e.target === state.lastTabbableNode) {
|
4844 | e.preventDefault();
|
4845 | tryFocus(state.firstTabbableNode);
|
4846 | return;
|
4847 | }
|
4848 | }
|
4849 | function checkClick(e) {
|
4850 | if (config.clickOutsideDeactivates) return;
|
4851 | if (container.contains(e.target)) return;
|
4852 | e.preventDefault();
|
4853 | e.stopImmediatePropagation();
|
4854 | }
|
4855 | function updateTabbableNodes() {
|
4856 | var tabbableNodes = tabbable(container);
|
4857 | state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode();
|
4858 | state.lastTabbableNode = tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode();
|
4859 | }
|
4860 | function tryFocus(node) {
|
4861 | if (node === doc.activeElement) return;
|
4862 | if (!node || !node.focus) {
|
4863 | tryFocus(getInitialFocusNode());
|
4864 | return;
|
4865 | }
|
4866 | node.focus();
|
4867 | state.mostRecentlyFocusedNode = node;
|
4868 | if (isSelectableInput(node)) {
|
4869 | node.select();
|
4870 | }
|
4871 | }
|
4872 | }
|
4873 | function isSelectableInput(node) {
|
4874 | return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function";
|
4875 | }
|
4876 | function isEscapeEvent(e) {
|
4877 | return e.key === "Escape" || e.key === "Esc" || e.keyCode === 27;
|
4878 | }
|
4879 | function isTabEvent(e) {
|
4880 | return e.key === "Tab" || e.keyCode === 9;
|
4881 | }
|
4882 | function delay(fn) {
|
4883 | return setTimeout(fn, 0);
|
4884 | }
|
4885 | module.exports = focusTrap;
|
4886 | }, function(module, exports, __webpack_require__) {
|
4887 | "use strict";
|
4888 | Object.defineProperty(exports, "__esModule", {
|
4889 | value: true
|
4890 | });
|
4891 | var cssClasses = {
|
4892 | LIST_ITEM_ACTIVATED_CLASS: "mdc-list-item--activated",
|
4893 | LIST_ITEM_CLASS: "mdc-list-item",
|
4894 | LIST_ITEM_DISABLED_CLASS: "mdc-list-item--disabled",
|
4895 | LIST_ITEM_SELECTED_CLASS: "mdc-list-item--selected",
|
4896 | ROOT: "mdc-list"
|
4897 | };
|
4898 | exports.cssClasses = cssClasses;
|
4899 | var strings = {
|
4900 | ACTION_EVENT: "MDCList:action",
|
4901 | ARIA_CHECKED: "aria-checked",
|
4902 | ARIA_CHECKED_CHECKBOX_SELECTOR: '[role="checkbox"][aria-checked="true"]',
|
4903 | ARIA_CHECKED_RADIO_SELECTOR: '[role="radio"][aria-checked="true"]',
|
4904 | ARIA_CURRENT: "aria-current",
|
4905 | ARIA_ORIENTATION: "aria-orientation",
|
4906 | ARIA_ORIENTATION_HORIZONTAL: "horizontal",
|
4907 | ARIA_ROLE_CHECKBOX_SELECTOR: '[role="checkbox"]',
|
4908 | ARIA_SELECTED: "aria-selected",
|
4909 | CHECKBOX_RADIO_SELECTOR: 'input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled)',
|
4910 | CHECKBOX_SELECTOR: 'input[type="checkbox"]:not(:disabled)',
|
4911 | CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: "\n ." + cssClasses.LIST_ITEM_CLASS + " button:not(:disabled),\n ." + cssClasses.LIST_ITEM_CLASS + " a\n ",
|
4912 | FOCUSABLE_CHILD_ELEMENTS: "\n ." + cssClasses.LIST_ITEM_CLASS + " button:not(:disabled),\n ." + cssClasses.LIST_ITEM_CLASS + " a,\n ." + cssClasses.LIST_ITEM_CLASS + ' input[type="radio"]:not(:disabled),\n .' + cssClasses.LIST_ITEM_CLASS + ' input[type="checkbox"]:not(:disabled)\n ',
|
4913 | RADIO_SELECTOR: 'input[type="radio"]:not(:disabled)'
|
4914 | };
|
4915 | exports.strings = strings;
|
4916 | var numbers = {
|
4917 | UNSET_INDEX: -1
|
4918 | };
|
4919 | exports.numbers = numbers;
|
4920 | }, function(module, exports, __webpack_require__) {
|
4921 | "use strict";
|
4922 | var __extends = this && this.__extends || function() {
|
4923 | var _extendStatics = function extendStatics(d, b) {
|
4924 | _extendStatics = Object.setPrototypeOf || {
|
4925 | __proto__: []
|
4926 | } instanceof Array && function(d, b) {
|
4927 | d.__proto__ = b;
|
4928 | } || function(d, b) {
|
4929 | for (var p in b) {
|
4930 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
4931 | }
|
4932 | };
|
4933 | return _extendStatics(d, b);
|
4934 | };
|
4935 | return function(d, b) {
|
4936 | _extendStatics(d, b);
|
4937 | function __() {
|
4938 | this.constructor = d;
|
4939 | }
|
4940 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
4941 | };
|
4942 | }();
|
4943 | Object.defineProperty(exports, "__esModule", {
|
4944 | value: true
|
4945 | });
|
4946 | var foundation_1 = __webpack_require__(14);
|
4947 | var MDCModalDrawerFoundation = function(_super) {
|
4948 | __extends(MDCModalDrawerFoundation, _super);
|
4949 | function MDCModalDrawerFoundation() {
|
4950 | return _super !== null && _super.apply(this, arguments) || this;
|
4951 | }
|
4952 | MDCModalDrawerFoundation.prototype.handleScrimClick = function() {
|
4953 | this.close();
|
4954 | };
|
4955 | MDCModalDrawerFoundation.prototype.opened_ = function() {
|
4956 | this.adapter_.trapFocus();
|
4957 | };
|
4958 | MDCModalDrawerFoundation.prototype.closed_ = function() {
|
4959 | this.adapter_.releaseFocus();
|
4960 | };
|
4961 | return MDCModalDrawerFoundation;
|
4962 | }(foundation_1.MDCDismissibleDrawerFoundation);
|
4963 | exports.MDCModalDrawerFoundation = MDCModalDrawerFoundation;
|
4964 | exports.default = MDCModalDrawerFoundation;
|
4965 | }, function(module, exports, __webpack_require__) {
|
4966 | "use strict";
|
4967 | var __extends = this && this.__extends || function() {
|
4968 | var _extendStatics = function extendStatics(d, b) {
|
4969 | _extendStatics = Object.setPrototypeOf || {
|
4970 | __proto__: []
|
4971 | } instanceof Array && function(d, b) {
|
4972 | d.__proto__ = b;
|
4973 | } || function(d, b) {
|
4974 | for (var p in b) {
|
4975 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
4976 | }
|
4977 | };
|
4978 | return _extendStatics(d, b);
|
4979 | };
|
4980 | return function(d, b) {
|
4981 | _extendStatics(d, b);
|
4982 | function __() {
|
4983 | this.constructor = d;
|
4984 | }
|
4985 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
4986 | };
|
4987 | }();
|
4988 | var __assign = this && this.__assign || function() {
|
4989 | __assign = Object.assign || function(t) {
|
4990 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4991 | s = arguments[i];
|
4992 | for (var p in s) {
|
4993 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
4994 | }
|
4995 | }
|
4996 | return t;
|
4997 | };
|
4998 | return __assign.apply(this, arguments);
|
4999 | };
|
5000 | Object.defineProperty(exports, "__esModule", {
|
5001 | value: true
|
5002 | });
|
5003 | var foundation_1 = __webpack_require__(0);
|
5004 | var constants_1 = __webpack_require__(106);
|
5005 | var MDCFormFieldFoundation = function(_super) {
|
5006 | __extends(MDCFormFieldFoundation, _super);
|
5007 | function MDCFormFieldFoundation(adapter) {
|
5008 | var _this = _super.call(this, __assign({}, MDCFormFieldFoundation.defaultAdapter, adapter)) || this;
|
5009 | _this.clickHandler_ = function() {
|
5010 | return _this.handleClick_();
|
5011 | };
|
5012 | return _this;
|
5013 | }
|
5014 | Object.defineProperty(MDCFormFieldFoundation, "cssClasses", {
|
5015 | get: function get() {
|
5016 | return constants_1.cssClasses;
|
5017 | },
|
5018 | enumerable: true,
|
5019 | configurable: true
|
5020 | });
|
5021 | Object.defineProperty(MDCFormFieldFoundation, "strings", {
|
5022 | get: function get() {
|
5023 | return constants_1.strings;
|
5024 | },
|
5025 | enumerable: true,
|
5026 | configurable: true
|
5027 | });
|
5028 | Object.defineProperty(MDCFormFieldFoundation, "defaultAdapter", {
|
5029 | get: function get() {
|
5030 | return {
|
5031 | activateInputRipple: function activateInputRipple() {
|
5032 | return undefined;
|
5033 | },
|
5034 | deactivateInputRipple: function deactivateInputRipple() {
|
5035 | return undefined;
|
5036 | },
|
5037 | deregisterInteractionHandler: function deregisterInteractionHandler() {
|
5038 | return undefined;
|
5039 | },
|
5040 | registerInteractionHandler: function registerInteractionHandler() {
|
5041 | return undefined;
|
5042 | }
|
5043 | };
|
5044 | },
|
5045 | enumerable: true,
|
5046 | configurable: true
|
5047 | });
|
5048 | MDCFormFieldFoundation.prototype.init = function() {
|
5049 | this.adapter_.registerInteractionHandler("click", this.clickHandler_);
|
5050 | };
|
5051 | MDCFormFieldFoundation.prototype.destroy = function() {
|
5052 | this.adapter_.deregisterInteractionHandler("click", this.clickHandler_);
|
5053 | };
|
5054 | MDCFormFieldFoundation.prototype.handleClick_ = function() {
|
5055 | var _this = this;
|
5056 | this.adapter_.activateInputRipple();
|
5057 | requestAnimationFrame(function() {
|
5058 | return _this.adapter_.deactivateInputRipple();
|
5059 | });
|
5060 | };
|
5061 | return MDCFormFieldFoundation;
|
5062 | }(foundation_1.MDCFoundation);
|
5063 | exports.MDCFormFieldFoundation = MDCFormFieldFoundation;
|
5064 | exports.default = MDCFormFieldFoundation;
|
5065 | }, function(module, exports, __webpack_require__) {
|
5066 | "use strict";
|
5067 | var __extends = this && this.__extends || function() {
|
5068 | var _extendStatics = function extendStatics(d, b) {
|
5069 | _extendStatics = Object.setPrototypeOf || {
|
5070 | __proto__: []
|
5071 | } instanceof Array && function(d, b) {
|
5072 | d.__proto__ = b;
|
5073 | } || function(d, b) {
|
5074 | for (var p in b) {
|
5075 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
5076 | }
|
5077 | };
|
5078 | return _extendStatics(d, b);
|
5079 | };
|
5080 | return function(d, b) {
|
5081 | _extendStatics(d, b);
|
5082 | function __() {
|
5083 | this.constructor = d;
|
5084 | }
|
5085 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
5086 | };
|
5087 | }();
|
5088 | var __assign = this && this.__assign || function() {
|
5089 | __assign = Object.assign || function(t) {
|
5090 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5091 | s = arguments[i];
|
5092 | for (var p in s) {
|
5093 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
5094 | }
|
5095 | }
|
5096 | return t;
|
5097 | };
|
5098 | return __assign.apply(this, arguments);
|
5099 | };
|
5100 | Object.defineProperty(exports, "__esModule", {
|
5101 | value: true
|
5102 | });
|
5103 | var foundation_1 = __webpack_require__(0);
|
5104 | var constants_1 = __webpack_require__(109);
|
5105 | var MDCGridListFoundation = function(_super) {
|
5106 | __extends(MDCGridListFoundation, _super);
|
5107 | function MDCGridListFoundation(adapter) {
|
5108 | var _this = _super.call(this, __assign({}, MDCGridListFoundation.defaultAdapter, adapter)) || this;
|
5109 | _this.resizeFrame_ = 0;
|
5110 | _this.resizeHandler_ = _this.alignCenter.bind(_this);
|
5111 | return _this;
|
5112 | }
|
5113 | Object.defineProperty(MDCGridListFoundation, "strings", {
|
5114 | get: function get() {
|
5115 | return constants_1.strings;
|
5116 | },
|
5117 | enumerable: true,
|
5118 | configurable: true
|
5119 | });
|
5120 | Object.defineProperty(MDCGridListFoundation, "defaultAdapter", {
|
5121 | get: function get() {
|
5122 | return {
|
5123 | deregisterResizeHandler: function deregisterResizeHandler() {
|
5124 | return undefined;
|
5125 | },
|
5126 | getNumberOfTiles: function getNumberOfTiles() {
|
5127 | return 0;
|
5128 | },
|
5129 | getOffsetWidth: function getOffsetWidth() {
|
5130 | return 0;
|
5131 | },
|
5132 | getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex() {
|
5133 | return 0;
|
5134 | },
|
5135 | registerResizeHandler: function registerResizeHandler() {
|
5136 | return undefined;
|
5137 | },
|
5138 | setStyleForTilesElement: function setStyleForTilesElement() {
|
5139 | return undefined;
|
5140 | }
|
5141 | };
|
5142 | },
|
5143 | enumerable: true,
|
5144 | configurable: true
|
5145 | });
|
5146 | MDCGridListFoundation.prototype.init = function() {
|
5147 | this.alignCenter();
|
5148 | this.adapter_.registerResizeHandler(this.resizeHandler_);
|
5149 | };
|
5150 | MDCGridListFoundation.prototype.destroy = function() {
|
5151 | this.adapter_.deregisterResizeHandler(this.resizeHandler_);
|
5152 | };
|
5153 | MDCGridListFoundation.prototype.alignCenter = function() {
|
5154 | var _this = this;
|
5155 | cancelAnimationFrame(this.resizeFrame_);
|
5156 | this.resizeFrame_ = requestAnimationFrame(function() {
|
5157 | _this.alignCenter_();
|
5158 | _this.resizeFrame_ = 0;
|
5159 | });
|
5160 | };
|
5161 | MDCGridListFoundation.prototype.alignCenter_ = function() {
|
5162 | if (this.adapter_.getNumberOfTiles() === 0) {
|
5163 | return;
|
5164 | }
|
5165 | var gridWidth = this.adapter_.getOffsetWidth();
|
5166 | var itemWidth = this.adapter_.getOffsetWidthForTileAtIndex(0);
|
5167 | var tilesWidth = itemWidth * Math.floor(gridWidth / itemWidth);
|
5168 | this.adapter_.setStyleForTilesElement("width", tilesWidth + "px");
|
5169 | };
|
5170 | return MDCGridListFoundation;
|
5171 | }(foundation_1.MDCFoundation);
|
5172 | exports.MDCGridListFoundation = MDCGridListFoundation;
|
5173 | exports.default = MDCGridListFoundation;
|
5174 | }, function(module, exports, __webpack_require__) {
|
5175 | "use strict";
|
5176 | var __extends = this && this.__extends || function() {
|
5177 | var _extendStatics = function extendStatics(d, b) {
|
5178 | _extendStatics = Object.setPrototypeOf || {
|
5179 | __proto__: []
|
5180 | } instanceof Array && function(d, b) {
|
5181 | d.__proto__ = b;
|
5182 | } || function(d, b) {
|
5183 | for (var p in b) {
|
5184 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
5185 | }
|
5186 | };
|
5187 | return _extendStatics(d, b);
|
5188 | };
|
5189 | return function(d, b) {
|
5190 | _extendStatics(d, b);
|
5191 | function __() {
|
5192 | this.constructor = d;
|
5193 | }
|
5194 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
5195 | };
|
5196 | }();
|
5197 | var __assign = this && this.__assign || function() {
|
5198 | __assign = Object.assign || function(t) {
|
5199 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5200 | s = arguments[i];
|
5201 | for (var p in s) {
|
5202 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
5203 | }
|
5204 | }
|
5205 | return t;
|
5206 | };
|
5207 | return __assign.apply(this, arguments);
|
5208 | };
|
5209 | Object.defineProperty(exports, "__esModule", {
|
5210 | value: true
|
5211 | });
|
5212 | var foundation_1 = __webpack_require__(0);
|
5213 | var constants_1 = __webpack_require__(112);
|
5214 | var MDCIconButtonToggleFoundation = function(_super) {
|
5215 | __extends(MDCIconButtonToggleFoundation, _super);
|
5216 | function MDCIconButtonToggleFoundation(adapter) {
|
5217 | return _super.call(this, __assign({}, MDCIconButtonToggleFoundation.defaultAdapter, adapter)) || this;
|
5218 | }
|
5219 | Object.defineProperty(MDCIconButtonToggleFoundation, "cssClasses", {
|
5220 | get: function get() {
|
5221 | return constants_1.cssClasses;
|
5222 | },
|
5223 | enumerable: true,
|
5224 | configurable: true
|
5225 | });
|
5226 | Object.defineProperty(MDCIconButtonToggleFoundation, "strings", {
|
5227 | get: function get() {
|
5228 | return constants_1.strings;
|
5229 | },
|
5230 | enumerable: true,
|
5231 | configurable: true
|
5232 | });
|
5233 | Object.defineProperty(MDCIconButtonToggleFoundation, "defaultAdapter", {
|
5234 | get: function get() {
|
5235 | return {
|
5236 | addClass: function addClass() {
|
5237 | return undefined;
|
5238 | },
|
5239 | hasClass: function hasClass() {
|
5240 | return false;
|
5241 | },
|
5242 | notifyChange: function notifyChange() {
|
5243 | return undefined;
|
5244 | },
|
5245 | removeClass: function removeClass() {
|
5246 | return undefined;
|
5247 | },
|
5248 | setAttr: function setAttr() {
|
5249 | return undefined;
|
5250 | }
|
5251 | };
|
5252 | },
|
5253 | enumerable: true,
|
5254 | configurable: true
|
5255 | });
|
5256 | MDCIconButtonToggleFoundation.prototype.init = function() {
|
5257 | this.adapter_.setAttr(constants_1.strings.ARIA_PRESSED, "" + this.isOn());
|
5258 | };
|
5259 | MDCIconButtonToggleFoundation.prototype.handleClick = function() {
|
5260 | this.toggle();
|
5261 | this.adapter_.notifyChange({
|
5262 | isOn: this.isOn()
|
5263 | });
|
5264 | };
|
5265 | MDCIconButtonToggleFoundation.prototype.isOn = function() {
|
5266 | return this.adapter_.hasClass(constants_1.cssClasses.ICON_BUTTON_ON);
|
5267 | };
|
5268 | MDCIconButtonToggleFoundation.prototype.toggle = function(isOn) {
|
5269 | if (isOn === void 0) {
|
5270 | isOn = !this.isOn();
|
5271 | }
|
5272 | if (isOn) {
|
5273 | this.adapter_.addClass(constants_1.cssClasses.ICON_BUTTON_ON);
|
5274 | } else {
|
5275 | this.adapter_.removeClass(constants_1.cssClasses.ICON_BUTTON_ON);
|
5276 | }
|
5277 | this.adapter_.setAttr(constants_1.strings.ARIA_PRESSED, "" + isOn);
|
5278 | };
|
5279 | return MDCIconButtonToggleFoundation;
|
5280 | }(foundation_1.MDCFoundation);
|
5281 | exports.MDCIconButtonToggleFoundation = MDCIconButtonToggleFoundation;
|
5282 | exports.default = MDCIconButtonToggleFoundation;
|
5283 | }, function(module, exports, __webpack_require__) {
|
5284 | "use strict";
|
5285 | var __extends = this && this.__extends || function() {
|
5286 | var _extendStatics = function extendStatics(d, b) {
|
5287 | _extendStatics = Object.setPrototypeOf || {
|
5288 | __proto__: []
|
5289 | } instanceof Array && function(d, b) {
|
5290 | d.__proto__ = b;
|
5291 | } || function(d, b) {
|
5292 | for (var p in b) {
|
5293 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
5294 | }
|
5295 | };
|
5296 | return _extendStatics(d, b);
|
5297 | };
|
5298 | return function(d, b) {
|
5299 | _extendStatics(d, b);
|
5300 | function __() {
|
5301 | this.constructor = d;
|
5302 | }
|
5303 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
5304 | };
|
5305 | }();
|
5306 | var __assign = this && this.__assign || function() {
|
5307 | __assign = Object.assign || function(t) {
|
5308 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5309 | s = arguments[i];
|
5310 | for (var p in s) {
|
5311 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
5312 | }
|
5313 | }
|
5314 | return t;
|
5315 | };
|
5316 | return __assign.apply(this, arguments);
|
5317 | };
|
5318 | Object.defineProperty(exports, "__esModule", {
|
5319 | value: true
|
5320 | });
|
5321 | var foundation_1 = __webpack_require__(0);
|
5322 | var constants_1 = __webpack_require__(114);
|
5323 | var MDCLineRippleFoundation = function(_super) {
|
5324 | __extends(MDCLineRippleFoundation, _super);
|
5325 | function MDCLineRippleFoundation(adapter) {
|
5326 | var _this = _super.call(this, __assign({}, MDCLineRippleFoundation.defaultAdapter, adapter)) || this;
|
5327 | _this.transitionEndHandler_ = function(evt) {
|
5328 | return _this.handleTransitionEnd(evt);
|
5329 | };
|
5330 | return _this;
|
5331 | }
|
5332 | Object.defineProperty(MDCLineRippleFoundation, "cssClasses", {
|
5333 | get: function get() {
|
5334 | return constants_1.cssClasses;
|
5335 | },
|
5336 | enumerable: true,
|
5337 | configurable: true
|
5338 | });
|
5339 | Object.defineProperty(MDCLineRippleFoundation, "defaultAdapter", {
|
5340 | get: function get() {
|
5341 | return {
|
5342 | addClass: function addClass() {
|
5343 | return undefined;
|
5344 | },
|
5345 | removeClass: function removeClass() {
|
5346 | return undefined;
|
5347 | },
|
5348 | hasClass: function hasClass() {
|
5349 | return false;
|
5350 | },
|
5351 | setStyle: function setStyle() {
|
5352 | return undefined;
|
5353 | },
|
5354 | registerEventHandler: function registerEventHandler() {
|
5355 | return undefined;
|
5356 | },
|
5357 | deregisterEventHandler: function deregisterEventHandler() {
|
5358 | return undefined;
|
5359 | }
|
5360 | };
|
5361 | },
|
5362 | enumerable: true,
|
5363 | configurable: true
|
5364 | });
|
5365 | MDCLineRippleFoundation.prototype.init = function() {
|
5366 | this.adapter_.registerEventHandler("transitionend", this.transitionEndHandler_);
|
5367 | };
|
5368 | MDCLineRippleFoundation.prototype.destroy = function() {
|
5369 | this.adapter_.deregisterEventHandler("transitionend", this.transitionEndHandler_);
|
5370 | };
|
5371 | MDCLineRippleFoundation.prototype.activate = function() {
|
5372 | this.adapter_.removeClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
|
5373 | this.adapter_.addClass(constants_1.cssClasses.LINE_RIPPLE_ACTIVE);
|
5374 | };
|
5375 | MDCLineRippleFoundation.prototype.setRippleCenter = function(xCoordinate) {
|
5376 | this.adapter_.setStyle("transform-origin", xCoordinate + "px center");
|
5377 | };
|
5378 | MDCLineRippleFoundation.prototype.deactivate = function() {
|
5379 | this.adapter_.addClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
|
5380 | };
|
5381 | MDCLineRippleFoundation.prototype.handleTransitionEnd = function(evt) {
|
5382 | var isDeactivating = this.adapter_.hasClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
|
5383 | if (evt.propertyName === "opacity") {
|
5384 | if (isDeactivating) {
|
5385 | this.adapter_.removeClass(constants_1.cssClasses.LINE_RIPPLE_ACTIVE);
|
5386 | this.adapter_.removeClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
|
5387 | }
|
5388 | }
|
5389 | };
|
5390 | return MDCLineRippleFoundation;
|
5391 | }(foundation_1.MDCFoundation);
|
5392 | exports.MDCLineRippleFoundation = MDCLineRippleFoundation;
|
5393 | exports.default = MDCLineRippleFoundation;
|
5394 | }, function(module, exports, __webpack_require__) {
|
5395 | "use strict";
|
5396 | var __extends = this && this.__extends || function() {
|
5397 | var _extendStatics = function extendStatics(d, b) {
|
5398 | _extendStatics = Object.setPrototypeOf || {
|
5399 | __proto__: []
|
5400 | } instanceof Array && function(d, b) {
|
5401 | d.__proto__ = b;
|
5402 | } || function(d, b) {
|
5403 | for (var p in b) {
|
5404 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
5405 | }
|
5406 | };
|
5407 | return _extendStatics(d, b);
|
5408 | };
|
5409 | return function(d, b) {
|
5410 | _extendStatics(d, b);
|
5411 | function __() {
|
5412 | this.constructor = d;
|
5413 | }
|
5414 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
5415 | };
|
5416 | }();
|
5417 | var __assign = this && this.__assign || function() {
|
5418 | __assign = Object.assign || function(t) {
|
5419 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5420 | s = arguments[i];
|
5421 | for (var p in s) {
|
5422 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
5423 | }
|
5424 | }
|
5425 | return t;
|
5426 | };
|
5427 | return __assign.apply(this, arguments);
|
5428 | };
|
5429 | Object.defineProperty(exports, "__esModule", {
|
5430 | value: true
|
5431 | });
|
5432 | var util_1 = __webpack_require__(10);
|
5433 | var foundation_1 = __webpack_require__(0);
|
5434 | var constants_1 = __webpack_require__(117);
|
5435 | var MDCLinearProgressFoundation = function(_super) {
|
5436 | __extends(MDCLinearProgressFoundation, _super);
|
5437 | function MDCLinearProgressFoundation(adapter) {
|
5438 | return _super.call(this, __assign({}, MDCLinearProgressFoundation.defaultAdapter, adapter)) || this;
|
5439 | }
|
5440 | Object.defineProperty(MDCLinearProgressFoundation, "cssClasses", {
|
5441 | get: function get() {
|
5442 | return constants_1.cssClasses;
|
5443 | },
|
5444 | enumerable: true,
|
5445 | configurable: true
|
5446 | });
|
5447 | Object.defineProperty(MDCLinearProgressFoundation, "strings", {
|
5448 | get: function get() {
|
5449 | return constants_1.strings;
|
5450 | },
|
5451 | enumerable: true,
|
5452 | configurable: true
|
5453 | });
|
5454 | Object.defineProperty(MDCLinearProgressFoundation, "defaultAdapter", {
|
5455 | get: function get() {
|
5456 | return {
|
5457 | addClass: function addClass() {
|
5458 | return undefined;
|
5459 | },
|
5460 | getBuffer: function getBuffer() {
|
5461 | return null;
|
5462 | },
|
5463 | getPrimaryBar: function getPrimaryBar() {
|
5464 | return null;
|
5465 | },
|
5466 | hasClass: function hasClass() {
|
5467 | return false;
|
5468 | },
|
5469 | removeClass: function removeClass() {
|
5470 | return undefined;
|
5471 | },
|
5472 | setStyle: function setStyle() {
|
5473 | return undefined;
|
5474 | }
|
5475 | };
|
5476 | },
|
5477 | enumerable: true,
|
5478 | configurable: true
|
5479 | });
|
5480 | MDCLinearProgressFoundation.prototype.init = function() {
|
5481 | this.isDeterminate_ = !this.adapter_.hasClass(constants_1.cssClasses.INDETERMINATE_CLASS);
|
5482 | this.isReversed_ = this.adapter_.hasClass(constants_1.cssClasses.REVERSED_CLASS);
|
5483 | this.progress_ = 0;
|
5484 | };
|
5485 | MDCLinearProgressFoundation.prototype.setDeterminate = function(isDeterminate) {
|
5486 | this.isDeterminate_ = isDeterminate;
|
5487 | if (this.isDeterminate_) {
|
5488 | this.adapter_.removeClass(constants_1.cssClasses.INDETERMINATE_CLASS);
|
5489 | this.setScale_(this.adapter_.getPrimaryBar(), this.progress_);
|
5490 | } else {
|
5491 | this.adapter_.addClass(constants_1.cssClasses.INDETERMINATE_CLASS);
|
5492 | this.setScale_(this.adapter_.getPrimaryBar(), 1);
|
5493 | this.setScale_(this.adapter_.getBuffer(), 1);
|
5494 | }
|
5495 | };
|
5496 | MDCLinearProgressFoundation.prototype.setProgress = function(value) {
|
5497 | this.progress_ = value;
|
5498 | if (this.isDeterminate_) {
|
5499 | this.setScale_(this.adapter_.getPrimaryBar(), value);
|
5500 | }
|
5501 | };
|
5502 | MDCLinearProgressFoundation.prototype.setBuffer = function(value) {
|
5503 | if (this.isDeterminate_) {
|
5504 | this.setScale_(this.adapter_.getBuffer(), value);
|
5505 | }
|
5506 | };
|
5507 | MDCLinearProgressFoundation.prototype.setReverse = function(isReversed) {
|
5508 | this.isReversed_ = isReversed;
|
5509 | if (this.isReversed_) {
|
5510 | this.adapter_.addClass(constants_1.cssClasses.REVERSED_CLASS);
|
5511 | } else {
|
5512 | this.adapter_.removeClass(constants_1.cssClasses.REVERSED_CLASS);
|
5513 | }
|
5514 | };
|
5515 | MDCLinearProgressFoundation.prototype.open = function() {
|
5516 | this.adapter_.removeClass(constants_1.cssClasses.CLOSED_CLASS);
|
5517 | };
|
5518 | MDCLinearProgressFoundation.prototype.close = function() {
|
5519 | this.adapter_.addClass(constants_1.cssClasses.CLOSED_CLASS);
|
5520 | };
|
5521 | MDCLinearProgressFoundation.prototype.setScale_ = function(el, scaleValue) {
|
5522 | if (!el) {
|
5523 | return;
|
5524 | }
|
5525 | var value = "scaleX(" + scaleValue + ")";
|
5526 | this.adapter_.setStyle(el, util_1.getCorrectPropertyName(window, "transform"), value);
|
5527 | };
|
5528 | return MDCLinearProgressFoundation;
|
5529 | }(foundation_1.MDCFoundation);
|
5530 | exports.MDCLinearProgressFoundation = MDCLinearProgressFoundation;
|
5531 | exports.default = MDCLinearProgressFoundation;
|
5532 | }, function(module, exports, __webpack_require__) {
|
5533 | "use strict";
|
5534 | Object.defineProperty(exports, "__esModule", {
|
5535 | value: true
|
5536 | });
|
5537 | var cachedCssTransformPropertyName_;
|
5538 | function getTransformPropertyName(globalObj, forceRefresh) {
|
5539 | if (forceRefresh === void 0) {
|
5540 | forceRefresh = false;
|
5541 | }
|
5542 | if (cachedCssTransformPropertyName_ === undefined || forceRefresh) {
|
5543 | var el = globalObj.document.createElement("div");
|
5544 | cachedCssTransformPropertyName_ = "transform" in el.style ? "transform" : "webkitTransform";
|
5545 | }
|
5546 | return cachedCssTransformPropertyName_;
|
5547 | }
|
5548 | exports.getTransformPropertyName = getTransformPropertyName;
|
5549 | }, function(module, exports, __webpack_require__) {
|
5550 | "use strict";
|
5551 | var __extends = this && this.__extends || function() {
|
5552 | var _extendStatics = function extendStatics(d, b) {
|
5553 | _extendStatics = Object.setPrototypeOf || {
|
5554 | __proto__: []
|
5555 | } instanceof Array && function(d, b) {
|
5556 | d.__proto__ = b;
|
5557 | } || function(d, b) {
|
5558 | for (var p in b) {
|
5559 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
5560 | }
|
5561 | };
|
5562 | return _extendStatics(d, b);
|
5563 | };
|
5564 | return function(d, b) {
|
5565 | _extendStatics(d, b);
|
5566 | function __() {
|
5567 | this.constructor = d;
|
5568 | }
|
5569 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
5570 | };
|
5571 | }();
|
5572 | var __importStar = this && this.__importStar || function(mod) {
|
5573 | if (mod && mod.__esModule) return mod;
|
5574 | var result = {};
|
5575 | if (mod != null) for (var k in mod) {
|
5576 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
5577 | }
|
5578 | result["default"] = mod;
|
5579 | return result;
|
5580 | };
|
5581 | Object.defineProperty(exports, "__esModule", {
|
5582 | value: true
|
5583 | });
|
5584 | var component_1 = __webpack_require__(1);
|
5585 | var constants_1 = __webpack_require__(6);
|
5586 | var foundation_1 = __webpack_require__(8);
|
5587 | var util = __importStar(__webpack_require__(42));
|
5588 | var MDCMenuSurface = function(_super) {
|
5589 | __extends(MDCMenuSurface, _super);
|
5590 | function MDCMenuSurface() {
|
5591 | return _super !== null && _super.apply(this, arguments) || this;
|
5592 | }
|
5593 | MDCMenuSurface.attachTo = function(root) {
|
5594 | return new MDCMenuSurface(root);
|
5595 | };
|
5596 | MDCMenuSurface.prototype.initialSyncWithDOM = function() {
|
5597 | var _this = this;
|
5598 | var parentEl = this.root_.parentElement;
|
5599 | this.anchorElement = parentEl && parentEl.classList.contains(constants_1.cssClasses.ANCHOR) ? parentEl : null;
|
5600 | if (this.root_.classList.contains(constants_1.cssClasses.FIXED)) {
|
5601 | this.setFixedPosition(true);
|
5602 | }
|
5603 | this.handleKeydown_ = function(evt) {
|
5604 | return _this.foundation_.handleKeydown(evt);
|
5605 | };
|
5606 | this.handleBodyClick_ = function(evt) {
|
5607 | return _this.foundation_.handleBodyClick(evt);
|
5608 | };
|
5609 | this.registerBodyClickListener_ = function() {
|
5610 | return document.body.addEventListener("click", _this.handleBodyClick_);
|
5611 | };
|
5612 | this.deregisterBodyClickListener_ = function() {
|
5613 | return document.body.removeEventListener("click", _this.handleBodyClick_);
|
5614 | };
|
5615 | this.listen("keydown", this.handleKeydown_);
|
5616 | this.listen(constants_1.strings.OPENED_EVENT, this.registerBodyClickListener_);
|
5617 | this.listen(constants_1.strings.CLOSED_EVENT, this.deregisterBodyClickListener_);
|
5618 | };
|
5619 | MDCMenuSurface.prototype.destroy = function() {
|
5620 | this.unlisten("keydown", this.handleKeydown_);
|
5621 | this.unlisten(constants_1.strings.OPENED_EVENT, this.registerBodyClickListener_);
|
5622 | this.unlisten(constants_1.strings.CLOSED_EVENT, this.deregisterBodyClickListener_);
|
5623 | _super.prototype.destroy.call(this);
|
5624 | };
|
5625 | Object.defineProperty(MDCMenuSurface.prototype, "open", {
|
5626 | get: function get() {
|
5627 | return this.foundation_.isOpen();
|
5628 | },
|
5629 | set: function set(value) {
|
5630 | if (value) {
|
5631 | var focusableElements = this.root_.querySelectorAll(constants_1.strings.FOCUSABLE_ELEMENTS);
|
5632 | this.firstFocusableElement_ = focusableElements[0];
|
5633 | this.lastFocusableElement_ = focusableElements[focusableElements.length - 1];
|
5634 | this.foundation_.open();
|
5635 | } else {
|
5636 | this.foundation_.close();
|
5637 | }
|
5638 | },
|
5639 | enumerable: true,
|
5640 | configurable: true
|
5641 | });
|
5642 | Object.defineProperty(MDCMenuSurface.prototype, "quickOpen", {
|
5643 | set: function set(quickOpen) {
|
5644 | this.foundation_.setQuickOpen(quickOpen);
|
5645 | },
|
5646 | enumerable: true,
|
5647 | configurable: true
|
5648 | });
|
5649 | MDCMenuSurface.prototype.hoistMenuToBody = function() {
|
5650 | document.body.appendChild(this.root_);
|
5651 | this.setIsHoisted(true);
|
5652 | };
|
5653 | MDCMenuSurface.prototype.setIsHoisted = function(isHoisted) {
|
5654 | this.foundation_.setIsHoisted(isHoisted);
|
5655 | };
|
5656 | MDCMenuSurface.prototype.setMenuSurfaceAnchorElement = function(element) {
|
5657 | this.anchorElement = element;
|
5658 | };
|
5659 | MDCMenuSurface.prototype.setFixedPosition = function(isFixed) {
|
5660 | if (isFixed) {
|
5661 | this.root_.classList.add(constants_1.cssClasses.FIXED);
|
5662 | } else {
|
5663 | this.root_.classList.remove(constants_1.cssClasses.FIXED);
|
5664 | }
|
5665 | this.foundation_.setFixedPosition(isFixed);
|
5666 | };
|
5667 | MDCMenuSurface.prototype.setAbsolutePosition = function(x, y) {
|
5668 | this.foundation_.setAbsolutePosition(x, y);
|
5669 | this.setIsHoisted(true);
|
5670 | };
|
5671 | MDCMenuSurface.prototype.setAnchorCorner = function(corner) {
|
5672 | this.foundation_.setAnchorCorner(corner);
|
5673 | };
|
5674 | MDCMenuSurface.prototype.setAnchorMargin = function(margin) {
|
5675 | this.foundation_.setAnchorMargin(margin);
|
5676 | };
|
5677 | MDCMenuSurface.prototype.getDefaultFoundation = function() {
|
5678 | var _this = this;
|
5679 | var adapter = {
|
5680 | addClass: function addClass(className) {
|
5681 | return _this.root_.classList.add(className);
|
5682 | },
|
5683 | removeClass: function removeClass(className) {
|
5684 | return _this.root_.classList.remove(className);
|
5685 | },
|
5686 | hasClass: function hasClass(className) {
|
5687 | return _this.root_.classList.contains(className);
|
5688 | },
|
5689 | hasAnchor: function hasAnchor() {
|
5690 | return !!_this.anchorElement;
|
5691 | },
|
5692 | notifyClose: function notifyClose() {
|
5693 | return _this.emit(foundation_1.MDCMenuSurfaceFoundation.strings.CLOSED_EVENT, {});
|
5694 | },
|
5695 | notifyOpen: function notifyOpen() {
|
5696 | return _this.emit(foundation_1.MDCMenuSurfaceFoundation.strings.OPENED_EVENT, {});
|
5697 | },
|
5698 | isElementInContainer: function isElementInContainer(el) {
|
5699 | return _this.root_.contains(el);
|
5700 | },
|
5701 | isRtl: function isRtl() {
|
5702 | return getComputedStyle(_this.root_).getPropertyValue("direction") === "rtl";
|
5703 | },
|
5704 | setTransformOrigin: function setTransformOrigin(origin) {
|
5705 | var propertyName = util.getTransformPropertyName(window) + "-origin";
|
5706 | _this.root_.style.setProperty(propertyName, origin);
|
5707 | },
|
5708 | isFocused: function isFocused() {
|
5709 | return document.activeElement === _this.root_;
|
5710 | },
|
5711 | saveFocus: function saveFocus() {
|
5712 | _this.previousFocus_ = document.activeElement;
|
5713 | },
|
5714 | restoreFocus: function restoreFocus() {
|
5715 | if (_this.root_.contains(document.activeElement)) {
|
5716 | if (_this.previousFocus_ && _this.previousFocus_.focus) {
|
5717 | _this.previousFocus_.focus();
|
5718 | }
|
5719 | }
|
5720 | },
|
5721 | isFirstElementFocused: function isFirstElementFocused() {
|
5722 | return _this.firstFocusableElement_ ? _this.firstFocusableElement_ === document.activeElement : false;
|
5723 | },
|
5724 | isLastElementFocused: function isLastElementFocused() {
|
5725 | return _this.lastFocusableElement_ ? _this.lastFocusableElement_ === document.activeElement : false;
|
5726 | },
|
5727 | focusFirstElement: function focusFirstElement() {
|
5728 | return _this.firstFocusableElement_ && _this.firstFocusableElement_.focus && _this.firstFocusableElement_.focus();
|
5729 | },
|
5730 | focusLastElement: function focusLastElement() {
|
5731 | return _this.lastFocusableElement_ && _this.lastFocusableElement_.focus && _this.lastFocusableElement_.focus();
|
5732 | },
|
5733 | getInnerDimensions: function getInnerDimensions() {
|
5734 | return {
|
5735 | width: _this.root_.offsetWidth,
|
5736 | height: _this.root_.offsetHeight
|
5737 | };
|
5738 | },
|
5739 | getAnchorDimensions: function getAnchorDimensions() {
|
5740 | return _this.anchorElement ? _this.anchorElement.getBoundingClientRect() : null;
|
5741 | },
|
5742 | getWindowDimensions: function getWindowDimensions() {
|
5743 | return {
|
5744 | width: window.innerWidth,
|
5745 | height: window.innerHeight
|
5746 | };
|
5747 | },
|
5748 | getBodyDimensions: function getBodyDimensions() {
|
5749 | return {
|
5750 | width: document.body.clientWidth,
|
5751 | height: document.body.clientHeight
|
5752 | };
|
5753 | },
|
5754 | getWindowScroll: function getWindowScroll() {
|
5755 | return {
|
5756 | x: window.pageXOffset,
|
5757 | y: window.pageYOffset
|
5758 | };
|
5759 | },
|
5760 | setPosition: function setPosition(position) {
|
5761 | _this.root_.style.left = "left" in position ? position.left + "px" : "";
|
5762 | _this.root_.style.right = "right" in position ? position.right + "px" : "";
|
5763 | _this.root_.style.top = "top" in position ? position.top + "px" : "";
|
5764 | _this.root_.style.bottom = "bottom" in position ? position.bottom + "px" : "";
|
5765 | },
|
5766 | setMaxHeight: function setMaxHeight(height) {
|
5767 | _this.root_.style.maxHeight = height;
|
5768 | }
|
5769 | };
|
5770 | return new foundation_1.MDCMenuSurfaceFoundation(adapter);
|
5771 | };
|
5772 | return MDCMenuSurface;
|
5773 | }(component_1.MDCComponent);
|
5774 | exports.MDCMenuSurface = MDCMenuSurface;
|
5775 | }, function(module, exports, __webpack_require__) {
|
5776 | "use strict";
|
5777 | var __extends = this && this.__extends || function() {
|
5778 | var _extendStatics = function extendStatics(d, b) {
|
5779 | _extendStatics = Object.setPrototypeOf || {
|
5780 | __proto__: []
|
5781 | } instanceof Array && function(d, b) {
|
5782 | d.__proto__ = b;
|
5783 | } || function(d, b) {
|
5784 | for (var p in b) {
|
5785 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
5786 | }
|
5787 | };
|
5788 | return _extendStatics(d, b);
|
5789 | };
|
5790 | return function(d, b) {
|
5791 | _extendStatics(d, b);
|
5792 | function __() {
|
5793 | this.constructor = d;
|
5794 | }
|
5795 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
5796 | };
|
5797 | }();
|
5798 | Object.defineProperty(exports, "__esModule", {
|
5799 | value: true
|
5800 | });
|
5801 | var component_1 = __webpack_require__(1);
|
5802 | var component_2 = __webpack_require__(13);
|
5803 | var foundation_1 = __webpack_require__(5);
|
5804 | var component_3 = __webpack_require__(43);
|
5805 | var foundation_2 = __webpack_require__(8);
|
5806 | var constants_1 = __webpack_require__(18);
|
5807 | var foundation_3 = __webpack_require__(45);
|
5808 | var MDCMenu = function(_super) {
|
5809 | __extends(MDCMenu, _super);
|
5810 | function MDCMenu() {
|
5811 | return _super !== null && _super.apply(this, arguments) || this;
|
5812 | }
|
5813 | MDCMenu.attachTo = function(root) {
|
5814 | return new MDCMenu(root);
|
5815 | };
|
5816 | MDCMenu.prototype.initialize = function(menuSurfaceFactory, listFactory) {
|
5817 | if (menuSurfaceFactory === void 0) {
|
5818 | menuSurfaceFactory = function menuSurfaceFactory(el) {
|
5819 | return new component_3.MDCMenuSurface(el);
|
5820 | };
|
5821 | }
|
5822 | if (listFactory === void 0) {
|
5823 | listFactory = function listFactory(el) {
|
5824 | return new component_2.MDCList(el);
|
5825 | };
|
5826 | }
|
5827 | this.menuSurfaceFactory_ = menuSurfaceFactory;
|
5828 | this.listFactory_ = listFactory;
|
5829 | };
|
5830 | MDCMenu.prototype.initialSyncWithDOM = function() {
|
5831 | var _this = this;
|
5832 | this.menuSurface_ = this.menuSurfaceFactory_(this.root_);
|
5833 | var list = this.root_.querySelector(constants_1.strings.LIST_SELECTOR);
|
5834 | if (list) {
|
5835 | this.list_ = this.listFactory_(list);
|
5836 | this.list_.wrapFocus = true;
|
5837 | } else {
|
5838 | this.list_ = null;
|
5839 | }
|
5840 | this.handleKeydown_ = function(evt) {
|
5841 | return _this.foundation_.handleKeydown(evt);
|
5842 | };
|
5843 | this.handleItemAction_ = function(evt) {
|
5844 | return _this.foundation_.handleItemAction(_this.items[evt.detail.index]);
|
5845 | };
|
5846 | this.handleMenuSurfaceOpened_ = function() {
|
5847 | return _this.foundation_.handleMenuSurfaceOpened();
|
5848 | };
|
5849 | this.menuSurface_.listen(foundation_2.MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);
|
5850 | this.listen("keydown", this.handleKeydown_);
|
5851 | this.listen(foundation_1.MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);
|
5852 | };
|
5853 | MDCMenu.prototype.destroy = function() {
|
5854 | if (this.list_) {
|
5855 | this.list_.destroy();
|
5856 | }
|
5857 | this.menuSurface_.destroy();
|
5858 | this.menuSurface_.unlisten(foundation_2.MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);
|
5859 | this.unlisten("keydown", this.handleKeydown_);
|
5860 | this.unlisten(foundation_1.MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);
|
5861 | _super.prototype.destroy.call(this);
|
5862 | };
|
5863 | Object.defineProperty(MDCMenu.prototype, "open", {
|
5864 | get: function get() {
|
5865 | return this.menuSurface_.open;
|
5866 | },
|
5867 | set: function set(value) {
|
5868 | this.menuSurface_.open = value;
|
5869 | },
|
5870 | enumerable: true,
|
5871 | configurable: true
|
5872 | });
|
5873 | Object.defineProperty(MDCMenu.prototype, "wrapFocus", {
|
5874 | get: function get() {
|
5875 | return this.list_ ? this.list_.wrapFocus : false;
|
5876 | },
|
5877 | set: function set(value) {
|
5878 | if (this.list_) {
|
5879 | this.list_.wrapFocus = value;
|
5880 | }
|
5881 | },
|
5882 | enumerable: true,
|
5883 | configurable: true
|
5884 | });
|
5885 | Object.defineProperty(MDCMenu.prototype, "items", {
|
5886 | get: function get() {
|
5887 | return this.list_ ? this.list_.listElements : [];
|
5888 | },
|
5889 | enumerable: true,
|
5890 | configurable: true
|
5891 | });
|
5892 | Object.defineProperty(MDCMenu.prototype, "quickOpen", {
|
5893 | set: function set(quickOpen) {
|
5894 | this.menuSurface_.quickOpen = quickOpen;
|
5895 | },
|
5896 | enumerable: true,
|
5897 | configurable: true
|
5898 | });
|
5899 | MDCMenu.prototype.setDefaultFocusState = function(focusState) {
|
5900 | this.foundation_.setDefaultFocusState(focusState);
|
5901 | };
|
5902 | MDCMenu.prototype.setAnchorCorner = function(corner) {
|
5903 | this.menuSurface_.setAnchorCorner(corner);
|
5904 | };
|
5905 | MDCMenu.prototype.setAnchorMargin = function(margin) {
|
5906 | this.menuSurface_.setAnchorMargin(margin);
|
5907 | };
|
5908 | MDCMenu.prototype.getOptionByIndex = function(index) {
|
5909 | var items = this.items;
|
5910 | if (index < items.length) {
|
5911 | return this.items[index];
|
5912 | } else {
|
5913 | return null;
|
5914 | }
|
5915 | };
|
5916 | MDCMenu.prototype.setFixedPosition = function(isFixed) {
|
5917 | this.menuSurface_.setFixedPosition(isFixed);
|
5918 | };
|
5919 | MDCMenu.prototype.hoistMenuToBody = function() {
|
5920 | this.menuSurface_.hoistMenuToBody();
|
5921 | };
|
5922 | MDCMenu.prototype.setIsHoisted = function(isHoisted) {
|
5923 | this.menuSurface_.setIsHoisted(isHoisted);
|
5924 | };
|
5925 | MDCMenu.prototype.setAbsolutePosition = function(x, y) {
|
5926 | this.menuSurface_.setAbsolutePosition(x, y);
|
5927 | };
|
5928 | MDCMenu.prototype.setAnchorElement = function(element) {
|
5929 | this.menuSurface_.anchorElement = element;
|
5930 | };
|
5931 | MDCMenu.prototype.getDefaultFoundation = function() {
|
5932 | var _this = this;
|
5933 | var adapter = {
|
5934 | addClassToElementAtIndex: function addClassToElementAtIndex(index, className) {
|
5935 | var list = _this.items;
|
5936 | list[index].classList.add(className);
|
5937 | },
|
5938 | removeClassFromElementAtIndex: function removeClassFromElementAtIndex(index, className) {
|
5939 | var list = _this.items;
|
5940 | list[index].classList.remove(className);
|
5941 | },
|
5942 | addAttributeToElementAtIndex: function addAttributeToElementAtIndex(index, attr, value) {
|
5943 | var list = _this.items;
|
5944 | list[index].setAttribute(attr, value);
|
5945 | },
|
5946 | removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex(index, attr) {
|
5947 | var list = _this.items;
|
5948 | list[index].removeAttribute(attr);
|
5949 | },
|
5950 | elementContainsClass: function elementContainsClass(element, className) {
|
5951 | return element.classList.contains(className);
|
5952 | },
|
5953 | closeSurface: function closeSurface() {
|
5954 | return _this.open = false;
|
5955 | },
|
5956 | getElementIndex: function getElementIndex(element) {
|
5957 | return _this.items.indexOf(element);
|
5958 | },
|
5959 | getParentElement: function getParentElement(element) {
|
5960 | return element.parentElement;
|
5961 | },
|
5962 | getSelectedElementIndex: function getSelectedElementIndex(selectionGroup) {
|
5963 | var selectedListItem = selectionGroup.querySelector("." + constants_1.cssClasses.MENU_SELECTED_LIST_ITEM);
|
5964 | return selectedListItem ? _this.items.indexOf(selectedListItem) : -1;
|
5965 | },
|
5966 | notifySelected: function notifySelected(evtData) {
|
5967 | return _this.emit(constants_1.strings.SELECTED_EVENT, {
|
5968 | index: evtData.index,
|
5969 | item: _this.items[evtData.index]
|
5970 | });
|
5971 | },
|
5972 | getMenuItemCount: function getMenuItemCount() {
|
5973 | return _this.items.length;
|
5974 | },
|
5975 | focusItemAtIndex: function focusItemAtIndex(index) {
|
5976 | return _this.items[index].focus();
|
5977 | },
|
5978 | focusListRoot: function focusListRoot() {
|
5979 | return _this.root_.querySelector(constants_1.strings.LIST_SELECTOR).focus();
|
5980 | }
|
5981 | };
|
5982 | return new foundation_3.MDCMenuFoundation(adapter);
|
5983 | };
|
5984 | return MDCMenu;
|
5985 | }(component_1.MDCComponent);
|
5986 | exports.MDCMenu = MDCMenu;
|
5987 | }, function(module, exports, __webpack_require__) {
|
5988 | "use strict";
|
5989 | var __extends = this && this.__extends || function() {
|
5990 | var _extendStatics = function extendStatics(d, b) {
|
5991 | _extendStatics = Object.setPrototypeOf || {
|
5992 | __proto__: []
|
5993 | } instanceof Array && function(d, b) {
|
5994 | d.__proto__ = b;
|
5995 | } || function(d, b) {
|
5996 | for (var p in b) {
|
5997 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
5998 | }
|
5999 | };
|
6000 | return _extendStatics(d, b);
|
6001 | };
|
6002 | return function(d, b) {
|
6003 | _extendStatics(d, b);
|
6004 | function __() {
|
6005 | this.constructor = d;
|
6006 | }
|
6007 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
6008 | };
|
6009 | }();
|
6010 | var __assign = this && this.__assign || function() {
|
6011 | __assign = Object.assign || function(t) {
|
6012 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
6013 | s = arguments[i];
|
6014 | for (var p in s) {
|
6015 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
6016 | }
|
6017 | }
|
6018 | return t;
|
6019 | };
|
6020 | return __assign.apply(this, arguments);
|
6021 | };
|
6022 | Object.defineProperty(exports, "__esModule", {
|
6023 | value: true
|
6024 | });
|
6025 | var foundation_1 = __webpack_require__(0);
|
6026 | var foundation_2 = __webpack_require__(5);
|
6027 | var foundation_3 = __webpack_require__(8);
|
6028 | var constants_1 = __webpack_require__(18);
|
6029 | var MDCMenuFoundation = function(_super) {
|
6030 | __extends(MDCMenuFoundation, _super);
|
6031 | function MDCMenuFoundation(adapter) {
|
6032 | var _this = _super.call(this, __assign({}, MDCMenuFoundation.defaultAdapter, adapter)) || this;
|
6033 | _this.closeAnimationEndTimerId_ = 0;
|
6034 | _this.defaultFocusState_ = constants_1.DefaultFocusState.LIST_ROOT;
|
6035 | return _this;
|
6036 | }
|
6037 | Object.defineProperty(MDCMenuFoundation, "cssClasses", {
|
6038 | get: function get() {
|
6039 | return constants_1.cssClasses;
|
6040 | },
|
6041 | enumerable: true,
|
6042 | configurable: true
|
6043 | });
|
6044 | Object.defineProperty(MDCMenuFoundation, "strings", {
|
6045 | get: function get() {
|
6046 | return constants_1.strings;
|
6047 | },
|
6048 | enumerable: true,
|
6049 | configurable: true
|
6050 | });
|
6051 | Object.defineProperty(MDCMenuFoundation, "numbers", {
|
6052 | get: function get() {
|
6053 | return constants_1.numbers;
|
6054 | },
|
6055 | enumerable: true,
|
6056 | configurable: true
|
6057 | });
|
6058 | Object.defineProperty(MDCMenuFoundation, "defaultAdapter", {
|
6059 | get: function get() {
|
6060 | return {
|
6061 | addClassToElementAtIndex: function addClassToElementAtIndex() {
|
6062 | return undefined;
|
6063 | },
|
6064 | removeClassFromElementAtIndex: function removeClassFromElementAtIndex() {
|
6065 | return undefined;
|
6066 | },
|
6067 | addAttributeToElementAtIndex: function addAttributeToElementAtIndex() {
|
6068 | return undefined;
|
6069 | },
|
6070 | removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex() {
|
6071 | return undefined;
|
6072 | },
|
6073 | elementContainsClass: function elementContainsClass() {
|
6074 | return false;
|
6075 | },
|
6076 | closeSurface: function closeSurface() {
|
6077 | return undefined;
|
6078 | },
|
6079 | getElementIndex: function getElementIndex() {
|
6080 | return -1;
|
6081 | },
|
6082 | getParentElement: function getParentElement() {
|
6083 | return null;
|
6084 | },
|
6085 | getSelectedElementIndex: function getSelectedElementIndex() {
|
6086 | return -1;
|
6087 | },
|
6088 | notifySelected: function notifySelected() {
|
6089 | return undefined;
|
6090 | },
|
6091 | getMenuItemCount: function getMenuItemCount() {
|
6092 | return 0;
|
6093 | },
|
6094 | focusItemAtIndex: function focusItemAtIndex() {
|
6095 | return undefined;
|
6096 | },
|
6097 | focusListRoot: function focusListRoot() {
|
6098 | return undefined;
|
6099 | }
|
6100 | };
|
6101 | },
|
6102 | enumerable: true,
|
6103 | configurable: true
|
6104 | });
|
6105 | MDCMenuFoundation.prototype.destroy = function() {
|
6106 | if (this.closeAnimationEndTimerId_) {
|
6107 | clearTimeout(this.closeAnimationEndTimerId_);
|
6108 | }
|
6109 | this.adapter_.closeSurface();
|
6110 | };
|
6111 | MDCMenuFoundation.prototype.handleKeydown = function(evt) {
|
6112 | var key = evt.key, keyCode = evt.keyCode;
|
6113 | var isTab = key === "Tab" || keyCode === 9;
|
6114 | if (isTab) {
|
6115 | this.adapter_.closeSurface();
|
6116 | }
|
6117 | };
|
6118 | MDCMenuFoundation.prototype.handleItemAction = function(listItem) {
|
6119 | var _this = this;
|
6120 | var index = this.adapter_.getElementIndex(listItem);
|
6121 | if (index < 0) {
|
6122 | return;
|
6123 | }
|
6124 | this.adapter_.notifySelected({
|
6125 | index: index
|
6126 | });
|
6127 | this.adapter_.closeSurface();
|
6128 | this.closeAnimationEndTimerId_ = setTimeout(function() {
|
6129 | var selectionGroup = _this.getSelectionGroup_(listItem);
|
6130 | if (selectionGroup) {
|
6131 | _this.handleSelectionGroup_(selectionGroup, index);
|
6132 | }
|
6133 | }, foundation_3.MDCMenuSurfaceFoundation.numbers.TRANSITION_CLOSE_DURATION);
|
6134 | };
|
6135 | MDCMenuFoundation.prototype.handleMenuSurfaceOpened = function() {
|
6136 | switch (this.defaultFocusState_) {
|
6137 | case constants_1.DefaultFocusState.FIRST_ITEM:
|
6138 | this.adapter_.focusItemAtIndex(0);
|
6139 | break;
|
6140 |
|
6141 | case constants_1.DefaultFocusState.LAST_ITEM:
|
6142 | this.adapter_.focusItemAtIndex(this.adapter_.getMenuItemCount() - 1);
|
6143 | break;
|
6144 |
|
6145 | case constants_1.DefaultFocusState.NONE:
|
6146 | break;
|
6147 |
|
6148 | default:
|
6149 | this.adapter_.focusListRoot();
|
6150 | break;
|
6151 | }
|
6152 | };
|
6153 | MDCMenuFoundation.prototype.setDefaultFocusState = function(focusState) {
|
6154 | this.defaultFocusState_ = focusState;
|
6155 | };
|
6156 | MDCMenuFoundation.prototype.handleSelectionGroup_ = function(selectionGroup, index) {
|
6157 | var selectedIndex = this.adapter_.getSelectedElementIndex(selectionGroup);
|
6158 | if (selectedIndex >= 0) {
|
6159 | this.adapter_.removeAttributeFromElementAtIndex(selectedIndex, constants_1.strings.ARIA_SELECTED_ATTR);
|
6160 | this.adapter_.removeClassFromElementAtIndex(selectedIndex, constants_1.cssClasses.MENU_SELECTED_LIST_ITEM);
|
6161 | }
|
6162 | this.adapter_.addClassToElementAtIndex(index, constants_1.cssClasses.MENU_SELECTED_LIST_ITEM);
|
6163 | this.adapter_.addAttributeToElementAtIndex(index, constants_1.strings.ARIA_SELECTED_ATTR, "true");
|
6164 | };
|
6165 | MDCMenuFoundation.prototype.getSelectionGroup_ = function(listItem) {
|
6166 | var parent = this.adapter_.getParentElement(listItem);
|
6167 | if (!parent) {
|
6168 | return null;
|
6169 | }
|
6170 | var isGroup = this.adapter_.elementContainsClass(parent, constants_1.cssClasses.MENU_SELECTION_GROUP);
|
6171 | while (!isGroup && parent && !this.adapter_.elementContainsClass(parent, foundation_2.MDCListFoundation.cssClasses.ROOT)) {
|
6172 | parent = this.adapter_.getParentElement(parent);
|
6173 | isGroup = parent ? this.adapter_.elementContainsClass(parent, constants_1.cssClasses.MENU_SELECTION_GROUP) : false;
|
6174 | }
|
6175 | if (isGroup) {
|
6176 | return parent;
|
6177 | } else {
|
6178 | return null;
|
6179 | }
|
6180 | };
|
6181 | return MDCMenuFoundation;
|
6182 | }(foundation_1.MDCFoundation);
|
6183 | exports.MDCMenuFoundation = MDCMenuFoundation;
|
6184 | exports.default = MDCMenuFoundation;
|
6185 | }, function(module, exports, __webpack_require__) {
|
6186 | "use strict";
|
6187 | Object.defineProperty(exports, "__esModule", {
|
6188 | value: true
|
6189 | });
|
6190 | var strings = {
|
6191 | NOTCH_ELEMENT_SELECTOR: ".mdc-notched-outline__notch"
|
6192 | };
|
6193 | exports.strings = strings;
|
6194 | var numbers = {
|
6195 | NOTCH_ELEMENT_PADDING: 8
|
6196 | };
|
6197 | exports.numbers = numbers;
|
6198 | var cssClasses = {
|
6199 | NO_LABEL: "mdc-notched-outline--no-label",
|
6200 | OUTLINE_NOTCHED: "mdc-notched-outline--notched",
|
6201 | OUTLINE_UPGRADED: "mdc-notched-outline--upgraded"
|
6202 | };
|
6203 | exports.cssClasses = cssClasses;
|
6204 | }, function(module, exports, __webpack_require__) {
|
6205 | "use strict";
|
6206 | var __extends = this && this.__extends || function() {
|
6207 | var _extendStatics = function extendStatics(d, b) {
|
6208 | _extendStatics = Object.setPrototypeOf || {
|
6209 | __proto__: []
|
6210 | } instanceof Array && function(d, b) {
|
6211 | d.__proto__ = b;
|
6212 | } || function(d, b) {
|
6213 | for (var p in b) {
|
6214 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
6215 | }
|
6216 | };
|
6217 | return _extendStatics(d, b);
|
6218 | };
|
6219 | return function(d, b) {
|
6220 | _extendStatics(d, b);
|
6221 | function __() {
|
6222 | this.constructor = d;
|
6223 | }
|
6224 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
6225 | };
|
6226 | }();
|
6227 | var __assign = this && this.__assign || function() {
|
6228 | __assign = Object.assign || function(t) {
|
6229 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
6230 | s = arguments[i];
|
6231 | for (var p in s) {
|
6232 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
6233 | }
|
6234 | }
|
6235 | return t;
|
6236 | };
|
6237 | return __assign.apply(this, arguments);
|
6238 | };
|
6239 | Object.defineProperty(exports, "__esModule", {
|
6240 | value: true
|
6241 | });
|
6242 | var foundation_1 = __webpack_require__(0);
|
6243 | var constants_1 = __webpack_require__(46);
|
6244 | var MDCNotchedOutlineFoundation = function(_super) {
|
6245 | __extends(MDCNotchedOutlineFoundation, _super);
|
6246 | function MDCNotchedOutlineFoundation(adapter) {
|
6247 | return _super.call(this, __assign({}, MDCNotchedOutlineFoundation.defaultAdapter, adapter)) || this;
|
6248 | }
|
6249 | Object.defineProperty(MDCNotchedOutlineFoundation, "strings", {
|
6250 | get: function get() {
|
6251 | return constants_1.strings;
|
6252 | },
|
6253 | enumerable: true,
|
6254 | configurable: true
|
6255 | });
|
6256 | Object.defineProperty(MDCNotchedOutlineFoundation, "cssClasses", {
|
6257 | get: function get() {
|
6258 | return constants_1.cssClasses;
|
6259 | },
|
6260 | enumerable: true,
|
6261 | configurable: true
|
6262 | });
|
6263 | Object.defineProperty(MDCNotchedOutlineFoundation, "numbers", {
|
6264 | get: function get() {
|
6265 | return constants_1.numbers;
|
6266 | },
|
6267 | enumerable: true,
|
6268 | configurable: true
|
6269 | });
|
6270 | Object.defineProperty(MDCNotchedOutlineFoundation, "defaultAdapter", {
|
6271 | get: function get() {
|
6272 | return {
|
6273 | addClass: function addClass() {
|
6274 | return undefined;
|
6275 | },
|
6276 | removeClass: function removeClass() {
|
6277 | return undefined;
|
6278 | },
|
6279 | setNotchWidthProperty: function setNotchWidthProperty() {
|
6280 | return undefined;
|
6281 | },
|
6282 | removeNotchWidthProperty: function removeNotchWidthProperty() {
|
6283 | return undefined;
|
6284 | }
|
6285 | };
|
6286 | },
|
6287 | enumerable: true,
|
6288 | configurable: true
|
6289 | });
|
6290 | MDCNotchedOutlineFoundation.prototype.notch = function(notchWidth) {
|
6291 | var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
|
6292 | if (notchWidth > 0) {
|
6293 | notchWidth += constants_1.numbers.NOTCH_ELEMENT_PADDING;
|
6294 | }
|
6295 | this.adapter_.setNotchWidthProperty(notchWidth);
|
6296 | this.adapter_.addClass(OUTLINE_NOTCHED);
|
6297 | };
|
6298 | MDCNotchedOutlineFoundation.prototype.closeNotch = function() {
|
6299 | var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
|
6300 | this.adapter_.removeClass(OUTLINE_NOTCHED);
|
6301 | this.adapter_.removeNotchWidthProperty();
|
6302 | };
|
6303 | return MDCNotchedOutlineFoundation;
|
6304 | }(foundation_1.MDCFoundation);
|
6305 | exports.MDCNotchedOutlineFoundation = MDCNotchedOutlineFoundation;
|
6306 | exports.default = MDCNotchedOutlineFoundation;
|
6307 | }, function(module, exports, __webpack_require__) {
|
6308 | "use strict";
|
6309 | var __extends = this && this.__extends || function() {
|
6310 | var _extendStatics = function extendStatics(d, b) {
|
6311 | _extendStatics = Object.setPrototypeOf || {
|
6312 | __proto__: []
|
6313 | } instanceof Array && function(d, b) {
|
6314 | d.__proto__ = b;
|
6315 | } || function(d, b) {
|
6316 | for (var p in b) {
|
6317 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
6318 | }
|
6319 | };
|
6320 | return _extendStatics(d, b);
|
6321 | };
|
6322 | return function(d, b) {
|
6323 | _extendStatics(d, b);
|
6324 | function __() {
|
6325 | this.constructor = d;
|
6326 | }
|
6327 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
6328 | };
|
6329 | }();
|
6330 | var __assign = this && this.__assign || function() {
|
6331 | __assign = Object.assign || function(t) {
|
6332 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
6333 | s = arguments[i];
|
6334 | for (var p in s) {
|
6335 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
6336 | }
|
6337 | }
|
6338 | return t;
|
6339 | };
|
6340 | return __assign.apply(this, arguments);
|
6341 | };
|
6342 | Object.defineProperty(exports, "__esModule", {
|
6343 | value: true
|
6344 | });
|
6345 | var foundation_1 = __webpack_require__(0);
|
6346 | var constants_1 = __webpack_require__(124);
|
6347 | var MDCRadioFoundation = function(_super) {
|
6348 | __extends(MDCRadioFoundation, _super);
|
6349 | function MDCRadioFoundation(adapter) {
|
6350 | return _super.call(this, __assign({}, MDCRadioFoundation.defaultAdapter, adapter)) || this;
|
6351 | }
|
6352 | Object.defineProperty(MDCRadioFoundation, "cssClasses", {
|
6353 | get: function get() {
|
6354 | return constants_1.cssClasses;
|
6355 | },
|
6356 | enumerable: true,
|
6357 | configurable: true
|
6358 | });
|
6359 | Object.defineProperty(MDCRadioFoundation, "strings", {
|
6360 | get: function get() {
|
6361 | return constants_1.strings;
|
6362 | },
|
6363 | enumerable: true,
|
6364 | configurable: true
|
6365 | });
|
6366 | Object.defineProperty(MDCRadioFoundation, "defaultAdapter", {
|
6367 | get: function get() {
|
6368 | return {
|
6369 | addClass: function addClass() {
|
6370 | return undefined;
|
6371 | },
|
6372 | removeClass: function removeClass() {
|
6373 | return undefined;
|
6374 | },
|
6375 | setNativeControlDisabled: function setNativeControlDisabled() {
|
6376 | return undefined;
|
6377 | }
|
6378 | };
|
6379 | },
|
6380 | enumerable: true,
|
6381 | configurable: true
|
6382 | });
|
6383 | MDCRadioFoundation.prototype.setDisabled = function(disabled) {
|
6384 | var DISABLED = MDCRadioFoundation.cssClasses.DISABLED;
|
6385 | this.adapter_.setNativeControlDisabled(disabled);
|
6386 | if (disabled) {
|
6387 | this.adapter_.addClass(DISABLED);
|
6388 | } else {
|
6389 | this.adapter_.removeClass(DISABLED);
|
6390 | }
|
6391 | };
|
6392 | return MDCRadioFoundation;
|
6393 | }(foundation_1.MDCFoundation);
|
6394 | exports.MDCRadioFoundation = MDCRadioFoundation;
|
6395 | exports.default = MDCRadioFoundation;
|
6396 | }, function(module, exports, __webpack_require__) {
|
6397 | "use strict";
|
6398 | Object.defineProperty(exports, "__esModule", {
|
6399 | value: true
|
6400 | });
|
6401 | var cssClasses = {
|
6402 | DISABLED: "mdc-select--disabled",
|
6403 | FOCUSED: "mdc-select--focused",
|
6404 | INVALID: "mdc-select--invalid",
|
6405 | OUTLINED: "mdc-select--outlined",
|
6406 | REQUIRED: "mdc-select--required",
|
6407 | ROOT: "mdc-select",
|
6408 | SELECTED_ITEM_CLASS: "mdc-list-item--selected",
|
6409 | WITH_LEADING_ICON: "mdc-select--with-leading-icon"
|
6410 | };
|
6411 | exports.cssClasses = cssClasses;
|
6412 | var strings = {
|
6413 | ARIA_CONTROLS: "aria-controls",
|
6414 | ARIA_SELECTED_ATTR: "aria-selected",
|
6415 | CHANGE_EVENT: "MDCSelect:change",
|
6416 | ENHANCED_VALUE_ATTR: "data-value",
|
6417 | HIDDEN_INPUT_SELECTOR: 'input[type="hidden"]',
|
6418 | LABEL_SELECTOR: ".mdc-floating-label",
|
6419 | LEADING_ICON_SELECTOR: ".mdc-select__icon",
|
6420 | LINE_RIPPLE_SELECTOR: ".mdc-line-ripple",
|
6421 | MENU_SELECTOR: ".mdc-select__menu",
|
6422 | NATIVE_CONTROL_SELECTOR: ".mdc-select__native-control",
|
6423 | OUTLINE_SELECTOR: ".mdc-notched-outline",
|
6424 | SELECTED_ITEM_SELECTOR: "." + cssClasses.SELECTED_ITEM_CLASS,
|
6425 | SELECTED_TEXT_SELECTOR: ".mdc-select__selected-text"
|
6426 | };
|
6427 | exports.strings = strings;
|
6428 | var numbers = {
|
6429 | LABEL_SCALE: .75
|
6430 | };
|
6431 | exports.numbers = numbers;
|
6432 | }, function(module, exports, __webpack_require__) {
|
6433 | "use strict";
|
6434 | var __extends = this && this.__extends || function() {
|
6435 | var _extendStatics = function extendStatics(d, b) {
|
6436 | _extendStatics = Object.setPrototypeOf || {
|
6437 | __proto__: []
|
6438 | } instanceof Array && function(d, b) {
|
6439 | d.__proto__ = b;
|
6440 | } || function(d, b) {
|
6441 | for (var p in b) {
|
6442 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
6443 | }
|
6444 | };
|
6445 | return _extendStatics(d, b);
|
6446 | };
|
6447 | return function(d, b) {
|
6448 | _extendStatics(d, b);
|
6449 | function __() {
|
6450 | this.constructor = d;
|
6451 | }
|
6452 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
6453 | };
|
6454 | }();
|
6455 | var __assign = this && this.__assign || function() {
|
6456 | __assign = Object.assign || function(t) {
|
6457 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
6458 | s = arguments[i];
|
6459 | for (var p in s) {
|
6460 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
6461 | }
|
6462 | }
|
6463 | return t;
|
6464 | };
|
6465 | return __assign.apply(this, arguments);
|
6466 | };
|
6467 | Object.defineProperty(exports, "__esModule", {
|
6468 | value: true
|
6469 | });
|
6470 | var foundation_1 = __webpack_require__(0);
|
6471 | var constants_1 = __webpack_require__(49);
|
6472 | var MDCSelectFoundation = function(_super) {
|
6473 | __extends(MDCSelectFoundation, _super);
|
6474 | function MDCSelectFoundation(adapter, foundationMap) {
|
6475 | if (foundationMap === void 0) {
|
6476 | foundationMap = {};
|
6477 | }
|
6478 | var _this = _super.call(this, __assign({}, MDCSelectFoundation.defaultAdapter, adapter)) || this;
|
6479 | _this.leadingIcon_ = foundationMap.leadingIcon;
|
6480 | _this.helperText_ = foundationMap.helperText;
|
6481 | return _this;
|
6482 | }
|
6483 | Object.defineProperty(MDCSelectFoundation, "cssClasses", {
|
6484 | get: function get() {
|
6485 | return constants_1.cssClasses;
|
6486 | },
|
6487 | enumerable: true,
|
6488 | configurable: true
|
6489 | });
|
6490 | Object.defineProperty(MDCSelectFoundation, "numbers", {
|
6491 | get: function get() {
|
6492 | return constants_1.numbers;
|
6493 | },
|
6494 | enumerable: true,
|
6495 | configurable: true
|
6496 | });
|
6497 | Object.defineProperty(MDCSelectFoundation, "strings", {
|
6498 | get: function get() {
|
6499 | return constants_1.strings;
|
6500 | },
|
6501 | enumerable: true,
|
6502 | configurable: true
|
6503 | });
|
6504 | Object.defineProperty(MDCSelectFoundation, "defaultAdapter", {
|
6505 | get: function get() {
|
6506 | return {
|
6507 | addClass: function addClass() {
|
6508 | return undefined;
|
6509 | },
|
6510 | removeClass: function removeClass() {
|
6511 | return undefined;
|
6512 | },
|
6513 | hasClass: function hasClass() {
|
6514 | return false;
|
6515 | },
|
6516 | activateBottomLine: function activateBottomLine() {
|
6517 | return undefined;
|
6518 | },
|
6519 | deactivateBottomLine: function deactivateBottomLine() {
|
6520 | return undefined;
|
6521 | },
|
6522 | setValue: function setValue() {
|
6523 | return undefined;
|
6524 | },
|
6525 | getValue: function getValue() {
|
6526 | return "";
|
6527 | },
|
6528 | floatLabel: function floatLabel() {
|
6529 | return undefined;
|
6530 | },
|
6531 | getLabelWidth: function getLabelWidth() {
|
6532 | return 0;
|
6533 | },
|
6534 | hasOutline: function hasOutline() {
|
6535 | return false;
|
6536 | },
|
6537 | notchOutline: function notchOutline() {
|
6538 | return undefined;
|
6539 | },
|
6540 | closeOutline: function closeOutline() {
|
6541 | return undefined;
|
6542 | },
|
6543 | openMenu: function openMenu() {
|
6544 | return undefined;
|
6545 | },
|
6546 | closeMenu: function closeMenu() {
|
6547 | return undefined;
|
6548 | },
|
6549 | isMenuOpen: function isMenuOpen() {
|
6550 | return false;
|
6551 | },
|
6552 | setSelectedIndex: function setSelectedIndex() {
|
6553 | return undefined;
|
6554 | },
|
6555 | setDisabled: function setDisabled() {
|
6556 | return undefined;
|
6557 | },
|
6558 | setRippleCenter: function setRippleCenter() {
|
6559 | return undefined;
|
6560 | },
|
6561 | notifyChange: function notifyChange() {
|
6562 | return undefined;
|
6563 | },
|
6564 | checkValidity: function checkValidity() {
|
6565 | return false;
|
6566 | },
|
6567 | setValid: function setValid() {
|
6568 | return undefined;
|
6569 | }
|
6570 | };
|
6571 | },
|
6572 | enumerable: true,
|
6573 | configurable: true
|
6574 | });
|
6575 | MDCSelectFoundation.prototype.setSelectedIndex = function(index) {
|
6576 | this.adapter_.setSelectedIndex(index);
|
6577 | this.adapter_.closeMenu();
|
6578 | var didChange = true;
|
6579 | this.handleChange(didChange);
|
6580 | };
|
6581 | MDCSelectFoundation.prototype.setValue = function(value) {
|
6582 | this.adapter_.setValue(value);
|
6583 | var didChange = true;
|
6584 | this.handleChange(didChange);
|
6585 | };
|
6586 | MDCSelectFoundation.prototype.getValue = function() {
|
6587 | return this.adapter_.getValue();
|
6588 | };
|
6589 | MDCSelectFoundation.prototype.setDisabled = function(isDisabled) {
|
6590 | if (isDisabled) {
|
6591 | this.adapter_.addClass(constants_1.cssClasses.DISABLED);
|
6592 | } else {
|
6593 | this.adapter_.removeClass(constants_1.cssClasses.DISABLED);
|
6594 | }
|
6595 | this.adapter_.setDisabled(isDisabled);
|
6596 | this.adapter_.closeMenu();
|
6597 | if (this.leadingIcon_) {
|
6598 | this.leadingIcon_.setDisabled(isDisabled);
|
6599 | }
|
6600 | };
|
6601 | MDCSelectFoundation.prototype.setHelperTextContent = function(content) {
|
6602 | if (this.helperText_) {
|
6603 | this.helperText_.setContent(content);
|
6604 | }
|
6605 | };
|
6606 | MDCSelectFoundation.prototype.layout = function() {
|
6607 | var openNotch = this.getValue().length > 0;
|
6608 | this.notchOutline(openNotch);
|
6609 | };
|
6610 | MDCSelectFoundation.prototype.handleChange = function(didChange) {
|
6611 | if (didChange === void 0) {
|
6612 | didChange = true;
|
6613 | }
|
6614 | var value = this.getValue();
|
6615 | var optionHasValue = value.length > 0;
|
6616 | var isRequired = this.adapter_.hasClass(constants_1.cssClasses.REQUIRED);
|
6617 | this.notchOutline(optionHasValue);
|
6618 | if (!this.adapter_.hasClass(constants_1.cssClasses.FOCUSED)) {
|
6619 | this.adapter_.floatLabel(optionHasValue);
|
6620 | }
|
6621 | if (didChange) {
|
6622 | this.adapter_.notifyChange(value);
|
6623 | if (isRequired) {
|
6624 | this.setValid(this.isValid());
|
6625 | if (this.helperText_) {
|
6626 | this.helperText_.setValidity(this.isValid());
|
6627 | }
|
6628 | }
|
6629 | }
|
6630 | };
|
6631 | MDCSelectFoundation.prototype.handleFocus = function() {
|
6632 | this.adapter_.addClass(constants_1.cssClasses.FOCUSED);
|
6633 | this.adapter_.floatLabel(true);
|
6634 | this.notchOutline(true);
|
6635 | this.adapter_.activateBottomLine();
|
6636 | if (this.helperText_) {
|
6637 | this.helperText_.showToScreenReader();
|
6638 | }
|
6639 | };
|
6640 | MDCSelectFoundation.prototype.handleBlur = function() {
|
6641 | if (this.adapter_.isMenuOpen()) {
|
6642 | return;
|
6643 | }
|
6644 | this.adapter_.removeClass(constants_1.cssClasses.FOCUSED);
|
6645 | this.handleChange(false);
|
6646 | this.adapter_.deactivateBottomLine();
|
6647 | var isRequired = this.adapter_.hasClass(constants_1.cssClasses.REQUIRED);
|
6648 | if (isRequired) {
|
6649 | this.setValid(this.isValid());
|
6650 | if (this.helperText_) {
|
6651 | this.helperText_.setValidity(this.isValid());
|
6652 | }
|
6653 | }
|
6654 | };
|
6655 | MDCSelectFoundation.prototype.handleClick = function(normalizedX) {
|
6656 | if (this.adapter_.isMenuOpen()) {
|
6657 | return;
|
6658 | }
|
6659 | this.adapter_.setRippleCenter(normalizedX);
|
6660 | this.adapter_.openMenu();
|
6661 | };
|
6662 | MDCSelectFoundation.prototype.handleKeydown = function(event) {
|
6663 | if (this.adapter_.isMenuOpen()) {
|
6664 | return;
|
6665 | }
|
6666 | var isEnter = event.key === "Enter" || event.keyCode === 13;
|
6667 | var isSpace = event.key === "Space" || event.keyCode === 32;
|
6668 | var arrowUp = event.key === "ArrowUp" || event.keyCode === 38;
|
6669 | var arrowDown = event.key === "ArrowDown" || event.keyCode === 40;
|
6670 | if (this.adapter_.hasClass(constants_1.cssClasses.FOCUSED) && (isEnter || isSpace || arrowUp || arrowDown)) {
|
6671 | this.adapter_.openMenu();
|
6672 | event.preventDefault();
|
6673 | }
|
6674 | };
|
6675 | MDCSelectFoundation.prototype.notchOutline = function(openNotch) {
|
6676 | if (!this.adapter_.hasOutline()) {
|
6677 | return;
|
6678 | }
|
6679 | var isFocused = this.adapter_.hasClass(constants_1.cssClasses.FOCUSED);
|
6680 | if (openNotch) {
|
6681 | var labelScale = constants_1.numbers.LABEL_SCALE;
|
6682 | var labelWidth = this.adapter_.getLabelWidth() * labelScale;
|
6683 | this.adapter_.notchOutline(labelWidth);
|
6684 | } else if (!isFocused) {
|
6685 | this.adapter_.closeOutline();
|
6686 | }
|
6687 | };
|
6688 | MDCSelectFoundation.prototype.setLeadingIconAriaLabel = function(label) {
|
6689 | if (this.leadingIcon_) {
|
6690 | this.leadingIcon_.setAriaLabel(label);
|
6691 | }
|
6692 | };
|
6693 | MDCSelectFoundation.prototype.setLeadingIconContent = function(content) {
|
6694 | if (this.leadingIcon_) {
|
6695 | this.leadingIcon_.setContent(content);
|
6696 | }
|
6697 | };
|
6698 | MDCSelectFoundation.prototype.setValid = function(isValid) {
|
6699 | this.adapter_.setValid(isValid);
|
6700 | };
|
6701 | MDCSelectFoundation.prototype.isValid = function() {
|
6702 | return this.adapter_.checkValidity();
|
6703 | };
|
6704 | return MDCSelectFoundation;
|
6705 | }(foundation_1.MDCFoundation);
|
6706 | exports.MDCSelectFoundation = MDCSelectFoundation;
|
6707 | exports.default = MDCSelectFoundation;
|
6708 | }, function(module, exports, __webpack_require__) {
|
6709 | "use strict";
|
6710 | var __extends = this && this.__extends || function() {
|
6711 | var _extendStatics = function extendStatics(d, b) {
|
6712 | _extendStatics = Object.setPrototypeOf || {
|
6713 | __proto__: []
|
6714 | } instanceof Array && function(d, b) {
|
6715 | d.__proto__ = b;
|
6716 | } || function(d, b) {
|
6717 | for (var p in b) {
|
6718 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
6719 | }
|
6720 | };
|
6721 | return _extendStatics(d, b);
|
6722 | };
|
6723 | return function(d, b) {
|
6724 | _extendStatics(d, b);
|
6725 | function __() {
|
6726 | this.constructor = d;
|
6727 | }
|
6728 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
6729 | };
|
6730 | }();
|
6731 | Object.defineProperty(exports, "__esModule", {
|
6732 | value: true
|
6733 | });
|
6734 | var component_1 = __webpack_require__(1);
|
6735 | var foundation_1 = __webpack_require__(52);
|
6736 | var MDCSelectHelperText = function(_super) {
|
6737 | __extends(MDCSelectHelperText, _super);
|
6738 | function MDCSelectHelperText() {
|
6739 | return _super !== null && _super.apply(this, arguments) || this;
|
6740 | }
|
6741 | MDCSelectHelperText.attachTo = function(root) {
|
6742 | return new MDCSelectHelperText(root);
|
6743 | };
|
6744 | Object.defineProperty(MDCSelectHelperText.prototype, "foundation", {
|
6745 | get: function get() {
|
6746 | return this.foundation_;
|
6747 | },
|
6748 | enumerable: true,
|
6749 | configurable: true
|
6750 | });
|
6751 | MDCSelectHelperText.prototype.getDefaultFoundation = function() {
|
6752 | var _this = this;
|
6753 | var adapter = {
|
6754 | addClass: function addClass(className) {
|
6755 | return _this.root_.classList.add(className);
|
6756 | },
|
6757 | removeClass: function removeClass(className) {
|
6758 | return _this.root_.classList.remove(className);
|
6759 | },
|
6760 | hasClass: function hasClass(className) {
|
6761 | return _this.root_.classList.contains(className);
|
6762 | },
|
6763 | setAttr: function setAttr(attr, value) {
|
6764 | return _this.root_.setAttribute(attr, value);
|
6765 | },
|
6766 | removeAttr: function removeAttr(attr) {
|
6767 | return _this.root_.removeAttribute(attr);
|
6768 | },
|
6769 | setContent: function setContent(content) {
|
6770 | _this.root_.textContent = content;
|
6771 | }
|
6772 | };
|
6773 | return new foundation_1.MDCSelectHelperTextFoundation(adapter);
|
6774 | };
|
6775 | return MDCSelectHelperText;
|
6776 | }(component_1.MDCComponent);
|
6777 | exports.MDCSelectHelperText = MDCSelectHelperText;
|
6778 | }, function(module, exports, __webpack_require__) {
|
6779 | "use strict";
|
6780 | var __extends = this && this.__extends || function() {
|
6781 | var _extendStatics = function extendStatics(d, b) {
|
6782 | _extendStatics = Object.setPrototypeOf || {
|
6783 | __proto__: []
|
6784 | } instanceof Array && function(d, b) {
|
6785 | d.__proto__ = b;
|
6786 | } || function(d, b) {
|
6787 | for (var p in b) {
|
6788 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
6789 | }
|
6790 | };
|
6791 | return _extendStatics(d, b);
|
6792 | };
|
6793 | return function(d, b) {
|
6794 | _extendStatics(d, b);
|
6795 | function __() {
|
6796 | this.constructor = d;
|
6797 | }
|
6798 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
6799 | };
|
6800 | }();
|
6801 | var __assign = this && this.__assign || function() {
|
6802 | __assign = Object.assign || function(t) {
|
6803 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
6804 | s = arguments[i];
|
6805 | for (var p in s) {
|
6806 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
6807 | }
|
6808 | }
|
6809 | return t;
|
6810 | };
|
6811 | return __assign.apply(this, arguments);
|
6812 | };
|
6813 | Object.defineProperty(exports, "__esModule", {
|
6814 | value: true
|
6815 | });
|
6816 | var foundation_1 = __webpack_require__(0);
|
6817 | var constants_1 = __webpack_require__(128);
|
6818 | var MDCSelectHelperTextFoundation = function(_super) {
|
6819 | __extends(MDCSelectHelperTextFoundation, _super);
|
6820 | function MDCSelectHelperTextFoundation(adapter) {
|
6821 | return _super.call(this, __assign({}, MDCSelectHelperTextFoundation.defaultAdapter, adapter)) || this;
|
6822 | }
|
6823 | Object.defineProperty(MDCSelectHelperTextFoundation, "cssClasses", {
|
6824 | get: function get() {
|
6825 | return constants_1.cssClasses;
|
6826 | },
|
6827 | enumerable: true,
|
6828 | configurable: true
|
6829 | });
|
6830 | Object.defineProperty(MDCSelectHelperTextFoundation, "strings", {
|
6831 | get: function get() {
|
6832 | return constants_1.strings;
|
6833 | },
|
6834 | enumerable: true,
|
6835 | configurable: true
|
6836 | });
|
6837 | Object.defineProperty(MDCSelectHelperTextFoundation, "defaultAdapter", {
|
6838 | get: function get() {
|
6839 | return {
|
6840 | addClass: function addClass() {
|
6841 | return undefined;
|
6842 | },
|
6843 | removeClass: function removeClass() {
|
6844 | return undefined;
|
6845 | },
|
6846 | hasClass: function hasClass() {
|
6847 | return false;
|
6848 | },
|
6849 | setAttr: function setAttr() {
|
6850 | return undefined;
|
6851 | },
|
6852 | removeAttr: function removeAttr() {
|
6853 | return undefined;
|
6854 | },
|
6855 | setContent: function setContent() {
|
6856 | return undefined;
|
6857 | }
|
6858 | };
|
6859 | },
|
6860 | enumerable: true,
|
6861 | configurable: true
|
6862 | });
|
6863 | MDCSelectHelperTextFoundation.prototype.setContent = function(content) {
|
6864 | this.adapter_.setContent(content);
|
6865 | };
|
6866 | MDCSelectHelperTextFoundation.prototype.setPersistent = function(isPersistent) {
|
6867 | if (isPersistent) {
|
6868 | this.adapter_.addClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
|
6869 | } else {
|
6870 | this.adapter_.removeClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
|
6871 | }
|
6872 | };
|
6873 | MDCSelectHelperTextFoundation.prototype.setValidation = function(isValidation) {
|
6874 | if (isValidation) {
|
6875 | this.adapter_.addClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
|
6876 | } else {
|
6877 | this.adapter_.removeClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
|
6878 | }
|
6879 | };
|
6880 | MDCSelectHelperTextFoundation.prototype.showToScreenReader = function() {
|
6881 | this.adapter_.removeAttr(constants_1.strings.ARIA_HIDDEN);
|
6882 | };
|
6883 | MDCSelectHelperTextFoundation.prototype.setValidity = function(selectIsValid) {
|
6884 | var helperTextIsPersistent = this.adapter_.hasClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
|
6885 | var helperTextIsValidationMsg = this.adapter_.hasClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
|
6886 | var validationMsgNeedsDisplay = helperTextIsValidationMsg && !selectIsValid;
|
6887 | if (validationMsgNeedsDisplay) {
|
6888 | this.adapter_.setAttr(constants_1.strings.ROLE, "alert");
|
6889 | } else {
|
6890 | this.adapter_.removeAttr(constants_1.strings.ROLE);
|
6891 | }
|
6892 | if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
|
6893 | this.hide_();
|
6894 | }
|
6895 | };
|
6896 | MDCSelectHelperTextFoundation.prototype.hide_ = function() {
|
6897 | this.adapter_.setAttr(constants_1.strings.ARIA_HIDDEN, "true");
|
6898 | };
|
6899 | return MDCSelectHelperTextFoundation;
|
6900 | }(foundation_1.MDCFoundation);
|
6901 | exports.MDCSelectHelperTextFoundation = MDCSelectHelperTextFoundation;
|
6902 | exports.default = MDCSelectHelperTextFoundation;
|
6903 | }, function(module, exports, __webpack_require__) {
|
6904 | "use strict";
|
6905 | var __extends = this && this.__extends || function() {
|
6906 | var _extendStatics = function extendStatics(d, b) {
|
6907 | _extendStatics = Object.setPrototypeOf || {
|
6908 | __proto__: []
|
6909 | } instanceof Array && function(d, b) {
|
6910 | d.__proto__ = b;
|
6911 | } || function(d, b) {
|
6912 | for (var p in b) {
|
6913 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
6914 | }
|
6915 | };
|
6916 | return _extendStatics(d, b);
|
6917 | };
|
6918 | return function(d, b) {
|
6919 | _extendStatics(d, b);
|
6920 | function __() {
|
6921 | this.constructor = d;
|
6922 | }
|
6923 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
6924 | };
|
6925 | }();
|
6926 | Object.defineProperty(exports, "__esModule", {
|
6927 | value: true
|
6928 | });
|
6929 | var component_1 = __webpack_require__(1);
|
6930 | var foundation_1 = __webpack_require__(54);
|
6931 | var MDCSelectIcon = function(_super) {
|
6932 | __extends(MDCSelectIcon, _super);
|
6933 | function MDCSelectIcon() {
|
6934 | return _super !== null && _super.apply(this, arguments) || this;
|
6935 | }
|
6936 | MDCSelectIcon.attachTo = function(root) {
|
6937 | return new MDCSelectIcon(root);
|
6938 | };
|
6939 | Object.defineProperty(MDCSelectIcon.prototype, "foundation", {
|
6940 | get: function get() {
|
6941 | return this.foundation_;
|
6942 | },
|
6943 | enumerable: true,
|
6944 | configurable: true
|
6945 | });
|
6946 | MDCSelectIcon.prototype.getDefaultFoundation = function() {
|
6947 | var _this = this;
|
6948 | var adapter = {
|
6949 | getAttr: function getAttr(attr) {
|
6950 | return _this.root_.getAttribute(attr);
|
6951 | },
|
6952 | setAttr: function setAttr(attr, value) {
|
6953 | return _this.root_.setAttribute(attr, value);
|
6954 | },
|
6955 | removeAttr: function removeAttr(attr) {
|
6956 | return _this.root_.removeAttribute(attr);
|
6957 | },
|
6958 | setContent: function setContent(content) {
|
6959 | _this.root_.textContent = content;
|
6960 | },
|
6961 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
6962 | return _this.listen(evtType, handler);
|
6963 | },
|
6964 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
6965 | return _this.unlisten(evtType, handler);
|
6966 | },
|
6967 | notifyIconAction: function notifyIconAction() {
|
6968 | return _this.emit(foundation_1.MDCSelectIconFoundation.strings.ICON_EVENT, {}, true);
|
6969 | }
|
6970 | };
|
6971 | return new foundation_1.MDCSelectIconFoundation(adapter);
|
6972 | };
|
6973 | return MDCSelectIcon;
|
6974 | }(component_1.MDCComponent);
|
6975 | exports.MDCSelectIcon = MDCSelectIcon;
|
6976 | }, function(module, exports, __webpack_require__) {
|
6977 | "use strict";
|
6978 | var __extends = this && this.__extends || function() {
|
6979 | var _extendStatics = function extendStatics(d, b) {
|
6980 | _extendStatics = Object.setPrototypeOf || {
|
6981 | __proto__: []
|
6982 | } instanceof Array && function(d, b) {
|
6983 | d.__proto__ = b;
|
6984 | } || function(d, b) {
|
6985 | for (var p in b) {
|
6986 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
6987 | }
|
6988 | };
|
6989 | return _extendStatics(d, b);
|
6990 | };
|
6991 | return function(d, b) {
|
6992 | _extendStatics(d, b);
|
6993 | function __() {
|
6994 | this.constructor = d;
|
6995 | }
|
6996 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
6997 | };
|
6998 | }();
|
6999 | var __assign = this && this.__assign || function() {
|
7000 | __assign = Object.assign || function(t) {
|
7001 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
7002 | s = arguments[i];
|
7003 | for (var p in s) {
|
7004 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
7005 | }
|
7006 | }
|
7007 | return t;
|
7008 | };
|
7009 | return __assign.apply(this, arguments);
|
7010 | };
|
7011 | Object.defineProperty(exports, "__esModule", {
|
7012 | value: true
|
7013 | });
|
7014 | var foundation_1 = __webpack_require__(0);
|
7015 | var constants_1 = __webpack_require__(129);
|
7016 | var INTERACTION_EVENTS = [ "click", "keydown" ];
|
7017 | var MDCSelectIconFoundation = function(_super) {
|
7018 | __extends(MDCSelectIconFoundation, _super);
|
7019 | function MDCSelectIconFoundation(adapter) {
|
7020 | var _this = _super.call(this, __assign({}, MDCSelectIconFoundation.defaultAdapter, adapter)) || this;
|
7021 | _this.savedTabIndex_ = null;
|
7022 | _this.interactionHandler_ = function(evt) {
|
7023 | return _this.handleInteraction(evt);
|
7024 | };
|
7025 | return _this;
|
7026 | }
|
7027 | Object.defineProperty(MDCSelectIconFoundation, "strings", {
|
7028 | get: function get() {
|
7029 | return constants_1.strings;
|
7030 | },
|
7031 | enumerable: true,
|
7032 | configurable: true
|
7033 | });
|
7034 | Object.defineProperty(MDCSelectIconFoundation, "defaultAdapter", {
|
7035 | get: function get() {
|
7036 | return {
|
7037 | getAttr: function getAttr() {
|
7038 | return null;
|
7039 | },
|
7040 | setAttr: function setAttr() {
|
7041 | return undefined;
|
7042 | },
|
7043 | removeAttr: function removeAttr() {
|
7044 | return undefined;
|
7045 | },
|
7046 | setContent: function setContent() {
|
7047 | return undefined;
|
7048 | },
|
7049 | registerInteractionHandler: function registerInteractionHandler() {
|
7050 | return undefined;
|
7051 | },
|
7052 | deregisterInteractionHandler: function deregisterInteractionHandler() {
|
7053 | return undefined;
|
7054 | },
|
7055 | notifyIconAction: function notifyIconAction() {
|
7056 | return undefined;
|
7057 | }
|
7058 | };
|
7059 | },
|
7060 | enumerable: true,
|
7061 | configurable: true
|
7062 | });
|
7063 | MDCSelectIconFoundation.prototype.init = function() {
|
7064 | var _this = this;
|
7065 | this.savedTabIndex_ = this.adapter_.getAttr("tabindex");
|
7066 | INTERACTION_EVENTS.forEach(function(evtType) {
|
7067 | _this.adapter_.registerInteractionHandler(evtType, _this.interactionHandler_);
|
7068 | });
|
7069 | };
|
7070 | MDCSelectIconFoundation.prototype.destroy = function() {
|
7071 | var _this = this;
|
7072 | INTERACTION_EVENTS.forEach(function(evtType) {
|
7073 | _this.adapter_.deregisterInteractionHandler(evtType, _this.interactionHandler_);
|
7074 | });
|
7075 | };
|
7076 | MDCSelectIconFoundation.prototype.setDisabled = function(disabled) {
|
7077 | if (!this.savedTabIndex_) {
|
7078 | return;
|
7079 | }
|
7080 | if (disabled) {
|
7081 | this.adapter_.setAttr("tabindex", "-1");
|
7082 | this.adapter_.removeAttr("role");
|
7083 | } else {
|
7084 | this.adapter_.setAttr("tabindex", this.savedTabIndex_);
|
7085 | this.adapter_.setAttr("role", constants_1.strings.ICON_ROLE);
|
7086 | }
|
7087 | };
|
7088 | MDCSelectIconFoundation.prototype.setAriaLabel = function(label) {
|
7089 | this.adapter_.setAttr("aria-label", label);
|
7090 | };
|
7091 | MDCSelectIconFoundation.prototype.setContent = function(content) {
|
7092 | this.adapter_.setContent(content);
|
7093 | };
|
7094 | MDCSelectIconFoundation.prototype.handleInteraction = function(evt) {
|
7095 | var isEnterKey = evt.key === "Enter" || evt.keyCode === 13;
|
7096 | if (evt.type === "click" || isEnterKey) {
|
7097 | this.adapter_.notifyIconAction();
|
7098 | }
|
7099 | };
|
7100 | return MDCSelectIconFoundation;
|
7101 | }(foundation_1.MDCFoundation);
|
7102 | exports.MDCSelectIconFoundation = MDCSelectIconFoundation;
|
7103 | exports.default = MDCSelectIconFoundation;
|
7104 | }, function(module, exports, __webpack_require__) {
|
7105 | "use strict";
|
7106 | Object.defineProperty(exports, "__esModule", {
|
7107 | value: true
|
7108 | });
|
7109 | var cssClasses = {
|
7110 | ACTIVE: "mdc-slider--active",
|
7111 | DISABLED: "mdc-slider--disabled",
|
7112 | DISCRETE: "mdc-slider--discrete",
|
7113 | FOCUS: "mdc-slider--focus",
|
7114 | HAS_TRACK_MARKER: "mdc-slider--display-markers",
|
7115 | IN_TRANSIT: "mdc-slider--in-transit",
|
7116 | IS_DISCRETE: "mdc-slider--discrete"
|
7117 | };
|
7118 | exports.cssClasses = cssClasses;
|
7119 | var strings = {
|
7120 | ARIA_DISABLED: "aria-disabled",
|
7121 | ARIA_VALUEMAX: "aria-valuemax",
|
7122 | ARIA_VALUEMIN: "aria-valuemin",
|
7123 | ARIA_VALUENOW: "aria-valuenow",
|
7124 | CHANGE_EVENT: "MDCSlider:change",
|
7125 | INPUT_EVENT: "MDCSlider:input",
|
7126 | LAST_TRACK_MARKER_SELECTOR: ".mdc-slider__track-marker:last-child",
|
7127 | PIN_VALUE_MARKER_SELECTOR: ".mdc-slider__pin-value-marker",
|
7128 | STEP_DATA_ATTR: "data-step",
|
7129 | THUMB_CONTAINER_SELECTOR: ".mdc-slider__thumb-container",
|
7130 | TRACK_MARKER_CONTAINER_SELECTOR: ".mdc-slider__track-marker-container",
|
7131 | TRACK_SELECTOR: ".mdc-slider__track"
|
7132 | };
|
7133 | exports.strings = strings;
|
7134 | var numbers = {
|
7135 | PAGE_FACTOR: 4
|
7136 | };
|
7137 | exports.numbers = numbers;
|
7138 | }, function(module, exports, __webpack_require__) {
|
7139 | "use strict";
|
7140 | var __extends = this && this.__extends || function() {
|
7141 | var _extendStatics = function extendStatics(d, b) {
|
7142 | _extendStatics = Object.setPrototypeOf || {
|
7143 | __proto__: []
|
7144 | } instanceof Array && function(d, b) {
|
7145 | d.__proto__ = b;
|
7146 | } || function(d, b) {
|
7147 | for (var p in b) {
|
7148 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
7149 | }
|
7150 | };
|
7151 | return _extendStatics(d, b);
|
7152 | };
|
7153 | return function(d, b) {
|
7154 | _extendStatics(d, b);
|
7155 | function __() {
|
7156 | this.constructor = d;
|
7157 | }
|
7158 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
7159 | };
|
7160 | }();
|
7161 | var __assign = this && this.__assign || function() {
|
7162 | __assign = Object.assign || function(t) {
|
7163 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
7164 | s = arguments[i];
|
7165 | for (var p in s) {
|
7166 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
7167 | }
|
7168 | }
|
7169 | return t;
|
7170 | };
|
7171 | return __assign.apply(this, arguments);
|
7172 | };
|
7173 | Object.defineProperty(exports, "__esModule", {
|
7174 | value: true
|
7175 | });
|
7176 | var util_1 = __webpack_require__(10);
|
7177 | var foundation_1 = __webpack_require__(0);
|
7178 | var constants_1 = __webpack_require__(55);
|
7179 | var DOWN_EVENTS = [ "mousedown", "pointerdown", "touchstart" ];
|
7180 | var UP_EVENTS = [ "mouseup", "pointerup", "touchend" ];
|
7181 | var MOVE_EVENT_MAP = {
|
7182 | mousedown: "mousemove",
|
7183 | pointerdown: "pointermove",
|
7184 | touchstart: "touchmove"
|
7185 | };
|
7186 | var KEY_IDS = {
|
7187 | ARROW_DOWN: "ArrowDown",
|
7188 | ARROW_LEFT: "ArrowLeft",
|
7189 | ARROW_RIGHT: "ArrowRight",
|
7190 | ARROW_UP: "ArrowUp",
|
7191 | END: "End",
|
7192 | HOME: "Home",
|
7193 | PAGE_DOWN: "PageDown",
|
7194 | PAGE_UP: "PageUp"
|
7195 | };
|
7196 | var MDCSliderFoundation = function(_super) {
|
7197 | __extends(MDCSliderFoundation, _super);
|
7198 | function MDCSliderFoundation(adapter) {
|
7199 | var _this = _super.call(this, __assign({}, MDCSliderFoundation.defaultAdapter, adapter)) || this;
|
7200 | _this.savedTabIndex_ = NaN;
|
7201 | _this.active_ = false;
|
7202 | _this.inTransit_ = false;
|
7203 | _this.isDiscrete_ = false;
|
7204 | _this.hasTrackMarker_ = false;
|
7205 | _this.handlingThumbTargetEvt_ = false;
|
7206 | _this.min_ = 0;
|
7207 | _this.max_ = 100;
|
7208 | _this.step_ = 0;
|
7209 | _this.value_ = 0;
|
7210 | _this.disabled_ = false;
|
7211 | _this.preventFocusState_ = false;
|
7212 | _this.thumbContainerPointerHandler_ = function() {
|
7213 | return _this.handlingThumbTargetEvt_ = true;
|
7214 | };
|
7215 | _this.interactionStartHandler_ = function(evt) {
|
7216 | return _this.handleDown_(evt);
|
7217 | };
|
7218 | _this.keydownHandler_ = function(evt) {
|
7219 | return _this.handleKeydown_(evt);
|
7220 | };
|
7221 | _this.focusHandler_ = function() {
|
7222 | return _this.handleFocus_();
|
7223 | };
|
7224 | _this.blurHandler_ = function() {
|
7225 | return _this.handleBlur_();
|
7226 | };
|
7227 | _this.resizeHandler_ = function() {
|
7228 | return _this.layout();
|
7229 | };
|
7230 | return _this;
|
7231 | }
|
7232 | Object.defineProperty(MDCSliderFoundation, "cssClasses", {
|
7233 | get: function get() {
|
7234 | return constants_1.cssClasses;
|
7235 | },
|
7236 | enumerable: true,
|
7237 | configurable: true
|
7238 | });
|
7239 | Object.defineProperty(MDCSliderFoundation, "strings", {
|
7240 | get: function get() {
|
7241 | return constants_1.strings;
|
7242 | },
|
7243 | enumerable: true,
|
7244 | configurable: true
|
7245 | });
|
7246 | Object.defineProperty(MDCSliderFoundation, "numbers", {
|
7247 | get: function get() {
|
7248 | return constants_1.numbers;
|
7249 | },
|
7250 | enumerable: true,
|
7251 | configurable: true
|
7252 | });
|
7253 | Object.defineProperty(MDCSliderFoundation, "defaultAdapter", {
|
7254 | get: function get() {
|
7255 | return {
|
7256 | hasClass: function hasClass() {
|
7257 | return false;
|
7258 | },
|
7259 | addClass: function addClass() {
|
7260 | return undefined;
|
7261 | },
|
7262 | removeClass: function removeClass() {
|
7263 | return undefined;
|
7264 | },
|
7265 | getAttribute: function getAttribute() {
|
7266 | return null;
|
7267 | },
|
7268 | setAttribute: function setAttribute() {
|
7269 | return undefined;
|
7270 | },
|
7271 | removeAttribute: function removeAttribute() {
|
7272 | return undefined;
|
7273 | },
|
7274 | computeBoundingRect: function computeBoundingRect() {
|
7275 | return {
|
7276 | top: 0,
|
7277 | right: 0,
|
7278 | bottom: 0,
|
7279 | left: 0,
|
7280 | width: 0,
|
7281 | height: 0
|
7282 | };
|
7283 | },
|
7284 | getTabIndex: function getTabIndex() {
|
7285 | return 0;
|
7286 | },
|
7287 | registerInteractionHandler: function registerInteractionHandler() {
|
7288 | return undefined;
|
7289 | },
|
7290 | deregisterInteractionHandler: function deregisterInteractionHandler() {
|
7291 | return undefined;
|
7292 | },
|
7293 | registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler() {
|
7294 | return undefined;
|
7295 | },
|
7296 | deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler() {
|
7297 | return undefined;
|
7298 | },
|
7299 | registerBodyInteractionHandler: function registerBodyInteractionHandler() {
|
7300 | return undefined;
|
7301 | },
|
7302 | deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler() {
|
7303 | return undefined;
|
7304 | },
|
7305 | registerResizeHandler: function registerResizeHandler() {
|
7306 | return undefined;
|
7307 | },
|
7308 | deregisterResizeHandler: function deregisterResizeHandler() {
|
7309 | return undefined;
|
7310 | },
|
7311 | notifyInput: function notifyInput() {
|
7312 | return undefined;
|
7313 | },
|
7314 | notifyChange: function notifyChange() {
|
7315 | return undefined;
|
7316 | },
|
7317 | setThumbContainerStyleProperty: function setThumbContainerStyleProperty() {
|
7318 | return undefined;
|
7319 | },
|
7320 | setTrackStyleProperty: function setTrackStyleProperty() {
|
7321 | return undefined;
|
7322 | },
|
7323 | setMarkerValue: function setMarkerValue() {
|
7324 | return undefined;
|
7325 | },
|
7326 | appendTrackMarkers: function appendTrackMarkers() {
|
7327 | return undefined;
|
7328 | },
|
7329 | removeTrackMarkers: function removeTrackMarkers() {
|
7330 | return undefined;
|
7331 | },
|
7332 | setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty() {
|
7333 | return undefined;
|
7334 | },
|
7335 | isRTL: function isRTL() {
|
7336 | return false;
|
7337 | }
|
7338 | };
|
7339 | },
|
7340 | enumerable: true,
|
7341 | configurable: true
|
7342 | });
|
7343 | MDCSliderFoundation.prototype.init = function() {
|
7344 | var _this = this;
|
7345 | this.isDiscrete_ = this.adapter_.hasClass(constants_1.cssClasses.IS_DISCRETE);
|
7346 | this.hasTrackMarker_ = this.adapter_.hasClass(constants_1.cssClasses.HAS_TRACK_MARKER);
|
7347 | DOWN_EVENTS.forEach(function(evtName) {
|
7348 | _this.adapter_.registerInteractionHandler(evtName, _this.interactionStartHandler_);
|
7349 | _this.adapter_.registerThumbContainerInteractionHandler(evtName, _this.thumbContainerPointerHandler_);
|
7350 | });
|
7351 | this.adapter_.registerInteractionHandler("keydown", this.keydownHandler_);
|
7352 | this.adapter_.registerInteractionHandler("focus", this.focusHandler_);
|
7353 | this.adapter_.registerInteractionHandler("blur", this.blurHandler_);
|
7354 | this.adapter_.registerResizeHandler(this.resizeHandler_);
|
7355 | this.layout();
|
7356 | if (this.isDiscrete_ && this.getStep() === 0) {
|
7357 | this.step_ = 1;
|
7358 | }
|
7359 | };
|
7360 | MDCSliderFoundation.prototype.destroy = function() {
|
7361 | var _this = this;
|
7362 | DOWN_EVENTS.forEach(function(evtName) {
|
7363 | _this.adapter_.deregisterInteractionHandler(evtName, _this.interactionStartHandler_);
|
7364 | _this.adapter_.deregisterThumbContainerInteractionHandler(evtName, _this.thumbContainerPointerHandler_);
|
7365 | });
|
7366 | this.adapter_.deregisterInteractionHandler("keydown", this.keydownHandler_);
|
7367 | this.adapter_.deregisterInteractionHandler("focus", this.focusHandler_);
|
7368 | this.adapter_.deregisterInteractionHandler("blur", this.blurHandler_);
|
7369 | this.adapter_.deregisterResizeHandler(this.resizeHandler_);
|
7370 | };
|
7371 | MDCSliderFoundation.prototype.setupTrackMarker = function() {
|
7372 | if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() !== 0) {
|
7373 | var min = this.getMin();
|
7374 | var max = this.getMax();
|
7375 | var step = this.getStep();
|
7376 | var numMarkers = (max - min) / step;
|
7377 | var indivisible = Math.ceil(numMarkers) !== numMarkers;
|
7378 | if (indivisible) {
|
7379 | numMarkers = Math.ceil(numMarkers);
|
7380 | }
|
7381 | this.adapter_.removeTrackMarkers();
|
7382 | this.adapter_.appendTrackMarkers(numMarkers);
|
7383 | if (indivisible) {
|
7384 | var lastStepRatio = (max - numMarkers * step) / step + 1;
|
7385 | this.adapter_.setLastTrackMarkersStyleProperty("flex-grow", String(lastStepRatio));
|
7386 | }
|
7387 | }
|
7388 | };
|
7389 | MDCSliderFoundation.prototype.layout = function() {
|
7390 | this.rect_ = this.adapter_.computeBoundingRect();
|
7391 | this.updateUIForCurrentValue_();
|
7392 | };
|
7393 | MDCSliderFoundation.prototype.getValue = function() {
|
7394 | return this.value_;
|
7395 | };
|
7396 | MDCSliderFoundation.prototype.setValue = function(value) {
|
7397 | this.setValue_(value, false);
|
7398 | };
|
7399 | MDCSliderFoundation.prototype.getMax = function() {
|
7400 | return this.max_;
|
7401 | };
|
7402 | MDCSliderFoundation.prototype.setMax = function(max) {
|
7403 | if (max < this.min_) {
|
7404 | throw new Error("Cannot set max to be less than the slider's minimum value");
|
7405 | }
|
7406 | this.max_ = max;
|
7407 | this.setValue_(this.value_, false, true);
|
7408 | this.adapter_.setAttribute(constants_1.strings.ARIA_VALUEMAX, String(this.max_));
|
7409 | this.setupTrackMarker();
|
7410 | };
|
7411 | MDCSliderFoundation.prototype.getMin = function() {
|
7412 | return this.min_;
|
7413 | };
|
7414 | MDCSliderFoundation.prototype.setMin = function(min) {
|
7415 | if (min > this.max_) {
|
7416 | throw new Error("Cannot set min to be greater than the slider's maximum value");
|
7417 | }
|
7418 | this.min_ = min;
|
7419 | this.setValue_(this.value_, false, true);
|
7420 | this.adapter_.setAttribute(constants_1.strings.ARIA_VALUEMIN, String(this.min_));
|
7421 | this.setupTrackMarker();
|
7422 | };
|
7423 | MDCSliderFoundation.prototype.getStep = function() {
|
7424 | return this.step_;
|
7425 | };
|
7426 | MDCSliderFoundation.prototype.setStep = function(step) {
|
7427 | if (step < 0) {
|
7428 | throw new Error("Step cannot be set to a negative number");
|
7429 | }
|
7430 | if (this.isDiscrete_ && (typeof step !== "number" || step < 1)) {
|
7431 | step = 1;
|
7432 | }
|
7433 | this.step_ = step;
|
7434 | this.setValue_(this.value_, false, true);
|
7435 | this.setupTrackMarker();
|
7436 | };
|
7437 | MDCSliderFoundation.prototype.isDisabled = function() {
|
7438 | return this.disabled_;
|
7439 | };
|
7440 | MDCSliderFoundation.prototype.setDisabled = function(disabled) {
|
7441 | this.disabled_ = disabled;
|
7442 | this.toggleClass_(constants_1.cssClasses.DISABLED, this.disabled_);
|
7443 | if (this.disabled_) {
|
7444 | this.savedTabIndex_ = this.adapter_.getTabIndex();
|
7445 | this.adapter_.setAttribute(constants_1.strings.ARIA_DISABLED, "true");
|
7446 | this.adapter_.removeAttribute("tabindex");
|
7447 | } else {
|
7448 | this.adapter_.removeAttribute(constants_1.strings.ARIA_DISABLED);
|
7449 | if (!isNaN(this.savedTabIndex_)) {
|
7450 | this.adapter_.setAttribute("tabindex", String(this.savedTabIndex_));
|
7451 | }
|
7452 | }
|
7453 | };
|
7454 | MDCSliderFoundation.prototype.handleDown_ = function(downEvent) {
|
7455 | var _this = this;
|
7456 | if (this.disabled_) {
|
7457 | return;
|
7458 | }
|
7459 | this.preventFocusState_ = true;
|
7460 | this.setInTransit_(!this.handlingThumbTargetEvt_);
|
7461 | this.handlingThumbTargetEvt_ = false;
|
7462 | this.setActive_(true);
|
7463 | var moveHandler = function moveHandler(moveEvent) {
|
7464 | _this.handleMove_(moveEvent);
|
7465 | };
|
7466 | var moveEventType = MOVE_EVENT_MAP[downEvent.type];
|
7467 | var upHandler = function upHandler() {
|
7468 | _this.handleUp_();
|
7469 | _this.adapter_.deregisterBodyInteractionHandler(moveEventType, moveHandler);
|
7470 | UP_EVENTS.forEach(function(evtName) {
|
7471 | return _this.adapter_.deregisterBodyInteractionHandler(evtName, upHandler);
|
7472 | });
|
7473 | };
|
7474 | this.adapter_.registerBodyInteractionHandler(moveEventType, moveHandler);
|
7475 | UP_EVENTS.forEach(function(evtName) {
|
7476 | return _this.adapter_.registerBodyInteractionHandler(evtName, upHandler);
|
7477 | });
|
7478 | this.setValueFromEvt_(downEvent);
|
7479 | };
|
7480 | MDCSliderFoundation.prototype.handleMove_ = function(evt) {
|
7481 | evt.preventDefault();
|
7482 | this.setValueFromEvt_(evt);
|
7483 | };
|
7484 | MDCSliderFoundation.prototype.handleUp_ = function() {
|
7485 | this.setActive_(false);
|
7486 | this.adapter_.notifyChange();
|
7487 | };
|
7488 | MDCSliderFoundation.prototype.getPageX_ = function(evt) {
|
7489 | if (evt.targetTouches && evt.targetTouches.length > 0) {
|
7490 | return evt.targetTouches[0].pageX;
|
7491 | }
|
7492 | return evt.pageX;
|
7493 | };
|
7494 | MDCSliderFoundation.prototype.setValueFromEvt_ = function(evt) {
|
7495 | var pageX = this.getPageX_(evt);
|
7496 | var value = this.computeValueFromPageX_(pageX);
|
7497 | this.setValue_(value, true);
|
7498 | };
|
7499 | MDCSliderFoundation.prototype.computeValueFromPageX_ = function(pageX) {
|
7500 | var _a = this, max = _a.max_, min = _a.min_;
|
7501 | var xPos = pageX - this.rect_.left;
|
7502 | var pctComplete = xPos / this.rect_.width;
|
7503 | if (this.adapter_.isRTL()) {
|
7504 | pctComplete = 1 - pctComplete;
|
7505 | }
|
7506 | return min + pctComplete * (max - min);
|
7507 | };
|
7508 | MDCSliderFoundation.prototype.handleKeydown_ = function(evt) {
|
7509 | var keyId = this.getKeyId_(evt);
|
7510 | var value = this.getValueForKeyId_(keyId);
|
7511 | if (isNaN(value)) {
|
7512 | return;
|
7513 | }
|
7514 | evt.preventDefault();
|
7515 | this.adapter_.addClass(constants_1.cssClasses.FOCUS);
|
7516 | this.setValue_(value, true);
|
7517 | this.adapter_.notifyChange();
|
7518 | };
|
7519 | MDCSliderFoundation.prototype.getKeyId_ = function(kbdEvt) {
|
7520 | if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {
|
7521 | return KEY_IDS.ARROW_LEFT;
|
7522 | }
|
7523 | if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {
|
7524 | return KEY_IDS.ARROW_RIGHT;
|
7525 | }
|
7526 | if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {
|
7527 | return KEY_IDS.ARROW_UP;
|
7528 | }
|
7529 | if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {
|
7530 | return KEY_IDS.ARROW_DOWN;
|
7531 | }
|
7532 | if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {
|
7533 | return KEY_IDS.HOME;
|
7534 | }
|
7535 | if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {
|
7536 | return KEY_IDS.END;
|
7537 | }
|
7538 | if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {
|
7539 | return KEY_IDS.PAGE_UP;
|
7540 | }
|
7541 | if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {
|
7542 | return KEY_IDS.PAGE_DOWN;
|
7543 | }
|
7544 | return "";
|
7545 | };
|
7546 | MDCSliderFoundation.prototype.getValueForKeyId_ = function(keyId) {
|
7547 | var _a = this, max = _a.max_, min = _a.min_, step = _a.step_;
|
7548 | var delta = step || (max - min) / 100;
|
7549 | var valueNeedsToBeFlipped = this.adapter_.isRTL() && (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);
|
7550 | if (valueNeedsToBeFlipped) {
|
7551 | delta = -delta;
|
7552 | }
|
7553 | switch (keyId) {
|
7554 | case KEY_IDS.ARROW_LEFT:
|
7555 | case KEY_IDS.ARROW_DOWN:
|
7556 | return this.value_ - delta;
|
7557 |
|
7558 | case KEY_IDS.ARROW_RIGHT:
|
7559 | case KEY_IDS.ARROW_UP:
|
7560 | return this.value_ + delta;
|
7561 |
|
7562 | case KEY_IDS.HOME:
|
7563 | return this.min_;
|
7564 |
|
7565 | case KEY_IDS.END:
|
7566 | return this.max_;
|
7567 |
|
7568 | case KEY_IDS.PAGE_UP:
|
7569 | return this.value_ + delta * constants_1.numbers.PAGE_FACTOR;
|
7570 |
|
7571 | case KEY_IDS.PAGE_DOWN:
|
7572 | return this.value_ - delta * constants_1.numbers.PAGE_FACTOR;
|
7573 |
|
7574 | default:
|
7575 | return NaN;
|
7576 | }
|
7577 | };
|
7578 | MDCSliderFoundation.prototype.handleFocus_ = function() {
|
7579 | if (this.preventFocusState_) {
|
7580 | return;
|
7581 | }
|
7582 | this.adapter_.addClass(constants_1.cssClasses.FOCUS);
|
7583 | };
|
7584 | MDCSliderFoundation.prototype.handleBlur_ = function() {
|
7585 | this.preventFocusState_ = false;
|
7586 | this.adapter_.removeClass(constants_1.cssClasses.FOCUS);
|
7587 | };
|
7588 | MDCSliderFoundation.prototype.setValue_ = function(value, shouldFireInput, force) {
|
7589 | if (force === void 0) {
|
7590 | force = false;
|
7591 | }
|
7592 | if (value === this.value_ && !force) {
|
7593 | return;
|
7594 | }
|
7595 | var _a = this, min = _a.min_, max = _a.max_;
|
7596 | var valueSetToBoundary = value === min || value === max;
|
7597 | if (this.step_ && !valueSetToBoundary) {
|
7598 | value = this.quantize_(value);
|
7599 | }
|
7600 | if (value < min) {
|
7601 | value = min;
|
7602 | } else if (value > max) {
|
7603 | value = max;
|
7604 | }
|
7605 | this.value_ = value;
|
7606 | this.adapter_.setAttribute(constants_1.strings.ARIA_VALUENOW, String(this.value_));
|
7607 | this.updateUIForCurrentValue_();
|
7608 | if (shouldFireInput) {
|
7609 | this.adapter_.notifyInput();
|
7610 | if (this.isDiscrete_) {
|
7611 | this.adapter_.setMarkerValue(value);
|
7612 | }
|
7613 | }
|
7614 | };
|
7615 | MDCSliderFoundation.prototype.quantize_ = function(value) {
|
7616 | var numSteps = Math.round(value / this.step_);
|
7617 | return numSteps * this.step_;
|
7618 | };
|
7619 | MDCSliderFoundation.prototype.updateUIForCurrentValue_ = function() {
|
7620 | var _this = this;
|
7621 | var _a = this, max = _a.max_, min = _a.min_, value = _a.value_;
|
7622 | var pctComplete = (value - min) / (max - min);
|
7623 | var translatePx = pctComplete * this.rect_.width;
|
7624 | if (this.adapter_.isRTL()) {
|
7625 | translatePx = this.rect_.width - translatePx;
|
7626 | }
|
7627 | var transformProp = util_1.getCorrectPropertyName(window, "transform");
|
7628 | var transitionendEvtName = util_1.getCorrectEventName(window, "transitionend");
|
7629 | if (this.inTransit_) {
|
7630 | var onTransitionEnd_1 = function onTransitionEnd_1() {
|
7631 | _this.setInTransit_(false);
|
7632 | _this.adapter_.deregisterThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd_1);
|
7633 | };
|
7634 | this.adapter_.registerThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd_1);
|
7635 | }
|
7636 | requestAnimationFrame(function() {
|
7637 | _this.adapter_.setThumbContainerStyleProperty(transformProp, "translateX(" + translatePx + "px) translateX(-50%)");
|
7638 | _this.adapter_.setTrackStyleProperty(transformProp, "scaleX(" + pctComplete + ")");
|
7639 | });
|
7640 | };
|
7641 | MDCSliderFoundation.prototype.setActive_ = function(active) {
|
7642 | this.active_ = active;
|
7643 | this.toggleClass_(constants_1.cssClasses.ACTIVE, this.active_);
|
7644 | };
|
7645 | MDCSliderFoundation.prototype.setInTransit_ = function(inTransit) {
|
7646 | this.inTransit_ = inTransit;
|
7647 | this.toggleClass_(constants_1.cssClasses.IN_TRANSIT, this.inTransit_);
|
7648 | };
|
7649 | MDCSliderFoundation.prototype.toggleClass_ = function(className, shouldBePresent) {
|
7650 | if (shouldBePresent) {
|
7651 | this.adapter_.addClass(className);
|
7652 | } else {
|
7653 | this.adapter_.removeClass(className);
|
7654 | }
|
7655 | };
|
7656 | return MDCSliderFoundation;
|
7657 | }(foundation_1.MDCFoundation);
|
7658 | exports.MDCSliderFoundation = MDCSliderFoundation;
|
7659 | exports.default = MDCSliderFoundation;
|
7660 | }, function(module, exports, __webpack_require__) {
|
7661 | "use strict";
|
7662 | Object.defineProperty(exports, "__esModule", {
|
7663 | value: true
|
7664 | });
|
7665 | var constants_1 = __webpack_require__(20);
|
7666 | var ARIA_LIVE_DELAY_MS = constants_1.numbers.ARIA_LIVE_DELAY_MS;
|
7667 | var ARIA_LIVE_LABEL_TEXT_ATTR = constants_1.strings.ARIA_LIVE_LABEL_TEXT_ATTR;
|
7668 | function announce(ariaEl, labelEl) {
|
7669 | if (labelEl === void 0) {
|
7670 | labelEl = ariaEl;
|
7671 | }
|
7672 | var priority = ariaEl.getAttribute("aria-live");
|
7673 | var labelText = labelEl.textContent.trim();
|
7674 | if (!labelText || !priority) {
|
7675 | return;
|
7676 | }
|
7677 | ariaEl.setAttribute("aria-live", "off");
|
7678 | labelEl.textContent = "";
|
7679 | labelEl.innerHTML = '<span style="display: inline-block; width: 0; height: 1px;"> </span>';
|
7680 | labelEl.setAttribute(ARIA_LIVE_LABEL_TEXT_ATTR, labelText);
|
7681 | setTimeout(function() {
|
7682 | ariaEl.setAttribute("aria-live", priority);
|
7683 | labelEl.removeAttribute(ARIA_LIVE_LABEL_TEXT_ATTR);
|
7684 | labelEl.textContent = labelText;
|
7685 | }, ARIA_LIVE_DELAY_MS);
|
7686 | }
|
7687 | exports.announce = announce;
|
7688 | }, function(module, exports, __webpack_require__) {
|
7689 | "use strict";
|
7690 | var __extends = this && this.__extends || function() {
|
7691 | var _extendStatics = function extendStatics(d, b) {
|
7692 | _extendStatics = Object.setPrototypeOf || {
|
7693 | __proto__: []
|
7694 | } instanceof Array && function(d, b) {
|
7695 | d.__proto__ = b;
|
7696 | } || function(d, b) {
|
7697 | for (var p in b) {
|
7698 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
7699 | }
|
7700 | };
|
7701 | return _extendStatics(d, b);
|
7702 | };
|
7703 | return function(d, b) {
|
7704 | _extendStatics(d, b);
|
7705 | function __() {
|
7706 | this.constructor = d;
|
7707 | }
|
7708 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
7709 | };
|
7710 | }();
|
7711 | var __assign = this && this.__assign || function() {
|
7712 | __assign = Object.assign || function(t) {
|
7713 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
7714 | s = arguments[i];
|
7715 | for (var p in s) {
|
7716 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
7717 | }
|
7718 | }
|
7719 | return t;
|
7720 | };
|
7721 | return __assign.apply(this, arguments);
|
7722 | };
|
7723 | Object.defineProperty(exports, "__esModule", {
|
7724 | value: true
|
7725 | });
|
7726 | var foundation_1 = __webpack_require__(0);
|
7727 | var constants_1 = __webpack_require__(20);
|
7728 | var OPENING = constants_1.cssClasses.OPENING, OPEN = constants_1.cssClasses.OPEN, CLOSING = constants_1.cssClasses.CLOSING;
|
7729 | var REASON_ACTION = constants_1.strings.REASON_ACTION, REASON_DISMISS = constants_1.strings.REASON_DISMISS;
|
7730 | var MDCSnackbarFoundation = function(_super) {
|
7731 | __extends(MDCSnackbarFoundation, _super);
|
7732 | function MDCSnackbarFoundation(adapter) {
|
7733 | var _this = _super.call(this, __assign({}, MDCSnackbarFoundation.defaultAdapter, adapter)) || this;
|
7734 | _this.isOpen_ = false;
|
7735 | _this.animationFrame_ = 0;
|
7736 | _this.animationTimer_ = 0;
|
7737 | _this.autoDismissTimer_ = 0;
|
7738 | _this.autoDismissTimeoutMs_ = constants_1.numbers.DEFAULT_AUTO_DISMISS_TIMEOUT_MS;
|
7739 | _this.closeOnEscape_ = true;
|
7740 | return _this;
|
7741 | }
|
7742 | Object.defineProperty(MDCSnackbarFoundation, "cssClasses", {
|
7743 | get: function get() {
|
7744 | return constants_1.cssClasses;
|
7745 | },
|
7746 | enumerable: true,
|
7747 | configurable: true
|
7748 | });
|
7749 | Object.defineProperty(MDCSnackbarFoundation, "strings", {
|
7750 | get: function get() {
|
7751 | return constants_1.strings;
|
7752 | },
|
7753 | enumerable: true,
|
7754 | configurable: true
|
7755 | });
|
7756 | Object.defineProperty(MDCSnackbarFoundation, "numbers", {
|
7757 | get: function get() {
|
7758 | return constants_1.numbers;
|
7759 | },
|
7760 | enumerable: true,
|
7761 | configurable: true
|
7762 | });
|
7763 | Object.defineProperty(MDCSnackbarFoundation, "defaultAdapter", {
|
7764 | get: function get() {
|
7765 | return {
|
7766 | addClass: function addClass() {
|
7767 | return undefined;
|
7768 | },
|
7769 | announce: function announce() {
|
7770 | return undefined;
|
7771 | },
|
7772 | notifyClosed: function notifyClosed() {
|
7773 | return undefined;
|
7774 | },
|
7775 | notifyClosing: function notifyClosing() {
|
7776 | return undefined;
|
7777 | },
|
7778 | notifyOpened: function notifyOpened() {
|
7779 | return undefined;
|
7780 | },
|
7781 | notifyOpening: function notifyOpening() {
|
7782 | return undefined;
|
7783 | },
|
7784 | removeClass: function removeClass() {
|
7785 | return undefined;
|
7786 | }
|
7787 | };
|
7788 | },
|
7789 | enumerable: true,
|
7790 | configurable: true
|
7791 | });
|
7792 | MDCSnackbarFoundation.prototype.destroy = function() {
|
7793 | this.clearAutoDismissTimer_();
|
7794 | cancelAnimationFrame(this.animationFrame_);
|
7795 | this.animationFrame_ = 0;
|
7796 | clearTimeout(this.animationTimer_);
|
7797 | this.animationTimer_ = 0;
|
7798 | this.adapter_.removeClass(OPENING);
|
7799 | this.adapter_.removeClass(OPEN);
|
7800 | this.adapter_.removeClass(CLOSING);
|
7801 | };
|
7802 | MDCSnackbarFoundation.prototype.open = function() {
|
7803 | var _this = this;
|
7804 | this.clearAutoDismissTimer_();
|
7805 | this.isOpen_ = true;
|
7806 | this.adapter_.notifyOpening();
|
7807 | this.adapter_.removeClass(CLOSING);
|
7808 | this.adapter_.addClass(OPENING);
|
7809 | this.adapter_.announce();
|
7810 | this.runNextAnimationFrame_(function() {
|
7811 | _this.adapter_.addClass(OPEN);
|
7812 | _this.animationTimer_ = setTimeout(function() {
|
7813 | _this.handleAnimationTimerEnd_();
|
7814 | _this.adapter_.notifyOpened();
|
7815 | _this.autoDismissTimer_ = setTimeout(function() {
|
7816 | _this.close(REASON_DISMISS);
|
7817 | }, _this.getTimeoutMs());
|
7818 | }, constants_1.numbers.SNACKBAR_ANIMATION_OPEN_TIME_MS);
|
7819 | });
|
7820 | };
|
7821 | MDCSnackbarFoundation.prototype.close = function(reason) {
|
7822 | var _this = this;
|
7823 | if (reason === void 0) {
|
7824 | reason = "";
|
7825 | }
|
7826 | if (!this.isOpen_) {
|
7827 | return;
|
7828 | }
|
7829 | cancelAnimationFrame(this.animationFrame_);
|
7830 | this.animationFrame_ = 0;
|
7831 | this.clearAutoDismissTimer_();
|
7832 | this.isOpen_ = false;
|
7833 | this.adapter_.notifyClosing(reason);
|
7834 | this.adapter_.addClass(constants_1.cssClasses.CLOSING);
|
7835 | this.adapter_.removeClass(constants_1.cssClasses.OPEN);
|
7836 | this.adapter_.removeClass(constants_1.cssClasses.OPENING);
|
7837 | clearTimeout(this.animationTimer_);
|
7838 | this.animationTimer_ = setTimeout(function() {
|
7839 | _this.handleAnimationTimerEnd_();
|
7840 | _this.adapter_.notifyClosed(reason);
|
7841 | }, constants_1.numbers.SNACKBAR_ANIMATION_CLOSE_TIME_MS);
|
7842 | };
|
7843 | MDCSnackbarFoundation.prototype.isOpen = function() {
|
7844 | return this.isOpen_;
|
7845 | };
|
7846 | MDCSnackbarFoundation.prototype.getTimeoutMs = function() {
|
7847 | return this.autoDismissTimeoutMs_;
|
7848 | };
|
7849 | MDCSnackbarFoundation.prototype.setTimeoutMs = function(timeoutMs) {
|
7850 | var minValue = constants_1.numbers.MIN_AUTO_DISMISS_TIMEOUT_MS;
|
7851 | var maxValue = constants_1.numbers.MAX_AUTO_DISMISS_TIMEOUT_MS;
|
7852 | if (timeoutMs <= maxValue && timeoutMs >= minValue) {
|
7853 | this.autoDismissTimeoutMs_ = timeoutMs;
|
7854 | } else {
|
7855 | throw new Error("timeoutMs must be an integer in the range " + minValue + "–" + maxValue + ", but got '" + timeoutMs + "'");
|
7856 | }
|
7857 | };
|
7858 | MDCSnackbarFoundation.prototype.getCloseOnEscape = function() {
|
7859 | return this.closeOnEscape_;
|
7860 | };
|
7861 | MDCSnackbarFoundation.prototype.setCloseOnEscape = function(closeOnEscape) {
|
7862 | this.closeOnEscape_ = closeOnEscape;
|
7863 | };
|
7864 | MDCSnackbarFoundation.prototype.handleKeyDown = function(evt) {
|
7865 | var isEscapeKey = evt.key === "Escape" || evt.keyCode === 27;
|
7866 | if (isEscapeKey && this.getCloseOnEscape()) {
|
7867 | this.close(REASON_DISMISS);
|
7868 | }
|
7869 | };
|
7870 | MDCSnackbarFoundation.prototype.handleActionButtonClick = function(_evt) {
|
7871 | this.close(REASON_ACTION);
|
7872 | };
|
7873 | MDCSnackbarFoundation.prototype.handleActionIconClick = function(_evt) {
|
7874 | this.close(REASON_DISMISS);
|
7875 | };
|
7876 | MDCSnackbarFoundation.prototype.clearAutoDismissTimer_ = function() {
|
7877 | clearTimeout(this.autoDismissTimer_);
|
7878 | this.autoDismissTimer_ = 0;
|
7879 | };
|
7880 | MDCSnackbarFoundation.prototype.handleAnimationTimerEnd_ = function() {
|
7881 | this.animationTimer_ = 0;
|
7882 | this.adapter_.removeClass(constants_1.cssClasses.OPENING);
|
7883 | this.adapter_.removeClass(constants_1.cssClasses.CLOSING);
|
7884 | };
|
7885 | MDCSnackbarFoundation.prototype.runNextAnimationFrame_ = function(callback) {
|
7886 | var _this = this;
|
7887 | cancelAnimationFrame(this.animationFrame_);
|
7888 | this.animationFrame_ = requestAnimationFrame(function() {
|
7889 | _this.animationFrame_ = 0;
|
7890 | clearTimeout(_this.animationTimer_);
|
7891 | _this.animationTimer_ = setTimeout(callback, 0);
|
7892 | });
|
7893 | };
|
7894 | return MDCSnackbarFoundation;
|
7895 | }(foundation_1.MDCFoundation);
|
7896 | exports.MDCSnackbarFoundation = MDCSnackbarFoundation;
|
7897 | exports.default = MDCSnackbarFoundation;
|
7898 | }, function(module, exports, __webpack_require__) {
|
7899 | "use strict";
|
7900 | var __extends = this && this.__extends || function() {
|
7901 | var _extendStatics = function extendStatics(d, b) {
|
7902 | _extendStatics = Object.setPrototypeOf || {
|
7903 | __proto__: []
|
7904 | } instanceof Array && function(d, b) {
|
7905 | d.__proto__ = b;
|
7906 | } || function(d, b) {
|
7907 | for (var p in b) {
|
7908 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
7909 | }
|
7910 | };
|
7911 | return _extendStatics(d, b);
|
7912 | };
|
7913 | return function(d, b) {
|
7914 | _extendStatics(d, b);
|
7915 | function __() {
|
7916 | this.constructor = d;
|
7917 | }
|
7918 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
7919 | };
|
7920 | }();
|
7921 | var __assign = this && this.__assign || function() {
|
7922 | __assign = Object.assign || function(t) {
|
7923 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
7924 | s = arguments[i];
|
7925 | for (var p in s) {
|
7926 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
7927 | }
|
7928 | }
|
7929 | return t;
|
7930 | };
|
7931 | return __assign.apply(this, arguments);
|
7932 | };
|
7933 | Object.defineProperty(exports, "__esModule", {
|
7934 | value: true
|
7935 | });
|
7936 | var foundation_1 = __webpack_require__(0);
|
7937 | var constants_1 = __webpack_require__(138);
|
7938 | var MDCSwitchFoundation = function(_super) {
|
7939 | __extends(MDCSwitchFoundation, _super);
|
7940 | function MDCSwitchFoundation(adapter) {
|
7941 | return _super.call(this, __assign({}, MDCSwitchFoundation.defaultAdapter, adapter)) || this;
|
7942 | }
|
7943 | Object.defineProperty(MDCSwitchFoundation, "strings", {
|
7944 | get: function get() {
|
7945 | return constants_1.strings;
|
7946 | },
|
7947 | enumerable: true,
|
7948 | configurable: true
|
7949 | });
|
7950 | Object.defineProperty(MDCSwitchFoundation, "cssClasses", {
|
7951 | get: function get() {
|
7952 | return constants_1.cssClasses;
|
7953 | },
|
7954 | enumerable: true,
|
7955 | configurable: true
|
7956 | });
|
7957 | Object.defineProperty(MDCSwitchFoundation, "defaultAdapter", {
|
7958 | get: function get() {
|
7959 | return {
|
7960 | addClass: function addClass() {
|
7961 | return undefined;
|
7962 | },
|
7963 | removeClass: function removeClass() {
|
7964 | return undefined;
|
7965 | },
|
7966 | setNativeControlChecked: function setNativeControlChecked() {
|
7967 | return undefined;
|
7968 | },
|
7969 | setNativeControlDisabled: function setNativeControlDisabled() {
|
7970 | return undefined;
|
7971 | }
|
7972 | };
|
7973 | },
|
7974 | enumerable: true,
|
7975 | configurable: true
|
7976 | });
|
7977 | MDCSwitchFoundation.prototype.setChecked = function(checked) {
|
7978 | this.adapter_.setNativeControlChecked(checked);
|
7979 | this.updateCheckedStyling_(checked);
|
7980 | };
|
7981 | MDCSwitchFoundation.prototype.setDisabled = function(disabled) {
|
7982 | this.adapter_.setNativeControlDisabled(disabled);
|
7983 | if (disabled) {
|
7984 | this.adapter_.addClass(constants_1.cssClasses.DISABLED);
|
7985 | } else {
|
7986 | this.adapter_.removeClass(constants_1.cssClasses.DISABLED);
|
7987 | }
|
7988 | };
|
7989 | MDCSwitchFoundation.prototype.handleChange = function(evt) {
|
7990 | var nativeControl = evt.target;
|
7991 | this.updateCheckedStyling_(nativeControl.checked);
|
7992 | };
|
7993 | MDCSwitchFoundation.prototype.updateCheckedStyling_ = function(checked) {
|
7994 | if (checked) {
|
7995 | this.adapter_.addClass(constants_1.cssClasses.CHECKED);
|
7996 | } else {
|
7997 | this.adapter_.removeClass(constants_1.cssClasses.CHECKED);
|
7998 | }
|
7999 | };
|
8000 | return MDCSwitchFoundation;
|
8001 | }(foundation_1.MDCFoundation);
|
8002 | exports.MDCSwitchFoundation = MDCSwitchFoundation;
|
8003 | exports.default = MDCSwitchFoundation;
|
8004 | }, function(module, exports, __webpack_require__) {
|
8005 | "use strict";
|
8006 | var __extends = this && this.__extends || function() {
|
8007 | var _extendStatics = function extendStatics(d, b) {
|
8008 | _extendStatics = Object.setPrototypeOf || {
|
8009 | __proto__: []
|
8010 | } instanceof Array && function(d, b) {
|
8011 | d.__proto__ = b;
|
8012 | } || function(d, b) {
|
8013 | for (var p in b) {
|
8014 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
8015 | }
|
8016 | };
|
8017 | return _extendStatics(d, b);
|
8018 | };
|
8019 | return function(d, b) {
|
8020 | _extendStatics(d, b);
|
8021 | function __() {
|
8022 | this.constructor = d;
|
8023 | }
|
8024 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
8025 | };
|
8026 | }();
|
8027 | var __importStar = this && this.__importStar || function(mod) {
|
8028 | if (mod && mod.__esModule) return mod;
|
8029 | var result = {};
|
8030 | if (mod != null) for (var k in mod) {
|
8031 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
8032 | }
|
8033 | result["default"] = mod;
|
8034 | return result;
|
8035 | };
|
8036 | Object.defineProperty(exports, "__esModule", {
|
8037 | value: true
|
8038 | });
|
8039 | var component_1 = __webpack_require__(1);
|
8040 | var ponyfill_1 = __webpack_require__(3);
|
8041 | var foundation_1 = __webpack_require__(61);
|
8042 | var util = __importStar(__webpack_require__(63));
|
8043 | var MDCTabScroller = function(_super) {
|
8044 | __extends(MDCTabScroller, _super);
|
8045 | function MDCTabScroller() {
|
8046 | return _super !== null && _super.apply(this, arguments) || this;
|
8047 | }
|
8048 | MDCTabScroller.attachTo = function(root) {
|
8049 | return new MDCTabScroller(root);
|
8050 | };
|
8051 | MDCTabScroller.prototype.initialize = function() {
|
8052 | this.area_ = this.root_.querySelector(foundation_1.MDCTabScrollerFoundation.strings.AREA_SELECTOR);
|
8053 | this.content_ = this.root_.querySelector(foundation_1.MDCTabScrollerFoundation.strings.CONTENT_SELECTOR);
|
8054 | };
|
8055 | MDCTabScroller.prototype.initialSyncWithDOM = function() {
|
8056 | var _this = this;
|
8057 | this.handleInteraction_ = function() {
|
8058 | return _this.foundation_.handleInteraction();
|
8059 | };
|
8060 | this.handleTransitionEnd_ = function(evt) {
|
8061 | return _this.foundation_.handleTransitionEnd(evt);
|
8062 | };
|
8063 | this.area_.addEventListener("wheel", this.handleInteraction_);
|
8064 | this.area_.addEventListener("touchstart", this.handleInteraction_);
|
8065 | this.area_.addEventListener("pointerdown", this.handleInteraction_);
|
8066 | this.area_.addEventListener("mousedown", this.handleInteraction_);
|
8067 | this.area_.addEventListener("keydown", this.handleInteraction_);
|
8068 | this.content_.addEventListener("transitionend", this.handleTransitionEnd_);
|
8069 | };
|
8070 | MDCTabScroller.prototype.destroy = function() {
|
8071 | _super.prototype.destroy.call(this);
|
8072 | this.area_.removeEventListener("wheel", this.handleInteraction_);
|
8073 | this.area_.removeEventListener("touchstart", this.handleInteraction_);
|
8074 | this.area_.removeEventListener("pointerdown", this.handleInteraction_);
|
8075 | this.area_.removeEventListener("mousedown", this.handleInteraction_);
|
8076 | this.area_.removeEventListener("keydown", this.handleInteraction_);
|
8077 | this.content_.removeEventListener("transitionend", this.handleTransitionEnd_);
|
8078 | };
|
8079 | MDCTabScroller.prototype.getDefaultFoundation = function() {
|
8080 | var _this = this;
|
8081 | var adapter = {
|
8082 | eventTargetMatchesSelector: function eventTargetMatchesSelector(evtTarget, selector) {
|
8083 | return ponyfill_1.matches(evtTarget, selector);
|
8084 | },
|
8085 | addClass: function addClass(className) {
|
8086 | return _this.root_.classList.add(className);
|
8087 | },
|
8088 | removeClass: function removeClass(className) {
|
8089 | return _this.root_.classList.remove(className);
|
8090 | },
|
8091 | addScrollAreaClass: function addScrollAreaClass(className) {
|
8092 | return _this.area_.classList.add(className);
|
8093 | },
|
8094 | setScrollAreaStyleProperty: function setScrollAreaStyleProperty(prop, value) {
|
8095 | return _this.area_.style.setProperty(prop, value);
|
8096 | },
|
8097 | setScrollContentStyleProperty: function setScrollContentStyleProperty(prop, value) {
|
8098 | return _this.content_.style.setProperty(prop, value);
|
8099 | },
|
8100 | getScrollContentStyleValue: function getScrollContentStyleValue(propName) {
|
8101 | return window.getComputedStyle(_this.content_).getPropertyValue(propName);
|
8102 | },
|
8103 | setScrollAreaScrollLeft: function setScrollAreaScrollLeft(scrollX) {
|
8104 | return _this.area_.scrollLeft = scrollX;
|
8105 | },
|
8106 | getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {
|
8107 | return _this.area_.scrollLeft;
|
8108 | },
|
8109 | getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {
|
8110 | return _this.content_.offsetWidth;
|
8111 | },
|
8112 | getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {
|
8113 | return _this.area_.offsetWidth;
|
8114 | },
|
8115 | computeScrollAreaClientRect: function computeScrollAreaClientRect() {
|
8116 | return _this.area_.getBoundingClientRect();
|
8117 | },
|
8118 | computeScrollContentClientRect: function computeScrollContentClientRect() {
|
8119 | return _this.content_.getBoundingClientRect();
|
8120 | },
|
8121 | computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {
|
8122 | return util.computeHorizontalScrollbarHeight(document);
|
8123 | }
|
8124 | };
|
8125 | return new foundation_1.MDCTabScrollerFoundation(adapter);
|
8126 | };
|
8127 | MDCTabScroller.prototype.getScrollPosition = function() {
|
8128 | return this.foundation_.getScrollPosition();
|
8129 | };
|
8130 | MDCTabScroller.prototype.getScrollContentWidth = function() {
|
8131 | return this.content_.offsetWidth;
|
8132 | };
|
8133 | MDCTabScroller.prototype.incrementScroll = function(scrollXIncrement) {
|
8134 | this.foundation_.incrementScroll(scrollXIncrement);
|
8135 | };
|
8136 | MDCTabScroller.prototype.scrollTo = function(scrollX) {
|
8137 | this.foundation_.scrollTo(scrollX);
|
8138 | };
|
8139 | return MDCTabScroller;
|
8140 | }(component_1.MDCComponent);
|
8141 | exports.MDCTabScroller = MDCTabScroller;
|
8142 | }, function(module, exports, __webpack_require__) {
|
8143 | "use strict";
|
8144 | var __extends = this && this.__extends || function() {
|
8145 | var _extendStatics = function extendStatics(d, b) {
|
8146 | _extendStatics = Object.setPrototypeOf || {
|
8147 | __proto__: []
|
8148 | } instanceof Array && function(d, b) {
|
8149 | d.__proto__ = b;
|
8150 | } || function(d, b) {
|
8151 | for (var p in b) {
|
8152 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
8153 | }
|
8154 | };
|
8155 | return _extendStatics(d, b);
|
8156 | };
|
8157 | return function(d, b) {
|
8158 | _extendStatics(d, b);
|
8159 | function __() {
|
8160 | this.constructor = d;
|
8161 | }
|
8162 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
8163 | };
|
8164 | }();
|
8165 | var __assign = this && this.__assign || function() {
|
8166 | __assign = Object.assign || function(t) {
|
8167 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
8168 | s = arguments[i];
|
8169 | for (var p in s) {
|
8170 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
8171 | }
|
8172 | }
|
8173 | return t;
|
8174 | };
|
8175 | return __assign.apply(this, arguments);
|
8176 | };
|
8177 | var __read = this && this.__read || function(o, n) {
|
8178 | var m = typeof Symbol === "function" && o[Symbol.iterator];
|
8179 | if (!m) return o;
|
8180 | var i = m.call(o), r, ar = [], e;
|
8181 | try {
|
8182 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
8183 | ar.push(r.value);
|
8184 | }
|
8185 | } catch (error) {
|
8186 | e = {
|
8187 | error: error
|
8188 | };
|
8189 | } finally {
|
8190 | try {
|
8191 | if (r && !r.done && (m = i["return"])) m.call(i);
|
8192 | } finally {
|
8193 | if (e) throw e.error;
|
8194 | }
|
8195 | }
|
8196 | return ar;
|
8197 | };
|
8198 | Object.defineProperty(exports, "__esModule", {
|
8199 | value: true
|
8200 | });
|
8201 | var foundation_1 = __webpack_require__(0);
|
8202 | var constants_1 = __webpack_require__(62);
|
8203 | var rtl_default_scroller_1 = __webpack_require__(141);
|
8204 | var rtl_negative_scroller_1 = __webpack_require__(142);
|
8205 | var rtl_reverse_scroller_1 = __webpack_require__(143);
|
8206 | var MDCTabScrollerFoundation = function(_super) {
|
8207 | __extends(MDCTabScrollerFoundation, _super);
|
8208 | function MDCTabScrollerFoundation(adapter) {
|
8209 | var _this = _super.call(this, __assign({}, MDCTabScrollerFoundation.defaultAdapter, adapter)) || this;
|
8210 | _this.isAnimating_ = false;
|
8211 | return _this;
|
8212 | }
|
8213 | Object.defineProperty(MDCTabScrollerFoundation, "cssClasses", {
|
8214 | get: function get() {
|
8215 | return constants_1.cssClasses;
|
8216 | },
|
8217 | enumerable: true,
|
8218 | configurable: true
|
8219 | });
|
8220 | Object.defineProperty(MDCTabScrollerFoundation, "strings", {
|
8221 | get: function get() {
|
8222 | return constants_1.strings;
|
8223 | },
|
8224 | enumerable: true,
|
8225 | configurable: true
|
8226 | });
|
8227 | Object.defineProperty(MDCTabScrollerFoundation, "defaultAdapter", {
|
8228 | get: function get() {
|
8229 | return {
|
8230 | eventTargetMatchesSelector: function eventTargetMatchesSelector() {
|
8231 | return false;
|
8232 | },
|
8233 | addClass: function addClass() {
|
8234 | return undefined;
|
8235 | },
|
8236 | removeClass: function removeClass() {
|
8237 | return undefined;
|
8238 | },
|
8239 | addScrollAreaClass: function addScrollAreaClass() {
|
8240 | return undefined;
|
8241 | },
|
8242 | setScrollAreaStyleProperty: function setScrollAreaStyleProperty() {
|
8243 | return undefined;
|
8244 | },
|
8245 | setScrollContentStyleProperty: function setScrollContentStyleProperty() {
|
8246 | return undefined;
|
8247 | },
|
8248 | getScrollContentStyleValue: function getScrollContentStyleValue() {
|
8249 | return "";
|
8250 | },
|
8251 | setScrollAreaScrollLeft: function setScrollAreaScrollLeft() {
|
8252 | return undefined;
|
8253 | },
|
8254 | getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {
|
8255 | return 0;
|
8256 | },
|
8257 | getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {
|
8258 | return 0;
|
8259 | },
|
8260 | getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {
|
8261 | return 0;
|
8262 | },
|
8263 | computeScrollAreaClientRect: function computeScrollAreaClientRect() {
|
8264 | return {
|
8265 | top: 0,
|
8266 | right: 0,
|
8267 | bottom: 0,
|
8268 | left: 0,
|
8269 | width: 0,
|
8270 | height: 0
|
8271 | };
|
8272 | },
|
8273 | computeScrollContentClientRect: function computeScrollContentClientRect() {
|
8274 | return {
|
8275 | top: 0,
|
8276 | right: 0,
|
8277 | bottom: 0,
|
8278 | left: 0,
|
8279 | width: 0,
|
8280 | height: 0
|
8281 | };
|
8282 | },
|
8283 | computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {
|
8284 | return 0;
|
8285 | }
|
8286 | };
|
8287 | },
|
8288 | enumerable: true,
|
8289 | configurable: true
|
8290 | });
|
8291 | MDCTabScrollerFoundation.prototype.init = function() {
|
8292 | var horizontalScrollbarHeight = this.adapter_.computeHorizontalScrollbarHeight();
|
8293 | this.adapter_.setScrollAreaStyleProperty("margin-bottom", -horizontalScrollbarHeight + "px");
|
8294 | this.adapter_.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);
|
8295 | };
|
8296 | MDCTabScrollerFoundation.prototype.getScrollPosition = function() {
|
8297 | if (this.isRTL_()) {
|
8298 | return this.computeCurrentScrollPositionRTL_();
|
8299 | }
|
8300 | var currentTranslateX = this.calculateCurrentTranslateX_();
|
8301 | var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
8302 | return scrollLeft - currentTranslateX;
|
8303 | };
|
8304 | MDCTabScrollerFoundation.prototype.handleInteraction = function() {
|
8305 | if (!this.isAnimating_) {
|
8306 | return;
|
8307 | }
|
8308 | this.stopScrollAnimation_();
|
8309 | };
|
8310 | MDCTabScrollerFoundation.prototype.handleTransitionEnd = function(evt) {
|
8311 | var evtTarget = evt.target;
|
8312 | if (!this.isAnimating_ || !this.adapter_.eventTargetMatchesSelector(evtTarget, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {
|
8313 | return;
|
8314 | }
|
8315 | this.isAnimating_ = false;
|
8316 | this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
|
8317 | };
|
8318 | MDCTabScrollerFoundation.prototype.incrementScroll = function(scrollXIncrement) {
|
8319 | if (scrollXIncrement === 0) {
|
8320 | return;
|
8321 | }
|
8322 | if (this.isRTL_()) {
|
8323 | return this.incrementScrollRTL_(scrollXIncrement);
|
8324 | }
|
8325 | this.incrementScroll_(scrollXIncrement);
|
8326 | };
|
8327 | MDCTabScrollerFoundation.prototype.scrollTo = function(scrollX) {
|
8328 | if (this.isRTL_()) {
|
8329 | return this.scrollToRTL_(scrollX);
|
8330 | }
|
8331 | this.scrollTo_(scrollX);
|
8332 | };
|
8333 | MDCTabScrollerFoundation.prototype.getRTLScroller = function() {
|
8334 | if (!this.rtlScrollerInstance_) {
|
8335 | this.rtlScrollerInstance_ = this.rtlScrollerFactory_();
|
8336 | }
|
8337 | return this.rtlScrollerInstance_;
|
8338 | };
|
8339 | MDCTabScrollerFoundation.prototype.calculateCurrentTranslateX_ = function() {
|
8340 | var transformValue = this.adapter_.getScrollContentStyleValue("transform");
|
8341 | if (transformValue === "none") {
|
8342 | return 0;
|
8343 | }
|
8344 | var match = /\((.+?)\)/.exec(transformValue);
|
8345 | if (!match) {
|
8346 | return 0;
|
8347 | }
|
8348 | var matrixParams = match[1];
|
8349 | var _a = __read(matrixParams.split(","), 6), a = _a[0], b = _a[1], c = _a[2], d = _a[3], tx = _a[4], ty = _a[5];
|
8350 | return parseFloat(tx);
|
8351 | };
|
8352 | MDCTabScrollerFoundation.prototype.clampScrollValue_ = function(scrollX) {
|
8353 | var edges = this.calculateScrollEdges_();
|
8354 | return Math.min(Math.max(edges.left, scrollX), edges.right);
|
8355 | };
|
8356 | MDCTabScrollerFoundation.prototype.computeCurrentScrollPositionRTL_ = function() {
|
8357 | var translateX = this.calculateCurrentTranslateX_();
|
8358 | return this.getRTLScroller().getScrollPositionRTL(translateX);
|
8359 | };
|
8360 | MDCTabScrollerFoundation.prototype.calculateScrollEdges_ = function() {
|
8361 | var contentWidth = this.adapter_.getScrollContentOffsetWidth();
|
8362 | var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
|
8363 | return {
|
8364 | left: 0,
|
8365 | right: contentWidth - rootWidth
|
8366 | };
|
8367 | };
|
8368 | MDCTabScrollerFoundation.prototype.scrollTo_ = function(scrollX) {
|
8369 | var currentScrollX = this.getScrollPosition();
|
8370 | var safeScrollX = this.clampScrollValue_(scrollX);
|
8371 | var scrollDelta = safeScrollX - currentScrollX;
|
8372 | this.animate_({
|
8373 | finalScrollPosition: safeScrollX,
|
8374 | scrollDelta: scrollDelta
|
8375 | });
|
8376 | };
|
8377 | MDCTabScrollerFoundation.prototype.scrollToRTL_ = function(scrollX) {
|
8378 | var animation = this.getRTLScroller().scrollToRTL(scrollX);
|
8379 | this.animate_(animation);
|
8380 | };
|
8381 | MDCTabScrollerFoundation.prototype.incrementScroll_ = function(scrollX) {
|
8382 | var currentScrollX = this.getScrollPosition();
|
8383 | var targetScrollX = scrollX + currentScrollX;
|
8384 | var safeScrollX = this.clampScrollValue_(targetScrollX);
|
8385 | var scrollDelta = safeScrollX - currentScrollX;
|
8386 | this.animate_({
|
8387 | finalScrollPosition: safeScrollX,
|
8388 | scrollDelta: scrollDelta
|
8389 | });
|
8390 | };
|
8391 | MDCTabScrollerFoundation.prototype.incrementScrollRTL_ = function(scrollX) {
|
8392 | var animation = this.getRTLScroller().incrementScrollRTL(scrollX);
|
8393 | this.animate_(animation);
|
8394 | };
|
8395 | MDCTabScrollerFoundation.prototype.animate_ = function(animation) {
|
8396 | var _this = this;
|
8397 | if (animation.scrollDelta === 0) {
|
8398 | return;
|
8399 | }
|
8400 | this.stopScrollAnimation_();
|
8401 | this.adapter_.setScrollAreaScrollLeft(animation.finalScrollPosition);
|
8402 | this.adapter_.setScrollContentStyleProperty("transform", "translateX(" + animation.scrollDelta + "px)");
|
8403 | this.adapter_.computeScrollAreaClientRect();
|
8404 | requestAnimationFrame(function() {
|
8405 | _this.adapter_.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
|
8406 | _this.adapter_.setScrollContentStyleProperty("transform", "none");
|
8407 | });
|
8408 | this.isAnimating_ = true;
|
8409 | };
|
8410 | MDCTabScrollerFoundation.prototype.stopScrollAnimation_ = function() {
|
8411 | this.isAnimating_ = false;
|
8412 | var currentScrollPosition = this.getAnimatingScrollPosition_();
|
8413 | this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
|
8414 | this.adapter_.setScrollContentStyleProperty("transform", "translateX(0px)");
|
8415 | this.adapter_.setScrollAreaScrollLeft(currentScrollPosition);
|
8416 | };
|
8417 | MDCTabScrollerFoundation.prototype.getAnimatingScrollPosition_ = function() {
|
8418 | var currentTranslateX = this.calculateCurrentTranslateX_();
|
8419 | var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
8420 | if (this.isRTL_()) {
|
8421 | return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);
|
8422 | }
|
8423 | return scrollLeft - currentTranslateX;
|
8424 | };
|
8425 | MDCTabScrollerFoundation.prototype.rtlScrollerFactory_ = function() {
|
8426 | var initialScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
8427 | this.adapter_.setScrollAreaScrollLeft(initialScrollLeft - 1);
|
8428 | var newScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
8429 | if (newScrollLeft < 0) {
|
8430 | this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
|
8431 | return new rtl_negative_scroller_1.MDCTabScrollerRTLNegative(this.adapter_);
|
8432 | }
|
8433 | var rootClientRect = this.adapter_.computeScrollAreaClientRect();
|
8434 | var contentClientRect = this.adapter_.computeScrollContentClientRect();
|
8435 | var rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);
|
8436 | this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
|
8437 | if (rightEdgeDelta === newScrollLeft) {
|
8438 | return new rtl_reverse_scroller_1.MDCTabScrollerRTLReverse(this.adapter_);
|
8439 | }
|
8440 | return new rtl_default_scroller_1.MDCTabScrollerRTLDefault(this.adapter_);
|
8441 | };
|
8442 | MDCTabScrollerFoundation.prototype.isRTL_ = function() {
|
8443 | return this.adapter_.getScrollContentStyleValue("direction") === "rtl";
|
8444 | };
|
8445 | return MDCTabScrollerFoundation;
|
8446 | }(foundation_1.MDCFoundation);
|
8447 | exports.MDCTabScrollerFoundation = MDCTabScrollerFoundation;
|
8448 | exports.default = MDCTabScrollerFoundation;
|
8449 | }, function(module, exports, __webpack_require__) {
|
8450 | "use strict";
|
8451 | Object.defineProperty(exports, "__esModule", {
|
8452 | value: true
|
8453 | });
|
8454 | var cssClasses = {
|
8455 | ANIMATING: "mdc-tab-scroller--animating",
|
8456 | SCROLL_AREA_SCROLL: "mdc-tab-scroller__scroll-area--scroll",
|
8457 | SCROLL_TEST: "mdc-tab-scroller__test"
|
8458 | };
|
8459 | exports.cssClasses = cssClasses;
|
8460 | var strings = {
|
8461 | AREA_SELECTOR: ".mdc-tab-scroller__scroll-area",
|
8462 | CONTENT_SELECTOR: ".mdc-tab-scroller__scroll-content"
|
8463 | };
|
8464 | exports.strings = strings;
|
8465 | }, function(module, exports, __webpack_require__) {
|
8466 | "use strict";
|
8467 | Object.defineProperty(exports, "__esModule", {
|
8468 | value: true
|
8469 | });
|
8470 | var constants_1 = __webpack_require__(62);
|
8471 | var horizontalScrollbarHeight_;
|
8472 | function computeHorizontalScrollbarHeight(documentObj, shouldCacheResult) {
|
8473 | if (shouldCacheResult === void 0) {
|
8474 | shouldCacheResult = true;
|
8475 | }
|
8476 | if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== "undefined") {
|
8477 | return horizontalScrollbarHeight_;
|
8478 | }
|
8479 | var el = documentObj.createElement("div");
|
8480 | el.classList.add(constants_1.cssClasses.SCROLL_TEST);
|
8481 | documentObj.body.appendChild(el);
|
8482 | var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;
|
8483 | documentObj.body.removeChild(el);
|
8484 | if (shouldCacheResult) {
|
8485 | horizontalScrollbarHeight_ = horizontalScrollbarHeight;
|
8486 | }
|
8487 | return horizontalScrollbarHeight;
|
8488 | }
|
8489 | exports.computeHorizontalScrollbarHeight = computeHorizontalScrollbarHeight;
|
8490 | }, function(module, exports, __webpack_require__) {
|
8491 | "use strict";
|
8492 | var __extends = this && this.__extends || function() {
|
8493 | var _extendStatics = function extendStatics(d, b) {
|
8494 | _extendStatics = Object.setPrototypeOf || {
|
8495 | __proto__: []
|
8496 | } instanceof Array && function(d, b) {
|
8497 | d.__proto__ = b;
|
8498 | } || function(d, b) {
|
8499 | for (var p in b) {
|
8500 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
8501 | }
|
8502 | };
|
8503 | return _extendStatics(d, b);
|
8504 | };
|
8505 | return function(d, b) {
|
8506 | _extendStatics(d, b);
|
8507 | function __() {
|
8508 | this.constructor = d;
|
8509 | }
|
8510 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
8511 | };
|
8512 | }();
|
8513 | var __assign = this && this.__assign || function() {
|
8514 | __assign = Object.assign || function(t) {
|
8515 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
8516 | s = arguments[i];
|
8517 | for (var p in s) {
|
8518 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
8519 | }
|
8520 | }
|
8521 | return t;
|
8522 | };
|
8523 | return __assign.apply(this, arguments);
|
8524 | };
|
8525 | Object.defineProperty(exports, "__esModule", {
|
8526 | value: true
|
8527 | });
|
8528 | var component_1 = __webpack_require__(1);
|
8529 | var component_2 = __webpack_require__(2);
|
8530 | var foundation_1 = __webpack_require__(4);
|
8531 | var component_3 = __webpack_require__(65);
|
8532 | var foundation_2 = __webpack_require__(22);
|
8533 | var MDCTab = function(_super) {
|
8534 | __extends(MDCTab, _super);
|
8535 | function MDCTab() {
|
8536 | return _super !== null && _super.apply(this, arguments) || this;
|
8537 | }
|
8538 | MDCTab.attachTo = function(root) {
|
8539 | return new MDCTab(root);
|
8540 | };
|
8541 | MDCTab.prototype.initialize = function(rippleFactory, tabIndicatorFactory) {
|
8542 | if (rippleFactory === void 0) {
|
8543 | rippleFactory = function rippleFactory(el, foundation) {
|
8544 | return new component_2.MDCRipple(el, foundation);
|
8545 | };
|
8546 | }
|
8547 | if (tabIndicatorFactory === void 0) {
|
8548 | tabIndicatorFactory = function tabIndicatorFactory(el) {
|
8549 | return new component_3.MDCTabIndicator(el);
|
8550 | };
|
8551 | }
|
8552 | this.id = this.root_.id;
|
8553 | var rippleSurface = this.root_.querySelector(foundation_2.MDCTabFoundation.strings.RIPPLE_SELECTOR);
|
8554 | var rippleAdapter = __assign({}, component_2.MDCRipple.createAdapter(this), {
|
8555 | addClass: function addClass(className) {
|
8556 | return rippleSurface.classList.add(className);
|
8557 | },
|
8558 | removeClass: function removeClass(className) {
|
8559 | return rippleSurface.classList.remove(className);
|
8560 | },
|
8561 | updateCssVariable: function updateCssVariable(varName, value) {
|
8562 | return rippleSurface.style.setProperty(varName, value);
|
8563 | }
|
8564 | });
|
8565 | var rippleFoundation = new foundation_1.MDCRippleFoundation(rippleAdapter);
|
8566 | this.ripple_ = rippleFactory(this.root_, rippleFoundation);
|
8567 | var tabIndicatorElement = this.root_.querySelector(foundation_2.MDCTabFoundation.strings.TAB_INDICATOR_SELECTOR);
|
8568 | this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement);
|
8569 | this.content_ = this.root_.querySelector(foundation_2.MDCTabFoundation.strings.CONTENT_SELECTOR);
|
8570 | };
|
8571 | MDCTab.prototype.initialSyncWithDOM = function() {
|
8572 | var _this = this;
|
8573 | this.handleClick_ = function() {
|
8574 | return _this.foundation_.handleClick();
|
8575 | };
|
8576 | this.listen("click", this.handleClick_);
|
8577 | };
|
8578 | MDCTab.prototype.destroy = function() {
|
8579 | this.unlisten("click", this.handleClick_);
|
8580 | this.ripple_.destroy();
|
8581 | _super.prototype.destroy.call(this);
|
8582 | };
|
8583 | MDCTab.prototype.getDefaultFoundation = function() {
|
8584 | var _this = this;
|
8585 | var adapter = {
|
8586 | setAttr: function setAttr(attr, value) {
|
8587 | return _this.root_.setAttribute(attr, value);
|
8588 | },
|
8589 | addClass: function addClass(className) {
|
8590 | return _this.root_.classList.add(className);
|
8591 | },
|
8592 | removeClass: function removeClass(className) {
|
8593 | return _this.root_.classList.remove(className);
|
8594 | },
|
8595 | hasClass: function hasClass(className) {
|
8596 | return _this.root_.classList.contains(className);
|
8597 | },
|
8598 | activateIndicator: function activateIndicator(previousIndicatorClientRect) {
|
8599 | return _this.tabIndicator_.activate(previousIndicatorClientRect);
|
8600 | },
|
8601 | deactivateIndicator: function deactivateIndicator() {
|
8602 | return _this.tabIndicator_.deactivate();
|
8603 | },
|
8604 | notifyInteracted: function notifyInteracted() {
|
8605 | return _this.emit(foundation_2.MDCTabFoundation.strings.INTERACTED_EVENT, {
|
8606 | tabId: _this.id
|
8607 | }, true);
|
8608 | },
|
8609 | getOffsetLeft: function getOffsetLeft() {
|
8610 | return _this.root_.offsetLeft;
|
8611 | },
|
8612 | getOffsetWidth: function getOffsetWidth() {
|
8613 | return _this.root_.offsetWidth;
|
8614 | },
|
8615 | getContentOffsetLeft: function getContentOffsetLeft() {
|
8616 | return _this.content_.offsetLeft;
|
8617 | },
|
8618 | getContentOffsetWidth: function getContentOffsetWidth() {
|
8619 | return _this.content_.offsetWidth;
|
8620 | },
|
8621 | focus: function focus() {
|
8622 | return _this.root_.focus();
|
8623 | }
|
8624 | };
|
8625 | return new foundation_2.MDCTabFoundation(adapter);
|
8626 | };
|
8627 | Object.defineProperty(MDCTab.prototype, "active", {
|
8628 | get: function get() {
|
8629 | return this.foundation_.isActive();
|
8630 | },
|
8631 | enumerable: true,
|
8632 | configurable: true
|
8633 | });
|
8634 | Object.defineProperty(MDCTab.prototype, "focusOnActivate", {
|
8635 | set: function set(focusOnActivate) {
|
8636 | this.foundation_.setFocusOnActivate(focusOnActivate);
|
8637 | },
|
8638 | enumerable: true,
|
8639 | configurable: true
|
8640 | });
|
8641 | MDCTab.prototype.activate = function(computeIndicatorClientRect) {
|
8642 | this.foundation_.activate(computeIndicatorClientRect);
|
8643 | };
|
8644 | MDCTab.prototype.deactivate = function() {
|
8645 | this.foundation_.deactivate();
|
8646 | };
|
8647 | MDCTab.prototype.computeIndicatorClientRect = function() {
|
8648 | return this.tabIndicator_.computeContentClientRect();
|
8649 | };
|
8650 | MDCTab.prototype.computeDimensions = function() {
|
8651 | return this.foundation_.computeDimensions();
|
8652 | };
|
8653 | MDCTab.prototype.focus = function() {
|
8654 | this.root_.focus();
|
8655 | };
|
8656 | return MDCTab;
|
8657 | }(component_1.MDCComponent);
|
8658 | exports.MDCTab = MDCTab;
|
8659 | }, function(module, exports, __webpack_require__) {
|
8660 | "use strict";
|
8661 | var __extends = this && this.__extends || function() {
|
8662 | var _extendStatics = function extendStatics(d, b) {
|
8663 | _extendStatics = Object.setPrototypeOf || {
|
8664 | __proto__: []
|
8665 | } instanceof Array && function(d, b) {
|
8666 | d.__proto__ = b;
|
8667 | } || function(d, b) {
|
8668 | for (var p in b) {
|
8669 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
8670 | }
|
8671 | };
|
8672 | return _extendStatics(d, b);
|
8673 | };
|
8674 | return function(d, b) {
|
8675 | _extendStatics(d, b);
|
8676 | function __() {
|
8677 | this.constructor = d;
|
8678 | }
|
8679 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
8680 | };
|
8681 | }();
|
8682 | Object.defineProperty(exports, "__esModule", {
|
8683 | value: true
|
8684 | });
|
8685 | var component_1 = __webpack_require__(1);
|
8686 | var fading_foundation_1 = __webpack_require__(66);
|
8687 | var foundation_1 = __webpack_require__(9);
|
8688 | var sliding_foundation_1 = __webpack_require__(67);
|
8689 | var MDCTabIndicator = function(_super) {
|
8690 | __extends(MDCTabIndicator, _super);
|
8691 | function MDCTabIndicator() {
|
8692 | return _super !== null && _super.apply(this, arguments) || this;
|
8693 | }
|
8694 | MDCTabIndicator.attachTo = function(root) {
|
8695 | return new MDCTabIndicator(root);
|
8696 | };
|
8697 | MDCTabIndicator.prototype.initialize = function() {
|
8698 | this.content_ = this.root_.querySelector(foundation_1.MDCTabIndicatorFoundation.strings.CONTENT_SELECTOR);
|
8699 | };
|
8700 | MDCTabIndicator.prototype.computeContentClientRect = function() {
|
8701 | return this.foundation_.computeContentClientRect();
|
8702 | };
|
8703 | MDCTabIndicator.prototype.getDefaultFoundation = function() {
|
8704 | var _this = this;
|
8705 | var adapter = {
|
8706 | addClass: function addClass(className) {
|
8707 | return _this.root_.classList.add(className);
|
8708 | },
|
8709 | removeClass: function removeClass(className) {
|
8710 | return _this.root_.classList.remove(className);
|
8711 | },
|
8712 | computeContentClientRect: function computeContentClientRect() {
|
8713 | return _this.content_.getBoundingClientRect();
|
8714 | },
|
8715 | setContentStyleProperty: function setContentStyleProperty(prop, value) {
|
8716 | return _this.content_.style.setProperty(prop, value);
|
8717 | }
|
8718 | };
|
8719 | if (this.root_.classList.contains(foundation_1.MDCTabIndicatorFoundation.cssClasses.FADE)) {
|
8720 | return new fading_foundation_1.MDCFadingTabIndicatorFoundation(adapter);
|
8721 | }
|
8722 | return new sliding_foundation_1.MDCSlidingTabIndicatorFoundation(adapter);
|
8723 | };
|
8724 | MDCTabIndicator.prototype.activate = function(previousIndicatorClientRect) {
|
8725 | this.foundation_.activate(previousIndicatorClientRect);
|
8726 | };
|
8727 | MDCTabIndicator.prototype.deactivate = function() {
|
8728 | this.foundation_.deactivate();
|
8729 | };
|
8730 | return MDCTabIndicator;
|
8731 | }(component_1.MDCComponent);
|
8732 | exports.MDCTabIndicator = MDCTabIndicator;
|
8733 | }, function(module, exports, __webpack_require__) {
|
8734 | "use strict";
|
8735 | var __extends = this && this.__extends || function() {
|
8736 | var _extendStatics = function extendStatics(d, b) {
|
8737 | _extendStatics = Object.setPrototypeOf || {
|
8738 | __proto__: []
|
8739 | } instanceof Array && function(d, b) {
|
8740 | d.__proto__ = b;
|
8741 | } || function(d, b) {
|
8742 | for (var p in b) {
|
8743 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
8744 | }
|
8745 | };
|
8746 | return _extendStatics(d, b);
|
8747 | };
|
8748 | return function(d, b) {
|
8749 | _extendStatics(d, b);
|
8750 | function __() {
|
8751 | this.constructor = d;
|
8752 | }
|
8753 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
8754 | };
|
8755 | }();
|
8756 | Object.defineProperty(exports, "__esModule", {
|
8757 | value: true
|
8758 | });
|
8759 | var foundation_1 = __webpack_require__(9);
|
8760 | var MDCFadingTabIndicatorFoundation = function(_super) {
|
8761 | __extends(MDCFadingTabIndicatorFoundation, _super);
|
8762 | function MDCFadingTabIndicatorFoundation() {
|
8763 | return _super !== null && _super.apply(this, arguments) || this;
|
8764 | }
|
8765 | MDCFadingTabIndicatorFoundation.prototype.activate = function() {
|
8766 | this.adapter_.addClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.ACTIVE);
|
8767 | };
|
8768 | MDCFadingTabIndicatorFoundation.prototype.deactivate = function() {
|
8769 | this.adapter_.removeClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.ACTIVE);
|
8770 | };
|
8771 | return MDCFadingTabIndicatorFoundation;
|
8772 | }(foundation_1.MDCTabIndicatorFoundation);
|
8773 | exports.MDCFadingTabIndicatorFoundation = MDCFadingTabIndicatorFoundation;
|
8774 | exports.default = MDCFadingTabIndicatorFoundation;
|
8775 | }, function(module, exports, __webpack_require__) {
|
8776 | "use strict";
|
8777 | var __extends = this && this.__extends || function() {
|
8778 | var _extendStatics = function extendStatics(d, b) {
|
8779 | _extendStatics = Object.setPrototypeOf || {
|
8780 | __proto__: []
|
8781 | } instanceof Array && function(d, b) {
|
8782 | d.__proto__ = b;
|
8783 | } || function(d, b) {
|
8784 | for (var p in b) {
|
8785 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
8786 | }
|
8787 | };
|
8788 | return _extendStatics(d, b);
|
8789 | };
|
8790 | return function(d, b) {
|
8791 | _extendStatics(d, b);
|
8792 | function __() {
|
8793 | this.constructor = d;
|
8794 | }
|
8795 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
8796 | };
|
8797 | }();
|
8798 | Object.defineProperty(exports, "__esModule", {
|
8799 | value: true
|
8800 | });
|
8801 | var foundation_1 = __webpack_require__(9);
|
8802 | var MDCSlidingTabIndicatorFoundation = function(_super) {
|
8803 | __extends(MDCSlidingTabIndicatorFoundation, _super);
|
8804 | function MDCSlidingTabIndicatorFoundation() {
|
8805 | return _super !== null && _super.apply(this, arguments) || this;
|
8806 | }
|
8807 | MDCSlidingTabIndicatorFoundation.prototype.activate = function(previousIndicatorClientRect) {
|
8808 | if (!previousIndicatorClientRect) {
|
8809 | this.adapter_.addClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.ACTIVE);
|
8810 | return;
|
8811 | }
|
8812 | var currentClientRect = this.computeContentClientRect();
|
8813 | var widthDelta = previousIndicatorClientRect.width / currentClientRect.width;
|
8814 | var xPosition = previousIndicatorClientRect.left - currentClientRect.left;
|
8815 | this.adapter_.addClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);
|
8816 | this.adapter_.setContentStyleProperty("transform", "translateX(" + xPosition + "px) scaleX(" + widthDelta + ")");
|
8817 | this.computeContentClientRect();
|
8818 | this.adapter_.removeClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);
|
8819 | this.adapter_.addClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.ACTIVE);
|
8820 | this.adapter_.setContentStyleProperty("transform", "");
|
8821 | };
|
8822 | MDCSlidingTabIndicatorFoundation.prototype.deactivate = function() {
|
8823 | this.adapter_.removeClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.ACTIVE);
|
8824 | };
|
8825 | return MDCSlidingTabIndicatorFoundation;
|
8826 | }(foundation_1.MDCTabIndicatorFoundation);
|
8827 | exports.MDCSlidingTabIndicatorFoundation = MDCSlidingTabIndicatorFoundation;
|
8828 | exports.default = MDCSlidingTabIndicatorFoundation;
|
8829 | }, function(module, exports, __webpack_require__) {
|
8830 | "use strict";
|
8831 | var __extends = this && this.__extends || function() {
|
8832 | var _extendStatics = function extendStatics(d, b) {
|
8833 | _extendStatics = Object.setPrototypeOf || {
|
8834 | __proto__: []
|
8835 | } instanceof Array && function(d, b) {
|
8836 | d.__proto__ = b;
|
8837 | } || function(d, b) {
|
8838 | for (var p in b) {
|
8839 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
8840 | }
|
8841 | };
|
8842 | return _extendStatics(d, b);
|
8843 | };
|
8844 | return function(d, b) {
|
8845 | _extendStatics(d, b);
|
8846 | function __() {
|
8847 | this.constructor = d;
|
8848 | }
|
8849 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
8850 | };
|
8851 | }();
|
8852 | var __assign = this && this.__assign || function() {
|
8853 | __assign = Object.assign || function(t) {
|
8854 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
8855 | s = arguments[i];
|
8856 | for (var p in s) {
|
8857 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
8858 | }
|
8859 | }
|
8860 | return t;
|
8861 | };
|
8862 | return __assign.apply(this, arguments);
|
8863 | };
|
8864 | Object.defineProperty(exports, "__esModule", {
|
8865 | value: true
|
8866 | });
|
8867 | var foundation_1 = __webpack_require__(0);
|
8868 | var constants_1 = __webpack_require__(146);
|
8869 | var ACCEPTABLE_KEYS = new Set();
|
8870 | ACCEPTABLE_KEYS.add(constants_1.strings.ARROW_LEFT_KEY);
|
8871 | ACCEPTABLE_KEYS.add(constants_1.strings.ARROW_RIGHT_KEY);
|
8872 | ACCEPTABLE_KEYS.add(constants_1.strings.END_KEY);
|
8873 | ACCEPTABLE_KEYS.add(constants_1.strings.HOME_KEY);
|
8874 | ACCEPTABLE_KEYS.add(constants_1.strings.ENTER_KEY);
|
8875 | ACCEPTABLE_KEYS.add(constants_1.strings.SPACE_KEY);
|
8876 | var KEYCODE_MAP = new Map();
|
8877 | KEYCODE_MAP.set(constants_1.numbers.ARROW_LEFT_KEYCODE, constants_1.strings.ARROW_LEFT_KEY);
|
8878 | KEYCODE_MAP.set(constants_1.numbers.ARROW_RIGHT_KEYCODE, constants_1.strings.ARROW_RIGHT_KEY);
|
8879 | KEYCODE_MAP.set(constants_1.numbers.END_KEYCODE, constants_1.strings.END_KEY);
|
8880 | KEYCODE_MAP.set(constants_1.numbers.HOME_KEYCODE, constants_1.strings.HOME_KEY);
|
8881 | KEYCODE_MAP.set(constants_1.numbers.ENTER_KEYCODE, constants_1.strings.ENTER_KEY);
|
8882 | KEYCODE_MAP.set(constants_1.numbers.SPACE_KEYCODE, constants_1.strings.SPACE_KEY);
|
8883 | var MDCTabBarFoundation = function(_super) {
|
8884 | __extends(MDCTabBarFoundation, _super);
|
8885 | function MDCTabBarFoundation(adapter) {
|
8886 | var _this = _super.call(this, __assign({}, MDCTabBarFoundation.defaultAdapter, adapter)) || this;
|
8887 | _this.useAutomaticActivation_ = false;
|
8888 | return _this;
|
8889 | }
|
8890 | Object.defineProperty(MDCTabBarFoundation, "strings", {
|
8891 | get: function get() {
|
8892 | return constants_1.strings;
|
8893 | },
|
8894 | enumerable: true,
|
8895 | configurable: true
|
8896 | });
|
8897 | Object.defineProperty(MDCTabBarFoundation, "numbers", {
|
8898 | get: function get() {
|
8899 | return constants_1.numbers;
|
8900 | },
|
8901 | enumerable: true,
|
8902 | configurable: true
|
8903 | });
|
8904 | Object.defineProperty(MDCTabBarFoundation, "defaultAdapter", {
|
8905 | get: function get() {
|
8906 | return {
|
8907 | scrollTo: function scrollTo() {
|
8908 | return undefined;
|
8909 | },
|
8910 | incrementScroll: function incrementScroll() {
|
8911 | return undefined;
|
8912 | },
|
8913 | getScrollPosition: function getScrollPosition() {
|
8914 | return 0;
|
8915 | },
|
8916 | getScrollContentWidth: function getScrollContentWidth() {
|
8917 | return 0;
|
8918 | },
|
8919 | getOffsetWidth: function getOffsetWidth() {
|
8920 | return 0;
|
8921 | },
|
8922 | isRTL: function isRTL() {
|
8923 | return false;
|
8924 | },
|
8925 | setActiveTab: function setActiveTab() {
|
8926 | return undefined;
|
8927 | },
|
8928 | activateTabAtIndex: function activateTabAtIndex() {
|
8929 | return undefined;
|
8930 | },
|
8931 | deactivateTabAtIndex: function deactivateTabAtIndex() {
|
8932 | return undefined;
|
8933 | },
|
8934 | focusTabAtIndex: function focusTabAtIndex() {
|
8935 | return undefined;
|
8936 | },
|
8937 | getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex() {
|
8938 | return {
|
8939 | top: 0,
|
8940 | right: 0,
|
8941 | bottom: 0,
|
8942 | left: 0,
|
8943 | width: 0,
|
8944 | height: 0
|
8945 | };
|
8946 | },
|
8947 | getTabDimensionsAtIndex: function getTabDimensionsAtIndex() {
|
8948 | return {
|
8949 | rootLeft: 0,
|
8950 | rootRight: 0,
|
8951 | contentLeft: 0,
|
8952 | contentRight: 0
|
8953 | };
|
8954 | },
|
8955 | getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {
|
8956 | return -1;
|
8957 | },
|
8958 | getFocusedTabIndex: function getFocusedTabIndex() {
|
8959 | return -1;
|
8960 | },
|
8961 | getIndexOfTabById: function getIndexOfTabById() {
|
8962 | return -1;
|
8963 | },
|
8964 | getTabListLength: function getTabListLength() {
|
8965 | return 0;
|
8966 | },
|
8967 | notifyTabActivated: function notifyTabActivated() {
|
8968 | return undefined;
|
8969 | }
|
8970 | };
|
8971 | },
|
8972 | enumerable: true,
|
8973 | configurable: true
|
8974 | });
|
8975 | MDCTabBarFoundation.prototype.setUseAutomaticActivation = function(useAutomaticActivation) {
|
8976 | this.useAutomaticActivation_ = useAutomaticActivation;
|
8977 | };
|
8978 | MDCTabBarFoundation.prototype.activateTab = function(index) {
|
8979 | var previousActiveIndex = this.adapter_.getPreviousActiveTabIndex();
|
8980 | if (!this.indexIsInRange_(index) || index === previousActiveIndex) {
|
8981 | return;
|
8982 | }
|
8983 | var previousClientRect;
|
8984 | if (previousActiveIndex !== -1) {
|
8985 | this.adapter_.deactivateTabAtIndex(previousActiveIndex);
|
8986 | previousClientRect = this.adapter_.getTabIndicatorClientRectAtIndex(previousActiveIndex);
|
8987 | }
|
8988 | this.adapter_.activateTabAtIndex(index, previousClientRect);
|
8989 | this.scrollIntoView(index);
|
8990 | this.adapter_.notifyTabActivated(index);
|
8991 | };
|
8992 | MDCTabBarFoundation.prototype.handleKeyDown = function(evt) {
|
8993 | var key = this.getKeyFromEvent_(evt);
|
8994 | if (key === undefined) {
|
8995 | return;
|
8996 | }
|
8997 | if (!this.isActivationKey_(key)) {
|
8998 | evt.preventDefault();
|
8999 | }
|
9000 | if (this.useAutomaticActivation_) {
|
9001 | if (this.isActivationKey_(key)) {
|
9002 | return;
|
9003 | }
|
9004 | var index = this.determineTargetFromKey_(this.adapter_.getPreviousActiveTabIndex(), key);
|
9005 | this.adapter_.setActiveTab(index);
|
9006 | this.scrollIntoView(index);
|
9007 | } else {
|
9008 | var focusedTabIndex = this.adapter_.getFocusedTabIndex();
|
9009 | if (this.isActivationKey_(key)) {
|
9010 | this.adapter_.setActiveTab(focusedTabIndex);
|
9011 | } else {
|
9012 | var index = this.determineTargetFromKey_(focusedTabIndex, key);
|
9013 | this.adapter_.focusTabAtIndex(index);
|
9014 | this.scrollIntoView(index);
|
9015 | }
|
9016 | }
|
9017 | };
|
9018 | MDCTabBarFoundation.prototype.handleTabInteraction = function(evt) {
|
9019 | this.adapter_.setActiveTab(this.adapter_.getIndexOfTabById(evt.detail.tabId));
|
9020 | };
|
9021 | MDCTabBarFoundation.prototype.scrollIntoView = function(index) {
|
9022 | if (!this.indexIsInRange_(index)) {
|
9023 | return;
|
9024 | }
|
9025 | if (index === 0) {
|
9026 | return this.adapter_.scrollTo(0);
|
9027 | }
|
9028 | if (index === this.adapter_.getTabListLength() - 1) {
|
9029 | return this.adapter_.scrollTo(this.adapter_.getScrollContentWidth());
|
9030 | }
|
9031 | if (this.isRTL_()) {
|
9032 | return this.scrollIntoViewRTL_(index);
|
9033 | }
|
9034 | this.scrollIntoView_(index);
|
9035 | };
|
9036 | MDCTabBarFoundation.prototype.determineTargetFromKey_ = function(origin, key) {
|
9037 | var isRTL = this.isRTL_();
|
9038 | var maxIndex = this.adapter_.getTabListLength() - 1;
|
9039 | var shouldGoToEnd = key === constants_1.strings.END_KEY;
|
9040 | var shouldDecrement = key === constants_1.strings.ARROW_LEFT_KEY && !isRTL || key === constants_1.strings.ARROW_RIGHT_KEY && isRTL;
|
9041 | var shouldIncrement = key === constants_1.strings.ARROW_RIGHT_KEY && !isRTL || key === constants_1.strings.ARROW_LEFT_KEY && isRTL;
|
9042 | var index = origin;
|
9043 | if (shouldGoToEnd) {
|
9044 | index = maxIndex;
|
9045 | } else if (shouldDecrement) {
|
9046 | index -= 1;
|
9047 | } else if (shouldIncrement) {
|
9048 | index += 1;
|
9049 | } else {
|
9050 | index = 0;
|
9051 | }
|
9052 | if (index < 0) {
|
9053 | index = maxIndex;
|
9054 | } else if (index > maxIndex) {
|
9055 | index = 0;
|
9056 | }
|
9057 | return index;
|
9058 | };
|
9059 | MDCTabBarFoundation.prototype.calculateScrollIncrement_ = function(index, nextIndex, scrollPosition, barWidth) {
|
9060 | var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
|
9061 | var relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;
|
9062 | var relativeContentRight = nextTabDimensions.contentRight - scrollPosition;
|
9063 | var leftIncrement = relativeContentRight - constants_1.numbers.EXTRA_SCROLL_AMOUNT;
|
9064 | var rightIncrement = relativeContentLeft + constants_1.numbers.EXTRA_SCROLL_AMOUNT;
|
9065 | if (nextIndex < index) {
|
9066 | return Math.min(leftIncrement, 0);
|
9067 | }
|
9068 | return Math.max(rightIncrement, 0);
|
9069 | };
|
9070 | MDCTabBarFoundation.prototype.calculateScrollIncrementRTL_ = function(index, nextIndex, scrollPosition, barWidth, scrollContentWidth) {
|
9071 | var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
|
9072 | var relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;
|
9073 | var relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;
|
9074 | var leftIncrement = relativeContentRight + constants_1.numbers.EXTRA_SCROLL_AMOUNT;
|
9075 | var rightIncrement = relativeContentLeft - constants_1.numbers.EXTRA_SCROLL_AMOUNT;
|
9076 | if (nextIndex > index) {
|
9077 | return Math.max(leftIncrement, 0);
|
9078 | }
|
9079 | return Math.min(rightIncrement, 0);
|
9080 | };
|
9081 | MDCTabBarFoundation.prototype.findAdjacentTabIndexClosestToEdge_ = function(index, tabDimensions, scrollPosition, barWidth) {
|
9082 | var relativeRootLeft = tabDimensions.rootLeft - scrollPosition;
|
9083 | var relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;
|
9084 | var relativeRootDelta = relativeRootLeft + relativeRootRight;
|
9085 | var leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;
|
9086 | var rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;
|
9087 | if (leftEdgeIsCloser) {
|
9088 | return index - 1;
|
9089 | }
|
9090 | if (rightEdgeIsCloser) {
|
9091 | return index + 1;
|
9092 | }
|
9093 | return -1;
|
9094 | };
|
9095 | MDCTabBarFoundation.prototype.findAdjacentTabIndexClosestToEdgeRTL_ = function(index, tabDimensions, scrollPosition, barWidth, scrollContentWidth) {
|
9096 | var rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;
|
9097 | var rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;
|
9098 | var rootDelta = rootLeft + rootRight;
|
9099 | var leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;
|
9100 | var rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;
|
9101 | if (leftEdgeIsCloser) {
|
9102 | return index + 1;
|
9103 | }
|
9104 | if (rightEdgeIsCloser) {
|
9105 | return index - 1;
|
9106 | }
|
9107 | return -1;
|
9108 | };
|
9109 | MDCTabBarFoundation.prototype.getKeyFromEvent_ = function(evt) {
|
9110 | if (ACCEPTABLE_KEYS.has(evt.key)) {
|
9111 | return evt.key;
|
9112 | }
|
9113 | return KEYCODE_MAP.get(evt.keyCode);
|
9114 | };
|
9115 | MDCTabBarFoundation.prototype.isActivationKey_ = function(key) {
|
9116 | return key === constants_1.strings.SPACE_KEY || key === constants_1.strings.ENTER_KEY;
|
9117 | };
|
9118 | MDCTabBarFoundation.prototype.indexIsInRange_ = function(index) {
|
9119 | return index >= 0 && index < this.adapter_.getTabListLength();
|
9120 | };
|
9121 | MDCTabBarFoundation.prototype.isRTL_ = function() {
|
9122 | return this.adapter_.isRTL();
|
9123 | };
|
9124 | MDCTabBarFoundation.prototype.scrollIntoView_ = function(index) {
|
9125 | var scrollPosition = this.adapter_.getScrollPosition();
|
9126 | var barWidth = this.adapter_.getOffsetWidth();
|
9127 | var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
|
9128 | var nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);
|
9129 | if (!this.indexIsInRange_(nextIndex)) {
|
9130 | return;
|
9131 | }
|
9132 | var scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);
|
9133 | this.adapter_.incrementScroll(scrollIncrement);
|
9134 | };
|
9135 | MDCTabBarFoundation.prototype.scrollIntoViewRTL_ = function(index) {
|
9136 | var scrollPosition = this.adapter_.getScrollPosition();
|
9137 | var barWidth = this.adapter_.getOffsetWidth();
|
9138 | var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
|
9139 | var scrollWidth = this.adapter_.getScrollContentWidth();
|
9140 | var nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollWidth);
|
9141 | if (!this.indexIsInRange_(nextIndex)) {
|
9142 | return;
|
9143 | }
|
9144 | var scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);
|
9145 | this.adapter_.incrementScroll(scrollIncrement);
|
9146 | };
|
9147 | return MDCTabBarFoundation;
|
9148 | }(foundation_1.MDCFoundation);
|
9149 | exports.MDCTabBarFoundation = MDCTabBarFoundation;
|
9150 | exports.default = MDCTabBarFoundation;
|
9151 | }, function(module, exports, __webpack_require__) {
|
9152 | "use strict";
|
9153 | var __extends = this && this.__extends || function() {
|
9154 | var _extendStatics = function extendStatics(d, b) {
|
9155 | _extendStatics = Object.setPrototypeOf || {
|
9156 | __proto__: []
|
9157 | } instanceof Array && function(d, b) {
|
9158 | d.__proto__ = b;
|
9159 | } || function(d, b) {
|
9160 | for (var p in b) {
|
9161 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
9162 | }
|
9163 | };
|
9164 | return _extendStatics(d, b);
|
9165 | };
|
9166 | return function(d, b) {
|
9167 | _extendStatics(d, b);
|
9168 | function __() {
|
9169 | this.constructor = d;
|
9170 | }
|
9171 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
9172 | };
|
9173 | }();
|
9174 | Object.defineProperty(exports, "__esModule", {
|
9175 | value: true
|
9176 | });
|
9177 | var component_1 = __webpack_require__(1);
|
9178 | var foundation_1 = __webpack_require__(23);
|
9179 | var MDCTextFieldCharacterCounter = function(_super) {
|
9180 | __extends(MDCTextFieldCharacterCounter, _super);
|
9181 | function MDCTextFieldCharacterCounter() {
|
9182 | return _super !== null && _super.apply(this, arguments) || this;
|
9183 | }
|
9184 | MDCTextFieldCharacterCounter.attachTo = function(root) {
|
9185 | return new MDCTextFieldCharacterCounter(root);
|
9186 | };
|
9187 | Object.defineProperty(MDCTextFieldCharacterCounter.prototype, "foundation", {
|
9188 | get: function get() {
|
9189 | return this.foundation_;
|
9190 | },
|
9191 | enumerable: true,
|
9192 | configurable: true
|
9193 | });
|
9194 | MDCTextFieldCharacterCounter.prototype.getDefaultFoundation = function() {
|
9195 | var _this = this;
|
9196 | var adapter = {
|
9197 | setContent: function setContent(content) {
|
9198 | _this.root_.textContent = content;
|
9199 | }
|
9200 | };
|
9201 | return new foundation_1.MDCTextFieldCharacterCounterFoundation(adapter);
|
9202 | };
|
9203 | return MDCTextFieldCharacterCounter;
|
9204 | }(component_1.MDCComponent);
|
9205 | exports.MDCTextFieldCharacterCounter = MDCTextFieldCharacterCounter;
|
9206 | }, function(module, exports, __webpack_require__) {
|
9207 | "use strict";
|
9208 | Object.defineProperty(exports, "__esModule", {
|
9209 | value: true
|
9210 | });
|
9211 | var strings = {
|
9212 | ARIA_CONTROLS: "aria-controls",
|
9213 | ICON_SELECTOR: ".mdc-text-field__icon",
|
9214 | INPUT_SELECTOR: ".mdc-text-field__input",
|
9215 | LABEL_SELECTOR: ".mdc-floating-label",
|
9216 | LINE_RIPPLE_SELECTOR: ".mdc-line-ripple",
|
9217 | OUTLINE_SELECTOR: ".mdc-notched-outline"
|
9218 | };
|
9219 | exports.strings = strings;
|
9220 | var cssClasses = {
|
9221 | DENSE: "mdc-text-field--dense",
|
9222 | DISABLED: "mdc-text-field--disabled",
|
9223 | FOCUSED: "mdc-text-field--focused",
|
9224 | FULLWIDTH: "mdc-text-field--fullwidth",
|
9225 | HELPER_LINE: "mdc-text-field-helper-line",
|
9226 | INVALID: "mdc-text-field--invalid",
|
9227 | NO_LABEL: "mdc-text-field--no-label",
|
9228 | OUTLINED: "mdc-text-field--outlined",
|
9229 | ROOT: "mdc-text-field",
|
9230 | TEXTAREA: "mdc-text-field--textarea",
|
9231 | WITH_LEADING_ICON: "mdc-text-field--with-leading-icon",
|
9232 | WITH_TRAILING_ICON: "mdc-text-field--with-trailing-icon"
|
9233 | };
|
9234 | exports.cssClasses = cssClasses;
|
9235 | var numbers = {
|
9236 | DENSE_LABEL_SCALE: .923,
|
9237 | LABEL_SCALE: .75
|
9238 | };
|
9239 | exports.numbers = numbers;
|
9240 | var VALIDATION_ATTR_WHITELIST = [ "pattern", "min", "max", "required", "step", "minlength", "maxlength" ];
|
9241 | exports.VALIDATION_ATTR_WHITELIST = VALIDATION_ATTR_WHITELIST;
|
9242 | var ALWAYS_FLOAT_TYPES = [ "color", "date", "datetime-local", "month", "range", "time", "week" ];
|
9243 | exports.ALWAYS_FLOAT_TYPES = ALWAYS_FLOAT_TYPES;
|
9244 | }, function(module, exports, __webpack_require__) {
|
9245 | "use strict";
|
9246 | var __extends = this && this.__extends || function() {
|
9247 | var _extendStatics = function extendStatics(d, b) {
|
9248 | _extendStatics = Object.setPrototypeOf || {
|
9249 | __proto__: []
|
9250 | } instanceof Array && function(d, b) {
|
9251 | d.__proto__ = b;
|
9252 | } || function(d, b) {
|
9253 | for (var p in b) {
|
9254 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
9255 | }
|
9256 | };
|
9257 | return _extendStatics(d, b);
|
9258 | };
|
9259 | return function(d, b) {
|
9260 | _extendStatics(d, b);
|
9261 | function __() {
|
9262 | this.constructor = d;
|
9263 | }
|
9264 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
9265 | };
|
9266 | }();
|
9267 | var __assign = this && this.__assign || function() {
|
9268 | __assign = Object.assign || function(t) {
|
9269 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
9270 | s = arguments[i];
|
9271 | for (var p in s) {
|
9272 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
9273 | }
|
9274 | }
|
9275 | return t;
|
9276 | };
|
9277 | return __assign.apply(this, arguments);
|
9278 | };
|
9279 | Object.defineProperty(exports, "__esModule", {
|
9280 | value: true
|
9281 | });
|
9282 | var foundation_1 = __webpack_require__(0);
|
9283 | var constants_1 = __webpack_require__(70);
|
9284 | var POINTERDOWN_EVENTS = [ "mousedown", "touchstart" ];
|
9285 | var INTERACTION_EVENTS = [ "click", "keydown" ];
|
9286 | var MDCTextFieldFoundation = function(_super) {
|
9287 | __extends(MDCTextFieldFoundation, _super);
|
9288 | function MDCTextFieldFoundation(adapter, foundationMap) {
|
9289 | if (foundationMap === void 0) {
|
9290 | foundationMap = {};
|
9291 | }
|
9292 | var _this = _super.call(this, __assign({}, MDCTextFieldFoundation.defaultAdapter, adapter)) || this;
|
9293 | _this.isFocused_ = false;
|
9294 | _this.receivedUserInput_ = false;
|
9295 | _this.isValid_ = true;
|
9296 | _this.useNativeValidation_ = true;
|
9297 | _this.helperText_ = foundationMap.helperText;
|
9298 | _this.characterCounter_ = foundationMap.characterCounter;
|
9299 | _this.leadingIcon_ = foundationMap.leadingIcon;
|
9300 | _this.trailingIcon_ = foundationMap.trailingIcon;
|
9301 | _this.inputFocusHandler_ = function() {
|
9302 | return _this.activateFocus();
|
9303 | };
|
9304 | _this.inputBlurHandler_ = function() {
|
9305 | return _this.deactivateFocus();
|
9306 | };
|
9307 | _this.inputInputHandler_ = function() {
|
9308 | return _this.handleInput();
|
9309 | };
|
9310 | _this.setPointerXOffset_ = function(evt) {
|
9311 | return _this.setTransformOrigin(evt);
|
9312 | };
|
9313 | _this.textFieldInteractionHandler_ = function() {
|
9314 | return _this.handleTextFieldInteraction();
|
9315 | };
|
9316 | _this.validationAttributeChangeHandler_ = function(attributesList) {
|
9317 | return _this.handleValidationAttributeChange(attributesList);
|
9318 | };
|
9319 | return _this;
|
9320 | }
|
9321 | Object.defineProperty(MDCTextFieldFoundation, "cssClasses", {
|
9322 | get: function get() {
|
9323 | return constants_1.cssClasses;
|
9324 | },
|
9325 | enumerable: true,
|
9326 | configurable: true
|
9327 | });
|
9328 | Object.defineProperty(MDCTextFieldFoundation, "strings", {
|
9329 | get: function get() {
|
9330 | return constants_1.strings;
|
9331 | },
|
9332 | enumerable: true,
|
9333 | configurable: true
|
9334 | });
|
9335 | Object.defineProperty(MDCTextFieldFoundation, "numbers", {
|
9336 | get: function get() {
|
9337 | return constants_1.numbers;
|
9338 | },
|
9339 | enumerable: true,
|
9340 | configurable: true
|
9341 | });
|
9342 | Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldAlwaysFloat_", {
|
9343 | get: function get() {
|
9344 | var type = this.getNativeInput_().type;
|
9345 | return constants_1.ALWAYS_FLOAT_TYPES.indexOf(type) >= 0;
|
9346 | },
|
9347 | enumerable: true,
|
9348 | configurable: true
|
9349 | });
|
9350 | Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldFloat", {
|
9351 | get: function get() {
|
9352 | return this.shouldAlwaysFloat_ || this.isFocused_ || Boolean(this.getValue()) || this.isBadInput_();
|
9353 | },
|
9354 | enumerable: true,
|
9355 | configurable: true
|
9356 | });
|
9357 | Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldShake", {
|
9358 | get: function get() {
|
9359 | return !this.isFocused_ && !this.isValid() && Boolean(this.getValue());
|
9360 | },
|
9361 | enumerable: true,
|
9362 | configurable: true
|
9363 | });
|
9364 | Object.defineProperty(MDCTextFieldFoundation, "defaultAdapter", {
|
9365 | get: function get() {
|
9366 | return {
|
9367 | addClass: function addClass() {
|
9368 | return undefined;
|
9369 | },
|
9370 | removeClass: function removeClass() {
|
9371 | return undefined;
|
9372 | },
|
9373 | hasClass: function hasClass() {
|
9374 | return true;
|
9375 | },
|
9376 | registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() {
|
9377 | return undefined;
|
9378 | },
|
9379 | deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() {
|
9380 | return undefined;
|
9381 | },
|
9382 | registerInputInteractionHandler: function registerInputInteractionHandler() {
|
9383 | return undefined;
|
9384 | },
|
9385 | deregisterInputInteractionHandler: function deregisterInputInteractionHandler() {
|
9386 | return undefined;
|
9387 | },
|
9388 | registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() {
|
9389 | return new MutationObserver(function() {
|
9390 | return undefined;
|
9391 | });
|
9392 | },
|
9393 | deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() {
|
9394 | return undefined;
|
9395 | },
|
9396 | getNativeInput: function getNativeInput() {
|
9397 | return null;
|
9398 | },
|
9399 | isFocused: function isFocused() {
|
9400 | return false;
|
9401 | },
|
9402 | activateLineRipple: function activateLineRipple() {
|
9403 | return undefined;
|
9404 | },
|
9405 | deactivateLineRipple: function deactivateLineRipple() {
|
9406 | return undefined;
|
9407 | },
|
9408 | setLineRippleTransformOrigin: function setLineRippleTransformOrigin() {
|
9409 | return undefined;
|
9410 | },
|
9411 | shakeLabel: function shakeLabel() {
|
9412 | return undefined;
|
9413 | },
|
9414 | floatLabel: function floatLabel() {
|
9415 | return undefined;
|
9416 | },
|
9417 | hasLabel: function hasLabel() {
|
9418 | return false;
|
9419 | },
|
9420 | getLabelWidth: function getLabelWidth() {
|
9421 | return 0;
|
9422 | },
|
9423 | hasOutline: function hasOutline() {
|
9424 | return false;
|
9425 | },
|
9426 | notchOutline: function notchOutline() {
|
9427 | return undefined;
|
9428 | },
|
9429 | closeOutline: function closeOutline() {
|
9430 | return undefined;
|
9431 | }
|
9432 | };
|
9433 | },
|
9434 | enumerable: true,
|
9435 | configurable: true
|
9436 | });
|
9437 | MDCTextFieldFoundation.prototype.init = function() {
|
9438 | var _this = this;
|
9439 | if (this.adapter_.isFocused()) {
|
9440 | this.inputFocusHandler_();
|
9441 | } else if (this.adapter_.hasLabel() && this.shouldFloat) {
|
9442 | this.notchOutline(true);
|
9443 | this.adapter_.floatLabel(true);
|
9444 | }
|
9445 | this.adapter_.registerInputInteractionHandler("focus", this.inputFocusHandler_);
|
9446 | this.adapter_.registerInputInteractionHandler("blur", this.inputBlurHandler_);
|
9447 | this.adapter_.registerInputInteractionHandler("input", this.inputInputHandler_);
|
9448 | POINTERDOWN_EVENTS.forEach(function(evtType) {
|
9449 | _this.adapter_.registerInputInteractionHandler(evtType, _this.setPointerXOffset_);
|
9450 | });
|
9451 | INTERACTION_EVENTS.forEach(function(evtType) {
|
9452 | _this.adapter_.registerTextFieldInteractionHandler(evtType, _this.textFieldInteractionHandler_);
|
9453 | });
|
9454 | this.validationObserver_ = this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_);
|
9455 | this.setCharacterCounter_(this.getValue().length);
|
9456 | };
|
9457 | MDCTextFieldFoundation.prototype.destroy = function() {
|
9458 | var _this = this;
|
9459 | this.adapter_.deregisterInputInteractionHandler("focus", this.inputFocusHandler_);
|
9460 | this.adapter_.deregisterInputInteractionHandler("blur", this.inputBlurHandler_);
|
9461 | this.adapter_.deregisterInputInteractionHandler("input", this.inputInputHandler_);
|
9462 | POINTERDOWN_EVENTS.forEach(function(evtType) {
|
9463 | _this.adapter_.deregisterInputInteractionHandler(evtType, _this.setPointerXOffset_);
|
9464 | });
|
9465 | INTERACTION_EVENTS.forEach(function(evtType) {
|
9466 | _this.adapter_.deregisterTextFieldInteractionHandler(evtType, _this.textFieldInteractionHandler_);
|
9467 | });
|
9468 | this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_);
|
9469 | };
|
9470 | MDCTextFieldFoundation.prototype.handleTextFieldInteraction = function() {
|
9471 | var nativeInput = this.adapter_.getNativeInput();
|
9472 | if (nativeInput && nativeInput.disabled) {
|
9473 | return;
|
9474 | }
|
9475 | this.receivedUserInput_ = true;
|
9476 | };
|
9477 | MDCTextFieldFoundation.prototype.handleValidationAttributeChange = function(attributesList) {
|
9478 | var _this = this;
|
9479 | attributesList.some(function(attributeName) {
|
9480 | if (constants_1.VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) {
|
9481 | _this.styleValidity_(true);
|
9482 | return true;
|
9483 | }
|
9484 | return false;
|
9485 | });
|
9486 | if (attributesList.indexOf("maxlength") > -1) {
|
9487 | this.setCharacterCounter_(this.getValue().length);
|
9488 | }
|
9489 | };
|
9490 | MDCTextFieldFoundation.prototype.notchOutline = function(openNotch) {
|
9491 | if (!this.adapter_.hasOutline()) {
|
9492 | return;
|
9493 | }
|
9494 | if (openNotch) {
|
9495 | var isDense = this.adapter_.hasClass(constants_1.cssClasses.DENSE);
|
9496 | var labelScale = isDense ? constants_1.numbers.DENSE_LABEL_SCALE : constants_1.numbers.LABEL_SCALE;
|
9497 | var labelWidth = this.adapter_.getLabelWidth() * labelScale;
|
9498 | this.adapter_.notchOutline(labelWidth);
|
9499 | } else {
|
9500 | this.adapter_.closeOutline();
|
9501 | }
|
9502 | };
|
9503 | MDCTextFieldFoundation.prototype.activateFocus = function() {
|
9504 | this.isFocused_ = true;
|
9505 | this.styleFocused_(this.isFocused_);
|
9506 | this.adapter_.activateLineRipple();
|
9507 | if (this.adapter_.hasLabel()) {
|
9508 | this.notchOutline(this.shouldFloat);
|
9509 | this.adapter_.floatLabel(this.shouldFloat);
|
9510 | this.adapter_.shakeLabel(this.shouldShake);
|
9511 | }
|
9512 | if (this.helperText_) {
|
9513 | this.helperText_.showToScreenReader();
|
9514 | }
|
9515 | };
|
9516 | MDCTextFieldFoundation.prototype.setTransformOrigin = function(evt) {
|
9517 | var touches = evt.touches;
|
9518 | var targetEvent = touches ? touches[0] : evt;
|
9519 | var targetClientRect = targetEvent.target.getBoundingClientRect();
|
9520 | var normalizedX = targetEvent.clientX - targetClientRect.left;
|
9521 | this.adapter_.setLineRippleTransformOrigin(normalizedX);
|
9522 | };
|
9523 | MDCTextFieldFoundation.prototype.handleInput = function() {
|
9524 | this.autoCompleteFocus();
|
9525 | this.setCharacterCounter_(this.getValue().length);
|
9526 | };
|
9527 | MDCTextFieldFoundation.prototype.autoCompleteFocus = function() {
|
9528 | if (!this.receivedUserInput_) {
|
9529 | this.activateFocus();
|
9530 | }
|
9531 | };
|
9532 | MDCTextFieldFoundation.prototype.deactivateFocus = function() {
|
9533 | this.isFocused_ = false;
|
9534 | this.adapter_.deactivateLineRipple();
|
9535 | var isValid = this.isValid();
|
9536 | this.styleValidity_(isValid);
|
9537 | this.styleFocused_(this.isFocused_);
|
9538 | if (this.adapter_.hasLabel()) {
|
9539 | this.notchOutline(this.shouldFloat);
|
9540 | this.adapter_.floatLabel(this.shouldFloat);
|
9541 | this.adapter_.shakeLabel(this.shouldShake);
|
9542 | }
|
9543 | if (!this.shouldFloat) {
|
9544 | this.receivedUserInput_ = false;
|
9545 | }
|
9546 | };
|
9547 | MDCTextFieldFoundation.prototype.getValue = function() {
|
9548 | return this.getNativeInput_().value;
|
9549 | };
|
9550 | MDCTextFieldFoundation.prototype.setValue = function(value) {
|
9551 | if (this.getValue() !== value) {
|
9552 | this.getNativeInput_().value = value;
|
9553 | }
|
9554 | this.setCharacterCounter_(value.length);
|
9555 | var isValid = this.isValid();
|
9556 | this.styleValidity_(isValid);
|
9557 | if (this.adapter_.hasLabel()) {
|
9558 | this.notchOutline(this.shouldFloat);
|
9559 | this.adapter_.floatLabel(this.shouldFloat);
|
9560 | this.adapter_.shakeLabel(this.shouldShake);
|
9561 | }
|
9562 | };
|
9563 | MDCTextFieldFoundation.prototype.isValid = function() {
|
9564 | return this.useNativeValidation_ ? this.isNativeInputValid_() : this.isValid_;
|
9565 | };
|
9566 | MDCTextFieldFoundation.prototype.setValid = function(isValid) {
|
9567 | this.isValid_ = isValid;
|
9568 | this.styleValidity_(isValid);
|
9569 | var shouldShake = !isValid && !this.isFocused_;
|
9570 | if (this.adapter_.hasLabel()) {
|
9571 | this.adapter_.shakeLabel(shouldShake);
|
9572 | }
|
9573 | };
|
9574 | MDCTextFieldFoundation.prototype.setUseNativeValidation = function(useNativeValidation) {
|
9575 | this.useNativeValidation_ = useNativeValidation;
|
9576 | };
|
9577 | MDCTextFieldFoundation.prototype.isDisabled = function() {
|
9578 | return this.getNativeInput_().disabled;
|
9579 | };
|
9580 | MDCTextFieldFoundation.prototype.setDisabled = function(disabled) {
|
9581 | this.getNativeInput_().disabled = disabled;
|
9582 | this.styleDisabled_(disabled);
|
9583 | };
|
9584 | MDCTextFieldFoundation.prototype.setHelperTextContent = function(content) {
|
9585 | if (this.helperText_) {
|
9586 | this.helperText_.setContent(content);
|
9587 | }
|
9588 | };
|
9589 | MDCTextFieldFoundation.prototype.setLeadingIconAriaLabel = function(label) {
|
9590 | if (this.leadingIcon_) {
|
9591 | this.leadingIcon_.setAriaLabel(label);
|
9592 | }
|
9593 | };
|
9594 | MDCTextFieldFoundation.prototype.setLeadingIconContent = function(content) {
|
9595 | if (this.leadingIcon_) {
|
9596 | this.leadingIcon_.setContent(content);
|
9597 | }
|
9598 | };
|
9599 | MDCTextFieldFoundation.prototype.setTrailingIconAriaLabel = function(label) {
|
9600 | if (this.trailingIcon_) {
|
9601 | this.trailingIcon_.setAriaLabel(label);
|
9602 | }
|
9603 | };
|
9604 | MDCTextFieldFoundation.prototype.setTrailingIconContent = function(content) {
|
9605 | if (this.trailingIcon_) {
|
9606 | this.trailingIcon_.setContent(content);
|
9607 | }
|
9608 | };
|
9609 | MDCTextFieldFoundation.prototype.setCharacterCounter_ = function(currentLength) {
|
9610 | if (!this.characterCounter_) {
|
9611 | return;
|
9612 | }
|
9613 | var maxLength = this.getNativeInput_().maxLength;
|
9614 | if (maxLength === -1) {
|
9615 | throw new Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");
|
9616 | }
|
9617 | this.characterCounter_.setCounterValue(currentLength, maxLength);
|
9618 | };
|
9619 | MDCTextFieldFoundation.prototype.isBadInput_ = function() {
|
9620 | return this.getNativeInput_().validity.badInput || false;
|
9621 | };
|
9622 | MDCTextFieldFoundation.prototype.isNativeInputValid_ = function() {
|
9623 | return this.getNativeInput_().validity.valid;
|
9624 | };
|
9625 | MDCTextFieldFoundation.prototype.styleValidity_ = function(isValid) {
|
9626 | var INVALID = MDCTextFieldFoundation.cssClasses.INVALID;
|
9627 | if (isValid) {
|
9628 | this.adapter_.removeClass(INVALID);
|
9629 | } else {
|
9630 | this.adapter_.addClass(INVALID);
|
9631 | }
|
9632 | if (this.helperText_) {
|
9633 | this.helperText_.setValidity(isValid);
|
9634 | }
|
9635 | };
|
9636 | MDCTextFieldFoundation.prototype.styleFocused_ = function(isFocused) {
|
9637 | var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED;
|
9638 | if (isFocused) {
|
9639 | this.adapter_.addClass(FOCUSED);
|
9640 | } else {
|
9641 | this.adapter_.removeClass(FOCUSED);
|
9642 | }
|
9643 | };
|
9644 | MDCTextFieldFoundation.prototype.styleDisabled_ = function(isDisabled) {
|
9645 | var _a = MDCTextFieldFoundation.cssClasses, DISABLED = _a.DISABLED, INVALID = _a.INVALID;
|
9646 | if (isDisabled) {
|
9647 | this.adapter_.addClass(DISABLED);
|
9648 | this.adapter_.removeClass(INVALID);
|
9649 | } else {
|
9650 | this.adapter_.removeClass(DISABLED);
|
9651 | }
|
9652 | if (this.leadingIcon_) {
|
9653 | this.leadingIcon_.setDisabled(isDisabled);
|
9654 | }
|
9655 | if (this.trailingIcon_) {
|
9656 | this.trailingIcon_.setDisabled(isDisabled);
|
9657 | }
|
9658 | };
|
9659 | MDCTextFieldFoundation.prototype.getNativeInput_ = function() {
|
9660 | var nativeInput = this.adapter_ ? this.adapter_.getNativeInput() : null;
|
9661 | return nativeInput || {
|
9662 | disabled: false,
|
9663 | maxLength: -1,
|
9664 | type: "input",
|
9665 | validity: {
|
9666 | badInput: false,
|
9667 | valid: true
|
9668 | },
|
9669 | value: ""
|
9670 | };
|
9671 | };
|
9672 | return MDCTextFieldFoundation;
|
9673 | }(foundation_1.MDCFoundation);
|
9674 | exports.MDCTextFieldFoundation = MDCTextFieldFoundation;
|
9675 | exports.default = MDCTextFieldFoundation;
|
9676 | }, function(module, exports, __webpack_require__) {
|
9677 | "use strict";
|
9678 | var __extends = this && this.__extends || function() {
|
9679 | var _extendStatics = function extendStatics(d, b) {
|
9680 | _extendStatics = Object.setPrototypeOf || {
|
9681 | __proto__: []
|
9682 | } instanceof Array && function(d, b) {
|
9683 | d.__proto__ = b;
|
9684 | } || function(d, b) {
|
9685 | for (var p in b) {
|
9686 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
9687 | }
|
9688 | };
|
9689 | return _extendStatics(d, b);
|
9690 | };
|
9691 | return function(d, b) {
|
9692 | _extendStatics(d, b);
|
9693 | function __() {
|
9694 | this.constructor = d;
|
9695 | }
|
9696 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
9697 | };
|
9698 | }();
|
9699 | Object.defineProperty(exports, "__esModule", {
|
9700 | value: true
|
9701 | });
|
9702 | var component_1 = __webpack_require__(1);
|
9703 | var foundation_1 = __webpack_require__(24);
|
9704 | var MDCTextFieldHelperText = function(_super) {
|
9705 | __extends(MDCTextFieldHelperText, _super);
|
9706 | function MDCTextFieldHelperText() {
|
9707 | return _super !== null && _super.apply(this, arguments) || this;
|
9708 | }
|
9709 | MDCTextFieldHelperText.attachTo = function(root) {
|
9710 | return new MDCTextFieldHelperText(root);
|
9711 | };
|
9712 | Object.defineProperty(MDCTextFieldHelperText.prototype, "foundation", {
|
9713 | get: function get() {
|
9714 | return this.foundation_;
|
9715 | },
|
9716 | enumerable: true,
|
9717 | configurable: true
|
9718 | });
|
9719 | MDCTextFieldHelperText.prototype.getDefaultFoundation = function() {
|
9720 | var _this = this;
|
9721 | var adapter = {
|
9722 | addClass: function addClass(className) {
|
9723 | return _this.root_.classList.add(className);
|
9724 | },
|
9725 | removeClass: function removeClass(className) {
|
9726 | return _this.root_.classList.remove(className);
|
9727 | },
|
9728 | hasClass: function hasClass(className) {
|
9729 | return _this.root_.classList.contains(className);
|
9730 | },
|
9731 | setAttr: function setAttr(attr, value) {
|
9732 | return _this.root_.setAttribute(attr, value);
|
9733 | },
|
9734 | removeAttr: function removeAttr(attr) {
|
9735 | return _this.root_.removeAttribute(attr);
|
9736 | },
|
9737 | setContent: function setContent(content) {
|
9738 | _this.root_.textContent = content;
|
9739 | }
|
9740 | };
|
9741 | return new foundation_1.MDCTextFieldHelperTextFoundation(adapter);
|
9742 | };
|
9743 | return MDCTextFieldHelperText;
|
9744 | }(component_1.MDCComponent);
|
9745 | exports.MDCTextFieldHelperText = MDCTextFieldHelperText;
|
9746 | }, function(module, exports, __webpack_require__) {
|
9747 | "use strict";
|
9748 | var __extends = this && this.__extends || function() {
|
9749 | var _extendStatics = function extendStatics(d, b) {
|
9750 | _extendStatics = Object.setPrototypeOf || {
|
9751 | __proto__: []
|
9752 | } instanceof Array && function(d, b) {
|
9753 | d.__proto__ = b;
|
9754 | } || function(d, b) {
|
9755 | for (var p in b) {
|
9756 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
9757 | }
|
9758 | };
|
9759 | return _extendStatics(d, b);
|
9760 | };
|
9761 | return function(d, b) {
|
9762 | _extendStatics(d, b);
|
9763 | function __() {
|
9764 | this.constructor = d;
|
9765 | }
|
9766 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
9767 | };
|
9768 | }();
|
9769 | Object.defineProperty(exports, "__esModule", {
|
9770 | value: true
|
9771 | });
|
9772 | var component_1 = __webpack_require__(1);
|
9773 | var foundation_1 = __webpack_require__(74);
|
9774 | var MDCTextFieldIcon = function(_super) {
|
9775 | __extends(MDCTextFieldIcon, _super);
|
9776 | function MDCTextFieldIcon() {
|
9777 | return _super !== null && _super.apply(this, arguments) || this;
|
9778 | }
|
9779 | MDCTextFieldIcon.attachTo = function(root) {
|
9780 | return new MDCTextFieldIcon(root);
|
9781 | };
|
9782 | Object.defineProperty(MDCTextFieldIcon.prototype, "foundation", {
|
9783 | get: function get() {
|
9784 | return this.foundation_;
|
9785 | },
|
9786 | enumerable: true,
|
9787 | configurable: true
|
9788 | });
|
9789 | MDCTextFieldIcon.prototype.getDefaultFoundation = function() {
|
9790 | var _this = this;
|
9791 | var adapter = {
|
9792 | getAttr: function getAttr(attr) {
|
9793 | return _this.root_.getAttribute(attr);
|
9794 | },
|
9795 | setAttr: function setAttr(attr, value) {
|
9796 | return _this.root_.setAttribute(attr, value);
|
9797 | },
|
9798 | removeAttr: function removeAttr(attr) {
|
9799 | return _this.root_.removeAttribute(attr);
|
9800 | },
|
9801 | setContent: function setContent(content) {
|
9802 | _this.root_.textContent = content;
|
9803 | },
|
9804 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
9805 | return _this.listen(evtType, handler);
|
9806 | },
|
9807 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
9808 | return _this.unlisten(evtType, handler);
|
9809 | },
|
9810 | notifyIconAction: function notifyIconAction() {
|
9811 | return _this.emit(foundation_1.MDCTextFieldIconFoundation.strings.ICON_EVENT, {}, true);
|
9812 | }
|
9813 | };
|
9814 | return new foundation_1.MDCTextFieldIconFoundation(adapter);
|
9815 | };
|
9816 | return MDCTextFieldIcon;
|
9817 | }(component_1.MDCComponent);
|
9818 | exports.MDCTextFieldIcon = MDCTextFieldIcon;
|
9819 | }, function(module, exports, __webpack_require__) {
|
9820 | "use strict";
|
9821 | var __extends = this && this.__extends || function() {
|
9822 | var _extendStatics = function extendStatics(d, b) {
|
9823 | _extendStatics = Object.setPrototypeOf || {
|
9824 | __proto__: []
|
9825 | } instanceof Array && function(d, b) {
|
9826 | d.__proto__ = b;
|
9827 | } || function(d, b) {
|
9828 | for (var p in b) {
|
9829 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
9830 | }
|
9831 | };
|
9832 | return _extendStatics(d, b);
|
9833 | };
|
9834 | return function(d, b) {
|
9835 | _extendStatics(d, b);
|
9836 | function __() {
|
9837 | this.constructor = d;
|
9838 | }
|
9839 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
9840 | };
|
9841 | }();
|
9842 | var __assign = this && this.__assign || function() {
|
9843 | __assign = Object.assign || function(t) {
|
9844 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
9845 | s = arguments[i];
|
9846 | for (var p in s) {
|
9847 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
9848 | }
|
9849 | }
|
9850 | return t;
|
9851 | };
|
9852 | return __assign.apply(this, arguments);
|
9853 | };
|
9854 | Object.defineProperty(exports, "__esModule", {
|
9855 | value: true
|
9856 | });
|
9857 | var foundation_1 = __webpack_require__(0);
|
9858 | var constants_1 = __webpack_require__(154);
|
9859 | var INTERACTION_EVENTS = [ "click", "keydown" ];
|
9860 | var MDCTextFieldIconFoundation = function(_super) {
|
9861 | __extends(MDCTextFieldIconFoundation, _super);
|
9862 | function MDCTextFieldIconFoundation(adapter) {
|
9863 | var _this = _super.call(this, __assign({}, MDCTextFieldIconFoundation.defaultAdapter, adapter)) || this;
|
9864 | _this.savedTabIndex_ = null;
|
9865 | _this.interactionHandler_ = function(evt) {
|
9866 | return _this.handleInteraction(evt);
|
9867 | };
|
9868 | return _this;
|
9869 | }
|
9870 | Object.defineProperty(MDCTextFieldIconFoundation, "strings", {
|
9871 | get: function get() {
|
9872 | return constants_1.strings;
|
9873 | },
|
9874 | enumerable: true,
|
9875 | configurable: true
|
9876 | });
|
9877 | Object.defineProperty(MDCTextFieldIconFoundation, "cssClasses", {
|
9878 | get: function get() {
|
9879 | return constants_1.cssClasses;
|
9880 | },
|
9881 | enumerable: true,
|
9882 | configurable: true
|
9883 | });
|
9884 | Object.defineProperty(MDCTextFieldIconFoundation, "defaultAdapter", {
|
9885 | get: function get() {
|
9886 | return {
|
9887 | getAttr: function getAttr() {
|
9888 | return null;
|
9889 | },
|
9890 | setAttr: function setAttr() {
|
9891 | return undefined;
|
9892 | },
|
9893 | removeAttr: function removeAttr() {
|
9894 | return undefined;
|
9895 | },
|
9896 | setContent: function setContent() {
|
9897 | return undefined;
|
9898 | },
|
9899 | registerInteractionHandler: function registerInteractionHandler() {
|
9900 | return undefined;
|
9901 | },
|
9902 | deregisterInteractionHandler: function deregisterInteractionHandler() {
|
9903 | return undefined;
|
9904 | },
|
9905 | notifyIconAction: function notifyIconAction() {
|
9906 | return undefined;
|
9907 | }
|
9908 | };
|
9909 | },
|
9910 | enumerable: true,
|
9911 | configurable: true
|
9912 | });
|
9913 | MDCTextFieldIconFoundation.prototype.init = function() {
|
9914 | var _this = this;
|
9915 | this.savedTabIndex_ = this.adapter_.getAttr("tabindex");
|
9916 | INTERACTION_EVENTS.forEach(function(evtType) {
|
9917 | _this.adapter_.registerInteractionHandler(evtType, _this.interactionHandler_);
|
9918 | });
|
9919 | };
|
9920 | MDCTextFieldIconFoundation.prototype.destroy = function() {
|
9921 | var _this = this;
|
9922 | INTERACTION_EVENTS.forEach(function(evtType) {
|
9923 | _this.adapter_.deregisterInteractionHandler(evtType, _this.interactionHandler_);
|
9924 | });
|
9925 | };
|
9926 | MDCTextFieldIconFoundation.prototype.setDisabled = function(disabled) {
|
9927 | if (!this.savedTabIndex_) {
|
9928 | return;
|
9929 | }
|
9930 | if (disabled) {
|
9931 | this.adapter_.setAttr("tabindex", "-1");
|
9932 | this.adapter_.removeAttr("role");
|
9933 | } else {
|
9934 | this.adapter_.setAttr("tabindex", this.savedTabIndex_);
|
9935 | this.adapter_.setAttr("role", constants_1.strings.ICON_ROLE);
|
9936 | }
|
9937 | };
|
9938 | MDCTextFieldIconFoundation.prototype.setAriaLabel = function(label) {
|
9939 | this.adapter_.setAttr("aria-label", label);
|
9940 | };
|
9941 | MDCTextFieldIconFoundation.prototype.setContent = function(content) {
|
9942 | this.adapter_.setContent(content);
|
9943 | };
|
9944 | MDCTextFieldIconFoundation.prototype.handleInteraction = function(evt) {
|
9945 | var isEnterKey = evt.key === "Enter" || evt.keyCode === 13;
|
9946 | if (evt.type === "click" || isEnterKey) {
|
9947 | this.adapter_.notifyIconAction();
|
9948 | }
|
9949 | };
|
9950 | return MDCTextFieldIconFoundation;
|
9951 | }(foundation_1.MDCFoundation);
|
9952 | exports.MDCTextFieldIconFoundation = MDCTextFieldIconFoundation;
|
9953 | exports.default = MDCTextFieldIconFoundation;
|
9954 | }, function(module, exports, __webpack_require__) {
|
9955 | "use strict";
|
9956 | var __extends = this && this.__extends || function() {
|
9957 | var _extendStatics = function extendStatics(d, b) {
|
9958 | _extendStatics = Object.setPrototypeOf || {
|
9959 | __proto__: []
|
9960 | } instanceof Array && function(d, b) {
|
9961 | d.__proto__ = b;
|
9962 | } || function(d, b) {
|
9963 | for (var p in b) {
|
9964 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
9965 | }
|
9966 | };
|
9967 | return _extendStatics(d, b);
|
9968 | };
|
9969 | return function(d, b) {
|
9970 | _extendStatics(d, b);
|
9971 | function __() {
|
9972 | this.constructor = d;
|
9973 | }
|
9974 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
9975 | };
|
9976 | }();
|
9977 | var __assign = this && this.__assign || function() {
|
9978 | __assign = Object.assign || function(t) {
|
9979 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
9980 | s = arguments[i];
|
9981 | for (var p in s) {
|
9982 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
9983 | }
|
9984 | }
|
9985 | return t;
|
9986 | };
|
9987 | return __assign.apply(this, arguments);
|
9988 | };
|
9989 | Object.defineProperty(exports, "__esModule", {
|
9990 | value: true
|
9991 | });
|
9992 | var foundation_1 = __webpack_require__(0);
|
9993 | var constants_1 = __webpack_require__(160);
|
9994 | var MDCToolbarFoundation = function(_super) {
|
9995 | __extends(MDCToolbarFoundation, _super);
|
9996 | function MDCToolbarFoundation(adapter) {
|
9997 | var _this = _super.call(this, __assign({}, MDCToolbarFoundation.defaultAdapter, adapter)) || this;
|
9998 | _this.checkRowHeightFrame_ = 0;
|
9999 | _this.scrollFrame_ = 0;
|
10000 | _this.executedLastChange_ = false;
|
10001 | _this.isFixed_ = false;
|
10002 | _this.isFixedLastRow_ = false;
|
10003 | _this.hasFlexibleFirstRow_ = false;
|
10004 | _this.useFlexDefaultBehavior_ = false;
|
10005 | _this.calculations_ = {
|
10006 | flexibleExpansionHeight: 0,
|
10007 | flexibleExpansionRatio: 0,
|
10008 | maxTranslateYDistance: 0,
|
10009 | maxTranslateYRatio: 0,
|
10010 | scrollThreshold: 0,
|
10011 | scrollThresholdRatio: 0,
|
10012 | toolbarHeight: 0,
|
10013 | toolbarRatio: 0,
|
10014 | toolbarRowHeight: 0
|
10015 | };
|
10016 | return _this;
|
10017 | }
|
10018 | Object.defineProperty(MDCToolbarFoundation, "cssClasses", {
|
10019 | get: function get() {
|
10020 | return constants_1.cssClasses;
|
10021 | },
|
10022 | enumerable: true,
|
10023 | configurable: true
|
10024 | });
|
10025 | Object.defineProperty(MDCToolbarFoundation, "strings", {
|
10026 | get: function get() {
|
10027 | return constants_1.strings;
|
10028 | },
|
10029 | enumerable: true,
|
10030 | configurable: true
|
10031 | });
|
10032 | Object.defineProperty(MDCToolbarFoundation, "numbers", {
|
10033 | get: function get() {
|
10034 | return constants_1.numbers;
|
10035 | },
|
10036 | enumerable: true,
|
10037 | configurable: true
|
10038 | });
|
10039 | Object.defineProperty(MDCToolbarFoundation, "defaultAdapter", {
|
10040 | get: function get() {
|
10041 | return {
|
10042 | hasClass: function hasClass() {
|
10043 | return false;
|
10044 | },
|
10045 | addClass: function addClass() {
|
10046 | return undefined;
|
10047 | },
|
10048 | removeClass: function removeClass() {
|
10049 | return undefined;
|
10050 | },
|
10051 | registerScrollHandler: function registerScrollHandler() {
|
10052 | return undefined;
|
10053 | },
|
10054 | deregisterScrollHandler: function deregisterScrollHandler() {
|
10055 | return undefined;
|
10056 | },
|
10057 | registerResizeHandler: function registerResizeHandler() {
|
10058 | return undefined;
|
10059 | },
|
10060 | deregisterResizeHandler: function deregisterResizeHandler() {
|
10061 | return undefined;
|
10062 | },
|
10063 | getViewportWidth: function getViewportWidth() {
|
10064 | return 0;
|
10065 | },
|
10066 | getViewportScrollY: function getViewportScrollY() {
|
10067 | return 0;
|
10068 | },
|
10069 | getOffsetHeight: function getOffsetHeight() {
|
10070 | return 0;
|
10071 | },
|
10072 | getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
|
10073 | return 0;
|
10074 | },
|
10075 | notifyChange: function notifyChange() {
|
10076 | return undefined;
|
10077 | },
|
10078 | setStyle: function setStyle() {
|
10079 | return undefined;
|
10080 | },
|
10081 | setStyleForTitleElement: function setStyleForTitleElement() {
|
10082 | return undefined;
|
10083 | },
|
10084 | setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement() {
|
10085 | return undefined;
|
10086 | },
|
10087 | setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement() {
|
10088 | return undefined;
|
10089 | }
|
10090 | };
|
10091 | },
|
10092 | enumerable: true,
|
10093 | configurable: true
|
10094 | });
|
10095 | MDCToolbarFoundation.prototype.init = function() {
|
10096 | var _this = this;
|
10097 | this.isFixed_ = this.adapter_.hasClass(constants_1.cssClasses.FIXED);
|
10098 | this.isFixedLastRow_ = this.adapter_.hasClass(constants_1.cssClasses.FIXED_LASTROW) && this.isFixed_;
|
10099 | this.hasFlexibleFirstRow_ = this.adapter_.hasClass(constants_1.cssClasses.TOOLBAR_ROW_FLEXIBLE);
|
10100 | if (this.hasFlexibleFirstRow_) {
|
10101 | this.useFlexDefaultBehavior_ = this.adapter_.hasClass(constants_1.cssClasses.FLEXIBLE_DEFAULT_BEHAVIOR);
|
10102 | }
|
10103 | this.resizeHandler_ = function() {
|
10104 | return _this.checkRowHeight_();
|
10105 | };
|
10106 | this.scrollHandler_ = function() {
|
10107 | return _this.updateToolbarStyles_();
|
10108 | };
|
10109 | this.adapter_.registerResizeHandler(this.resizeHandler_);
|
10110 | this.adapter_.registerScrollHandler(this.scrollHandler_);
|
10111 | this.initKeyRatio_();
|
10112 | this.setKeyHeights_();
|
10113 | };
|
10114 | MDCToolbarFoundation.prototype.destroy = function() {
|
10115 | this.adapter_.deregisterResizeHandler(this.resizeHandler_);
|
10116 | this.adapter_.deregisterScrollHandler(this.scrollHandler_);
|
10117 | };
|
10118 | MDCToolbarFoundation.prototype.updateAdjustElementStyles = function() {
|
10119 | if (this.isFixed_) {
|
10120 | this.adapter_.setStyleForFixedAdjustElement("margin-top", this.calculations_.toolbarHeight + "px");
|
10121 | }
|
10122 | };
|
10123 | MDCToolbarFoundation.prototype.getFlexibleExpansionRatio_ = function(scrollTop) {
|
10124 | var delta = 1e-4;
|
10125 | return Math.max(0, 1 - scrollTop / (this.calculations_.flexibleExpansionHeight + delta));
|
10126 | };
|
10127 | MDCToolbarFoundation.prototype.checkRowHeight_ = function() {
|
10128 | var _this = this;
|
10129 | cancelAnimationFrame(this.checkRowHeightFrame_);
|
10130 | this.checkRowHeightFrame_ = requestAnimationFrame(function() {
|
10131 | return _this.setKeyHeights_();
|
10132 | });
|
10133 | };
|
10134 | MDCToolbarFoundation.prototype.setKeyHeights_ = function() {
|
10135 | var newToolbarRowHeight = this.getRowHeight_();
|
10136 | if (newToolbarRowHeight !== this.calculations_.toolbarRowHeight) {
|
10137 | this.calculations_.toolbarRowHeight = newToolbarRowHeight;
|
10138 | this.calculations_.toolbarHeight = this.calculations_.toolbarRatio * this.calculations_.toolbarRowHeight;
|
10139 | this.calculations_.flexibleExpansionHeight = this.calculations_.flexibleExpansionRatio * this.calculations_.toolbarRowHeight;
|
10140 | this.calculations_.maxTranslateYDistance = this.calculations_.maxTranslateYRatio * this.calculations_.toolbarRowHeight;
|
10141 | this.calculations_.scrollThreshold = this.calculations_.scrollThresholdRatio * this.calculations_.toolbarRowHeight;
|
10142 | this.updateAdjustElementStyles();
|
10143 | this.updateToolbarStyles_();
|
10144 | }
|
10145 | };
|
10146 | MDCToolbarFoundation.prototype.updateToolbarStyles_ = function() {
|
10147 | var _this = this;
|
10148 | cancelAnimationFrame(this.scrollFrame_);
|
10149 | this.scrollFrame_ = requestAnimationFrame(function() {
|
10150 | var scrollTop = _this.adapter_.getViewportScrollY();
|
10151 | var hasScrolledOutOfThreshold = _this.scrolledOutOfThreshold_(scrollTop);
|
10152 | if (hasScrolledOutOfThreshold && _this.executedLastChange_) {
|
10153 | return;
|
10154 | }
|
10155 | var flexibleExpansionRatio = _this.getFlexibleExpansionRatio_(scrollTop);
|
10156 | _this.updateToolbarFlexibleState_(flexibleExpansionRatio);
|
10157 | if (_this.isFixedLastRow_) {
|
10158 | _this.updateToolbarFixedState_(scrollTop);
|
10159 | }
|
10160 | if (_this.hasFlexibleFirstRow_) {
|
10161 | _this.updateFlexibleRowElementStyles_(flexibleExpansionRatio);
|
10162 | }
|
10163 | _this.executedLastChange_ = hasScrolledOutOfThreshold;
|
10164 | _this.adapter_.notifyChange({
|
10165 | flexibleExpansionRatio: flexibleExpansionRatio
|
10166 | });
|
10167 | });
|
10168 | };
|
10169 | MDCToolbarFoundation.prototype.scrolledOutOfThreshold_ = function(scrollTop) {
|
10170 | return scrollTop > this.calculations_.scrollThreshold;
|
10171 | };
|
10172 | MDCToolbarFoundation.prototype.initKeyRatio_ = function() {
|
10173 | var toolbarRowHeight = this.getRowHeight_();
|
10174 | var firstRowMaxRatio = this.adapter_.getFirstRowElementOffsetHeight() / toolbarRowHeight;
|
10175 | this.calculations_.toolbarRatio = this.adapter_.getOffsetHeight() / toolbarRowHeight;
|
10176 | this.calculations_.flexibleExpansionRatio = firstRowMaxRatio - 1;
|
10177 | this.calculations_.maxTranslateYRatio = this.isFixedLastRow_ ? this.calculations_.toolbarRatio - firstRowMaxRatio : 0;
|
10178 | this.calculations_.scrollThresholdRatio = (this.isFixedLastRow_ ? this.calculations_.toolbarRatio : firstRowMaxRatio) - 1;
|
10179 | };
|
10180 | MDCToolbarFoundation.prototype.getRowHeight_ = function() {
|
10181 | var breakpoint = constants_1.numbers.TOOLBAR_MOBILE_BREAKPOINT;
|
10182 | return this.adapter_.getViewportWidth() < breakpoint ? constants_1.numbers.TOOLBAR_ROW_MOBILE_HEIGHT : constants_1.numbers.TOOLBAR_ROW_HEIGHT;
|
10183 | };
|
10184 | MDCToolbarFoundation.prototype.updateToolbarFlexibleState_ = function(flexibleExpansionRatio) {
|
10185 | this.adapter_.removeClass(constants_1.cssClasses.FLEXIBLE_MAX);
|
10186 | this.adapter_.removeClass(constants_1.cssClasses.FLEXIBLE_MIN);
|
10187 | if (flexibleExpansionRatio === 1) {
|
10188 | this.adapter_.addClass(constants_1.cssClasses.FLEXIBLE_MAX);
|
10189 | } else if (flexibleExpansionRatio === 0) {
|
10190 | this.adapter_.addClass(constants_1.cssClasses.FLEXIBLE_MIN);
|
10191 | }
|
10192 | };
|
10193 | MDCToolbarFoundation.prototype.updateToolbarFixedState_ = function(scrollTop) {
|
10194 | var translateDistance = Math.max(0, Math.min(scrollTop - this.calculations_.flexibleExpansionHeight, this.calculations_.maxTranslateYDistance));
|
10195 | this.adapter_.setStyle("transform", "translateY(" + -translateDistance + "px)");
|
10196 | if (translateDistance === this.calculations_.maxTranslateYDistance) {
|
10197 | this.adapter_.addClass(constants_1.cssClasses.FIXED_AT_LAST_ROW);
|
10198 | } else {
|
10199 | this.adapter_.removeClass(constants_1.cssClasses.FIXED_AT_LAST_ROW);
|
10200 | }
|
10201 | };
|
10202 | MDCToolbarFoundation.prototype.updateFlexibleRowElementStyles_ = function(flexibleExpansionRatio) {
|
10203 | if (this.isFixed_) {
|
10204 | var height = this.calculations_.flexibleExpansionHeight * flexibleExpansionRatio;
|
10205 | this.adapter_.setStyleForFlexibleRowElement("height", height + this.calculations_.toolbarRowHeight + "px");
|
10206 | }
|
10207 | if (this.useFlexDefaultBehavior_) {
|
10208 | this.updateElementStylesDefaultBehavior_(flexibleExpansionRatio);
|
10209 | }
|
10210 | };
|
10211 | MDCToolbarFoundation.prototype.updateElementStylesDefaultBehavior_ = function(flexibleExpansionRatio) {
|
10212 | var maxTitleSize = constants_1.numbers.MAX_TITLE_SIZE;
|
10213 | var minTitleSize = constants_1.numbers.MIN_TITLE_SIZE;
|
10214 | var currentTitleSize = (maxTitleSize - minTitleSize) * flexibleExpansionRatio + minTitleSize;
|
10215 | this.adapter_.setStyleForTitleElement("font-size", currentTitleSize + "rem");
|
10216 | };
|
10217 | return MDCToolbarFoundation;
|
10218 | }(foundation_1.MDCFoundation);
|
10219 | exports.MDCToolbarFoundation = MDCToolbarFoundation;
|
10220 | exports.default = MDCToolbarFoundation;
|
10221 | }, function(module, exports, __webpack_require__) {
|
10222 | "use strict";
|
10223 | var __extends = this && this.__extends || function() {
|
10224 | var _extendStatics = function extendStatics(d, b) {
|
10225 | _extendStatics = Object.setPrototypeOf || {
|
10226 | __proto__: []
|
10227 | } instanceof Array && function(d, b) {
|
10228 | d.__proto__ = b;
|
10229 | } || function(d, b) {
|
10230 | for (var p in b) {
|
10231 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
10232 | }
|
10233 | };
|
10234 | return _extendStatics(d, b);
|
10235 | };
|
10236 | return function(d, b) {
|
10237 | _extendStatics(d, b);
|
10238 | function __() {
|
10239 | this.constructor = d;
|
10240 | }
|
10241 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
10242 | };
|
10243 | }();
|
10244 | Object.defineProperty(exports, "__esModule", {
|
10245 | value: true
|
10246 | });
|
10247 | var constants_1 = __webpack_require__(7);
|
10248 | var foundation_1 = __webpack_require__(25);
|
10249 | var MDCFixedTopAppBarFoundation = function(_super) {
|
10250 | __extends(MDCFixedTopAppBarFoundation, _super);
|
10251 | function MDCFixedTopAppBarFoundation(adapter) {
|
10252 | var _this = _super.call(this, adapter) || this;
|
10253 | _this.wasScrolled_ = false;
|
10254 | _this.scrollHandler_ = function() {
|
10255 | return _this.fixedScrollHandler_();
|
10256 | };
|
10257 | return _this;
|
10258 | }
|
10259 | MDCFixedTopAppBarFoundation.prototype.fixedScrollHandler_ = function() {
|
10260 | var currentScroll = this.adapter_.getViewportScrollY();
|
10261 | if (currentScroll <= 0) {
|
10262 | if (this.wasScrolled_) {
|
10263 | this.adapter_.removeClass(constants_1.cssClasses.FIXED_SCROLLED_CLASS);
|
10264 | this.wasScrolled_ = false;
|
10265 | }
|
10266 | } else {
|
10267 | if (!this.wasScrolled_) {
|
10268 | this.adapter_.addClass(constants_1.cssClasses.FIXED_SCROLLED_CLASS);
|
10269 | this.wasScrolled_ = true;
|
10270 | }
|
10271 | }
|
10272 | };
|
10273 | return MDCFixedTopAppBarFoundation;
|
10274 | }(foundation_1.MDCTopAppBarFoundation);
|
10275 | exports.MDCFixedTopAppBarFoundation = MDCFixedTopAppBarFoundation;
|
10276 | exports.default = MDCFixedTopAppBarFoundation;
|
10277 | }, function(module, exports, __webpack_require__) {
|
10278 | "use strict";
|
10279 | var __extends = this && this.__extends || function() {
|
10280 | var _extendStatics = function extendStatics(d, b) {
|
10281 | _extendStatics = Object.setPrototypeOf || {
|
10282 | __proto__: []
|
10283 | } instanceof Array && function(d, b) {
|
10284 | d.__proto__ = b;
|
10285 | } || function(d, b) {
|
10286 | for (var p in b) {
|
10287 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
10288 | }
|
10289 | };
|
10290 | return _extendStatics(d, b);
|
10291 | };
|
10292 | return function(d, b) {
|
10293 | _extendStatics(d, b);
|
10294 | function __() {
|
10295 | this.constructor = d;
|
10296 | }
|
10297 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
10298 | };
|
10299 | }();
|
10300 | Object.defineProperty(exports, "__esModule", {
|
10301 | value: true
|
10302 | });
|
10303 | var constants_1 = __webpack_require__(7);
|
10304 | var foundation_1 = __webpack_require__(26);
|
10305 | var MDCShortTopAppBarFoundation = function(_super) {
|
10306 | __extends(MDCShortTopAppBarFoundation, _super);
|
10307 | function MDCShortTopAppBarFoundation(adapter) {
|
10308 | var _this = _super.call(this, adapter) || this;
|
10309 | _this.isCollapsed_ = false;
|
10310 | return _this;
|
10311 | }
|
10312 | Object.defineProperty(MDCShortTopAppBarFoundation.prototype, "isCollapsed", {
|
10313 | get: function get() {
|
10314 | return this.isCollapsed_;
|
10315 | },
|
10316 | enumerable: true,
|
10317 | configurable: true
|
10318 | });
|
10319 | MDCShortTopAppBarFoundation.prototype.init = function() {
|
10320 | var _this = this;
|
10321 | _super.prototype.init.call(this);
|
10322 | if (this.adapter_.getTotalActionItems() > 0) {
|
10323 | this.adapter_.addClass(constants_1.cssClasses.SHORT_HAS_ACTION_ITEM_CLASS);
|
10324 | }
|
10325 | if (!this.adapter_.hasClass(constants_1.cssClasses.SHORT_COLLAPSED_CLASS)) {
|
10326 | this.scrollHandler_ = function() {
|
10327 | return _this.shortAppBarScrollHandler_();
|
10328 | };
|
10329 | this.adapter_.registerScrollHandler(this.scrollHandler_);
|
10330 | this.shortAppBarScrollHandler_();
|
10331 | }
|
10332 | };
|
10333 | MDCShortTopAppBarFoundation.prototype.destroy = function() {
|
10334 | _super.prototype.destroy.call(this);
|
10335 | };
|
10336 | MDCShortTopAppBarFoundation.prototype.shortAppBarScrollHandler_ = function() {
|
10337 | var currentScroll = this.adapter_.getViewportScrollY();
|
10338 | if (currentScroll <= 0) {
|
10339 | if (this.isCollapsed_) {
|
10340 | this.adapter_.removeClass(constants_1.cssClasses.SHORT_COLLAPSED_CLASS);
|
10341 | this.isCollapsed_ = false;
|
10342 | }
|
10343 | } else {
|
10344 | if (!this.isCollapsed_) {
|
10345 | this.adapter_.addClass(constants_1.cssClasses.SHORT_COLLAPSED_CLASS);
|
10346 | this.isCollapsed_ = true;
|
10347 | }
|
10348 | }
|
10349 | };
|
10350 | return MDCShortTopAppBarFoundation;
|
10351 | }(foundation_1.MDCTopAppBarBaseFoundation);
|
10352 | exports.MDCShortTopAppBarFoundation = MDCShortTopAppBarFoundation;
|
10353 | exports.default = MDCShortTopAppBarFoundation;
|
10354 | }, function(module, exports, __webpack_require__) {
|
10355 | "use strict";
|
10356 | var __importDefault = this && this.__importDefault || function(mod) {
|
10357 | return mod && mod.__esModule ? mod : {
|
10358 | default: mod
|
10359 | };
|
10360 | };
|
10361 | var __importStar = this && this.__importStar || function(mod) {
|
10362 | if (mod && mod.__esModule) return mod;
|
10363 | var result = {};
|
10364 | if (mod != null) for (var k in mod) {
|
10365 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
10366 | }
|
10367 | result["default"] = mod;
|
10368 | return result;
|
10369 | };
|
10370 | Object.defineProperty(exports, "__esModule", {
|
10371 | value: true
|
10372 | });
|
10373 | var index_1 = __importDefault(__webpack_require__(79));
|
10374 | exports.autoInit = index_1.default;
|
10375 | var base = __importStar(__webpack_require__(80));
|
10376 | exports.base = base;
|
10377 | var checkbox = __importStar(__webpack_require__(81));
|
10378 | exports.checkbox = checkbox;
|
10379 | var chips = __importStar(__webpack_require__(85));
|
10380 | exports.chips = chips;
|
10381 | var dialog = __importStar(__webpack_require__(90));
|
10382 | exports.dialog = dialog;
|
10383 | var dom = __importStar(__webpack_require__(96));
|
10384 | exports.dom = dom;
|
10385 | var drawer = __importStar(__webpack_require__(97));
|
10386 | exports.drawer = drawer;
|
10387 | var floatingLabel = __importStar(__webpack_require__(102));
|
10388 | exports.floatingLabel = floatingLabel;
|
10389 | var formField = __importStar(__webpack_require__(104));
|
10390 | exports.formField = formField;
|
10391 | var gridList = __importStar(__webpack_require__(107));
|
10392 | exports.gridList = gridList;
|
10393 | var iconButton = __importStar(__webpack_require__(110));
|
10394 | exports.iconButton = iconButton;
|
10395 | var lineRipple = __importStar(__webpack_require__(113));
|
10396 | exports.lineRipple = lineRipple;
|
10397 | var linearProgress = __importStar(__webpack_require__(115));
|
10398 | exports.linearProgress = linearProgress;
|
10399 | var list = __importStar(__webpack_require__(118));
|
10400 | exports.list = list;
|
10401 | var menuSurface = __importStar(__webpack_require__(119));
|
10402 | exports.menuSurface = menuSurface;
|
10403 | var menu = __importStar(__webpack_require__(120));
|
10404 | exports.menu = menu;
|
10405 | var notchedOutline = __importStar(__webpack_require__(121));
|
10406 | exports.notchedOutline = notchedOutline;
|
10407 | var radio = __importStar(__webpack_require__(122));
|
10408 | exports.radio = radio;
|
10409 | var ripple = __importStar(__webpack_require__(125));
|
10410 | exports.ripple = ripple;
|
10411 | var select = __importStar(__webpack_require__(126));
|
10412 | exports.select = select;
|
10413 | var slider = __importStar(__webpack_require__(132));
|
10414 | exports.slider = slider;
|
10415 | var snackbar = __importStar(__webpack_require__(134));
|
10416 | exports.snackbar = snackbar;
|
10417 | var switchControl = __importStar(__webpack_require__(136));
|
10418 | exports.switchControl = switchControl;
|
10419 | var tabBar = __importStar(__webpack_require__(139));
|
10420 | exports.tabBar = tabBar;
|
10421 | var tabIndicator = __importStar(__webpack_require__(147));
|
10422 | exports.tabIndicator = tabIndicator;
|
10423 | var tabScroller = __importStar(__webpack_require__(148));
|
10424 | exports.tabScroller = tabScroller;
|
10425 | var tab = __importStar(__webpack_require__(149));
|
10426 | exports.tab = tab;
|
10427 | var textField = __importStar(__webpack_require__(150));
|
10428 | exports.textField = textField;
|
10429 | var toolbar = __importStar(__webpack_require__(158));
|
10430 | exports.toolbar = toolbar;
|
10431 | var topAppBar = __importStar(__webpack_require__(161));
|
10432 | exports.topAppBar = topAppBar;
|
10433 | index_1.default.register("MDCCheckbox", checkbox.MDCCheckbox);
|
10434 | index_1.default.register("MDCChip", chips.MDCChip);
|
10435 | index_1.default.register("MDCChipSet", chips.MDCChipSet);
|
10436 | index_1.default.register("MDCDialog", dialog.MDCDialog);
|
10437 | index_1.default.register("MDCDrawer", drawer.MDCDrawer);
|
10438 | index_1.default.register("MDCFloatingLabel", floatingLabel.MDCFloatingLabel);
|
10439 | index_1.default.register("MDCFormField", formField.MDCFormField);
|
10440 | index_1.default.register("MDCGridList", gridList.MDCGridList);
|
10441 | index_1.default.register("MDCIconButtonToggle", iconButton.MDCIconButtonToggle);
|
10442 | index_1.default.register("MDCLineRipple", lineRipple.MDCLineRipple);
|
10443 | index_1.default.register("MDCLinearProgress", linearProgress.MDCLinearProgress);
|
10444 | index_1.default.register("MDCList", list.MDCList);
|
10445 | index_1.default.register("MDCMenu", menu.MDCMenu);
|
10446 | index_1.default.register("MDCMenuSurface", menuSurface.MDCMenuSurface);
|
10447 | index_1.default.register("MDCNotchedOutline", notchedOutline.MDCNotchedOutline);
|
10448 | index_1.default.register("MDCRadio", radio.MDCRadio);
|
10449 | index_1.default.register("MDCRipple", ripple.MDCRipple);
|
10450 | index_1.default.register("MDCSelect", select.MDCSelect);
|
10451 | index_1.default.register("MDCSlider", slider.MDCSlider);
|
10452 | index_1.default.register("MDCSnackbar", snackbar.MDCSnackbar);
|
10453 | index_1.default.register("MDCSwitch", switchControl.MDCSwitch);
|
10454 | index_1.default.register("MDCTabBar", tabBar.MDCTabBar);
|
10455 | index_1.default.register("MDCTextField", textField.MDCTextField);
|
10456 | index_1.default.register("MDCToolbar", toolbar.MDCToolbar);
|
10457 | index_1.default.register("MDCTopAppBar", topAppBar.MDCTopAppBar);
|
10458 | }, function(module, exports, __webpack_require__) {
|
10459 | "use strict";
|
10460 | var __values = this && this.__values || function(o) {
|
10461 | var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
10462 | if (m) return m.call(o);
|
10463 | return {
|
10464 | next: function next() {
|
10465 | if (o && i >= o.length) o = void 0;
|
10466 | return {
|
10467 | value: o && o[i++],
|
10468 | done: !o
|
10469 | };
|
10470 | }
|
10471 | };
|
10472 | };
|
10473 | Object.defineProperty(exports, "__esModule", {
|
10474 | value: true
|
10475 | });
|
10476 | var registry = {};
|
10477 | var CONSOLE_WARN = console.warn.bind(console);
|
10478 | function emit(evtType, evtData, shouldBubble) {
|
10479 | if (shouldBubble === void 0) {
|
10480 | shouldBubble = false;
|
10481 | }
|
10482 | var evt;
|
10483 | if (typeof CustomEvent === "function") {
|
10484 | evt = new CustomEvent(evtType, {
|
10485 | bubbles: shouldBubble,
|
10486 | detail: evtData
|
10487 | });
|
10488 | } else {
|
10489 | evt = document.createEvent("CustomEvent");
|
10490 | evt.initCustomEvent(evtType, shouldBubble, false, evtData);
|
10491 | }
|
10492 | document.dispatchEvent(evt);
|
10493 | }
|
10494 | function mdcAutoInit(root, warn) {
|
10495 | if (root === void 0) {
|
10496 | root = document;
|
10497 | }
|
10498 | if (warn === void 0) {
|
10499 | warn = CONSOLE_WARN;
|
10500 | }
|
10501 | var e_1, _a;
|
10502 | var components = [];
|
10503 | var nodes = [].slice.call(root.querySelectorAll("[data-mdc-auto-init]"));
|
10504 | try {
|
10505 | for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
|
10506 | var node = nodes_1_1.value;
|
10507 | var ctorName = node.getAttribute("data-mdc-auto-init");
|
10508 | if (!ctorName) {
|
10509 | throw new Error("(mdc-auto-init) Constructor name must be given.");
|
10510 | }
|
10511 | var Constructor = registry[ctorName];
|
10512 | if (typeof Constructor !== "function") {
|
10513 | throw new Error("(mdc-auto-init) Could not find constructor in registry for " + ctorName);
|
10514 | }
|
10515 | if (Object.getOwnPropertyDescriptor(node, ctorName)) {
|
10516 | warn("(mdc-auto-init) Component already initialized for " + node + ". Skipping...");
|
10517 | continue;
|
10518 | }
|
10519 | var component = Constructor.attachTo(node);
|
10520 | Object.defineProperty(node, ctorName, {
|
10521 | configurable: true,
|
10522 | enumerable: false,
|
10523 | value: component,
|
10524 | writable: false
|
10525 | });
|
10526 | components.push(component);
|
10527 | }
|
10528 | } catch (e_1_1) {
|
10529 | e_1 = {
|
10530 | error: e_1_1
|
10531 | };
|
10532 | } finally {
|
10533 | try {
|
10534 | if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
|
10535 | } finally {
|
10536 | if (e_1) throw e_1.error;
|
10537 | }
|
10538 | }
|
10539 | emit("MDCAutoInit:End", {});
|
10540 | return components;
|
10541 | }
|
10542 | exports.mdcAutoInit = mdcAutoInit;
|
10543 | mdcAutoInit.register = function(componentName, Constructor, warn) {
|
10544 | if (warn === void 0) {
|
10545 | warn = CONSOLE_WARN;
|
10546 | }
|
10547 | if (typeof Constructor !== "function") {
|
10548 | throw new Error("(mdc-auto-init) Invalid Constructor value: " + Constructor + ". Expected function.");
|
10549 | }
|
10550 | var registryValue = registry[componentName];
|
10551 | if (registryValue) {
|
10552 | warn("(mdc-auto-init) Overriding registration for " + componentName + " with " + Constructor + ". Was: " + registryValue);
|
10553 | }
|
10554 | registry[componentName] = Constructor;
|
10555 | };
|
10556 | mdcAutoInit.deregister = function(componentName) {
|
10557 | delete registry[componentName];
|
10558 | };
|
10559 | mdcAutoInit.deregisterAll = function() {
|
10560 | var keys = Object.keys(registry);
|
10561 | keys.forEach(this.deregister, this);
|
10562 | };
|
10563 | exports.default = mdcAutoInit;
|
10564 | }, function(module, exports, __webpack_require__) {
|
10565 | "use strict";
|
10566 | function __export(m) {
|
10567 | for (var p in m) {
|
10568 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
10569 | }
|
10570 | }
|
10571 | Object.defineProperty(exports, "__esModule", {
|
10572 | value: true
|
10573 | });
|
10574 | __export(__webpack_require__(1));
|
10575 | __export(__webpack_require__(0));
|
10576 | }, function(module, exports, __webpack_require__) {
|
10577 | "use strict";
|
10578 | function __export(m) {
|
10579 | for (var p in m) {
|
10580 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
10581 | }
|
10582 | }
|
10583 | Object.defineProperty(exports, "__esModule", {
|
10584 | value: true
|
10585 | });
|
10586 | __export(__webpack_require__(82));
|
10587 | __export(__webpack_require__(27));
|
10588 | }, function(module, exports, __webpack_require__) {
|
10589 | "use strict";
|
10590 | var __extends = this && this.__extends || function() {
|
10591 | var _extendStatics = function extendStatics(d, b) {
|
10592 | _extendStatics = Object.setPrototypeOf || {
|
10593 | __proto__: []
|
10594 | } instanceof Array && function(d, b) {
|
10595 | d.__proto__ = b;
|
10596 | } || function(d, b) {
|
10597 | for (var p in b) {
|
10598 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
10599 | }
|
10600 | };
|
10601 | return _extendStatics(d, b);
|
10602 | };
|
10603 | return function(d, b) {
|
10604 | _extendStatics(d, b);
|
10605 | function __() {
|
10606 | this.constructor = d;
|
10607 | }
|
10608 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
10609 | };
|
10610 | }();
|
10611 | var __assign = this && this.__assign || function() {
|
10612 | __assign = Object.assign || function(t) {
|
10613 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
10614 | s = arguments[i];
|
10615 | for (var p in s) {
|
10616 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
10617 | }
|
10618 | }
|
10619 | return t;
|
10620 | };
|
10621 | return __assign.apply(this, arguments);
|
10622 | };
|
10623 | Object.defineProperty(exports, "__esModule", {
|
10624 | value: true
|
10625 | });
|
10626 | var util_1 = __webpack_require__(10);
|
10627 | var component_1 = __webpack_require__(1);
|
10628 | var ponyfill_1 = __webpack_require__(3);
|
10629 | var component_2 = __webpack_require__(2);
|
10630 | var foundation_1 = __webpack_require__(4);
|
10631 | var foundation_2 = __webpack_require__(27);
|
10632 | var CB_PROTO_PROPS = [ "checked", "indeterminate" ];
|
10633 | var MDCCheckbox = function(_super) {
|
10634 | __extends(MDCCheckbox, _super);
|
10635 | function MDCCheckbox() {
|
10636 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
10637 | _this.ripple_ = _this.createRipple_();
|
10638 | return _this;
|
10639 | }
|
10640 | MDCCheckbox.attachTo = function(root) {
|
10641 | return new MDCCheckbox(root);
|
10642 | };
|
10643 | Object.defineProperty(MDCCheckbox.prototype, "ripple", {
|
10644 | get: function get() {
|
10645 | return this.ripple_;
|
10646 | },
|
10647 | enumerable: true,
|
10648 | configurable: true
|
10649 | });
|
10650 | Object.defineProperty(MDCCheckbox.prototype, "checked", {
|
10651 | get: function get() {
|
10652 | return this.nativeControl_.checked;
|
10653 | },
|
10654 | set: function set(checked) {
|
10655 | this.nativeControl_.checked = checked;
|
10656 | },
|
10657 | enumerable: true,
|
10658 | configurable: true
|
10659 | });
|
10660 | Object.defineProperty(MDCCheckbox.prototype, "indeterminate", {
|
10661 | get: function get() {
|
10662 | return this.nativeControl_.indeterminate;
|
10663 | },
|
10664 | set: function set(indeterminate) {
|
10665 | this.nativeControl_.indeterminate = indeterminate;
|
10666 | },
|
10667 | enumerable: true,
|
10668 | configurable: true
|
10669 | });
|
10670 | Object.defineProperty(MDCCheckbox.prototype, "disabled", {
|
10671 | get: function get() {
|
10672 | return this.nativeControl_.disabled;
|
10673 | },
|
10674 | set: function set(disabled) {
|
10675 | this.foundation_.setDisabled(disabled);
|
10676 | },
|
10677 | enumerable: true,
|
10678 | configurable: true
|
10679 | });
|
10680 | Object.defineProperty(MDCCheckbox.prototype, "value", {
|
10681 | get: function get() {
|
10682 | return this.nativeControl_.value;
|
10683 | },
|
10684 | set: function set(value) {
|
10685 | this.nativeControl_.value = value;
|
10686 | },
|
10687 | enumerable: true,
|
10688 | configurable: true
|
10689 | });
|
10690 | MDCCheckbox.prototype.initialSyncWithDOM = function() {
|
10691 | var _this = this;
|
10692 | this.handleChange_ = function() {
|
10693 | return _this.foundation_.handleChange();
|
10694 | };
|
10695 | this.handleAnimationEnd_ = function() {
|
10696 | return _this.foundation_.handleAnimationEnd();
|
10697 | };
|
10698 | this.nativeControl_.addEventListener("change", this.handleChange_);
|
10699 | this.listen(util_1.getCorrectEventName(window, "animationend"), this.handleAnimationEnd_);
|
10700 | this.installPropertyChangeHooks_();
|
10701 | };
|
10702 | MDCCheckbox.prototype.destroy = function() {
|
10703 | this.ripple_.destroy();
|
10704 | this.nativeControl_.removeEventListener("change", this.handleChange_);
|
10705 | this.unlisten(util_1.getCorrectEventName(window, "animationend"), this.handleAnimationEnd_);
|
10706 | this.uninstallPropertyChangeHooks_();
|
10707 | _super.prototype.destroy.call(this);
|
10708 | };
|
10709 | MDCCheckbox.prototype.getDefaultFoundation = function() {
|
10710 | var _this = this;
|
10711 | var adapter = {
|
10712 | addClass: function addClass(className) {
|
10713 | return _this.root_.classList.add(className);
|
10714 | },
|
10715 | forceLayout: function forceLayout() {
|
10716 | return _this.root_.offsetWidth;
|
10717 | },
|
10718 | hasNativeControl: function hasNativeControl() {
|
10719 | return !!_this.nativeControl_;
|
10720 | },
|
10721 | isAttachedToDOM: function isAttachedToDOM() {
|
10722 | return Boolean(_this.root_.parentNode);
|
10723 | },
|
10724 | isChecked: function isChecked() {
|
10725 | return _this.checked;
|
10726 | },
|
10727 | isIndeterminate: function isIndeterminate() {
|
10728 | return _this.indeterminate;
|
10729 | },
|
10730 | removeClass: function removeClass(className) {
|
10731 | return _this.root_.classList.remove(className);
|
10732 | },
|
10733 | removeNativeControlAttr: function removeNativeControlAttr(attr) {
|
10734 | return _this.nativeControl_.removeAttribute(attr);
|
10735 | },
|
10736 | setNativeControlAttr: function setNativeControlAttr(attr, value) {
|
10737 | return _this.nativeControl_.setAttribute(attr, value);
|
10738 | },
|
10739 | setNativeControlDisabled: function setNativeControlDisabled(disabled) {
|
10740 | return _this.nativeControl_.disabled = disabled;
|
10741 | }
|
10742 | };
|
10743 | return new foundation_2.MDCCheckboxFoundation(adapter);
|
10744 | };
|
10745 | MDCCheckbox.prototype.createRipple_ = function() {
|
10746 | var _this = this;
|
10747 | var adapter = __assign({}, component_2.MDCRipple.createAdapter(this), {
|
10748 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
10749 | return _this.nativeControl_.removeEventListener(evtType, handler);
|
10750 | },
|
10751 | isSurfaceActive: function isSurfaceActive() {
|
10752 | return ponyfill_1.matches(_this.nativeControl_, ":active");
|
10753 | },
|
10754 | isUnbounded: function isUnbounded() {
|
10755 | return true;
|
10756 | },
|
10757 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
10758 | return _this.nativeControl_.addEventListener(evtType, handler);
|
10759 | }
|
10760 | });
|
10761 | return new component_2.MDCRipple(this.root_, new foundation_1.MDCRippleFoundation(adapter));
|
10762 | };
|
10763 | MDCCheckbox.prototype.installPropertyChangeHooks_ = function() {
|
10764 | var _this = this;
|
10765 | var nativeCb = this.nativeControl_;
|
10766 | var cbProto = Object.getPrototypeOf(nativeCb);
|
10767 | CB_PROTO_PROPS.forEach(function(controlState) {
|
10768 | var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
|
10769 | if (!validDescriptor(desc)) {
|
10770 | return;
|
10771 | }
|
10772 | var nativeGetter = desc.get;
|
10773 | var nativeCbDesc = {
|
10774 | configurable: desc.configurable,
|
10775 | enumerable: desc.enumerable,
|
10776 | get: nativeGetter,
|
10777 | set: function set(state) {
|
10778 | desc.set.call(nativeCb, state);
|
10779 | _this.foundation_.handleChange();
|
10780 | }
|
10781 | };
|
10782 | Object.defineProperty(nativeCb, controlState, nativeCbDesc);
|
10783 | });
|
10784 | };
|
10785 | MDCCheckbox.prototype.uninstallPropertyChangeHooks_ = function() {
|
10786 | var nativeCb = this.nativeControl_;
|
10787 | var cbProto = Object.getPrototypeOf(nativeCb);
|
10788 | CB_PROTO_PROPS.forEach(function(controlState) {
|
10789 | var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
|
10790 | if (!validDescriptor(desc)) {
|
10791 | return;
|
10792 | }
|
10793 | Object.defineProperty(nativeCb, controlState, desc);
|
10794 | });
|
10795 | };
|
10796 | Object.defineProperty(MDCCheckbox.prototype, "nativeControl_", {
|
10797 | get: function get() {
|
10798 | var NATIVE_CONTROL_SELECTOR = foundation_2.MDCCheckboxFoundation.strings.NATIVE_CONTROL_SELECTOR;
|
10799 | var el = this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
|
10800 | if (!el) {
|
10801 | throw new Error("Checkbox component requires a " + NATIVE_CONTROL_SELECTOR + " element");
|
10802 | }
|
10803 | return el;
|
10804 | },
|
10805 | enumerable: true,
|
10806 | configurable: true
|
10807 | });
|
10808 | return MDCCheckbox;
|
10809 | }(component_1.MDCComponent);
|
10810 | exports.MDCCheckbox = MDCCheckbox;
|
10811 | function validDescriptor(inputPropDesc) {
|
10812 | return !!inputPropDesc && typeof inputPropDesc.set === "function";
|
10813 | }
|
10814 | }, function(module, exports, __webpack_require__) {
|
10815 | "use strict";
|
10816 | Object.defineProperty(exports, "__esModule", {
|
10817 | value: true
|
10818 | });
|
10819 | exports.cssClasses = {
|
10820 | BG_FOCUSED: "mdc-ripple-upgraded--background-focused",
|
10821 | FG_ACTIVATION: "mdc-ripple-upgraded--foreground-activation",
|
10822 | FG_DEACTIVATION: "mdc-ripple-upgraded--foreground-deactivation",
|
10823 | ROOT: "mdc-ripple-upgraded",
|
10824 | UNBOUNDED: "mdc-ripple-upgraded--unbounded"
|
10825 | };
|
10826 | exports.strings = {
|
10827 | VAR_FG_SCALE: "--mdc-ripple-fg-scale",
|
10828 | VAR_FG_SIZE: "--mdc-ripple-fg-size",
|
10829 | VAR_FG_TRANSLATE_END: "--mdc-ripple-fg-translate-end",
|
10830 | VAR_FG_TRANSLATE_START: "--mdc-ripple-fg-translate-start",
|
10831 | VAR_LEFT: "--mdc-ripple-left",
|
10832 | VAR_TOP: "--mdc-ripple-top"
|
10833 | };
|
10834 | exports.numbers = {
|
10835 | DEACTIVATION_TIMEOUT_MS: 225,
|
10836 | FG_DEACTIVATION_MS: 150,
|
10837 | INITIAL_ORIGIN_SCALE: .6,
|
10838 | PADDING: 10,
|
10839 | TAP_DELAY_MS: 300
|
10840 | };
|
10841 | }, function(module, exports, __webpack_require__) {
|
10842 | "use strict";
|
10843 | Object.defineProperty(exports, "__esModule", {
|
10844 | value: true
|
10845 | });
|
10846 | exports.cssClasses = {
|
10847 | ANIM_CHECKED_INDETERMINATE: "mdc-checkbox--anim-checked-indeterminate",
|
10848 | ANIM_CHECKED_UNCHECKED: "mdc-checkbox--anim-checked-unchecked",
|
10849 | ANIM_INDETERMINATE_CHECKED: "mdc-checkbox--anim-indeterminate-checked",
|
10850 | ANIM_INDETERMINATE_UNCHECKED: "mdc-checkbox--anim-indeterminate-unchecked",
|
10851 | ANIM_UNCHECKED_CHECKED: "mdc-checkbox--anim-unchecked-checked",
|
10852 | ANIM_UNCHECKED_INDETERMINATE: "mdc-checkbox--anim-unchecked-indeterminate",
|
10853 | BACKGROUND: "mdc-checkbox__background",
|
10854 | CHECKED: "mdc-checkbox--checked",
|
10855 | CHECKMARK: "mdc-checkbox__checkmark",
|
10856 | CHECKMARK_PATH: "mdc-checkbox__checkmark-path",
|
10857 | DISABLED: "mdc-checkbox--disabled",
|
10858 | INDETERMINATE: "mdc-checkbox--indeterminate",
|
10859 | MIXEDMARK: "mdc-checkbox__mixedmark",
|
10860 | NATIVE_CONTROL: "mdc-checkbox__native-control",
|
10861 | ROOT: "mdc-checkbox",
|
10862 | SELECTED: "mdc-checkbox--selected",
|
10863 | UPGRADED: "mdc-checkbox--upgraded"
|
10864 | };
|
10865 | exports.strings = {
|
10866 | ARIA_CHECKED_ATTR: "aria-checked",
|
10867 | ARIA_CHECKED_INDETERMINATE_VALUE: "mixed",
|
10868 | NATIVE_CONTROL_SELECTOR: ".mdc-checkbox__native-control",
|
10869 | TRANSITION_STATE_CHECKED: "checked",
|
10870 | TRANSITION_STATE_INDETERMINATE: "indeterminate",
|
10871 | TRANSITION_STATE_INIT: "init",
|
10872 | TRANSITION_STATE_UNCHECKED: "unchecked"
|
10873 | };
|
10874 | exports.numbers = {
|
10875 | ANIM_END_LATCH_MS: 250
|
10876 | };
|
10877 | }, function(module, exports, __webpack_require__) {
|
10878 | "use strict";
|
10879 | function __export(m) {
|
10880 | for (var p in m) {
|
10881 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
10882 | }
|
10883 | }
|
10884 | Object.defineProperty(exports, "__esModule", {
|
10885 | value: true
|
10886 | });
|
10887 | __export(__webpack_require__(86));
|
10888 | __export(__webpack_require__(87));
|
10889 | }, function(module, exports, __webpack_require__) {
|
10890 | "use strict";
|
10891 | function __export(m) {
|
10892 | for (var p in m) {
|
10893 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
10894 | }
|
10895 | }
|
10896 | Object.defineProperty(exports, "__esModule", {
|
10897 | value: true
|
10898 | });
|
10899 | __export(__webpack_require__(28));
|
10900 | __export(__webpack_require__(12));
|
10901 | }, function(module, exports, __webpack_require__) {
|
10902 | "use strict";
|
10903 | function __export(m) {
|
10904 | for (var p in m) {
|
10905 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
10906 | }
|
10907 | }
|
10908 | Object.defineProperty(exports, "__esModule", {
|
10909 | value: true
|
10910 | });
|
10911 | __export(__webpack_require__(88));
|
10912 | __export(__webpack_require__(30));
|
10913 | }, function(module, exports, __webpack_require__) {
|
10914 | "use strict";
|
10915 | var __extends = this && this.__extends || function() {
|
10916 | var _extendStatics = function extendStatics(d, b) {
|
10917 | _extendStatics = Object.setPrototypeOf || {
|
10918 | __proto__: []
|
10919 | } instanceof Array && function(d, b) {
|
10920 | d.__proto__ = b;
|
10921 | } || function(d, b) {
|
10922 | for (var p in b) {
|
10923 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
10924 | }
|
10925 | };
|
10926 | return _extendStatics(d, b);
|
10927 | };
|
10928 | return function(d, b) {
|
10929 | _extendStatics(d, b);
|
10930 | function __() {
|
10931 | this.constructor = d;
|
10932 | }
|
10933 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
10934 | };
|
10935 | }();
|
10936 | Object.defineProperty(exports, "__esModule", {
|
10937 | value: true
|
10938 | });
|
10939 | var component_1 = __webpack_require__(1);
|
10940 | var component_2 = __webpack_require__(28);
|
10941 | var foundation_1 = __webpack_require__(12);
|
10942 | var foundation_2 = __webpack_require__(30);
|
10943 | var _a = foundation_1.MDCChipFoundation.strings, INTERACTION_EVENT = _a.INTERACTION_EVENT, SELECTION_EVENT = _a.SELECTION_EVENT, REMOVAL_EVENT = _a.REMOVAL_EVENT;
|
10944 | var CHIP_SELECTOR = foundation_2.MDCChipSetFoundation.strings.CHIP_SELECTOR;
|
10945 | var idCounter = 0;
|
10946 | var MDCChipSet = function(_super) {
|
10947 | __extends(MDCChipSet, _super);
|
10948 | function MDCChipSet() {
|
10949 | return _super !== null && _super.apply(this, arguments) || this;
|
10950 | }
|
10951 | MDCChipSet.attachTo = function(root) {
|
10952 | return new MDCChipSet(root);
|
10953 | };
|
10954 | Object.defineProperty(MDCChipSet.prototype, "chips", {
|
10955 | get: function get() {
|
10956 | return this.chips_.slice();
|
10957 | },
|
10958 | enumerable: true,
|
10959 | configurable: true
|
10960 | });
|
10961 | Object.defineProperty(MDCChipSet.prototype, "selectedChipIds", {
|
10962 | get: function get() {
|
10963 | return this.foundation_.getSelectedChipIds();
|
10964 | },
|
10965 | enumerable: true,
|
10966 | configurable: true
|
10967 | });
|
10968 | MDCChipSet.prototype.initialize = function(chipFactory) {
|
10969 | if (chipFactory === void 0) {
|
10970 | chipFactory = function chipFactory(el) {
|
10971 | return new component_2.MDCChip(el);
|
10972 | };
|
10973 | }
|
10974 | this.chipFactory_ = chipFactory;
|
10975 | this.chips_ = this.instantiateChips_(this.chipFactory_);
|
10976 | };
|
10977 | MDCChipSet.prototype.initialSyncWithDOM = function() {
|
10978 | var _this = this;
|
10979 | this.chips_.forEach(function(chip) {
|
10980 | if (chip.id && chip.selected) {
|
10981 | _this.foundation_.select(chip.id);
|
10982 | }
|
10983 | });
|
10984 | this.handleChipInteraction_ = function(evt) {
|
10985 | return _this.foundation_.handleChipInteraction(evt.detail.chipId);
|
10986 | };
|
10987 | this.handleChipSelection_ = function(evt) {
|
10988 | return _this.foundation_.handleChipSelection(evt.detail.chipId, evt.detail.selected);
|
10989 | };
|
10990 | this.handleChipRemoval_ = function(evt) {
|
10991 | return _this.foundation_.handleChipRemoval(evt.detail.chipId);
|
10992 | };
|
10993 | this.listen(INTERACTION_EVENT, this.handleChipInteraction_);
|
10994 | this.listen(SELECTION_EVENT, this.handleChipSelection_);
|
10995 | this.listen(REMOVAL_EVENT, this.handleChipRemoval_);
|
10996 | };
|
10997 | MDCChipSet.prototype.destroy = function() {
|
10998 | this.chips_.forEach(function(chip) {
|
10999 | chip.destroy();
|
11000 | });
|
11001 | this.unlisten(INTERACTION_EVENT, this.handleChipInteraction_);
|
11002 | this.unlisten(SELECTION_EVENT, this.handleChipSelection_);
|
11003 | this.unlisten(REMOVAL_EVENT, this.handleChipRemoval_);
|
11004 | _super.prototype.destroy.call(this);
|
11005 | };
|
11006 | MDCChipSet.prototype.addChip = function(chipEl) {
|
11007 | chipEl.id = chipEl.id || "mdc-chip-" + ++idCounter;
|
11008 | this.chips_.push(this.chipFactory_(chipEl));
|
11009 | };
|
11010 | MDCChipSet.prototype.getDefaultFoundation = function() {
|
11011 | var _this = this;
|
11012 | var adapter = {
|
11013 | hasClass: function hasClass(className) {
|
11014 | return _this.root_.classList.contains(className);
|
11015 | },
|
11016 | removeChip: function removeChip(chipId) {
|
11017 | var index = _this.findChipIndex_(chipId);
|
11018 | if (index >= 0) {
|
11019 | _this.chips_[index].destroy();
|
11020 | _this.chips_.splice(index, 1);
|
11021 | }
|
11022 | },
|
11023 | setSelected: function setSelected(chipId, selected) {
|
11024 | var index = _this.findChipIndex_(chipId);
|
11025 | if (index >= 0) {
|
11026 | _this.chips_[index].selected = selected;
|
11027 | }
|
11028 | }
|
11029 | };
|
11030 | return new foundation_2.MDCChipSetFoundation(adapter);
|
11031 | };
|
11032 | MDCChipSet.prototype.instantiateChips_ = function(chipFactory) {
|
11033 | var chipElements = [].slice.call(this.root_.querySelectorAll(CHIP_SELECTOR));
|
11034 | return chipElements.map(function(el) {
|
11035 | el.id = el.id || "mdc-chip-" + ++idCounter;
|
11036 | return chipFactory(el);
|
11037 | });
|
11038 | };
|
11039 | MDCChipSet.prototype.findChipIndex_ = function(chipId) {
|
11040 | for (var i = 0; i < this.chips_.length; i++) {
|
11041 | if (this.chips_[i].id === chipId) {
|
11042 | return i;
|
11043 | }
|
11044 | }
|
11045 | return -1;
|
11046 | };
|
11047 | return MDCChipSet;
|
11048 | }(component_1.MDCComponent);
|
11049 | exports.MDCChipSet = MDCChipSet;
|
11050 | }, function(module, exports, __webpack_require__) {
|
11051 | "use strict";
|
11052 | Object.defineProperty(exports, "__esModule", {
|
11053 | value: true
|
11054 | });
|
11055 | exports.strings = {
|
11056 | CHIP_SELECTOR: ".mdc-chip"
|
11057 | };
|
11058 | exports.cssClasses = {
|
11059 | CHOICE: "mdc-chip-set--choice",
|
11060 | FILTER: "mdc-chip-set--filter"
|
11061 | };
|
11062 | }, function(module, exports, __webpack_require__) {
|
11063 | "use strict";
|
11064 | function __export(m) {
|
11065 | for (var p in m) {
|
11066 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
11067 | }
|
11068 | }
|
11069 | var __importStar = this && this.__importStar || function(mod) {
|
11070 | if (mod && mod.__esModule) return mod;
|
11071 | var result = {};
|
11072 | if (mod != null) for (var k in mod) {
|
11073 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
11074 | }
|
11075 | result["default"] = mod;
|
11076 | return result;
|
11077 | };
|
11078 | Object.defineProperty(exports, "__esModule", {
|
11079 | value: true
|
11080 | });
|
11081 | var util = __importStar(__webpack_require__(31));
|
11082 | exports.util = util;
|
11083 | __export(__webpack_require__(94));
|
11084 | __export(__webpack_require__(32));
|
11085 | }, function(module, exports, __webpack_require__) {
|
11086 | var tabbable = __webpack_require__(92);
|
11087 | var xtend = __webpack_require__(93);
|
11088 | var activeFocusTraps = function() {
|
11089 | var trapQueue = [];
|
11090 | return {
|
11091 | activateTrap: function(trap) {
|
11092 | if (trapQueue.length > 0) {
|
11093 | var activeTrap = trapQueue[trapQueue.length - 1];
|
11094 | if (activeTrap !== trap) {
|
11095 | activeTrap.pause();
|
11096 | }
|
11097 | }
|
11098 | var trapIndex = trapQueue.indexOf(trap);
|
11099 | if (trapIndex === -1) {
|
11100 | trapQueue.push(trap);
|
11101 | } else {
|
11102 | trapQueue.splice(trapIndex, 1);
|
11103 | trapQueue.push(trap);
|
11104 | }
|
11105 | },
|
11106 | deactivateTrap: function(trap) {
|
11107 | var trapIndex = trapQueue.indexOf(trap);
|
11108 | if (trapIndex !== -1) {
|
11109 | trapQueue.splice(trapIndex, 1);
|
11110 | }
|
11111 | if (trapQueue.length > 0) {
|
11112 | trapQueue[trapQueue.length - 1].unpause();
|
11113 | }
|
11114 | }
|
11115 | };
|
11116 | }();
|
11117 | function focusTrap(element, userOptions) {
|
11118 | var doc = document;
|
11119 | var container = typeof element === "string" ? doc.querySelector(element) : element;
|
11120 | var config = xtend({
|
11121 | returnFocusOnDeactivate: true,
|
11122 | escapeDeactivates: true
|
11123 | }, userOptions);
|
11124 | var state = {
|
11125 | firstTabbableNode: null,
|
11126 | lastTabbableNode: null,
|
11127 | nodeFocusedBeforeActivation: null,
|
11128 | mostRecentlyFocusedNode: null,
|
11129 | active: false,
|
11130 | paused: false
|
11131 | };
|
11132 | var trap = {
|
11133 | activate: activate,
|
11134 | deactivate: deactivate,
|
11135 | pause: pause,
|
11136 | unpause: unpause
|
11137 | };
|
11138 | return trap;
|
11139 | function activate(activateOptions) {
|
11140 | if (state.active) return;
|
11141 | updateTabbableNodes();
|
11142 | state.active = true;
|
11143 | state.paused = false;
|
11144 | state.nodeFocusedBeforeActivation = doc.activeElement;
|
11145 | var onActivate = activateOptions && activateOptions.onActivate ? activateOptions.onActivate : config.onActivate;
|
11146 | if (onActivate) {
|
11147 | onActivate();
|
11148 | }
|
11149 | addListeners();
|
11150 | return trap;
|
11151 | }
|
11152 | function deactivate(deactivateOptions) {
|
11153 | if (!state.active) return;
|
11154 | removeListeners();
|
11155 | state.active = false;
|
11156 | state.paused = false;
|
11157 | activeFocusTraps.deactivateTrap(trap);
|
11158 | var onDeactivate = deactivateOptions && deactivateOptions.onDeactivate !== undefined ? deactivateOptions.onDeactivate : config.onDeactivate;
|
11159 | if (onDeactivate) {
|
11160 | onDeactivate();
|
11161 | }
|
11162 | var returnFocus = deactivateOptions && deactivateOptions.returnFocus !== undefined ? deactivateOptions.returnFocus : config.returnFocusOnDeactivate;
|
11163 | if (returnFocus) {
|
11164 | delay(function() {
|
11165 | tryFocus(state.nodeFocusedBeforeActivation);
|
11166 | });
|
11167 | }
|
11168 | return trap;
|
11169 | }
|
11170 | function pause() {
|
11171 | if (state.paused || !state.active) return;
|
11172 | state.paused = true;
|
11173 | removeListeners();
|
11174 | }
|
11175 | function unpause() {
|
11176 | if (!state.paused || !state.active) return;
|
11177 | state.paused = false;
|
11178 | updateTabbableNodes();
|
11179 | addListeners();
|
11180 | }
|
11181 | function addListeners() {
|
11182 | if (!state.active) return;
|
11183 | activeFocusTraps.activateTrap(trap);
|
11184 | delay(function() {
|
11185 | tryFocus(getInitialFocusNode());
|
11186 | });
|
11187 | doc.addEventListener("focusin", checkFocusIn, true);
|
11188 | doc.addEventListener("mousedown", checkPointerDown, {
|
11189 | capture: true,
|
11190 | passive: false
|
11191 | });
|
11192 | doc.addEventListener("touchstart", checkPointerDown, {
|
11193 | capture: true,
|
11194 | passive: false
|
11195 | });
|
11196 | doc.addEventListener("click", checkClick, {
|
11197 | capture: true,
|
11198 | passive: false
|
11199 | });
|
11200 | doc.addEventListener("keydown", checkKey, {
|
11201 | capture: true,
|
11202 | passive: false
|
11203 | });
|
11204 | return trap;
|
11205 | }
|
11206 | function removeListeners() {
|
11207 | if (!state.active) return;
|
11208 | doc.removeEventListener("focusin", checkFocusIn, true);
|
11209 | doc.removeEventListener("mousedown", checkPointerDown, true);
|
11210 | doc.removeEventListener("touchstart", checkPointerDown, true);
|
11211 | doc.removeEventListener("click", checkClick, true);
|
11212 | doc.removeEventListener("keydown", checkKey, true);
|
11213 | return trap;
|
11214 | }
|
11215 | function getNodeForOption(optionName) {
|
11216 | var optionValue = config[optionName];
|
11217 | var node = optionValue;
|
11218 | if (!optionValue) {
|
11219 | return null;
|
11220 | }
|
11221 | if (typeof optionValue === "string") {
|
11222 | node = doc.querySelector(optionValue);
|
11223 | if (!node) {
|
11224 | throw new Error("`" + optionName + "` refers to no known node");
|
11225 | }
|
11226 | }
|
11227 | if (typeof optionValue === "function") {
|
11228 | node = optionValue();
|
11229 | if (!node) {
|
11230 | throw new Error("`" + optionName + "` did not return a node");
|
11231 | }
|
11232 | }
|
11233 | return node;
|
11234 | }
|
11235 | function getInitialFocusNode() {
|
11236 | var node;
|
11237 | if (getNodeForOption("initialFocus") !== null) {
|
11238 | node = getNodeForOption("initialFocus");
|
11239 | } else if (container.contains(doc.activeElement)) {
|
11240 | node = doc.activeElement;
|
11241 | } else {
|
11242 | node = state.firstTabbableNode || getNodeForOption("fallbackFocus");
|
11243 | }
|
11244 | if (!node) {
|
11245 | throw new Error("You can't have a focus-trap without at least one focusable element");
|
11246 | }
|
11247 | return node;
|
11248 | }
|
11249 | function checkPointerDown(e) {
|
11250 | if (container.contains(e.target)) return;
|
11251 | if (config.clickOutsideDeactivates) {
|
11252 | deactivate({
|
11253 | returnFocus: !tabbable.isFocusable(e.target)
|
11254 | });
|
11255 | } else {
|
11256 | e.preventDefault();
|
11257 | }
|
11258 | }
|
11259 | function checkFocusIn(e) {
|
11260 | if (container.contains(e.target) || e.target instanceof Document) {
|
11261 | return;
|
11262 | }
|
11263 | e.stopImmediatePropagation();
|
11264 | tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
|
11265 | }
|
11266 | function checkKey(e) {
|
11267 | if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
|
11268 | e.preventDefault();
|
11269 | deactivate();
|
11270 | return;
|
11271 | }
|
11272 | if (isTabEvent(e)) {
|
11273 | checkTab(e);
|
11274 | return;
|
11275 | }
|
11276 | }
|
11277 | function checkTab(e) {
|
11278 | updateTabbableNodes();
|
11279 | if (e.shiftKey && e.target === state.firstTabbableNode) {
|
11280 | e.preventDefault();
|
11281 | tryFocus(state.lastTabbableNode);
|
11282 | return;
|
11283 | }
|
11284 | if (!e.shiftKey && e.target === state.lastTabbableNode) {
|
11285 | e.preventDefault();
|
11286 | tryFocus(state.firstTabbableNode);
|
11287 | return;
|
11288 | }
|
11289 | }
|
11290 | function checkClick(e) {
|
11291 | if (config.clickOutsideDeactivates) return;
|
11292 | if (container.contains(e.target)) return;
|
11293 | e.preventDefault();
|
11294 | e.stopImmediatePropagation();
|
11295 | }
|
11296 | function updateTabbableNodes() {
|
11297 | var tabbableNodes = tabbable(container);
|
11298 | state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode();
|
11299 | state.lastTabbableNode = tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode();
|
11300 | }
|
11301 | function tryFocus(node) {
|
11302 | if (node === doc.activeElement) return;
|
11303 | if (!node || !node.focus) {
|
11304 | tryFocus(getInitialFocusNode());
|
11305 | return;
|
11306 | }
|
11307 | node.focus();
|
11308 | state.mostRecentlyFocusedNode = node;
|
11309 | if (isSelectableInput(node)) {
|
11310 | node.select();
|
11311 | }
|
11312 | }
|
11313 | }
|
11314 | function isSelectableInput(node) {
|
11315 | return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function";
|
11316 | }
|
11317 | function isEscapeEvent(e) {
|
11318 | return e.key === "Escape" || e.key === "Esc" || e.keyCode === 27;
|
11319 | }
|
11320 | function isTabEvent(e) {
|
11321 | return e.key === "Tab" || e.keyCode === 9;
|
11322 | }
|
11323 | function delay(fn) {
|
11324 | return setTimeout(fn, 0);
|
11325 | }
|
11326 | module.exports = focusTrap;
|
11327 | }, function(module, exports) {
|
11328 | var candidateSelectors = [ "input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])' ];
|
11329 | var candidateSelector = candidateSelectors.join(",");
|
11330 | var matches = typeof Element === "undefined" ? function() {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
11331 | function tabbable(el, options) {
|
11332 | options = options || {};
|
11333 | var regularTabbables = [];
|
11334 | var orderedTabbables = [];
|
11335 | var candidates = el.querySelectorAll(candidateSelector);
|
11336 | if (options.includeContainer) {
|
11337 | if (matches.call(el, candidateSelector)) {
|
11338 | candidates = Array.prototype.slice.apply(candidates);
|
11339 | candidates.unshift(el);
|
11340 | }
|
11341 | }
|
11342 | var i, candidate, candidateTabindex;
|
11343 | for (i = 0; i < candidates.length; i++) {
|
11344 | candidate = candidates[i];
|
11345 | if (!isNodeMatchingSelectorTabbable(candidate)) continue;
|
11346 | candidateTabindex = getTabindex(candidate);
|
11347 | if (candidateTabindex === 0) {
|
11348 | regularTabbables.push(candidate);
|
11349 | } else {
|
11350 | orderedTabbables.push({
|
11351 | documentOrder: i,
|
11352 | tabIndex: candidateTabindex,
|
11353 | node: candidate
|
11354 | });
|
11355 | }
|
11356 | }
|
11357 | var tabbableNodes = orderedTabbables.sort(sortOrderedTabbables).map(function(a) {
|
11358 | return a.node;
|
11359 | }).concat(regularTabbables);
|
11360 | return tabbableNodes;
|
11361 | }
|
11362 | tabbable.isTabbable = isTabbable;
|
11363 | tabbable.isFocusable = isFocusable;
|
11364 | function isNodeMatchingSelectorTabbable(node) {
|
11365 | if (!isNodeMatchingSelectorFocusable(node) || isNonTabbableRadio(node) || getTabindex(node) < 0) {
|
11366 | return false;
|
11367 | }
|
11368 | return true;
|
11369 | }
|
11370 | function isTabbable(node) {
|
11371 | if (!node) throw new Error("No node provided");
|
11372 | if (matches.call(node, candidateSelector) === false) return false;
|
11373 | return isNodeMatchingSelectorTabbable(node);
|
11374 | }
|
11375 | function isNodeMatchingSelectorFocusable(node) {
|
11376 | if (node.disabled || isHiddenInput(node) || isHidden(node)) {
|
11377 | return false;
|
11378 | }
|
11379 | return true;
|
11380 | }
|
11381 | var focusableCandidateSelector = candidateSelectors.concat("iframe").join(",");
|
11382 | function isFocusable(node) {
|
11383 | if (!node) throw new Error("No node provided");
|
11384 | if (matches.call(node, focusableCandidateSelector) === false) return false;
|
11385 | return isNodeMatchingSelectorFocusable(node);
|
11386 | }
|
11387 | function getTabindex(node) {
|
11388 | var tabindexAttr = parseInt(node.getAttribute("tabindex"), 10);
|
11389 | if (!isNaN(tabindexAttr)) return tabindexAttr;
|
11390 | if (isContentEditable(node)) return 0;
|
11391 | return node.tabIndex;
|
11392 | }
|
11393 | function sortOrderedTabbables(a, b) {
|
11394 | return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
11395 | }
|
11396 | function isContentEditable(node) {
|
11397 | return node.contentEditable === "true";
|
11398 | }
|
11399 | function isInput(node) {
|
11400 | return node.tagName === "INPUT";
|
11401 | }
|
11402 | function isHiddenInput(node) {
|
11403 | return isInput(node) && node.type === "hidden";
|
11404 | }
|
11405 | function isRadio(node) {
|
11406 | return isInput(node) && node.type === "radio";
|
11407 | }
|
11408 | function isNonTabbableRadio(node) {
|
11409 | return isRadio(node) && !isTabbableRadio(node);
|
11410 | }
|
11411 | function getCheckedRadio(nodes) {
|
11412 | for (var i = 0; i < nodes.length; i++) {
|
11413 | if (nodes[i].checked) {
|
11414 | return nodes[i];
|
11415 | }
|
11416 | }
|
11417 | }
|
11418 | function isTabbableRadio(node) {
|
11419 | if (!node.name) return true;
|
11420 | var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]');
|
11421 | var checked = getCheckedRadio(radioSet);
|
11422 | return !checked || checked === node;
|
11423 | }
|
11424 | function isHidden(node) {
|
11425 | return node.offsetParent === null || getComputedStyle(node).visibility === "hidden";
|
11426 | }
|
11427 | module.exports = tabbable;
|
11428 | }, function(module, exports) {
|
11429 | module.exports = extend;
|
11430 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
11431 | function extend() {
|
11432 | var target = {};
|
11433 | for (var i = 0; i < arguments.length; i++) {
|
11434 | var source = arguments[i];
|
11435 | for (var key in source) {
|
11436 | if (hasOwnProperty.call(source, key)) {
|
11437 | target[key] = source[key];
|
11438 | }
|
11439 | }
|
11440 | }
|
11441 | return target;
|
11442 | }
|
11443 | }, function(module, exports, __webpack_require__) {
|
11444 | "use strict";
|
11445 | var __extends = this && this.__extends || function() {
|
11446 | var _extendStatics = function extendStatics(d, b) {
|
11447 | _extendStatics = Object.setPrototypeOf || {
|
11448 | __proto__: []
|
11449 | } instanceof Array && function(d, b) {
|
11450 | d.__proto__ = b;
|
11451 | } || function(d, b) {
|
11452 | for (var p in b) {
|
11453 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
11454 | }
|
11455 | };
|
11456 | return _extendStatics(d, b);
|
11457 | };
|
11458 | return function(d, b) {
|
11459 | _extendStatics(d, b);
|
11460 | function __() {
|
11461 | this.constructor = d;
|
11462 | }
|
11463 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
11464 | };
|
11465 | }();
|
11466 | var __values = this && this.__values || function(o) {
|
11467 | var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
11468 | if (m) return m.call(o);
|
11469 | return {
|
11470 | next: function next() {
|
11471 | if (o && i >= o.length) o = void 0;
|
11472 | return {
|
11473 | value: o && o[i++],
|
11474 | done: !o
|
11475 | };
|
11476 | }
|
11477 | };
|
11478 | };
|
11479 | var __importStar = this && this.__importStar || function(mod) {
|
11480 | if (mod && mod.__esModule) return mod;
|
11481 | var result = {};
|
11482 | if (mod != null) for (var k in mod) {
|
11483 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
11484 | }
|
11485 | result["default"] = mod;
|
11486 | return result;
|
11487 | };
|
11488 | Object.defineProperty(exports, "__esModule", {
|
11489 | value: true
|
11490 | });
|
11491 | var component_1 = __webpack_require__(1);
|
11492 | var ponyfill_1 = __webpack_require__(3);
|
11493 | var component_2 = __webpack_require__(2);
|
11494 | var foundation_1 = __webpack_require__(32);
|
11495 | var util = __importStar(__webpack_require__(31));
|
11496 | var strings = foundation_1.MDCDialogFoundation.strings;
|
11497 | var MDCDialog = function(_super) {
|
11498 | __extends(MDCDialog, _super);
|
11499 | function MDCDialog() {
|
11500 | return _super !== null && _super.apply(this, arguments) || this;
|
11501 | }
|
11502 | Object.defineProperty(MDCDialog.prototype, "isOpen", {
|
11503 | get: function get() {
|
11504 | return this.foundation_.isOpen();
|
11505 | },
|
11506 | enumerable: true,
|
11507 | configurable: true
|
11508 | });
|
11509 | Object.defineProperty(MDCDialog.prototype, "escapeKeyAction", {
|
11510 | get: function get() {
|
11511 | return this.foundation_.getEscapeKeyAction();
|
11512 | },
|
11513 | set: function set(action) {
|
11514 | this.foundation_.setEscapeKeyAction(action);
|
11515 | },
|
11516 | enumerable: true,
|
11517 | configurable: true
|
11518 | });
|
11519 | Object.defineProperty(MDCDialog.prototype, "scrimClickAction", {
|
11520 | get: function get() {
|
11521 | return this.foundation_.getScrimClickAction();
|
11522 | },
|
11523 | set: function set(action) {
|
11524 | this.foundation_.setScrimClickAction(action);
|
11525 | },
|
11526 | enumerable: true,
|
11527 | configurable: true
|
11528 | });
|
11529 | Object.defineProperty(MDCDialog.prototype, "autoStackButtons", {
|
11530 | get: function get() {
|
11531 | return this.foundation_.getAutoStackButtons();
|
11532 | },
|
11533 | set: function set(autoStack) {
|
11534 | this.foundation_.setAutoStackButtons(autoStack);
|
11535 | },
|
11536 | enumerable: true,
|
11537 | configurable: true
|
11538 | });
|
11539 | MDCDialog.attachTo = function(root) {
|
11540 | return new MDCDialog(root);
|
11541 | };
|
11542 | MDCDialog.prototype.initialize = function(focusTrapFactory, initialFocusEl) {
|
11543 | var e_1, _a;
|
11544 | var container = this.root_.querySelector(strings.CONTAINER_SELECTOR);
|
11545 | if (!container) {
|
11546 | throw new Error("Dialog component requires a " + strings.CONTAINER_SELECTOR + " container element");
|
11547 | }
|
11548 | this.container_ = container;
|
11549 | this.content_ = this.root_.querySelector(strings.CONTENT_SELECTOR);
|
11550 | this.buttons_ = [].slice.call(this.root_.querySelectorAll(strings.BUTTON_SELECTOR));
|
11551 | this.defaultButton_ = this.root_.querySelector(strings.DEFAULT_BUTTON_SELECTOR);
|
11552 | this.focusTrapFactory_ = focusTrapFactory;
|
11553 | this.initialFocusEl_ = initialFocusEl;
|
11554 | this.buttonRipples_ = [];
|
11555 | try {
|
11556 | for (var _b = __values(this.buttons_), _c = _b.next(); !_c.done; _c = _b.next()) {
|
11557 | var buttonEl = _c.value;
|
11558 | this.buttonRipples_.push(new component_2.MDCRipple(buttonEl));
|
11559 | }
|
11560 | } catch (e_1_1) {
|
11561 | e_1 = {
|
11562 | error: e_1_1
|
11563 | };
|
11564 | } finally {
|
11565 | try {
|
11566 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
11567 | } finally {
|
11568 | if (e_1) throw e_1.error;
|
11569 | }
|
11570 | }
|
11571 | };
|
11572 | MDCDialog.prototype.initialSyncWithDOM = function() {
|
11573 | var _this = this;
|
11574 | this.focusTrap_ = util.createFocusTrapInstance(this.container_, this.focusTrapFactory_, this.initialFocusEl_);
|
11575 | this.handleInteraction_ = this.foundation_.handleInteraction.bind(this.foundation_);
|
11576 | this.handleDocumentKeydown_ = this.foundation_.handleDocumentKeydown.bind(this.foundation_);
|
11577 | this.handleLayout_ = this.layout.bind(this);
|
11578 | var LAYOUT_EVENTS = [ "resize", "orientationchange" ];
|
11579 | this.handleOpening_ = function() {
|
11580 | LAYOUT_EVENTS.forEach(function(evtType) {
|
11581 | return window.addEventListener(evtType, _this.handleLayout_);
|
11582 | });
|
11583 | document.addEventListener("keydown", _this.handleDocumentKeydown_);
|
11584 | };
|
11585 | this.handleClosing_ = function() {
|
11586 | LAYOUT_EVENTS.forEach(function(evtType) {
|
11587 | return window.removeEventListener(evtType, _this.handleLayout_);
|
11588 | });
|
11589 | document.removeEventListener("keydown", _this.handleDocumentKeydown_);
|
11590 | };
|
11591 | this.listen("click", this.handleInteraction_);
|
11592 | this.listen("keydown", this.handleInteraction_);
|
11593 | this.listen(strings.OPENING_EVENT, this.handleOpening_);
|
11594 | this.listen(strings.CLOSING_EVENT, this.handleClosing_);
|
11595 | };
|
11596 | MDCDialog.prototype.destroy = function() {
|
11597 | this.unlisten("click", this.handleInteraction_);
|
11598 | this.unlisten("keydown", this.handleInteraction_);
|
11599 | this.unlisten(strings.OPENING_EVENT, this.handleOpening_);
|
11600 | this.unlisten(strings.CLOSING_EVENT, this.handleClosing_);
|
11601 | this.handleClosing_();
|
11602 | this.buttonRipples_.forEach(function(ripple) {
|
11603 | return ripple.destroy();
|
11604 | });
|
11605 | _super.prototype.destroy.call(this);
|
11606 | };
|
11607 | MDCDialog.prototype.layout = function() {
|
11608 | this.foundation_.layout();
|
11609 | };
|
11610 | MDCDialog.prototype.open = function() {
|
11611 | this.foundation_.open();
|
11612 | };
|
11613 | MDCDialog.prototype.close = function(action) {
|
11614 | if (action === void 0) {
|
11615 | action = "";
|
11616 | }
|
11617 | this.foundation_.close(action);
|
11618 | };
|
11619 | MDCDialog.prototype.getDefaultFoundation = function() {
|
11620 | var _this = this;
|
11621 | var adapter = {
|
11622 | addBodyClass: function addBodyClass(className) {
|
11623 | return document.body.classList.add(className);
|
11624 | },
|
11625 | addClass: function addClass(className) {
|
11626 | return _this.root_.classList.add(className);
|
11627 | },
|
11628 | areButtonsStacked: function areButtonsStacked() {
|
11629 | return util.areTopsMisaligned(_this.buttons_);
|
11630 | },
|
11631 | clickDefaultButton: function clickDefaultButton() {
|
11632 | return _this.defaultButton_ && _this.defaultButton_.click();
|
11633 | },
|
11634 | eventTargetMatches: function eventTargetMatches(target, selector) {
|
11635 | return target ? ponyfill_1.matches(target, selector) : false;
|
11636 | },
|
11637 | getActionFromEvent: function getActionFromEvent(evt) {
|
11638 | if (!evt.target) {
|
11639 | return "";
|
11640 | }
|
11641 | var element = ponyfill_1.closest(evt.target, "[" + strings.ACTION_ATTRIBUTE + "]");
|
11642 | return element && element.getAttribute(strings.ACTION_ATTRIBUTE);
|
11643 | },
|
11644 | hasClass: function hasClass(className) {
|
11645 | return _this.root_.classList.contains(className);
|
11646 | },
|
11647 | isContentScrollable: function isContentScrollable() {
|
11648 | return util.isScrollable(_this.content_);
|
11649 | },
|
11650 | notifyClosed: function notifyClosed(action) {
|
11651 | return _this.emit(strings.CLOSED_EVENT, action ? {
|
11652 | action: action
|
11653 | } : {});
|
11654 | },
|
11655 | notifyClosing: function notifyClosing(action) {
|
11656 | return _this.emit(strings.CLOSING_EVENT, action ? {
|
11657 | action: action
|
11658 | } : {});
|
11659 | },
|
11660 | notifyOpened: function notifyOpened() {
|
11661 | return _this.emit(strings.OPENED_EVENT, {});
|
11662 | },
|
11663 | notifyOpening: function notifyOpening() {
|
11664 | return _this.emit(strings.OPENING_EVENT, {});
|
11665 | },
|
11666 | releaseFocus: function releaseFocus() {
|
11667 | return _this.focusTrap_.deactivate();
|
11668 | },
|
11669 | removeBodyClass: function removeBodyClass(className) {
|
11670 | return document.body.classList.remove(className);
|
11671 | },
|
11672 | removeClass: function removeClass(className) {
|
11673 | return _this.root_.classList.remove(className);
|
11674 | },
|
11675 | reverseButtons: function reverseButtons() {
|
11676 | _this.buttons_.reverse();
|
11677 | _this.buttons_.forEach(function(button) {
|
11678 | button.parentElement.appendChild(button);
|
11679 | });
|
11680 | },
|
11681 | trapFocus: function trapFocus() {
|
11682 | return _this.focusTrap_.activate();
|
11683 | }
|
11684 | };
|
11685 | return new foundation_1.MDCDialogFoundation(adapter);
|
11686 | };
|
11687 | return MDCDialog;
|
11688 | }(component_1.MDCComponent);
|
11689 | exports.MDCDialog = MDCDialog;
|
11690 | }, function(module, exports, __webpack_require__) {
|
11691 | "use strict";
|
11692 | Object.defineProperty(exports, "__esModule", {
|
11693 | value: true
|
11694 | });
|
11695 | exports.cssClasses = {
|
11696 | CLOSING: "mdc-dialog--closing",
|
11697 | OPEN: "mdc-dialog--open",
|
11698 | OPENING: "mdc-dialog--opening",
|
11699 | SCROLLABLE: "mdc-dialog--scrollable",
|
11700 | SCROLL_LOCK: "mdc-dialog-scroll-lock",
|
11701 | STACKED: "mdc-dialog--stacked"
|
11702 | };
|
11703 | exports.strings = {
|
11704 | ACTION_ATTRIBUTE: "data-mdc-dialog-action",
|
11705 | BUTTON_SELECTOR: ".mdc-dialog__button",
|
11706 | CLOSED_EVENT: "MDCDialog:closed",
|
11707 | CLOSE_ACTION: "close",
|
11708 | CLOSING_EVENT: "MDCDialog:closing",
|
11709 | CONTAINER_SELECTOR: ".mdc-dialog__container",
|
11710 | CONTENT_SELECTOR: ".mdc-dialog__content",
|
11711 | DEFAULT_BUTTON_SELECTOR: ".mdc-dialog__button--default",
|
11712 | DESTROY_ACTION: "destroy",
|
11713 | OPENED_EVENT: "MDCDialog:opened",
|
11714 | OPENING_EVENT: "MDCDialog:opening",
|
11715 | SCRIM_SELECTOR: ".mdc-dialog__scrim",
|
11716 | SUPPRESS_DEFAULT_PRESS_SELECTOR: [ "textarea", ".mdc-menu .mdc-list-item" ].join(", "),
|
11717 | SURFACE_SELECTOR: ".mdc-dialog__surface"
|
11718 | };
|
11719 | exports.numbers = {
|
11720 | DIALOG_ANIMATION_CLOSE_TIME_MS: 75,
|
11721 | DIALOG_ANIMATION_OPEN_TIME_MS: 150
|
11722 | };
|
11723 | }, function(module, exports, __webpack_require__) {
|
11724 | "use strict";
|
11725 | var __importStar = this && this.__importStar || function(mod) {
|
11726 | if (mod && mod.__esModule) return mod;
|
11727 | var result = {};
|
11728 | if (mod != null) for (var k in mod) {
|
11729 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
11730 | }
|
11731 | result["default"] = mod;
|
11732 | return result;
|
11733 | };
|
11734 | Object.defineProperty(exports, "__esModule", {
|
11735 | value: true
|
11736 | });
|
11737 | var ponyfill = __importStar(__webpack_require__(3));
|
11738 | exports.ponyfill = ponyfill;
|
11739 | }, function(module, exports, __webpack_require__) {
|
11740 | "use strict";
|
11741 | function __export(m) {
|
11742 | for (var p in m) {
|
11743 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
11744 | }
|
11745 | }
|
11746 | var __importStar = this && this.__importStar || function(mod) {
|
11747 | if (mod && mod.__esModule) return mod;
|
11748 | var result = {};
|
11749 | if (mod != null) for (var k in mod) {
|
11750 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
11751 | }
|
11752 | result["default"] = mod;
|
11753 | return result;
|
11754 | };
|
11755 | Object.defineProperty(exports, "__esModule", {
|
11756 | value: true
|
11757 | });
|
11758 | var util = __importStar(__webpack_require__(33));
|
11759 | exports.util = util;
|
11760 | __export(__webpack_require__(100));
|
11761 | __export(__webpack_require__(14));
|
11762 | __export(__webpack_require__(36));
|
11763 | }, function(module, exports) {
|
11764 | var candidateSelectors = [ "input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])' ];
|
11765 | var candidateSelector = candidateSelectors.join(",");
|
11766 | var matches = typeof Element === "undefined" ? function() {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
11767 | function tabbable(el, options) {
|
11768 | options = options || {};
|
11769 | var regularTabbables = [];
|
11770 | var orderedTabbables = [];
|
11771 | var candidates = el.querySelectorAll(candidateSelector);
|
11772 | if (options.includeContainer) {
|
11773 | if (matches.call(el, candidateSelector)) {
|
11774 | candidates = Array.prototype.slice.apply(candidates);
|
11775 | candidates.unshift(el);
|
11776 | }
|
11777 | }
|
11778 | var i, candidate, candidateTabindex;
|
11779 | for (i = 0; i < candidates.length; i++) {
|
11780 | candidate = candidates[i];
|
11781 | if (!isNodeMatchingSelectorTabbable(candidate)) continue;
|
11782 | candidateTabindex = getTabindex(candidate);
|
11783 | if (candidateTabindex === 0) {
|
11784 | regularTabbables.push(candidate);
|
11785 | } else {
|
11786 | orderedTabbables.push({
|
11787 | documentOrder: i,
|
11788 | tabIndex: candidateTabindex,
|
11789 | node: candidate
|
11790 | });
|
11791 | }
|
11792 | }
|
11793 | var tabbableNodes = orderedTabbables.sort(sortOrderedTabbables).map(function(a) {
|
11794 | return a.node;
|
11795 | }).concat(regularTabbables);
|
11796 | return tabbableNodes;
|
11797 | }
|
11798 | tabbable.isTabbable = isTabbable;
|
11799 | tabbable.isFocusable = isFocusable;
|
11800 | function isNodeMatchingSelectorTabbable(node) {
|
11801 | if (!isNodeMatchingSelectorFocusable(node) || isNonTabbableRadio(node) || getTabindex(node) < 0) {
|
11802 | return false;
|
11803 | }
|
11804 | return true;
|
11805 | }
|
11806 | function isTabbable(node) {
|
11807 | if (!node) throw new Error("No node provided");
|
11808 | if (matches.call(node, candidateSelector) === false) return false;
|
11809 | return isNodeMatchingSelectorTabbable(node);
|
11810 | }
|
11811 | function isNodeMatchingSelectorFocusable(node) {
|
11812 | if (node.disabled || isHiddenInput(node) || isHidden(node)) {
|
11813 | return false;
|
11814 | }
|
11815 | return true;
|
11816 | }
|
11817 | var focusableCandidateSelector = candidateSelectors.concat("iframe").join(",");
|
11818 | function isFocusable(node) {
|
11819 | if (!node) throw new Error("No node provided");
|
11820 | if (matches.call(node, focusableCandidateSelector) === false) return false;
|
11821 | return isNodeMatchingSelectorFocusable(node);
|
11822 | }
|
11823 | function getTabindex(node) {
|
11824 | var tabindexAttr = parseInt(node.getAttribute("tabindex"), 10);
|
11825 | if (!isNaN(tabindexAttr)) return tabindexAttr;
|
11826 | if (isContentEditable(node)) return 0;
|
11827 | return node.tabIndex;
|
11828 | }
|
11829 | function sortOrderedTabbables(a, b) {
|
11830 | return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
11831 | }
|
11832 | function isContentEditable(node) {
|
11833 | return node.contentEditable === "true";
|
11834 | }
|
11835 | function isInput(node) {
|
11836 | return node.tagName === "INPUT";
|
11837 | }
|
11838 | function isHiddenInput(node) {
|
11839 | return isInput(node) && node.type === "hidden";
|
11840 | }
|
11841 | function isRadio(node) {
|
11842 | return isInput(node) && node.type === "radio";
|
11843 | }
|
11844 | function isNonTabbableRadio(node) {
|
11845 | return isRadio(node) && !isTabbableRadio(node);
|
11846 | }
|
11847 | function getCheckedRadio(nodes) {
|
11848 | for (var i = 0; i < nodes.length; i++) {
|
11849 | if (nodes[i].checked) {
|
11850 | return nodes[i];
|
11851 | }
|
11852 | }
|
11853 | }
|
11854 | function isTabbableRadio(node) {
|
11855 | if (!node.name) return true;
|
11856 | var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]');
|
11857 | var checked = getCheckedRadio(radioSet);
|
11858 | return !checked || checked === node;
|
11859 | }
|
11860 | function isHidden(node) {
|
11861 | return node.offsetParent === null || getComputedStyle(node).visibility === "hidden";
|
11862 | }
|
11863 | module.exports = tabbable;
|
11864 | }, function(module, exports) {
|
11865 | module.exports = extend;
|
11866 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
11867 | function extend() {
|
11868 | var target = {};
|
11869 | for (var i = 0; i < arguments.length; i++) {
|
11870 | var source = arguments[i];
|
11871 | for (var key in source) {
|
11872 | if (hasOwnProperty.call(source, key)) {
|
11873 | target[key] = source[key];
|
11874 | }
|
11875 | }
|
11876 | }
|
11877 | return target;
|
11878 | }
|
11879 | }, function(module, exports, __webpack_require__) {
|
11880 | "use strict";
|
11881 | var __extends = this && this.__extends || function() {
|
11882 | var _extendStatics = function extendStatics(d, b) {
|
11883 | _extendStatics = Object.setPrototypeOf || {
|
11884 | __proto__: []
|
11885 | } instanceof Array && function(d, b) {
|
11886 | d.__proto__ = b;
|
11887 | } || function(d, b) {
|
11888 | for (var p in b) {
|
11889 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
11890 | }
|
11891 | };
|
11892 | return _extendStatics(d, b);
|
11893 | };
|
11894 | return function(d, b) {
|
11895 | _extendStatics(d, b);
|
11896 | function __() {
|
11897 | this.constructor = d;
|
11898 | }
|
11899 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
11900 | };
|
11901 | }();
|
11902 | var __importDefault = this && this.__importDefault || function(mod) {
|
11903 | return mod && mod.__esModule ? mod : {
|
11904 | default: mod
|
11905 | };
|
11906 | };
|
11907 | var __importStar = this && this.__importStar || function(mod) {
|
11908 | if (mod && mod.__esModule) return mod;
|
11909 | var result = {};
|
11910 | if (mod != null) for (var k in mod) {
|
11911 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
11912 | }
|
11913 | result["default"] = mod;
|
11914 | return result;
|
11915 | };
|
11916 | Object.defineProperty(exports, "__esModule", {
|
11917 | value: true
|
11918 | });
|
11919 | var component_1 = __webpack_require__(1);
|
11920 | var component_2 = __webpack_require__(13);
|
11921 | var foundation_1 = __webpack_require__(5);
|
11922 | var focus_trap_1 = __importDefault(__webpack_require__(34));
|
11923 | var foundation_2 = __webpack_require__(14);
|
11924 | var foundation_3 = __webpack_require__(36);
|
11925 | var util = __importStar(__webpack_require__(33));
|
11926 | var cssClasses = foundation_2.MDCDismissibleDrawerFoundation.cssClasses, strings = foundation_2.MDCDismissibleDrawerFoundation.strings;
|
11927 | var MDCDrawer = function(_super) {
|
11928 | __extends(MDCDrawer, _super);
|
11929 | function MDCDrawer() {
|
11930 | return _super !== null && _super.apply(this, arguments) || this;
|
11931 | }
|
11932 | MDCDrawer.attachTo = function(root) {
|
11933 | return new MDCDrawer(root);
|
11934 | };
|
11935 | Object.defineProperty(MDCDrawer.prototype, "open", {
|
11936 | get: function get() {
|
11937 | return this.foundation_.isOpen();
|
11938 | },
|
11939 | set: function set(isOpen) {
|
11940 | if (isOpen) {
|
11941 | this.foundation_.open();
|
11942 | } else {
|
11943 | this.foundation_.close();
|
11944 | }
|
11945 | },
|
11946 | enumerable: true,
|
11947 | configurable: true
|
11948 | });
|
11949 | Object.defineProperty(MDCDrawer.prototype, "list", {
|
11950 | get: function get() {
|
11951 | return this.list_;
|
11952 | },
|
11953 | enumerable: true,
|
11954 | configurable: true
|
11955 | });
|
11956 | MDCDrawer.prototype.initialize = function(focusTrapFactory, listFactory) {
|
11957 | if (focusTrapFactory === void 0) {
|
11958 | focusTrapFactory = focus_trap_1.default;
|
11959 | }
|
11960 | if (listFactory === void 0) {
|
11961 | listFactory = function listFactory(el) {
|
11962 | return new component_2.MDCList(el);
|
11963 | };
|
11964 | }
|
11965 | var listEl = this.root_.querySelector("." + foundation_1.MDCListFoundation.cssClasses.ROOT);
|
11966 | if (listEl) {
|
11967 | this.list_ = listFactory(listEl);
|
11968 | this.list_.wrapFocus = true;
|
11969 | }
|
11970 | this.focusTrapFactory_ = focusTrapFactory;
|
11971 | };
|
11972 | MDCDrawer.prototype.initialSyncWithDOM = function() {
|
11973 | var _this = this;
|
11974 | var MODAL = cssClasses.MODAL;
|
11975 | var SCRIM_SELECTOR = strings.SCRIM_SELECTOR;
|
11976 | this.scrim_ = this.root_.parentNode.querySelector(SCRIM_SELECTOR);
|
11977 | if (this.scrim_ && this.root_.classList.contains(MODAL)) {
|
11978 | this.handleScrimClick_ = function() {
|
11979 | return _this.foundation_.handleScrimClick();
|
11980 | };
|
11981 | this.scrim_.addEventListener("click", this.handleScrimClick_);
|
11982 | this.focusTrap_ = util.createFocusTrapInstance(this.root_, this.focusTrapFactory_);
|
11983 | }
|
11984 | this.handleKeydown_ = function(evt) {
|
11985 | return _this.foundation_.handleKeydown(evt);
|
11986 | };
|
11987 | this.handleTransitionEnd_ = function(evt) {
|
11988 | return _this.foundation_.handleTransitionEnd(evt);
|
11989 | };
|
11990 | this.listen("keydown", this.handleKeydown_);
|
11991 | this.listen("transitionend", this.handleTransitionEnd_);
|
11992 | };
|
11993 | MDCDrawer.prototype.destroy = function() {
|
11994 | this.unlisten("keydown", this.handleKeydown_);
|
11995 | this.unlisten("transitionend", this.handleTransitionEnd_);
|
11996 | if (this.list_) {
|
11997 | this.list_.destroy();
|
11998 | }
|
11999 | var MODAL = cssClasses.MODAL;
|
12000 | if (this.scrim_ && this.handleScrimClick_ && this.root_.classList.contains(MODAL)) {
|
12001 | this.scrim_.removeEventListener("click", this.handleScrimClick_);
|
12002 | this.open = false;
|
12003 | }
|
12004 | };
|
12005 | MDCDrawer.prototype.getDefaultFoundation = function() {
|
12006 | var _this = this;
|
12007 | var adapter = {
|
12008 | addClass: function addClass(className) {
|
12009 | return _this.root_.classList.add(className);
|
12010 | },
|
12011 | removeClass: function removeClass(className) {
|
12012 | return _this.root_.classList.remove(className);
|
12013 | },
|
12014 | hasClass: function hasClass(className) {
|
12015 | return _this.root_.classList.contains(className);
|
12016 | },
|
12017 | elementHasClass: function elementHasClass(element, className) {
|
12018 | return element.classList.contains(className);
|
12019 | },
|
12020 | saveFocus: function saveFocus() {
|
12021 | return _this.previousFocus_ = document.activeElement;
|
12022 | },
|
12023 | restoreFocus: function restoreFocus() {
|
12024 | var previousFocus = _this.previousFocus_;
|
12025 | if (previousFocus && previousFocus.focus && _this.root_.contains(document.activeElement)) {
|
12026 | previousFocus.focus();
|
12027 | }
|
12028 | },
|
12029 | focusActiveNavigationItem: function focusActiveNavigationItem() {
|
12030 | var activeNavItemEl = _this.root_.querySelector("." + foundation_1.MDCListFoundation.cssClasses.LIST_ITEM_ACTIVATED_CLASS);
|
12031 | if (activeNavItemEl) {
|
12032 | activeNavItemEl.focus();
|
12033 | }
|
12034 | },
|
12035 | notifyClose: function notifyClose() {
|
12036 | return _this.emit(strings.CLOSE_EVENT, {}, true);
|
12037 | },
|
12038 | notifyOpen: function notifyOpen() {
|
12039 | return _this.emit(strings.OPEN_EVENT, {}, true);
|
12040 | },
|
12041 | trapFocus: function trapFocus() {
|
12042 | return _this.focusTrap_.activate();
|
12043 | },
|
12044 | releaseFocus: function releaseFocus() {
|
12045 | return _this.focusTrap_.deactivate();
|
12046 | }
|
12047 | };
|
12048 | var DISMISSIBLE = cssClasses.DISMISSIBLE, MODAL = cssClasses.MODAL;
|
12049 | if (this.root_.classList.contains(DISMISSIBLE)) {
|
12050 | return new foundation_2.MDCDismissibleDrawerFoundation(adapter);
|
12051 | } else if (this.root_.classList.contains(MODAL)) {
|
12052 | return new foundation_3.MDCModalDrawerFoundation(adapter);
|
12053 | } else {
|
12054 | throw new Error("MDCDrawer: Failed to instantiate component. Supported variants are " + DISMISSIBLE + " and " + MODAL + ".");
|
12055 | }
|
12056 | };
|
12057 | return MDCDrawer;
|
12058 | }(component_1.MDCComponent);
|
12059 | exports.MDCDrawer = MDCDrawer;
|
12060 | }, function(module, exports, __webpack_require__) {
|
12061 | "use strict";
|
12062 | Object.defineProperty(exports, "__esModule", {
|
12063 | value: true
|
12064 | });
|
12065 | var cssClasses = {
|
12066 | ANIMATE: "mdc-drawer--animate",
|
12067 | CLOSING: "mdc-drawer--closing",
|
12068 | DISMISSIBLE: "mdc-drawer--dismissible",
|
12069 | MODAL: "mdc-drawer--modal",
|
12070 | OPEN: "mdc-drawer--open",
|
12071 | OPENING: "mdc-drawer--opening",
|
12072 | ROOT: "mdc-drawer"
|
12073 | };
|
12074 | exports.cssClasses = cssClasses;
|
12075 | var strings = {
|
12076 | APP_CONTENT_SELECTOR: ".mdc-drawer-app-content",
|
12077 | CLOSE_EVENT: "MDCDrawer:closed",
|
12078 | OPEN_EVENT: "MDCDrawer:opened",
|
12079 | SCRIM_SELECTOR: ".mdc-drawer-scrim"
|
12080 | };
|
12081 | exports.strings = strings;
|
12082 | }, function(module, exports, __webpack_require__) {
|
12083 | "use strict";
|
12084 | function __export(m) {
|
12085 | for (var p in m) {
|
12086 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12087 | }
|
12088 | }
|
12089 | Object.defineProperty(exports, "__esModule", {
|
12090 | value: true
|
12091 | });
|
12092 | __export(__webpack_require__(15));
|
12093 | __export(__webpack_require__(16));
|
12094 | }, function(module, exports, __webpack_require__) {
|
12095 | "use strict";
|
12096 | Object.defineProperty(exports, "__esModule", {
|
12097 | value: true
|
12098 | });
|
12099 | exports.cssClasses = {
|
12100 | LABEL_FLOAT_ABOVE: "mdc-floating-label--float-above",
|
12101 | LABEL_SHAKE: "mdc-floating-label--shake",
|
12102 | ROOT: "mdc-floating-label"
|
12103 | };
|
12104 | }, function(module, exports, __webpack_require__) {
|
12105 | "use strict";
|
12106 | function __export(m) {
|
12107 | for (var p in m) {
|
12108 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12109 | }
|
12110 | }
|
12111 | Object.defineProperty(exports, "__esModule", {
|
12112 | value: true
|
12113 | });
|
12114 | __export(__webpack_require__(105));
|
12115 | __export(__webpack_require__(37));
|
12116 | }, function(module, exports, __webpack_require__) {
|
12117 | "use strict";
|
12118 | var __extends = this && this.__extends || function() {
|
12119 | var _extendStatics = function extendStatics(d, b) {
|
12120 | _extendStatics = Object.setPrototypeOf || {
|
12121 | __proto__: []
|
12122 | } instanceof Array && function(d, b) {
|
12123 | d.__proto__ = b;
|
12124 | } || function(d, b) {
|
12125 | for (var p in b) {
|
12126 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
12127 | }
|
12128 | };
|
12129 | return _extendStatics(d, b);
|
12130 | };
|
12131 | return function(d, b) {
|
12132 | _extendStatics(d, b);
|
12133 | function __() {
|
12134 | this.constructor = d;
|
12135 | }
|
12136 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12137 | };
|
12138 | }();
|
12139 | Object.defineProperty(exports, "__esModule", {
|
12140 | value: true
|
12141 | });
|
12142 | var component_1 = __webpack_require__(1);
|
12143 | var foundation_1 = __webpack_require__(37);
|
12144 | var MDCFormField = function(_super) {
|
12145 | __extends(MDCFormField, _super);
|
12146 | function MDCFormField() {
|
12147 | return _super !== null && _super.apply(this, arguments) || this;
|
12148 | }
|
12149 | MDCFormField.attachTo = function(root) {
|
12150 | return new MDCFormField(root);
|
12151 | };
|
12152 | Object.defineProperty(MDCFormField.prototype, "input", {
|
12153 | get: function get() {
|
12154 | return this.input_;
|
12155 | },
|
12156 | set: function set(input) {
|
12157 | this.input_ = input;
|
12158 | },
|
12159 | enumerable: true,
|
12160 | configurable: true
|
12161 | });
|
12162 | Object.defineProperty(MDCFormField.prototype, "label_", {
|
12163 | get: function get() {
|
12164 | var LABEL_SELECTOR = foundation_1.MDCFormFieldFoundation.strings.LABEL_SELECTOR;
|
12165 | return this.root_.querySelector(LABEL_SELECTOR);
|
12166 | },
|
12167 | enumerable: true,
|
12168 | configurable: true
|
12169 | });
|
12170 | MDCFormField.prototype.getDefaultFoundation = function() {
|
12171 | var _this = this;
|
12172 | var adapter = {
|
12173 | activateInputRipple: function activateInputRipple() {
|
12174 | if (_this.input_ && _this.input_.ripple) {
|
12175 | _this.input_.ripple.activate();
|
12176 | }
|
12177 | },
|
12178 | deactivateInputRipple: function deactivateInputRipple() {
|
12179 | if (_this.input_ && _this.input_.ripple) {
|
12180 | _this.input_.ripple.deactivate();
|
12181 | }
|
12182 | },
|
12183 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
12184 | if (_this.label_) {
|
12185 | _this.label_.removeEventListener(evtType, handler);
|
12186 | }
|
12187 | },
|
12188 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
12189 | if (_this.label_) {
|
12190 | _this.label_.addEventListener(evtType, handler);
|
12191 | }
|
12192 | }
|
12193 | };
|
12194 | return new foundation_1.MDCFormFieldFoundation(adapter);
|
12195 | };
|
12196 | return MDCFormField;
|
12197 | }(component_1.MDCComponent);
|
12198 | exports.MDCFormField = MDCFormField;
|
12199 | }, function(module, exports, __webpack_require__) {
|
12200 | "use strict";
|
12201 | Object.defineProperty(exports, "__esModule", {
|
12202 | value: true
|
12203 | });
|
12204 | exports.cssClasses = {
|
12205 | ROOT: "mdc-form-field"
|
12206 | };
|
12207 | exports.strings = {
|
12208 | LABEL_SELECTOR: ".mdc-form-field > label"
|
12209 | };
|
12210 | }, function(module, exports, __webpack_require__) {
|
12211 | "use strict";
|
12212 | function __export(m) {
|
12213 | for (var p in m) {
|
12214 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12215 | }
|
12216 | }
|
12217 | Object.defineProperty(exports, "__esModule", {
|
12218 | value: true
|
12219 | });
|
12220 | __export(__webpack_require__(108));
|
12221 | __export(__webpack_require__(38));
|
12222 | }, function(module, exports, __webpack_require__) {
|
12223 | "use strict";
|
12224 | var __extends = this && this.__extends || function() {
|
12225 | var _extendStatics = function extendStatics(d, b) {
|
12226 | _extendStatics = Object.setPrototypeOf || {
|
12227 | __proto__: []
|
12228 | } instanceof Array && function(d, b) {
|
12229 | d.__proto__ = b;
|
12230 | } || function(d, b) {
|
12231 | for (var p in b) {
|
12232 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
12233 | }
|
12234 | };
|
12235 | return _extendStatics(d, b);
|
12236 | };
|
12237 | return function(d, b) {
|
12238 | _extendStatics(d, b);
|
12239 | function __() {
|
12240 | this.constructor = d;
|
12241 | }
|
12242 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12243 | };
|
12244 | }();
|
12245 | Object.defineProperty(exports, "__esModule", {
|
12246 | value: true
|
12247 | });
|
12248 | var component_1 = __webpack_require__(1);
|
12249 | var foundation_1 = __webpack_require__(38);
|
12250 | var MDCGridList = function(_super) {
|
12251 | __extends(MDCGridList, _super);
|
12252 | function MDCGridList() {
|
12253 | return _super !== null && _super.apply(this, arguments) || this;
|
12254 | }
|
12255 | MDCGridList.attachTo = function(root) {
|
12256 | return new MDCGridList(root);
|
12257 | };
|
12258 | MDCGridList.prototype.getDefaultFoundation = function() {
|
12259 | var _this = this;
|
12260 | var adapter = {
|
12261 | deregisterResizeHandler: function deregisterResizeHandler(handler) {
|
12262 | return window.removeEventListener("resize", handler);
|
12263 | },
|
12264 | getNumberOfTiles: function getNumberOfTiles() {
|
12265 | return _this.root_.querySelectorAll(foundation_1.MDCGridListFoundation.strings.TILE_SELECTOR).length;
|
12266 | },
|
12267 | getOffsetWidth: function getOffsetWidth() {
|
12268 | return _this.root_.offsetWidth;
|
12269 | },
|
12270 | getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex(index) {
|
12271 | var tileEl = _this.root_.querySelectorAll(foundation_1.MDCGridListFoundation.strings.TILE_SELECTOR)[index];
|
12272 | return tileEl.offsetWidth;
|
12273 | },
|
12274 | registerResizeHandler: function registerResizeHandler(handler) {
|
12275 | return window.addEventListener("resize", handler);
|
12276 | },
|
12277 | setStyleForTilesElement: function setStyleForTilesElement(property, value) {
|
12278 | var tilesEl = _this.root_.querySelector(foundation_1.MDCGridListFoundation.strings.TILES_SELECTOR);
|
12279 | tilesEl.style[property] = value;
|
12280 | }
|
12281 | };
|
12282 | return new foundation_1.MDCGridListFoundation(adapter);
|
12283 | };
|
12284 | return MDCGridList;
|
12285 | }(component_1.MDCComponent);
|
12286 | exports.MDCGridList = MDCGridList;
|
12287 | }, function(module, exports, __webpack_require__) {
|
12288 | "use strict";
|
12289 | Object.defineProperty(exports, "__esModule", {
|
12290 | value: true
|
12291 | });
|
12292 | exports.strings = {
|
12293 | TILES_SELECTOR: ".mdc-grid-list__tiles",
|
12294 | TILE_SELECTOR: ".mdc-grid-tile"
|
12295 | };
|
12296 | }, function(module, exports, __webpack_require__) {
|
12297 | "use strict";
|
12298 | function __export(m) {
|
12299 | for (var p in m) {
|
12300 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12301 | }
|
12302 | }
|
12303 | Object.defineProperty(exports, "__esModule", {
|
12304 | value: true
|
12305 | });
|
12306 | __export(__webpack_require__(111));
|
12307 | __export(__webpack_require__(39));
|
12308 | }, function(module, exports, __webpack_require__) {
|
12309 | "use strict";
|
12310 | var __extends = this && this.__extends || function() {
|
12311 | var _extendStatics = function extendStatics(d, b) {
|
12312 | _extendStatics = Object.setPrototypeOf || {
|
12313 | __proto__: []
|
12314 | } instanceof Array && function(d, b) {
|
12315 | d.__proto__ = b;
|
12316 | } || function(d, b) {
|
12317 | for (var p in b) {
|
12318 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
12319 | }
|
12320 | };
|
12321 | return _extendStatics(d, b);
|
12322 | };
|
12323 | return function(d, b) {
|
12324 | _extendStatics(d, b);
|
12325 | function __() {
|
12326 | this.constructor = d;
|
12327 | }
|
12328 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12329 | };
|
12330 | }();
|
12331 | Object.defineProperty(exports, "__esModule", {
|
12332 | value: true
|
12333 | });
|
12334 | var component_1 = __webpack_require__(1);
|
12335 | var component_2 = __webpack_require__(2);
|
12336 | var foundation_1 = __webpack_require__(39);
|
12337 | var strings = foundation_1.MDCIconButtonToggleFoundation.strings;
|
12338 | var MDCIconButtonToggle = function(_super) {
|
12339 | __extends(MDCIconButtonToggle, _super);
|
12340 | function MDCIconButtonToggle() {
|
12341 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
12342 | _this.ripple_ = _this.createRipple_();
|
12343 | return _this;
|
12344 | }
|
12345 | MDCIconButtonToggle.attachTo = function(root) {
|
12346 | return new MDCIconButtonToggle(root);
|
12347 | };
|
12348 | MDCIconButtonToggle.prototype.initialSyncWithDOM = function() {
|
12349 | var _this = this;
|
12350 | this.handleClick_ = function() {
|
12351 | return _this.foundation_.handleClick();
|
12352 | };
|
12353 | this.listen("click", this.handleClick_);
|
12354 | };
|
12355 | MDCIconButtonToggle.prototype.destroy = function() {
|
12356 | this.unlisten("click", this.handleClick_);
|
12357 | this.ripple_.destroy();
|
12358 | _super.prototype.destroy.call(this);
|
12359 | };
|
12360 | MDCIconButtonToggle.prototype.getDefaultFoundation = function() {
|
12361 | var _this = this;
|
12362 | var adapter = {
|
12363 | addClass: function addClass(className) {
|
12364 | return _this.root_.classList.add(className);
|
12365 | },
|
12366 | hasClass: function hasClass(className) {
|
12367 | return _this.root_.classList.contains(className);
|
12368 | },
|
12369 | notifyChange: function notifyChange(evtData) {
|
12370 | return _this.emit(strings.CHANGE_EVENT, evtData);
|
12371 | },
|
12372 | removeClass: function removeClass(className) {
|
12373 | return _this.root_.classList.remove(className);
|
12374 | },
|
12375 | setAttr: function setAttr(attrName, attrValue) {
|
12376 | return _this.root_.setAttribute(attrName, attrValue);
|
12377 | }
|
12378 | };
|
12379 | return new foundation_1.MDCIconButtonToggleFoundation(adapter);
|
12380 | };
|
12381 | Object.defineProperty(MDCIconButtonToggle.prototype, "ripple", {
|
12382 | get: function get() {
|
12383 | return this.ripple_;
|
12384 | },
|
12385 | enumerable: true,
|
12386 | configurable: true
|
12387 | });
|
12388 | Object.defineProperty(MDCIconButtonToggle.prototype, "on", {
|
12389 | get: function get() {
|
12390 | return this.foundation_.isOn();
|
12391 | },
|
12392 | set: function set(isOn) {
|
12393 | this.foundation_.toggle(isOn);
|
12394 | },
|
12395 | enumerable: true,
|
12396 | configurable: true
|
12397 | });
|
12398 | MDCIconButtonToggle.prototype.createRipple_ = function() {
|
12399 | var ripple = new component_2.MDCRipple(this.root_);
|
12400 | ripple.unbounded = true;
|
12401 | return ripple;
|
12402 | };
|
12403 | return MDCIconButtonToggle;
|
12404 | }(component_1.MDCComponent);
|
12405 | exports.MDCIconButtonToggle = MDCIconButtonToggle;
|
12406 | }, function(module, exports, __webpack_require__) {
|
12407 | "use strict";
|
12408 | Object.defineProperty(exports, "__esModule", {
|
12409 | value: true
|
12410 | });
|
12411 | exports.cssClasses = {
|
12412 | ICON_BUTTON_ON: "mdc-icon-button--on",
|
12413 | ROOT: "mdc-icon-button"
|
12414 | };
|
12415 | exports.strings = {
|
12416 | ARIA_PRESSED: "aria-pressed",
|
12417 | CHANGE_EVENT: "MDCIconButtonToggle:change"
|
12418 | };
|
12419 | }, function(module, exports, __webpack_require__) {
|
12420 | "use strict";
|
12421 | function __export(m) {
|
12422 | for (var p in m) {
|
12423 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12424 | }
|
12425 | }
|
12426 | Object.defineProperty(exports, "__esModule", {
|
12427 | value: true
|
12428 | });
|
12429 | __export(__webpack_require__(17));
|
12430 | __export(__webpack_require__(40));
|
12431 | }, function(module, exports, __webpack_require__) {
|
12432 | "use strict";
|
12433 | Object.defineProperty(exports, "__esModule", {
|
12434 | value: true
|
12435 | });
|
12436 | var cssClasses = {
|
12437 | LINE_RIPPLE_ACTIVE: "mdc-line-ripple--active",
|
12438 | LINE_RIPPLE_DEACTIVATING: "mdc-line-ripple--deactivating"
|
12439 | };
|
12440 | exports.cssClasses = cssClasses;
|
12441 | }, function(module, exports, __webpack_require__) {
|
12442 | "use strict";
|
12443 | function __export(m) {
|
12444 | for (var p in m) {
|
12445 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12446 | }
|
12447 | }
|
12448 | Object.defineProperty(exports, "__esModule", {
|
12449 | value: true
|
12450 | });
|
12451 | __export(__webpack_require__(116));
|
12452 | __export(__webpack_require__(41));
|
12453 | }, function(module, exports, __webpack_require__) {
|
12454 | "use strict";
|
12455 | var __extends = this && this.__extends || function() {
|
12456 | var _extendStatics = function extendStatics(d, b) {
|
12457 | _extendStatics = Object.setPrototypeOf || {
|
12458 | __proto__: []
|
12459 | } instanceof Array && function(d, b) {
|
12460 | d.__proto__ = b;
|
12461 | } || function(d, b) {
|
12462 | for (var p in b) {
|
12463 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
12464 | }
|
12465 | };
|
12466 | return _extendStatics(d, b);
|
12467 | };
|
12468 | return function(d, b) {
|
12469 | _extendStatics(d, b);
|
12470 | function __() {
|
12471 | this.constructor = d;
|
12472 | }
|
12473 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12474 | };
|
12475 | }();
|
12476 | Object.defineProperty(exports, "__esModule", {
|
12477 | value: true
|
12478 | });
|
12479 | var component_1 = __webpack_require__(1);
|
12480 | var foundation_1 = __webpack_require__(41);
|
12481 | var MDCLinearProgress = function(_super) {
|
12482 | __extends(MDCLinearProgress, _super);
|
12483 | function MDCLinearProgress() {
|
12484 | return _super !== null && _super.apply(this, arguments) || this;
|
12485 | }
|
12486 | MDCLinearProgress.attachTo = function(root) {
|
12487 | return new MDCLinearProgress(root);
|
12488 | };
|
12489 | Object.defineProperty(MDCLinearProgress.prototype, "determinate", {
|
12490 | set: function set(value) {
|
12491 | this.foundation_.setDeterminate(value);
|
12492 | },
|
12493 | enumerable: true,
|
12494 | configurable: true
|
12495 | });
|
12496 | Object.defineProperty(MDCLinearProgress.prototype, "progress", {
|
12497 | set: function set(value) {
|
12498 | this.foundation_.setProgress(value);
|
12499 | },
|
12500 | enumerable: true,
|
12501 | configurable: true
|
12502 | });
|
12503 | Object.defineProperty(MDCLinearProgress.prototype, "buffer", {
|
12504 | set: function set(value) {
|
12505 | this.foundation_.setBuffer(value);
|
12506 | },
|
12507 | enumerable: true,
|
12508 | configurable: true
|
12509 | });
|
12510 | Object.defineProperty(MDCLinearProgress.prototype, "reverse", {
|
12511 | set: function set(value) {
|
12512 | this.foundation_.setReverse(value);
|
12513 | },
|
12514 | enumerable: true,
|
12515 | configurable: true
|
12516 | });
|
12517 | MDCLinearProgress.prototype.open = function() {
|
12518 | this.foundation_.open();
|
12519 | };
|
12520 | MDCLinearProgress.prototype.close = function() {
|
12521 | this.foundation_.close();
|
12522 | };
|
12523 | MDCLinearProgress.prototype.getDefaultFoundation = function() {
|
12524 | var _this = this;
|
12525 | var adapter = {
|
12526 | addClass: function addClass(className) {
|
12527 | return _this.root_.classList.add(className);
|
12528 | },
|
12529 | getBuffer: function getBuffer() {
|
12530 | return _this.root_.querySelector(foundation_1.MDCLinearProgressFoundation.strings.BUFFER_SELECTOR);
|
12531 | },
|
12532 | getPrimaryBar: function getPrimaryBar() {
|
12533 | return _this.root_.querySelector(foundation_1.MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR);
|
12534 | },
|
12535 | hasClass: function hasClass(className) {
|
12536 | return _this.root_.classList.contains(className);
|
12537 | },
|
12538 | removeClass: function removeClass(className) {
|
12539 | return _this.root_.classList.remove(className);
|
12540 | },
|
12541 | setStyle: function setStyle(el, styleProperty, value) {
|
12542 | return el.style.setProperty(styleProperty, value);
|
12543 | }
|
12544 | };
|
12545 | return new foundation_1.MDCLinearProgressFoundation(adapter);
|
12546 | };
|
12547 | return MDCLinearProgress;
|
12548 | }(component_1.MDCComponent);
|
12549 | exports.MDCLinearProgress = MDCLinearProgress;
|
12550 | }, function(module, exports, __webpack_require__) {
|
12551 | "use strict";
|
12552 | Object.defineProperty(exports, "__esModule", {
|
12553 | value: true
|
12554 | });
|
12555 | exports.cssClasses = {
|
12556 | CLOSED_CLASS: "mdc-linear-progress--closed",
|
12557 | INDETERMINATE_CLASS: "mdc-linear-progress--indeterminate",
|
12558 | REVERSED_CLASS: "mdc-linear-progress--reversed"
|
12559 | };
|
12560 | exports.strings = {
|
12561 | BUFFER_SELECTOR: ".mdc-linear-progress__buffer",
|
12562 | PRIMARY_BAR_SELECTOR: ".mdc-linear-progress__primary-bar"
|
12563 | };
|
12564 | }, function(module, exports, __webpack_require__) {
|
12565 | "use strict";
|
12566 | function __export(m) {
|
12567 | for (var p in m) {
|
12568 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12569 | }
|
12570 | }
|
12571 | Object.defineProperty(exports, "__esModule", {
|
12572 | value: true
|
12573 | });
|
12574 | __export(__webpack_require__(13));
|
12575 | __export(__webpack_require__(5));
|
12576 | }, function(module, exports, __webpack_require__) {
|
12577 | "use strict";
|
12578 | function __export(m) {
|
12579 | for (var p in m) {
|
12580 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12581 | }
|
12582 | }
|
12583 | var __importStar = this && this.__importStar || function(mod) {
|
12584 | if (mod && mod.__esModule) return mod;
|
12585 | var result = {};
|
12586 | if (mod != null) for (var k in mod) {
|
12587 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
12588 | }
|
12589 | result["default"] = mod;
|
12590 | return result;
|
12591 | };
|
12592 | Object.defineProperty(exports, "__esModule", {
|
12593 | value: true
|
12594 | });
|
12595 | var util = __importStar(__webpack_require__(42));
|
12596 | exports.util = util;
|
12597 | var constants_1 = __webpack_require__(6);
|
12598 | exports.Corner = constants_1.Corner;
|
12599 | exports.CornerBit = constants_1.CornerBit;
|
12600 | __export(__webpack_require__(43));
|
12601 | __export(__webpack_require__(8));
|
12602 | }, function(module, exports, __webpack_require__) {
|
12603 | "use strict";
|
12604 | function __export(m) {
|
12605 | for (var p in m) {
|
12606 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12607 | }
|
12608 | }
|
12609 | Object.defineProperty(exports, "__esModule", {
|
12610 | value: true
|
12611 | });
|
12612 | var constants_1 = __webpack_require__(6);
|
12613 | exports.Corner = constants_1.Corner;
|
12614 | __export(__webpack_require__(44));
|
12615 | __export(__webpack_require__(45));
|
12616 | }, function(module, exports, __webpack_require__) {
|
12617 | "use strict";
|
12618 | function __export(m) {
|
12619 | for (var p in m) {
|
12620 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12621 | }
|
12622 | }
|
12623 | Object.defineProperty(exports, "__esModule", {
|
12624 | value: true
|
12625 | });
|
12626 | __export(__webpack_require__(19));
|
12627 | __export(__webpack_require__(47));
|
12628 | }, function(module, exports, __webpack_require__) {
|
12629 | "use strict";
|
12630 | function __export(m) {
|
12631 | for (var p in m) {
|
12632 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12633 | }
|
12634 | }
|
12635 | Object.defineProperty(exports, "__esModule", {
|
12636 | value: true
|
12637 | });
|
12638 | __export(__webpack_require__(123));
|
12639 | __export(__webpack_require__(48));
|
12640 | }, function(module, exports, __webpack_require__) {
|
12641 | "use strict";
|
12642 | var __extends = this && this.__extends || function() {
|
12643 | var _extendStatics = function extendStatics(d, b) {
|
12644 | _extendStatics = Object.setPrototypeOf || {
|
12645 | __proto__: []
|
12646 | } instanceof Array && function(d, b) {
|
12647 | d.__proto__ = b;
|
12648 | } || function(d, b) {
|
12649 | for (var p in b) {
|
12650 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
12651 | }
|
12652 | };
|
12653 | return _extendStatics(d, b);
|
12654 | };
|
12655 | return function(d, b) {
|
12656 | _extendStatics(d, b);
|
12657 | function __() {
|
12658 | this.constructor = d;
|
12659 | }
|
12660 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12661 | };
|
12662 | }();
|
12663 | var __assign = this && this.__assign || function() {
|
12664 | __assign = Object.assign || function(t) {
|
12665 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
12666 | s = arguments[i];
|
12667 | for (var p in s) {
|
12668 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
12669 | }
|
12670 | }
|
12671 | return t;
|
12672 | };
|
12673 | return __assign.apply(this, arguments);
|
12674 | };
|
12675 | Object.defineProperty(exports, "__esModule", {
|
12676 | value: true
|
12677 | });
|
12678 | var component_1 = __webpack_require__(1);
|
12679 | var component_2 = __webpack_require__(2);
|
12680 | var foundation_1 = __webpack_require__(4);
|
12681 | var foundation_2 = __webpack_require__(48);
|
12682 | var MDCRadio = function(_super) {
|
12683 | __extends(MDCRadio, _super);
|
12684 | function MDCRadio() {
|
12685 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
12686 | _this.ripple_ = _this.createRipple_();
|
12687 | return _this;
|
12688 | }
|
12689 | MDCRadio.attachTo = function(root) {
|
12690 | return new MDCRadio(root);
|
12691 | };
|
12692 | Object.defineProperty(MDCRadio.prototype, "checked", {
|
12693 | get: function get() {
|
12694 | return this.nativeControl_.checked;
|
12695 | },
|
12696 | set: function set(checked) {
|
12697 | this.nativeControl_.checked = checked;
|
12698 | },
|
12699 | enumerable: true,
|
12700 | configurable: true
|
12701 | });
|
12702 | Object.defineProperty(MDCRadio.prototype, "disabled", {
|
12703 | get: function get() {
|
12704 | return this.nativeControl_.disabled;
|
12705 | },
|
12706 | set: function set(disabled) {
|
12707 | this.foundation_.setDisabled(disabled);
|
12708 | },
|
12709 | enumerable: true,
|
12710 | configurable: true
|
12711 | });
|
12712 | Object.defineProperty(MDCRadio.prototype, "value", {
|
12713 | get: function get() {
|
12714 | return this.nativeControl_.value;
|
12715 | },
|
12716 | set: function set(value) {
|
12717 | this.nativeControl_.value = value;
|
12718 | },
|
12719 | enumerable: true,
|
12720 | configurable: true
|
12721 | });
|
12722 | Object.defineProperty(MDCRadio.prototype, "ripple", {
|
12723 | get: function get() {
|
12724 | return this.ripple_;
|
12725 | },
|
12726 | enumerable: true,
|
12727 | configurable: true
|
12728 | });
|
12729 | MDCRadio.prototype.destroy = function() {
|
12730 | this.ripple_.destroy();
|
12731 | _super.prototype.destroy.call(this);
|
12732 | };
|
12733 | MDCRadio.prototype.getDefaultFoundation = function() {
|
12734 | var _this = this;
|
12735 | var adapter = {
|
12736 | addClass: function addClass(className) {
|
12737 | return _this.root_.classList.add(className);
|
12738 | },
|
12739 | removeClass: function removeClass(className) {
|
12740 | return _this.root_.classList.remove(className);
|
12741 | },
|
12742 | setNativeControlDisabled: function setNativeControlDisabled(disabled) {
|
12743 | return _this.nativeControl_.disabled = disabled;
|
12744 | }
|
12745 | };
|
12746 | return new foundation_2.MDCRadioFoundation(adapter);
|
12747 | };
|
12748 | MDCRadio.prototype.createRipple_ = function() {
|
12749 | var _this = this;
|
12750 | var adapter = __assign({}, component_2.MDCRipple.createAdapter(this), {
|
12751 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
12752 | return _this.nativeControl_.addEventListener(evtType, handler);
|
12753 | },
|
12754 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
12755 | return _this.nativeControl_.removeEventListener(evtType, handler);
|
12756 | },
|
12757 | isSurfaceActive: function isSurfaceActive() {
|
12758 | return false;
|
12759 | },
|
12760 | isUnbounded: function isUnbounded() {
|
12761 | return true;
|
12762 | }
|
12763 | });
|
12764 | return new component_2.MDCRipple(this.root_, new foundation_1.MDCRippleFoundation(adapter));
|
12765 | };
|
12766 | Object.defineProperty(MDCRadio.prototype, "nativeControl_", {
|
12767 | get: function get() {
|
12768 | var NATIVE_CONTROL_SELECTOR = foundation_2.MDCRadioFoundation.strings.NATIVE_CONTROL_SELECTOR;
|
12769 | var el = this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
|
12770 | if (!el) {
|
12771 | throw new Error("Radio component requires a " + NATIVE_CONTROL_SELECTOR + " element");
|
12772 | }
|
12773 | return el;
|
12774 | },
|
12775 | enumerable: true,
|
12776 | configurable: true
|
12777 | });
|
12778 | return MDCRadio;
|
12779 | }(component_1.MDCComponent);
|
12780 | exports.MDCRadio = MDCRadio;
|
12781 | }, function(module, exports, __webpack_require__) {
|
12782 | "use strict";
|
12783 | Object.defineProperty(exports, "__esModule", {
|
12784 | value: true
|
12785 | });
|
12786 | var strings = {
|
12787 | NATIVE_CONTROL_SELECTOR: ".mdc-radio__native-control"
|
12788 | };
|
12789 | exports.strings = strings;
|
12790 | var cssClasses = {
|
12791 | DISABLED: "mdc-radio--disabled",
|
12792 | ROOT: "mdc-radio"
|
12793 | };
|
12794 | exports.cssClasses = cssClasses;
|
12795 | }, function(module, exports, __webpack_require__) {
|
12796 | "use strict";
|
12797 | function __export(m) {
|
12798 | for (var p in m) {
|
12799 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12800 | }
|
12801 | }
|
12802 | var __importStar = this && this.__importStar || function(mod) {
|
12803 | if (mod && mod.__esModule) return mod;
|
12804 | var result = {};
|
12805 | if (mod != null) for (var k in mod) {
|
12806 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
12807 | }
|
12808 | result["default"] = mod;
|
12809 | return result;
|
12810 | };
|
12811 | Object.defineProperty(exports, "__esModule", {
|
12812 | value: true
|
12813 | });
|
12814 | var util = __importStar(__webpack_require__(11));
|
12815 | exports.util = util;
|
12816 | __export(__webpack_require__(2));
|
12817 | __export(__webpack_require__(4));
|
12818 | }, function(module, exports, __webpack_require__) {
|
12819 | "use strict";
|
12820 | function __export(m) {
|
12821 | for (var p in m) {
|
12822 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
12823 | }
|
12824 | }
|
12825 | Object.defineProperty(exports, "__esModule", {
|
12826 | value: true
|
12827 | });
|
12828 | __export(__webpack_require__(127));
|
12829 | __export(__webpack_require__(50));
|
12830 | __export(__webpack_require__(130));
|
12831 | __export(__webpack_require__(131));
|
12832 | }, function(module, exports, __webpack_require__) {
|
12833 | "use strict";
|
12834 | var __extends = this && this.__extends || function() {
|
12835 | var _extendStatics = function extendStatics(d, b) {
|
12836 | _extendStatics = Object.setPrototypeOf || {
|
12837 | __proto__: []
|
12838 | } instanceof Array && function(d, b) {
|
12839 | d.__proto__ = b;
|
12840 | } || function(d, b) {
|
12841 | for (var p in b) {
|
12842 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
12843 | }
|
12844 | };
|
12845 | return _extendStatics(d, b);
|
12846 | };
|
12847 | return function(d, b) {
|
12848 | _extendStatics(d, b);
|
12849 | function __() {
|
12850 | this.constructor = d;
|
12851 | }
|
12852 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12853 | };
|
12854 | }();
|
12855 | var __assign = this && this.__assign || function() {
|
12856 | __assign = Object.assign || function(t) {
|
12857 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
12858 | s = arguments[i];
|
12859 | for (var p in s) {
|
12860 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
12861 | }
|
12862 | }
|
12863 | return t;
|
12864 | };
|
12865 | return __assign.apply(this, arguments);
|
12866 | };
|
12867 | var __importStar = this && this.__importStar || function(mod) {
|
12868 | if (mod && mod.__esModule) return mod;
|
12869 | var result = {};
|
12870 | if (mod != null) for (var k in mod) {
|
12871 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
12872 | }
|
12873 | result["default"] = mod;
|
12874 | return result;
|
12875 | };
|
12876 | Object.defineProperty(exports, "__esModule", {
|
12877 | value: true
|
12878 | });
|
12879 | var component_1 = __webpack_require__(1);
|
12880 | var component_2 = __webpack_require__(15);
|
12881 | var component_3 = __webpack_require__(17);
|
12882 | var menuSurfaceConstants = __importStar(__webpack_require__(6));
|
12883 | var component_4 = __webpack_require__(44);
|
12884 | var menuConstants = __importStar(__webpack_require__(18));
|
12885 | var component_5 = __webpack_require__(19);
|
12886 | var component_6 = __webpack_require__(2);
|
12887 | var foundation_1 = __webpack_require__(4);
|
12888 | var constants_1 = __webpack_require__(49);
|
12889 | var foundation_2 = __webpack_require__(50);
|
12890 | var component_7 = __webpack_require__(51);
|
12891 | var component_8 = __webpack_require__(53);
|
12892 | var VALIDATION_ATTR_WHITELIST = [ "required", "aria-required" ];
|
12893 | var MDCSelect = function(_super) {
|
12894 | __extends(MDCSelect, _super);
|
12895 | function MDCSelect() {
|
12896 | return _super !== null && _super.apply(this, arguments) || this;
|
12897 | }
|
12898 | MDCSelect.attachTo = function(root) {
|
12899 | return new MDCSelect(root);
|
12900 | };
|
12901 | MDCSelect.prototype.initialize = function(labelFactory, lineRippleFactory, outlineFactory, menuFactory, iconFactory, helperTextFactory) {
|
12902 | if (labelFactory === void 0) {
|
12903 | labelFactory = function labelFactory(el) {
|
12904 | return new component_2.MDCFloatingLabel(el);
|
12905 | };
|
12906 | }
|
12907 | if (lineRippleFactory === void 0) {
|
12908 | lineRippleFactory = function lineRippleFactory(el) {
|
12909 | return new component_3.MDCLineRipple(el);
|
12910 | };
|
12911 | }
|
12912 | if (outlineFactory === void 0) {
|
12913 | outlineFactory = function outlineFactory(el) {
|
12914 | return new component_5.MDCNotchedOutline(el);
|
12915 | };
|
12916 | }
|
12917 | if (menuFactory === void 0) {
|
12918 | menuFactory = function menuFactory(el) {
|
12919 | return new component_4.MDCMenu(el);
|
12920 | };
|
12921 | }
|
12922 | if (iconFactory === void 0) {
|
12923 | iconFactory = function iconFactory(el) {
|
12924 | return new component_8.MDCSelectIcon(el);
|
12925 | };
|
12926 | }
|
12927 | if (helperTextFactory === void 0) {
|
12928 | helperTextFactory = function helperTextFactory(el) {
|
12929 | return new component_7.MDCSelectHelperText(el);
|
12930 | };
|
12931 | }
|
12932 | this.isMenuOpen_ = false;
|
12933 | this.nativeControl_ = this.root_.querySelector(constants_1.strings.NATIVE_CONTROL_SELECTOR);
|
12934 | this.selectedText_ = this.root_.querySelector(constants_1.strings.SELECTED_TEXT_SELECTOR);
|
12935 | var targetElement = this.nativeControl_ || this.selectedText_;
|
12936 | if (!targetElement) {
|
12937 | throw new Error("MDCSelect: Missing required element: Exactly one of the following selectors must be present: " + ("'" + constants_1.strings.NATIVE_CONTROL_SELECTOR + "' or '" + constants_1.strings.SELECTED_TEXT_SELECTOR + "'"));
|
12938 | }
|
12939 | this.targetElement_ = targetElement;
|
12940 | if (this.targetElement_.hasAttribute(constants_1.strings.ARIA_CONTROLS)) {
|
12941 | var helperTextElement = document.getElementById(this.targetElement_.getAttribute(constants_1.strings.ARIA_CONTROLS));
|
12942 | if (helperTextElement) {
|
12943 | this.helperText_ = helperTextFactory(helperTextElement);
|
12944 | }
|
12945 | }
|
12946 | if (this.selectedText_) {
|
12947 | this.enhancedSelectSetup_(menuFactory);
|
12948 | }
|
12949 | var labelElement = this.root_.querySelector(constants_1.strings.LABEL_SELECTOR);
|
12950 | this.label_ = labelElement ? labelFactory(labelElement) : null;
|
12951 | var lineRippleElement = this.root_.querySelector(constants_1.strings.LINE_RIPPLE_SELECTOR);
|
12952 | this.lineRipple_ = lineRippleElement ? lineRippleFactory(lineRippleElement) : null;
|
12953 | var outlineElement = this.root_.querySelector(constants_1.strings.OUTLINE_SELECTOR);
|
12954 | this.outline_ = outlineElement ? outlineFactory(outlineElement) : null;
|
12955 | var leadingIcon = this.root_.querySelector(constants_1.strings.LEADING_ICON_SELECTOR);
|
12956 | if (leadingIcon) {
|
12957 | this.root_.classList.add(constants_1.cssClasses.WITH_LEADING_ICON);
|
12958 | this.leadingIcon_ = iconFactory(leadingIcon);
|
12959 | if (this.menuElement_) {
|
12960 | this.menuElement_.classList.add(constants_1.cssClasses.WITH_LEADING_ICON);
|
12961 | }
|
12962 | }
|
12963 | if (!this.root_.classList.contains(constants_1.cssClasses.OUTLINED)) {
|
12964 | this.ripple = this.createRipple_();
|
12965 | }
|
12966 | this.initialSyncRequiredState_();
|
12967 | this.addMutationObserverForRequired_();
|
12968 | };
|
12969 | MDCSelect.prototype.initialSyncWithDOM = function() {
|
12970 | var _this = this;
|
12971 | this.handleChange_ = function() {
|
12972 | return _this.foundation_.handleChange(true);
|
12973 | };
|
12974 | this.handleFocus_ = function() {
|
12975 | return _this.foundation_.handleFocus();
|
12976 | };
|
12977 | this.handleBlur_ = function() {
|
12978 | return _this.foundation_.handleBlur();
|
12979 | };
|
12980 | this.handleClick_ = function(evt) {
|
12981 | if (_this.selectedText_) {
|
12982 | _this.selectedText_.focus();
|
12983 | }
|
12984 | _this.foundation_.handleClick(_this.getNormalizedXCoordinate_(evt));
|
12985 | };
|
12986 | this.handleKeydown_ = function(evt) {
|
12987 | return _this.foundation_.handleKeydown(evt);
|
12988 | };
|
12989 | this.handleMenuSelected_ = function(evtData) {
|
12990 | return _this.selectedIndex = evtData.detail.index;
|
12991 | };
|
12992 | this.handleMenuOpened_ = function() {
|
12993 | if (_this.menu_.items.length === 0) {
|
12994 | return;
|
12995 | }
|
12996 | var focusItemIndex = _this.selectedIndex >= 0 ? _this.selectedIndex : 0;
|
12997 | var focusItemEl = _this.menu_.items[focusItemIndex];
|
12998 | focusItemEl.focus();
|
12999 | };
|
13000 | this.handleMenuClosed_ = function() {
|
13001 | _this.isMenuOpen_ = false;
|
13002 | _this.selectedText_.removeAttribute("aria-expanded");
|
13003 | if (document.activeElement !== _this.selectedText_) {
|
13004 | _this.foundation_.handleBlur();
|
13005 | }
|
13006 | };
|
13007 | this.targetElement_.addEventListener("change", this.handleChange_);
|
13008 | this.targetElement_.addEventListener("focus", this.handleFocus_);
|
13009 | this.targetElement_.addEventListener("blur", this.handleBlur_);
|
13010 | this.targetElement_.addEventListener("click", this.handleClick_);
|
13011 | if (this.menuElement_) {
|
13012 | this.selectedText_.addEventListener("keydown", this.handleKeydown_);
|
13013 | this.menu_.listen(menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed_);
|
13014 | this.menu_.listen(menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened_);
|
13015 | this.menu_.listen(menuConstants.strings.SELECTED_EVENT, this.handleMenuSelected_);
|
13016 | if (this.hiddenInput_ && this.hiddenInput_.value) {
|
13017 | var enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_();
|
13018 | enhancedAdapterMethods.setValue(this.hiddenInput_.value);
|
13019 | } else if (this.menuElement_.querySelector(constants_1.strings.SELECTED_ITEM_SELECTOR)) {
|
13020 | var enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_();
|
13021 | enhancedAdapterMethods.setValue(enhancedAdapterMethods.getValue());
|
13022 | }
|
13023 | }
|
13024 | this.foundation_.handleChange(false);
|
13025 | if (this.root_.classList.contains(constants_1.cssClasses.DISABLED) || this.nativeControl_ && this.nativeControl_.disabled) {
|
13026 | this.disabled = true;
|
13027 | }
|
13028 | };
|
13029 | MDCSelect.prototype.destroy = function() {
|
13030 | this.targetElement_.removeEventListener("change", this.handleChange_);
|
13031 | this.targetElement_.removeEventListener("focus", this.handleFocus_);
|
13032 | this.targetElement_.removeEventListener("blur", this.handleBlur_);
|
13033 | this.targetElement_.removeEventListener("keydown", this.handleKeydown_);
|
13034 | this.targetElement_.removeEventListener("click", this.handleClick_);
|
13035 | if (this.menu_) {
|
13036 | this.menu_.unlisten(menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed_);
|
13037 | this.menu_.unlisten(menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened_);
|
13038 | this.menu_.unlisten(menuConstants.strings.SELECTED_EVENT, this.handleMenuSelected_);
|
13039 | this.menu_.destroy();
|
13040 | }
|
13041 | if (this.ripple) {
|
13042 | this.ripple.destroy();
|
13043 | }
|
13044 | if (this.outline_) {
|
13045 | this.outline_.destroy();
|
13046 | }
|
13047 | if (this.leadingIcon_) {
|
13048 | this.leadingIcon_.destroy();
|
13049 | }
|
13050 | if (this.helperText_) {
|
13051 | this.helperText_.destroy();
|
13052 | }
|
13053 | if (this.validationObserver_) {
|
13054 | this.validationObserver_.disconnect();
|
13055 | }
|
13056 | _super.prototype.destroy.call(this);
|
13057 | };
|
13058 | Object.defineProperty(MDCSelect.prototype, "value", {
|
13059 | get: function get() {
|
13060 | return this.foundation_.getValue();
|
13061 | },
|
13062 | set: function set(value) {
|
13063 | this.foundation_.setValue(value);
|
13064 | },
|
13065 | enumerable: true,
|
13066 | configurable: true
|
13067 | });
|
13068 | Object.defineProperty(MDCSelect.prototype, "selectedIndex", {
|
13069 | get: function get() {
|
13070 | var selectedIndex = -1;
|
13071 | if (this.menuElement_ && this.menu_) {
|
13072 | var selectedEl = this.menuElement_.querySelector(constants_1.strings.SELECTED_ITEM_SELECTOR);
|
13073 | selectedIndex = this.menu_.items.indexOf(selectedEl);
|
13074 | } else if (this.nativeControl_) {
|
13075 | selectedIndex = this.nativeControl_.selectedIndex;
|
13076 | }
|
13077 | return selectedIndex;
|
13078 | },
|
13079 | set: function set(selectedIndex) {
|
13080 | this.foundation_.setSelectedIndex(selectedIndex);
|
13081 | },
|
13082 | enumerable: true,
|
13083 | configurable: true
|
13084 | });
|
13085 | Object.defineProperty(MDCSelect.prototype, "disabled", {
|
13086 | get: function get() {
|
13087 | return this.root_.classList.contains(constants_1.cssClasses.DISABLED) || (this.nativeControl_ ? this.nativeControl_.disabled : false);
|
13088 | },
|
13089 | set: function set(disabled) {
|
13090 | this.foundation_.setDisabled(disabled);
|
13091 | },
|
13092 | enumerable: true,
|
13093 | configurable: true
|
13094 | });
|
13095 | Object.defineProperty(MDCSelect.prototype, "leadingIconAriaLabel", {
|
13096 | set: function set(label) {
|
13097 | this.foundation_.setLeadingIconAriaLabel(label);
|
13098 | },
|
13099 | enumerable: true,
|
13100 | configurable: true
|
13101 | });
|
13102 | Object.defineProperty(MDCSelect.prototype, "leadingIconContent", {
|
13103 | set: function set(content) {
|
13104 | this.foundation_.setLeadingIconContent(content);
|
13105 | },
|
13106 | enumerable: true,
|
13107 | configurable: true
|
13108 | });
|
13109 | Object.defineProperty(MDCSelect.prototype, "helperTextContent", {
|
13110 | set: function set(content) {
|
13111 | this.foundation_.setHelperTextContent(content);
|
13112 | },
|
13113 | enumerable: true,
|
13114 | configurable: true
|
13115 | });
|
13116 | Object.defineProperty(MDCSelect.prototype, "valid", {
|
13117 | get: function get() {
|
13118 | return this.foundation_.isValid();
|
13119 | },
|
13120 | set: function set(isValid) {
|
13121 | this.foundation_.setValid(isValid);
|
13122 | },
|
13123 | enumerable: true,
|
13124 | configurable: true
|
13125 | });
|
13126 | Object.defineProperty(MDCSelect.prototype, "required", {
|
13127 | get: function get() {
|
13128 | if (this.nativeControl_) {
|
13129 | return this.nativeControl_.required;
|
13130 | } else {
|
13131 | return this.selectedText_.getAttribute("aria-required") === "true";
|
13132 | }
|
13133 | },
|
13134 | set: function set(isRequired) {
|
13135 | if (this.nativeControl_) {
|
13136 | this.nativeControl_.required = isRequired;
|
13137 | } else {
|
13138 | if (isRequired) {
|
13139 | this.selectedText_.setAttribute("aria-required", isRequired.toString());
|
13140 | } else {
|
13141 | this.selectedText_.removeAttribute("aria-required");
|
13142 | }
|
13143 | }
|
13144 | },
|
13145 | enumerable: true,
|
13146 | configurable: true
|
13147 | });
|
13148 | MDCSelect.prototype.layout = function() {
|
13149 | this.foundation_.layout();
|
13150 | };
|
13151 | MDCSelect.prototype.getDefaultFoundation = function() {
|
13152 | var adapter = __assign({}, this.nativeControl_ ? this.getNativeSelectAdapterMethods_() : this.getEnhancedSelectAdapterMethods_(), this.getCommonAdapterMethods_(), this.getOutlineAdapterMethods_(), this.getLabelAdapterMethods_());
|
13153 | return new foundation_2.MDCSelectFoundation(adapter, this.getFoundationMap_());
|
13154 | };
|
13155 | MDCSelect.prototype.enhancedSelectSetup_ = function(menuFactory) {
|
13156 | var isDisabled = this.root_.classList.contains(constants_1.cssClasses.DISABLED);
|
13157 | this.selectedText_.setAttribute("tabindex", isDisabled ? "-1" : "0");
|
13158 | this.hiddenInput_ = this.root_.querySelector(constants_1.strings.HIDDEN_INPUT_SELECTOR);
|
13159 | this.menuElement_ = this.root_.querySelector(constants_1.strings.MENU_SELECTOR);
|
13160 | this.menu_ = menuFactory(this.menuElement_);
|
13161 | this.menu_.hoistMenuToBody();
|
13162 | this.menu_.setAnchorElement(this.root_);
|
13163 | this.menu_.setAnchorCorner(menuSurfaceConstants.Corner.BOTTOM_START);
|
13164 | this.menu_.wrapFocus = false;
|
13165 | };
|
13166 | MDCSelect.prototype.createRipple_ = function() {
|
13167 | var _this = this;
|
13168 | var adapter = __assign({}, component_6.MDCRipple.createAdapter(this), {
|
13169 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
13170 | return _this.targetElement_.addEventListener(evtType, handler);
|
13171 | },
|
13172 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
13173 | return _this.targetElement_.removeEventListener(evtType, handler);
|
13174 | }
|
13175 | });
|
13176 | return new component_6.MDCRipple(this.root_, new foundation_1.MDCRippleFoundation(adapter));
|
13177 | };
|
13178 | MDCSelect.prototype.getNativeSelectAdapterMethods_ = function() {
|
13179 | var _this = this;
|
13180 | return {
|
13181 | getValue: function getValue() {
|
13182 | return _this.nativeControl_.value;
|
13183 | },
|
13184 | setValue: function setValue(value) {
|
13185 | _this.nativeControl_.value = value;
|
13186 | },
|
13187 | openMenu: function openMenu() {
|
13188 | return undefined;
|
13189 | },
|
13190 | closeMenu: function closeMenu() {
|
13191 | return undefined;
|
13192 | },
|
13193 | isMenuOpen: function isMenuOpen() {
|
13194 | return false;
|
13195 | },
|
13196 | setSelectedIndex: function setSelectedIndex(index) {
|
13197 | _this.nativeControl_.selectedIndex = index;
|
13198 | },
|
13199 | setDisabled: function setDisabled(isDisabled) {
|
13200 | _this.nativeControl_.disabled = isDisabled;
|
13201 | },
|
13202 | setValid: function setValid(isValid) {
|
13203 | if (isValid) {
|
13204 | _this.root_.classList.remove(constants_1.cssClasses.INVALID);
|
13205 | } else {
|
13206 | _this.root_.classList.add(constants_1.cssClasses.INVALID);
|
13207 | }
|
13208 | },
|
13209 | checkValidity: function checkValidity() {
|
13210 | return _this.nativeControl_.checkValidity();
|
13211 | }
|
13212 | };
|
13213 | };
|
13214 | MDCSelect.prototype.getEnhancedSelectAdapterMethods_ = function() {
|
13215 | var _this = this;
|
13216 | return {
|
13217 | getValue: function getValue() {
|
13218 | var listItem = _this.menuElement_.querySelector(constants_1.strings.SELECTED_ITEM_SELECTOR);
|
13219 | if (listItem && listItem.hasAttribute(constants_1.strings.ENHANCED_VALUE_ATTR)) {
|
13220 | return listItem.getAttribute(constants_1.strings.ENHANCED_VALUE_ATTR) || "";
|
13221 | }
|
13222 | return "";
|
13223 | },
|
13224 | setValue: function setValue(value) {
|
13225 | var element = _this.menuElement_.querySelector("[" + constants_1.strings.ENHANCED_VALUE_ATTR + '="' + value + '"]');
|
13226 | _this.setEnhancedSelectedIndex_(element ? _this.menu_.items.indexOf(element) : -1);
|
13227 | },
|
13228 | openMenu: function openMenu() {
|
13229 | if (_this.menu_ && !_this.menu_.open) {
|
13230 | _this.menu_.open = true;
|
13231 | _this.isMenuOpen_ = true;
|
13232 | _this.selectedText_.setAttribute("aria-expanded", "true");
|
13233 | }
|
13234 | },
|
13235 | closeMenu: function closeMenu() {
|
13236 | if (_this.menu_ && _this.menu_.open) {
|
13237 | _this.menu_.open = false;
|
13238 | }
|
13239 | },
|
13240 | isMenuOpen: function isMenuOpen() {
|
13241 | return Boolean(_this.menu_) && _this.isMenuOpen_;
|
13242 | },
|
13243 | setSelectedIndex: function setSelectedIndex(index) {
|
13244 | return _this.setEnhancedSelectedIndex_(index);
|
13245 | },
|
13246 | setDisabled: function setDisabled(isDisabled) {
|
13247 | _this.selectedText_.setAttribute("tabindex", isDisabled ? "-1" : "0");
|
13248 | _this.selectedText_.setAttribute("aria-disabled", isDisabled.toString());
|
13249 | if (_this.hiddenInput_) {
|
13250 | _this.hiddenInput_.disabled = isDisabled;
|
13251 | }
|
13252 | },
|
13253 | checkValidity: function checkValidity() {
|
13254 | var classList = _this.root_.classList;
|
13255 | if (classList.contains(constants_1.cssClasses.REQUIRED) && !classList.contains(constants_1.cssClasses.DISABLED)) {
|
13256 | return _this.selectedIndex !== -1 && (_this.selectedIndex !== 0 || Boolean(_this.value));
|
13257 | } else {
|
13258 | return true;
|
13259 | }
|
13260 | },
|
13261 | setValid: function setValid(isValid) {
|
13262 | _this.selectedText_.setAttribute("aria-invalid", (!isValid).toString());
|
13263 | if (isValid) {
|
13264 | _this.root_.classList.remove(constants_1.cssClasses.INVALID);
|
13265 | } else {
|
13266 | _this.root_.classList.add(constants_1.cssClasses.INVALID);
|
13267 | }
|
13268 | }
|
13269 | };
|
13270 | };
|
13271 | MDCSelect.prototype.getCommonAdapterMethods_ = function() {
|
13272 | var _this = this;
|
13273 | return {
|
13274 | addClass: function addClass(className) {
|
13275 | return _this.root_.classList.add(className);
|
13276 | },
|
13277 | removeClass: function removeClass(className) {
|
13278 | return _this.root_.classList.remove(className);
|
13279 | },
|
13280 | hasClass: function hasClass(className) {
|
13281 | return _this.root_.classList.contains(className);
|
13282 | },
|
13283 | setRippleCenter: function setRippleCenter(normalizedX) {
|
13284 | return _this.lineRipple_ && _this.lineRipple_.setRippleCenter(normalizedX);
|
13285 | },
|
13286 | activateBottomLine: function activateBottomLine() {
|
13287 | return _this.lineRipple_ && _this.lineRipple_.activate();
|
13288 | },
|
13289 | deactivateBottomLine: function deactivateBottomLine() {
|
13290 | return _this.lineRipple_ && _this.lineRipple_.deactivate();
|
13291 | },
|
13292 | notifyChange: function notifyChange(value) {
|
13293 | var index = _this.selectedIndex;
|
13294 | _this.emit(constants_1.strings.CHANGE_EVENT, {
|
13295 | value: value,
|
13296 | index: index
|
13297 | }, true);
|
13298 | }
|
13299 | };
|
13300 | };
|
13301 | MDCSelect.prototype.getOutlineAdapterMethods_ = function() {
|
13302 | var _this = this;
|
13303 | return {
|
13304 | hasOutline: function hasOutline() {
|
13305 | return Boolean(_this.outline_);
|
13306 | },
|
13307 | notchOutline: function notchOutline(labelWidth) {
|
13308 | return _this.outline_ && _this.outline_.notch(labelWidth);
|
13309 | },
|
13310 | closeOutline: function closeOutline() {
|
13311 | return _this.outline_ && _this.outline_.closeNotch();
|
13312 | }
|
13313 | };
|
13314 | };
|
13315 | MDCSelect.prototype.getLabelAdapterMethods_ = function() {
|
13316 | var _this = this;
|
13317 | return {
|
13318 | floatLabel: function floatLabel(shouldFloat) {
|
13319 | return _this.label_ && _this.label_.float(shouldFloat);
|
13320 | },
|
13321 | getLabelWidth: function getLabelWidth() {
|
13322 | return _this.label_ ? _this.label_.getWidth() : 0;
|
13323 | }
|
13324 | };
|
13325 | };
|
13326 | MDCSelect.prototype.getNormalizedXCoordinate_ = function(evt) {
|
13327 | var targetClientRect = evt.target.getBoundingClientRect();
|
13328 | var xCoordinate = this.isTouchEvent_(evt) ? evt.touches[0].clientX : evt.clientX;
|
13329 | return xCoordinate - targetClientRect.left;
|
13330 | };
|
13331 | MDCSelect.prototype.isTouchEvent_ = function(evt) {
|
13332 | return Boolean(evt.touches);
|
13333 | };
|
13334 | MDCSelect.prototype.getFoundationMap_ = function() {
|
13335 | return {
|
13336 | helperText: this.helperText_ ? this.helperText_.foundation : undefined,
|
13337 | leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined
|
13338 | };
|
13339 | };
|
13340 | MDCSelect.prototype.setEnhancedSelectedIndex_ = function(index) {
|
13341 | var selectedItem = this.menu_.items[index];
|
13342 | this.selectedText_.textContent = selectedItem ? selectedItem.textContent.trim() : "";
|
13343 | var previouslySelected = this.menuElement_.querySelector(constants_1.strings.SELECTED_ITEM_SELECTOR);
|
13344 | if (previouslySelected) {
|
13345 | previouslySelected.classList.remove(constants_1.cssClasses.SELECTED_ITEM_CLASS);
|
13346 | previouslySelected.removeAttribute(constants_1.strings.ARIA_SELECTED_ATTR);
|
13347 | }
|
13348 | if (selectedItem) {
|
13349 | selectedItem.classList.add(constants_1.cssClasses.SELECTED_ITEM_CLASS);
|
13350 | selectedItem.setAttribute(constants_1.strings.ARIA_SELECTED_ATTR, "true");
|
13351 | }
|
13352 | if (this.hiddenInput_) {
|
13353 | this.hiddenInput_.value = selectedItem ? selectedItem.getAttribute(constants_1.strings.ENHANCED_VALUE_ATTR) || "" : "";
|
13354 | }
|
13355 | this.layout();
|
13356 | };
|
13357 | MDCSelect.prototype.initialSyncRequiredState_ = function() {
|
13358 | var isRequired = this.targetElement_.required || this.targetElement_.getAttribute("aria-required") === "true" || this.root_.classList.contains(constants_1.cssClasses.REQUIRED);
|
13359 | if (isRequired) {
|
13360 | if (this.nativeControl_) {
|
13361 | this.nativeControl_.required = true;
|
13362 | } else {
|
13363 | this.selectedText_.setAttribute("aria-required", "true");
|
13364 | }
|
13365 | this.root_.classList.add(constants_1.cssClasses.REQUIRED);
|
13366 | }
|
13367 | };
|
13368 | MDCSelect.prototype.addMutationObserverForRequired_ = function() {
|
13369 | var _this = this;
|
13370 | var observerHandler = function observerHandler(attributesList) {
|
13371 | attributesList.some(function(attributeName) {
|
13372 | if (VALIDATION_ATTR_WHITELIST.indexOf(attributeName) === -1) {
|
13373 | return false;
|
13374 | }
|
13375 | if (_this.selectedText_) {
|
13376 | if (_this.selectedText_.getAttribute("aria-required") === "true") {
|
13377 | _this.root_.classList.add(constants_1.cssClasses.REQUIRED);
|
13378 | } else {
|
13379 | _this.root_.classList.remove(constants_1.cssClasses.REQUIRED);
|
13380 | }
|
13381 | } else {
|
13382 | if (_this.nativeControl_.required) {
|
13383 | _this.root_.classList.add(constants_1.cssClasses.REQUIRED);
|
13384 | } else {
|
13385 | _this.root_.classList.remove(constants_1.cssClasses.REQUIRED);
|
13386 | }
|
13387 | }
|
13388 | return true;
|
13389 | });
|
13390 | };
|
13391 | var getAttributesList = function getAttributesList(mutationsList) {
|
13392 | return mutationsList.map(function(mutation) {
|
13393 | return mutation.attributeName;
|
13394 | }).filter(function(attributeName) {
|
13395 | return attributeName;
|
13396 | });
|
13397 | };
|
13398 | var observer = new MutationObserver(function(mutationsList) {
|
13399 | return observerHandler(getAttributesList(mutationsList));
|
13400 | });
|
13401 | observer.observe(this.targetElement_, {
|
13402 | attributes: true
|
13403 | });
|
13404 | this.validationObserver_ = observer;
|
13405 | };
|
13406 | return MDCSelect;
|
13407 | }(component_1.MDCComponent);
|
13408 | exports.MDCSelect = MDCSelect;
|
13409 | }, function(module, exports, __webpack_require__) {
|
13410 | "use strict";
|
13411 | Object.defineProperty(exports, "__esModule", {
|
13412 | value: true
|
13413 | });
|
13414 | var strings = {
|
13415 | ARIA_HIDDEN: "aria-hidden",
|
13416 | ROLE: "role"
|
13417 | };
|
13418 | exports.strings = strings;
|
13419 | var cssClasses = {
|
13420 | HELPER_TEXT_PERSISTENT: "mdc-select-helper-text--persistent",
|
13421 | HELPER_TEXT_VALIDATION_MSG: "mdc-select-helper-text--validation-msg"
|
13422 | };
|
13423 | exports.cssClasses = cssClasses;
|
13424 | }, function(module, exports, __webpack_require__) {
|
13425 | "use strict";
|
13426 | Object.defineProperty(exports, "__esModule", {
|
13427 | value: true
|
13428 | });
|
13429 | var strings = {
|
13430 | ICON_EVENT: "MDCSelect:icon",
|
13431 | ICON_ROLE: "button"
|
13432 | };
|
13433 | exports.strings = strings;
|
13434 | }, function(module, exports, __webpack_require__) {
|
13435 | "use strict";
|
13436 | function __export(m) {
|
13437 | for (var p in m) {
|
13438 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
13439 | }
|
13440 | }
|
13441 | Object.defineProperty(exports, "__esModule", {
|
13442 | value: true
|
13443 | });
|
13444 | __export(__webpack_require__(51));
|
13445 | __export(__webpack_require__(52));
|
13446 | }, function(module, exports, __webpack_require__) {
|
13447 | "use strict";
|
13448 | function __export(m) {
|
13449 | for (var p in m) {
|
13450 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
13451 | }
|
13452 | }
|
13453 | Object.defineProperty(exports, "__esModule", {
|
13454 | value: true
|
13455 | });
|
13456 | __export(__webpack_require__(53));
|
13457 | __export(__webpack_require__(54));
|
13458 | }, function(module, exports, __webpack_require__) {
|
13459 | "use strict";
|
13460 | function __export(m) {
|
13461 | for (var p in m) {
|
13462 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
13463 | }
|
13464 | }
|
13465 | Object.defineProperty(exports, "__esModule", {
|
13466 | value: true
|
13467 | });
|
13468 | __export(__webpack_require__(133));
|
13469 | __export(__webpack_require__(56));
|
13470 | }, function(module, exports, __webpack_require__) {
|
13471 | "use strict";
|
13472 | var __extends = this && this.__extends || function() {
|
13473 | var _extendStatics = function extendStatics(d, b) {
|
13474 | _extendStatics = Object.setPrototypeOf || {
|
13475 | __proto__: []
|
13476 | } instanceof Array && function(d, b) {
|
13477 | d.__proto__ = b;
|
13478 | } || function(d, b) {
|
13479 | for (var p in b) {
|
13480 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
13481 | }
|
13482 | };
|
13483 | return _extendStatics(d, b);
|
13484 | };
|
13485 | return function(d, b) {
|
13486 | _extendStatics(d, b);
|
13487 | function __() {
|
13488 | this.constructor = d;
|
13489 | }
|
13490 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13491 | };
|
13492 | }();
|
13493 | Object.defineProperty(exports, "__esModule", {
|
13494 | value: true
|
13495 | });
|
13496 | var component_1 = __webpack_require__(1);
|
13497 | var constants_1 = __webpack_require__(55);
|
13498 | var foundation_1 = __webpack_require__(56);
|
13499 | var MDCSlider = function(_super) {
|
13500 | __extends(MDCSlider, _super);
|
13501 | function MDCSlider() {
|
13502 | return _super !== null && _super.apply(this, arguments) || this;
|
13503 | }
|
13504 | MDCSlider.attachTo = function(root) {
|
13505 | return new MDCSlider(root);
|
13506 | };
|
13507 | Object.defineProperty(MDCSlider.prototype, "value", {
|
13508 | get: function get() {
|
13509 | return this.foundation_.getValue();
|
13510 | },
|
13511 | set: function set(value) {
|
13512 | this.foundation_.setValue(value);
|
13513 | },
|
13514 | enumerable: true,
|
13515 | configurable: true
|
13516 | });
|
13517 | Object.defineProperty(MDCSlider.prototype, "min", {
|
13518 | get: function get() {
|
13519 | return this.foundation_.getMin();
|
13520 | },
|
13521 | set: function set(min) {
|
13522 | this.foundation_.setMin(min);
|
13523 | },
|
13524 | enumerable: true,
|
13525 | configurable: true
|
13526 | });
|
13527 | Object.defineProperty(MDCSlider.prototype, "max", {
|
13528 | get: function get() {
|
13529 | return this.foundation_.getMax();
|
13530 | },
|
13531 | set: function set(max) {
|
13532 | this.foundation_.setMax(max);
|
13533 | },
|
13534 | enumerable: true,
|
13535 | configurable: true
|
13536 | });
|
13537 | Object.defineProperty(MDCSlider.prototype, "step", {
|
13538 | get: function get() {
|
13539 | return this.foundation_.getStep();
|
13540 | },
|
13541 | set: function set(step) {
|
13542 | this.foundation_.setStep(step);
|
13543 | },
|
13544 | enumerable: true,
|
13545 | configurable: true
|
13546 | });
|
13547 | Object.defineProperty(MDCSlider.prototype, "disabled", {
|
13548 | get: function get() {
|
13549 | return this.foundation_.isDisabled();
|
13550 | },
|
13551 | set: function set(disabled) {
|
13552 | this.foundation_.setDisabled(disabled);
|
13553 | },
|
13554 | enumerable: true,
|
13555 | configurable: true
|
13556 | });
|
13557 | MDCSlider.prototype.initialize = function() {
|
13558 | this.thumbContainer_ = this.root_.querySelector(constants_1.strings.THUMB_CONTAINER_SELECTOR);
|
13559 | this.track_ = this.root_.querySelector(constants_1.strings.TRACK_SELECTOR);
|
13560 | this.pinValueMarker_ = this.root_.querySelector(constants_1.strings.PIN_VALUE_MARKER_SELECTOR);
|
13561 | this.trackMarkerContainer_ = this.root_.querySelector(constants_1.strings.TRACK_MARKER_CONTAINER_SELECTOR);
|
13562 | };
|
13563 | MDCSlider.prototype.getDefaultFoundation = function() {
|
13564 | var _this = this;
|
13565 | var adapter = {
|
13566 | hasClass: function hasClass(className) {
|
13567 | return _this.root_.classList.contains(className);
|
13568 | },
|
13569 | addClass: function addClass(className) {
|
13570 | return _this.root_.classList.add(className);
|
13571 | },
|
13572 | removeClass: function removeClass(className) {
|
13573 | return _this.root_.classList.remove(className);
|
13574 | },
|
13575 | getAttribute: function getAttribute(name) {
|
13576 | return _this.root_.getAttribute(name);
|
13577 | },
|
13578 | setAttribute: function setAttribute(name, value) {
|
13579 | return _this.root_.setAttribute(name, value);
|
13580 | },
|
13581 | removeAttribute: function removeAttribute(name) {
|
13582 | return _this.root_.removeAttribute(name);
|
13583 | },
|
13584 | computeBoundingRect: function computeBoundingRect() {
|
13585 | return _this.root_.getBoundingClientRect();
|
13586 | },
|
13587 | getTabIndex: function getTabIndex() {
|
13588 | return _this.root_.tabIndex;
|
13589 | },
|
13590 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
13591 | return _this.listen(evtType, handler);
|
13592 | },
|
13593 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
13594 | return _this.unlisten(evtType, handler);
|
13595 | },
|
13596 | registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler(evtType, handler) {
|
13597 | _this.thumbContainer_.addEventListener(evtType, handler);
|
13598 | },
|
13599 | deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler(evtType, handler) {
|
13600 | _this.thumbContainer_.removeEventListener(evtType, handler);
|
13601 | },
|
13602 | registerBodyInteractionHandler: function registerBodyInteractionHandler(evtType, handler) {
|
13603 | return document.body.addEventListener(evtType, handler);
|
13604 | },
|
13605 | deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler(evtType, handler) {
|
13606 | return document.body.removeEventListener(evtType, handler);
|
13607 | },
|
13608 | registerResizeHandler: function registerResizeHandler(handler) {
|
13609 | return window.addEventListener("resize", handler);
|
13610 | },
|
13611 | deregisterResizeHandler: function deregisterResizeHandler(handler) {
|
13612 | return window.removeEventListener("resize", handler);
|
13613 | },
|
13614 | notifyInput: function notifyInput() {
|
13615 | return _this.emit(constants_1.strings.INPUT_EVENT, _this);
|
13616 | },
|
13617 | notifyChange: function notifyChange() {
|
13618 | return _this.emit(constants_1.strings.CHANGE_EVENT, _this);
|
13619 | },
|
13620 | setThumbContainerStyleProperty: function setThumbContainerStyleProperty(propertyName, value) {
|
13621 | _this.thumbContainer_.style.setProperty(propertyName, value);
|
13622 | },
|
13623 | setTrackStyleProperty: function setTrackStyleProperty(propertyName, value) {
|
13624 | return _this.track_.style.setProperty(propertyName, value);
|
13625 | },
|
13626 | setMarkerValue: function setMarkerValue(value) {
|
13627 | return _this.pinValueMarker_.innerText = value.toLocaleString();
|
13628 | },
|
13629 | appendTrackMarkers: function appendTrackMarkers(numMarkers) {
|
13630 | var frag = document.createDocumentFragment();
|
13631 | for (var i = 0; i < numMarkers; i++) {
|
13632 | var marker = document.createElement("div");
|
13633 | marker.classList.add("mdc-slider__track-marker");
|
13634 | frag.appendChild(marker);
|
13635 | }
|
13636 | _this.trackMarkerContainer_.appendChild(frag);
|
13637 | },
|
13638 | removeTrackMarkers: function removeTrackMarkers() {
|
13639 | while (_this.trackMarkerContainer_.firstChild) {
|
13640 | _this.trackMarkerContainer_.removeChild(_this.trackMarkerContainer_.firstChild);
|
13641 | }
|
13642 | },
|
13643 | setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty(propertyName, value) {
|
13644 | var lastTrackMarker = _this.root_.querySelector(constants_1.strings.LAST_TRACK_MARKER_SELECTOR);
|
13645 | lastTrackMarker.style.setProperty(propertyName, value);
|
13646 | },
|
13647 | isRTL: function isRTL() {
|
13648 | return getComputedStyle(_this.root_).direction === "rtl";
|
13649 | }
|
13650 | };
|
13651 | return new foundation_1.MDCSliderFoundation(adapter);
|
13652 | };
|
13653 | MDCSlider.prototype.initialSyncWithDOM = function() {
|
13654 | var origValueNow = this.parseFloat_(this.root_.getAttribute(constants_1.strings.ARIA_VALUENOW), this.value);
|
13655 | var min = this.parseFloat_(this.root_.getAttribute(constants_1.strings.ARIA_VALUEMIN), this.min);
|
13656 | var max = this.parseFloat_(this.root_.getAttribute(constants_1.strings.ARIA_VALUEMAX), this.max);
|
13657 | if (min >= this.max) {
|
13658 | this.max = max;
|
13659 | this.min = min;
|
13660 | } else {
|
13661 | this.min = min;
|
13662 | this.max = max;
|
13663 | }
|
13664 | this.step = this.parseFloat_(this.root_.getAttribute(constants_1.strings.STEP_DATA_ATTR), this.step);
|
13665 | this.value = origValueNow;
|
13666 | this.disabled = this.root_.hasAttribute(constants_1.strings.ARIA_DISABLED) && this.root_.getAttribute(constants_1.strings.ARIA_DISABLED) !== "false";
|
13667 | this.foundation_.setupTrackMarker();
|
13668 | };
|
13669 | MDCSlider.prototype.layout = function() {
|
13670 | this.foundation_.layout();
|
13671 | };
|
13672 | MDCSlider.prototype.stepUp = function(amount) {
|
13673 | if (amount === void 0) {
|
13674 | amount = this.step || 1;
|
13675 | }
|
13676 | this.value += amount;
|
13677 | };
|
13678 | MDCSlider.prototype.stepDown = function(amount) {
|
13679 | if (amount === void 0) {
|
13680 | amount = this.step || 1;
|
13681 | }
|
13682 | this.value -= amount;
|
13683 | };
|
13684 | MDCSlider.prototype.parseFloat_ = function(str, defaultValue) {
|
13685 | var num = parseFloat(str);
|
13686 | var isNumeric = typeof num === "number" && isFinite(num);
|
13687 | return isNumeric ? num : defaultValue;
|
13688 | };
|
13689 | return MDCSlider;
|
13690 | }(component_1.MDCComponent);
|
13691 | exports.MDCSlider = MDCSlider;
|
13692 | }, function(module, exports, __webpack_require__) {
|
13693 | "use strict";
|
13694 | function __export(m) {
|
13695 | for (var p in m) {
|
13696 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
13697 | }
|
13698 | }
|
13699 | var __importStar = this && this.__importStar || function(mod) {
|
13700 | if (mod && mod.__esModule) return mod;
|
13701 | var result = {};
|
13702 | if (mod != null) for (var k in mod) {
|
13703 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
13704 | }
|
13705 | result["default"] = mod;
|
13706 | return result;
|
13707 | };
|
13708 | Object.defineProperty(exports, "__esModule", {
|
13709 | value: true
|
13710 | });
|
13711 | var util = __importStar(__webpack_require__(57));
|
13712 | exports.util = util;
|
13713 | __export(__webpack_require__(135));
|
13714 | __export(__webpack_require__(58));
|
13715 | }, function(module, exports, __webpack_require__) {
|
13716 | "use strict";
|
13717 | var __extends = this && this.__extends || function() {
|
13718 | var _extendStatics = function extendStatics(d, b) {
|
13719 | _extendStatics = Object.setPrototypeOf || {
|
13720 | __proto__: []
|
13721 | } instanceof Array && function(d, b) {
|
13722 | d.__proto__ = b;
|
13723 | } || function(d, b) {
|
13724 | for (var p in b) {
|
13725 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
13726 | }
|
13727 | };
|
13728 | return _extendStatics(d, b);
|
13729 | };
|
13730 | return function(d, b) {
|
13731 | _extendStatics(d, b);
|
13732 | function __() {
|
13733 | this.constructor = d;
|
13734 | }
|
13735 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13736 | };
|
13737 | }();
|
13738 | var __importStar = this && this.__importStar || function(mod) {
|
13739 | if (mod && mod.__esModule) return mod;
|
13740 | var result = {};
|
13741 | if (mod != null) for (var k in mod) {
|
13742 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
13743 | }
|
13744 | result["default"] = mod;
|
13745 | return result;
|
13746 | };
|
13747 | Object.defineProperty(exports, "__esModule", {
|
13748 | value: true
|
13749 | });
|
13750 | var component_1 = __webpack_require__(1);
|
13751 | var ponyfill_1 = __webpack_require__(3);
|
13752 | var constants_1 = __webpack_require__(20);
|
13753 | var foundation_1 = __webpack_require__(58);
|
13754 | var util = __importStar(__webpack_require__(57));
|
13755 | var SURFACE_SELECTOR = constants_1.strings.SURFACE_SELECTOR, LABEL_SELECTOR = constants_1.strings.LABEL_SELECTOR, ACTION_SELECTOR = constants_1.strings.ACTION_SELECTOR, DISMISS_SELECTOR = constants_1.strings.DISMISS_SELECTOR, OPENING_EVENT = constants_1.strings.OPENING_EVENT, OPENED_EVENT = constants_1.strings.OPENED_EVENT, CLOSING_EVENT = constants_1.strings.CLOSING_EVENT, CLOSED_EVENT = constants_1.strings.CLOSED_EVENT;
|
13756 | var MDCSnackbar = function(_super) {
|
13757 | __extends(MDCSnackbar, _super);
|
13758 | function MDCSnackbar() {
|
13759 | return _super !== null && _super.apply(this, arguments) || this;
|
13760 | }
|
13761 | MDCSnackbar.attachTo = function(root) {
|
13762 | return new MDCSnackbar(root);
|
13763 | };
|
13764 | MDCSnackbar.prototype.initialize = function(announcerFactory) {
|
13765 | if (announcerFactory === void 0) {
|
13766 | announcerFactory = function announcerFactory() {
|
13767 | return util.announce;
|
13768 | };
|
13769 | }
|
13770 | this.announce_ = announcerFactory();
|
13771 | };
|
13772 | MDCSnackbar.prototype.initialSyncWithDOM = function() {
|
13773 | var _this = this;
|
13774 | this.surfaceEl_ = this.root_.querySelector(SURFACE_SELECTOR);
|
13775 | this.labelEl_ = this.root_.querySelector(LABEL_SELECTOR);
|
13776 | this.actionEl_ = this.root_.querySelector(ACTION_SELECTOR);
|
13777 | this.handleKeyDown_ = function(evt) {
|
13778 | return _this.foundation_.handleKeyDown(evt);
|
13779 | };
|
13780 | this.handleSurfaceClick_ = function(evt) {
|
13781 | var target = evt.target;
|
13782 | if (_this.isActionButton_(target)) {
|
13783 | _this.foundation_.handleActionButtonClick(evt);
|
13784 | } else if (_this.isActionIcon_(target)) {
|
13785 | _this.foundation_.handleActionIconClick(evt);
|
13786 | }
|
13787 | };
|
13788 | this.registerKeyDownHandler_(this.handleKeyDown_);
|
13789 | this.registerSurfaceClickHandler_(this.handleSurfaceClick_);
|
13790 | };
|
13791 | MDCSnackbar.prototype.destroy = function() {
|
13792 | _super.prototype.destroy.call(this);
|
13793 | this.deregisterKeyDownHandler_(this.handleKeyDown_);
|
13794 | this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_);
|
13795 | };
|
13796 | MDCSnackbar.prototype.open = function() {
|
13797 | this.foundation_.open();
|
13798 | };
|
13799 | MDCSnackbar.prototype.close = function(reason) {
|
13800 | if (reason === void 0) {
|
13801 | reason = "";
|
13802 | }
|
13803 | this.foundation_.close(reason);
|
13804 | };
|
13805 | MDCSnackbar.prototype.getDefaultFoundation = function() {
|
13806 | var _this = this;
|
13807 | var adapter = {
|
13808 | addClass: function addClass(className) {
|
13809 | return _this.root_.classList.add(className);
|
13810 | },
|
13811 | announce: function announce() {
|
13812 | return _this.announce_(_this.labelEl_);
|
13813 | },
|
13814 | notifyClosed: function notifyClosed(reason) {
|
13815 | return _this.emit(CLOSED_EVENT, reason ? {
|
13816 | reason: reason
|
13817 | } : {});
|
13818 | },
|
13819 | notifyClosing: function notifyClosing(reason) {
|
13820 | return _this.emit(CLOSING_EVENT, reason ? {
|
13821 | reason: reason
|
13822 | } : {});
|
13823 | },
|
13824 | notifyOpened: function notifyOpened() {
|
13825 | return _this.emit(OPENED_EVENT, {});
|
13826 | },
|
13827 | notifyOpening: function notifyOpening() {
|
13828 | return _this.emit(OPENING_EVENT, {});
|
13829 | },
|
13830 | removeClass: function removeClass(className) {
|
13831 | return _this.root_.classList.remove(className);
|
13832 | }
|
13833 | };
|
13834 | return new foundation_1.MDCSnackbarFoundation(adapter);
|
13835 | };
|
13836 | Object.defineProperty(MDCSnackbar.prototype, "timeoutMs", {
|
13837 | get: function get() {
|
13838 | return this.foundation_.getTimeoutMs();
|
13839 | },
|
13840 | set: function set(timeoutMs) {
|
13841 | this.foundation_.setTimeoutMs(timeoutMs);
|
13842 | },
|
13843 | enumerable: true,
|
13844 | configurable: true
|
13845 | });
|
13846 | Object.defineProperty(MDCSnackbar.prototype, "closeOnEscape", {
|
13847 | get: function get() {
|
13848 | return this.foundation_.getCloseOnEscape();
|
13849 | },
|
13850 | set: function set(closeOnEscape) {
|
13851 | this.foundation_.setCloseOnEscape(closeOnEscape);
|
13852 | },
|
13853 | enumerable: true,
|
13854 | configurable: true
|
13855 | });
|
13856 | Object.defineProperty(MDCSnackbar.prototype, "isOpen", {
|
13857 | get: function get() {
|
13858 | return this.foundation_.isOpen();
|
13859 | },
|
13860 | enumerable: true,
|
13861 | configurable: true
|
13862 | });
|
13863 | Object.defineProperty(MDCSnackbar.prototype, "labelText", {
|
13864 | get: function get() {
|
13865 | return this.labelEl_.textContent;
|
13866 | },
|
13867 | set: function set(labelText) {
|
13868 | this.labelEl_.textContent = labelText;
|
13869 | },
|
13870 | enumerable: true,
|
13871 | configurable: true
|
13872 | });
|
13873 | Object.defineProperty(MDCSnackbar.prototype, "actionButtonText", {
|
13874 | get: function get() {
|
13875 | return this.actionEl_.textContent;
|
13876 | },
|
13877 | set: function set(actionButtonText) {
|
13878 | this.actionEl_.textContent = actionButtonText;
|
13879 | },
|
13880 | enumerable: true,
|
13881 | configurable: true
|
13882 | });
|
13883 | MDCSnackbar.prototype.registerKeyDownHandler_ = function(handler) {
|
13884 | this.listen("keydown", handler);
|
13885 | };
|
13886 | MDCSnackbar.prototype.deregisterKeyDownHandler_ = function(handler) {
|
13887 | this.unlisten("keydown", handler);
|
13888 | };
|
13889 | MDCSnackbar.prototype.registerSurfaceClickHandler_ = function(handler) {
|
13890 | this.surfaceEl_.addEventListener("click", handler);
|
13891 | };
|
13892 | MDCSnackbar.prototype.deregisterSurfaceClickHandler_ = function(handler) {
|
13893 | this.surfaceEl_.removeEventListener("click", handler);
|
13894 | };
|
13895 | MDCSnackbar.prototype.isActionButton_ = function(target) {
|
13896 | return Boolean(ponyfill_1.closest(target, ACTION_SELECTOR));
|
13897 | };
|
13898 | MDCSnackbar.prototype.isActionIcon_ = function(target) {
|
13899 | return Boolean(ponyfill_1.closest(target, DISMISS_SELECTOR));
|
13900 | };
|
13901 | return MDCSnackbar;
|
13902 | }(component_1.MDCComponent);
|
13903 | exports.MDCSnackbar = MDCSnackbar;
|
13904 | }, function(module, exports, __webpack_require__) {
|
13905 | "use strict";
|
13906 | function __export(m) {
|
13907 | for (var p in m) {
|
13908 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
13909 | }
|
13910 | }
|
13911 | Object.defineProperty(exports, "__esModule", {
|
13912 | value: true
|
13913 | });
|
13914 | __export(__webpack_require__(137));
|
13915 | __export(__webpack_require__(59));
|
13916 | }, function(module, exports, __webpack_require__) {
|
13917 | "use strict";
|
13918 | var __extends = this && this.__extends || function() {
|
13919 | var _extendStatics = function extendStatics(d, b) {
|
13920 | _extendStatics = Object.setPrototypeOf || {
|
13921 | __proto__: []
|
13922 | } instanceof Array && function(d, b) {
|
13923 | d.__proto__ = b;
|
13924 | } || function(d, b) {
|
13925 | for (var p in b) {
|
13926 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
13927 | }
|
13928 | };
|
13929 | return _extendStatics(d, b);
|
13930 | };
|
13931 | return function(d, b) {
|
13932 | _extendStatics(d, b);
|
13933 | function __() {
|
13934 | this.constructor = d;
|
13935 | }
|
13936 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13937 | };
|
13938 | }();
|
13939 | var __assign = this && this.__assign || function() {
|
13940 | __assign = Object.assign || function(t) {
|
13941 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
13942 | s = arguments[i];
|
13943 | for (var p in s) {
|
13944 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
13945 | }
|
13946 | }
|
13947 | return t;
|
13948 | };
|
13949 | return __assign.apply(this, arguments);
|
13950 | };
|
13951 | var __read = this && this.__read || function(o, n) {
|
13952 | var m = typeof Symbol === "function" && o[Symbol.iterator];
|
13953 | if (!m) return o;
|
13954 | var i = m.call(o), r, ar = [], e;
|
13955 | try {
|
13956 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
13957 | ar.push(r.value);
|
13958 | }
|
13959 | } catch (error) {
|
13960 | e = {
|
13961 | error: error
|
13962 | };
|
13963 | } finally {
|
13964 | try {
|
13965 | if (r && !r.done && (m = i["return"])) m.call(i);
|
13966 | } finally {
|
13967 | if (e) throw e.error;
|
13968 | }
|
13969 | }
|
13970 | return ar;
|
13971 | };
|
13972 | var __spread = this && this.__spread || function() {
|
13973 | for (var ar = [], i = 0; i < arguments.length; i++) {
|
13974 | ar = ar.concat(__read(arguments[i]));
|
13975 | }
|
13976 | return ar;
|
13977 | };
|
13978 | Object.defineProperty(exports, "__esModule", {
|
13979 | value: true
|
13980 | });
|
13981 | var component_1 = __webpack_require__(1);
|
13982 | var ponyfill_1 = __webpack_require__(3);
|
13983 | var component_2 = __webpack_require__(2);
|
13984 | var foundation_1 = __webpack_require__(4);
|
13985 | var foundation_2 = __webpack_require__(59);
|
13986 | var MDCSwitch = function(_super) {
|
13987 | __extends(MDCSwitch, _super);
|
13988 | function MDCSwitch() {
|
13989 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
13990 | _this.ripple_ = _this.createRipple_();
|
13991 | return _this;
|
13992 | }
|
13993 | MDCSwitch.attachTo = function(root) {
|
13994 | return new MDCSwitch(root);
|
13995 | };
|
13996 | MDCSwitch.prototype.destroy = function() {
|
13997 | _super.prototype.destroy.call(this);
|
13998 | this.ripple_.destroy();
|
13999 | this.nativeControl_.removeEventListener("change", this.changeHandler_);
|
14000 | };
|
14001 | MDCSwitch.prototype.initialSyncWithDOM = function() {
|
14002 | var _this = this;
|
14003 | this.changeHandler_ = function() {
|
14004 | var args = [];
|
14005 | for (var _i = 0; _i < arguments.length; _i++) {
|
14006 | args[_i] = arguments[_i];
|
14007 | }
|
14008 | var _a;
|
14009 | return (_a = _this.foundation_).handleChange.apply(_a, __spread(args));
|
14010 | };
|
14011 | this.nativeControl_.addEventListener("change", this.changeHandler_);
|
14012 | this.checked = this.checked;
|
14013 | };
|
14014 | MDCSwitch.prototype.getDefaultFoundation = function() {
|
14015 | var _this = this;
|
14016 | var adapter = {
|
14017 | addClass: function addClass(className) {
|
14018 | return _this.root_.classList.add(className);
|
14019 | },
|
14020 | removeClass: function removeClass(className) {
|
14021 | return _this.root_.classList.remove(className);
|
14022 | },
|
14023 | setNativeControlChecked: function setNativeControlChecked(checked) {
|
14024 | return _this.nativeControl_.checked = checked;
|
14025 | },
|
14026 | setNativeControlDisabled: function setNativeControlDisabled(disabled) {
|
14027 | return _this.nativeControl_.disabled = disabled;
|
14028 | }
|
14029 | };
|
14030 | return new foundation_2.MDCSwitchFoundation(adapter);
|
14031 | };
|
14032 | Object.defineProperty(MDCSwitch.prototype, "ripple", {
|
14033 | get: function get() {
|
14034 | return this.ripple_;
|
14035 | },
|
14036 | enumerable: true,
|
14037 | configurable: true
|
14038 | });
|
14039 | Object.defineProperty(MDCSwitch.prototype, "checked", {
|
14040 | get: function get() {
|
14041 | return this.nativeControl_.checked;
|
14042 | },
|
14043 | set: function set(checked) {
|
14044 | this.foundation_.setChecked(checked);
|
14045 | },
|
14046 | enumerable: true,
|
14047 | configurable: true
|
14048 | });
|
14049 | Object.defineProperty(MDCSwitch.prototype, "disabled", {
|
14050 | get: function get() {
|
14051 | return this.nativeControl_.disabled;
|
14052 | },
|
14053 | set: function set(disabled) {
|
14054 | this.foundation_.setDisabled(disabled);
|
14055 | },
|
14056 | enumerable: true,
|
14057 | configurable: true
|
14058 | });
|
14059 | MDCSwitch.prototype.createRipple_ = function() {
|
14060 | var _this = this;
|
14061 | var RIPPLE_SURFACE_SELECTOR = foundation_2.MDCSwitchFoundation.strings.RIPPLE_SURFACE_SELECTOR;
|
14062 | var rippleSurface = this.root_.querySelector(RIPPLE_SURFACE_SELECTOR);
|
14063 | var adapter = __assign({}, component_2.MDCRipple.createAdapter(this), {
|
14064 | addClass: function addClass(className) {
|
14065 | return rippleSurface.classList.add(className);
|
14066 | },
|
14067 | computeBoundingRect: function computeBoundingRect() {
|
14068 | return rippleSurface.getBoundingClientRect();
|
14069 | },
|
14070 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
14071 | _this.nativeControl_.removeEventListener(evtType, handler);
|
14072 | },
|
14073 | isSurfaceActive: function isSurfaceActive() {
|
14074 | return ponyfill_1.matches(_this.nativeControl_, ":active");
|
14075 | },
|
14076 | isUnbounded: function isUnbounded() {
|
14077 | return true;
|
14078 | },
|
14079 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
14080 | _this.nativeControl_.addEventListener(evtType, handler);
|
14081 | },
|
14082 | removeClass: function removeClass(className) {
|
14083 | return rippleSurface.classList.remove(className);
|
14084 | },
|
14085 | updateCssVariable: function updateCssVariable(varName, value) {
|
14086 | rippleSurface.style.setProperty(varName, value);
|
14087 | }
|
14088 | });
|
14089 | return new component_2.MDCRipple(this.root_, new foundation_1.MDCRippleFoundation(adapter));
|
14090 | };
|
14091 | Object.defineProperty(MDCSwitch.prototype, "nativeControl_", {
|
14092 | get: function get() {
|
14093 | var NATIVE_CONTROL_SELECTOR = foundation_2.MDCSwitchFoundation.strings.NATIVE_CONTROL_SELECTOR;
|
14094 | return this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
|
14095 | },
|
14096 | enumerable: true,
|
14097 | configurable: true
|
14098 | });
|
14099 | return MDCSwitch;
|
14100 | }(component_1.MDCComponent);
|
14101 | exports.MDCSwitch = MDCSwitch;
|
14102 | }, function(module, exports, __webpack_require__) {
|
14103 | "use strict";
|
14104 | Object.defineProperty(exports, "__esModule", {
|
14105 | value: true
|
14106 | });
|
14107 | var cssClasses = {
|
14108 | CHECKED: "mdc-switch--checked",
|
14109 | DISABLED: "mdc-switch--disabled"
|
14110 | };
|
14111 | exports.cssClasses = cssClasses;
|
14112 | var strings = {
|
14113 | NATIVE_CONTROL_SELECTOR: ".mdc-switch__native-control",
|
14114 | RIPPLE_SURFACE_SELECTOR: ".mdc-switch__thumb-underlay"
|
14115 | };
|
14116 | exports.strings = strings;
|
14117 | }, function(module, exports, __webpack_require__) {
|
14118 | "use strict";
|
14119 | function __export(m) {
|
14120 | for (var p in m) {
|
14121 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
14122 | }
|
14123 | }
|
14124 | Object.defineProperty(exports, "__esModule", {
|
14125 | value: true
|
14126 | });
|
14127 | __export(__webpack_require__(140));
|
14128 | __export(__webpack_require__(68));
|
14129 | }, function(module, exports, __webpack_require__) {
|
14130 | "use strict";
|
14131 | var __extends = this && this.__extends || function() {
|
14132 | var _extendStatics = function extendStatics(d, b) {
|
14133 | _extendStatics = Object.setPrototypeOf || {
|
14134 | __proto__: []
|
14135 | } instanceof Array && function(d, b) {
|
14136 | d.__proto__ = b;
|
14137 | } || function(d, b) {
|
14138 | for (var p in b) {
|
14139 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
14140 | }
|
14141 | };
|
14142 | return _extendStatics(d, b);
|
14143 | };
|
14144 | return function(d, b) {
|
14145 | _extendStatics(d, b);
|
14146 | function __() {
|
14147 | this.constructor = d;
|
14148 | }
|
14149 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
14150 | };
|
14151 | }();
|
14152 | Object.defineProperty(exports, "__esModule", {
|
14153 | value: true
|
14154 | });
|
14155 | var component_1 = __webpack_require__(1);
|
14156 | var component_2 = __webpack_require__(60);
|
14157 | var component_3 = __webpack_require__(64);
|
14158 | var foundation_1 = __webpack_require__(22);
|
14159 | var foundation_2 = __webpack_require__(68);
|
14160 | var strings = foundation_2.MDCTabBarFoundation.strings;
|
14161 | var tabIdCounter = 0;
|
14162 | var MDCTabBar = function(_super) {
|
14163 | __extends(MDCTabBar, _super);
|
14164 | function MDCTabBar() {
|
14165 | return _super !== null && _super.apply(this, arguments) || this;
|
14166 | }
|
14167 | MDCTabBar.attachTo = function(root) {
|
14168 | return new MDCTabBar(root);
|
14169 | };
|
14170 | Object.defineProperty(MDCTabBar.prototype, "focusOnActivate", {
|
14171 | set: function set(focusOnActivate) {
|
14172 | this.tabList_.forEach(function(tab) {
|
14173 | return tab.focusOnActivate = focusOnActivate;
|
14174 | });
|
14175 | },
|
14176 | enumerable: true,
|
14177 | configurable: true
|
14178 | });
|
14179 | Object.defineProperty(MDCTabBar.prototype, "useAutomaticActivation", {
|
14180 | set: function set(useAutomaticActivation) {
|
14181 | this.foundation_.setUseAutomaticActivation(useAutomaticActivation);
|
14182 | },
|
14183 | enumerable: true,
|
14184 | configurable: true
|
14185 | });
|
14186 | MDCTabBar.prototype.initialize = function(tabFactory, tabScrollerFactory) {
|
14187 | if (tabFactory === void 0) {
|
14188 | tabFactory = function tabFactory(el) {
|
14189 | return new component_3.MDCTab(el);
|
14190 | };
|
14191 | }
|
14192 | if (tabScrollerFactory === void 0) {
|
14193 | tabScrollerFactory = function tabScrollerFactory(el) {
|
14194 | return new component_2.MDCTabScroller(el);
|
14195 | };
|
14196 | }
|
14197 | this.tabList_ = this.instantiateTabs_(tabFactory);
|
14198 | this.tabScroller_ = this.instantiateTabScroller_(tabScrollerFactory);
|
14199 | };
|
14200 | MDCTabBar.prototype.initialSyncWithDOM = function() {
|
14201 | var _this = this;
|
14202 | this.handleTabInteraction_ = function(evt) {
|
14203 | return _this.foundation_.handleTabInteraction(evt);
|
14204 | };
|
14205 | this.handleKeyDown_ = function(evt) {
|
14206 | return _this.foundation_.handleKeyDown(evt);
|
14207 | };
|
14208 | this.listen(foundation_1.MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction_);
|
14209 | this.listen("keydown", this.handleKeyDown_);
|
14210 | for (var i = 0; i < this.tabList_.length; i++) {
|
14211 | if (this.tabList_[i].active) {
|
14212 | this.scrollIntoView(i);
|
14213 | break;
|
14214 | }
|
14215 | }
|
14216 | };
|
14217 | MDCTabBar.prototype.destroy = function() {
|
14218 | _super.prototype.destroy.call(this);
|
14219 | this.unlisten(foundation_1.MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction_);
|
14220 | this.unlisten("keydown", this.handleKeyDown_);
|
14221 | this.tabList_.forEach(function(tab) {
|
14222 | return tab.destroy();
|
14223 | });
|
14224 | if (this.tabScroller_) {
|
14225 | this.tabScroller_.destroy();
|
14226 | }
|
14227 | };
|
14228 | MDCTabBar.prototype.getDefaultFoundation = function() {
|
14229 | var _this = this;
|
14230 | var adapter = {
|
14231 | scrollTo: function scrollTo(scrollX) {
|
14232 | return _this.tabScroller_.scrollTo(scrollX);
|
14233 | },
|
14234 | incrementScroll: function incrementScroll(scrollXIncrement) {
|
14235 | return _this.tabScroller_.incrementScroll(scrollXIncrement);
|
14236 | },
|
14237 | getScrollPosition: function getScrollPosition() {
|
14238 | return _this.tabScroller_.getScrollPosition();
|
14239 | },
|
14240 | getScrollContentWidth: function getScrollContentWidth() {
|
14241 | return _this.tabScroller_.getScrollContentWidth();
|
14242 | },
|
14243 | getOffsetWidth: function getOffsetWidth() {
|
14244 | return _this.root_.offsetWidth;
|
14245 | },
|
14246 | isRTL: function isRTL() {
|
14247 | return window.getComputedStyle(_this.root_).getPropertyValue("direction") === "rtl";
|
14248 | },
|
14249 | setActiveTab: function setActiveTab(index) {
|
14250 | return _this.foundation_.activateTab(index);
|
14251 | },
|
14252 | activateTabAtIndex: function activateTabAtIndex(index, clientRect) {
|
14253 | return _this.tabList_[index].activate(clientRect);
|
14254 | },
|
14255 | deactivateTabAtIndex: function deactivateTabAtIndex(index) {
|
14256 | return _this.tabList_[index].deactivate();
|
14257 | },
|
14258 | focusTabAtIndex: function focusTabAtIndex(index) {
|
14259 | return _this.tabList_[index].focus();
|
14260 | },
|
14261 | getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex(index) {
|
14262 | return _this.tabList_[index].computeIndicatorClientRect();
|
14263 | },
|
14264 | getTabDimensionsAtIndex: function getTabDimensionsAtIndex(index) {
|
14265 | return _this.tabList_[index].computeDimensions();
|
14266 | },
|
14267 | getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {
|
14268 | for (var i = 0; i < _this.tabList_.length; i++) {
|
14269 | if (_this.tabList_[i].active) {
|
14270 | return i;
|
14271 | }
|
14272 | }
|
14273 | return -1;
|
14274 | },
|
14275 | getFocusedTabIndex: function getFocusedTabIndex() {
|
14276 | var tabElements = _this.getTabElements_();
|
14277 | var activeElement = document.activeElement;
|
14278 | return tabElements.indexOf(activeElement);
|
14279 | },
|
14280 | getIndexOfTabById: function getIndexOfTabById(id) {
|
14281 | for (var i = 0; i < _this.tabList_.length; i++) {
|
14282 | if (_this.tabList_[i].id === id) {
|
14283 | return i;
|
14284 | }
|
14285 | }
|
14286 | return -1;
|
14287 | },
|
14288 | getTabListLength: function getTabListLength() {
|
14289 | return _this.tabList_.length;
|
14290 | },
|
14291 | notifyTabActivated: function notifyTabActivated(index) {
|
14292 | return _this.emit(strings.TAB_ACTIVATED_EVENT, {
|
14293 | index: index
|
14294 | }, true);
|
14295 | }
|
14296 | };
|
14297 | return new foundation_2.MDCTabBarFoundation(adapter);
|
14298 | };
|
14299 | MDCTabBar.prototype.activateTab = function(index) {
|
14300 | this.foundation_.activateTab(index);
|
14301 | };
|
14302 | MDCTabBar.prototype.scrollIntoView = function(index) {
|
14303 | this.foundation_.scrollIntoView(index);
|
14304 | };
|
14305 | MDCTabBar.prototype.getTabElements_ = function() {
|
14306 | return [].slice.call(this.root_.querySelectorAll(strings.TAB_SELECTOR));
|
14307 | };
|
14308 | MDCTabBar.prototype.instantiateTabs_ = function(tabFactory) {
|
14309 | return this.getTabElements_().map(function(el) {
|
14310 | el.id = el.id || "mdc-tab-" + ++tabIdCounter;
|
14311 | return tabFactory(el);
|
14312 | });
|
14313 | };
|
14314 | MDCTabBar.prototype.instantiateTabScroller_ = function(tabScrollerFactory) {
|
14315 | var tabScrollerElement = this.root_.querySelector(strings.TAB_SCROLLER_SELECTOR);
|
14316 | if (tabScrollerElement) {
|
14317 | return tabScrollerFactory(tabScrollerElement);
|
14318 | }
|
14319 | return null;
|
14320 | };
|
14321 | return MDCTabBar;
|
14322 | }(component_1.MDCComponent);
|
14323 | exports.MDCTabBar = MDCTabBar;
|
14324 | }, function(module, exports, __webpack_require__) {
|
14325 | "use strict";
|
14326 | var __extends = this && this.__extends || function() {
|
14327 | var _extendStatics = function extendStatics(d, b) {
|
14328 | _extendStatics = Object.setPrototypeOf || {
|
14329 | __proto__: []
|
14330 | } instanceof Array && function(d, b) {
|
14331 | d.__proto__ = b;
|
14332 | } || function(d, b) {
|
14333 | for (var p in b) {
|
14334 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
14335 | }
|
14336 | };
|
14337 | return _extendStatics(d, b);
|
14338 | };
|
14339 | return function(d, b) {
|
14340 | _extendStatics(d, b);
|
14341 | function __() {
|
14342 | this.constructor = d;
|
14343 | }
|
14344 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
14345 | };
|
14346 | }();
|
14347 | Object.defineProperty(exports, "__esModule", {
|
14348 | value: true
|
14349 | });
|
14350 | var rtl_scroller_1 = __webpack_require__(21);
|
14351 | var MDCTabScrollerRTLDefault = function(_super) {
|
14352 | __extends(MDCTabScrollerRTLDefault, _super);
|
14353 | function MDCTabScrollerRTLDefault() {
|
14354 | return _super !== null && _super.apply(this, arguments) || this;
|
14355 | }
|
14356 | MDCTabScrollerRTLDefault.prototype.getScrollPositionRTL = function() {
|
14357 | var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
14358 | var right = this.calculateScrollEdges_().right;
|
14359 | return Math.round(right - currentScrollLeft);
|
14360 | };
|
14361 | MDCTabScrollerRTLDefault.prototype.scrollToRTL = function(scrollX) {
|
14362 | var edges = this.calculateScrollEdges_();
|
14363 | var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
14364 | var clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);
|
14365 | return {
|
14366 | finalScrollPosition: clampedScrollLeft,
|
14367 | scrollDelta: clampedScrollLeft - currentScrollLeft
|
14368 | };
|
14369 | };
|
14370 | MDCTabScrollerRTLDefault.prototype.incrementScrollRTL = function(scrollX) {
|
14371 | var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
14372 | var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
|
14373 | return {
|
14374 | finalScrollPosition: clampedScrollLeft,
|
14375 | scrollDelta: clampedScrollLeft - currentScrollLeft
|
14376 | };
|
14377 | };
|
14378 | MDCTabScrollerRTLDefault.prototype.getAnimatingScrollPosition = function(scrollX) {
|
14379 | return scrollX;
|
14380 | };
|
14381 | MDCTabScrollerRTLDefault.prototype.calculateScrollEdges_ = function() {
|
14382 | var contentWidth = this.adapter_.getScrollContentOffsetWidth();
|
14383 | var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
|
14384 | return {
|
14385 | left: 0,
|
14386 | right: contentWidth - rootWidth
|
14387 | };
|
14388 | };
|
14389 | MDCTabScrollerRTLDefault.prototype.clampScrollValue_ = function(scrollX) {
|
14390 | var edges = this.calculateScrollEdges_();
|
14391 | return Math.min(Math.max(edges.left, scrollX), edges.right);
|
14392 | };
|
14393 | return MDCTabScrollerRTLDefault;
|
14394 | }(rtl_scroller_1.MDCTabScrollerRTL);
|
14395 | exports.MDCTabScrollerRTLDefault = MDCTabScrollerRTLDefault;
|
14396 | exports.default = MDCTabScrollerRTLDefault;
|
14397 | }, function(module, exports, __webpack_require__) {
|
14398 | "use strict";
|
14399 | var __extends = this && this.__extends || function() {
|
14400 | var _extendStatics = function extendStatics(d, b) {
|
14401 | _extendStatics = Object.setPrototypeOf || {
|
14402 | __proto__: []
|
14403 | } instanceof Array && function(d, b) {
|
14404 | d.__proto__ = b;
|
14405 | } || function(d, b) {
|
14406 | for (var p in b) {
|
14407 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
14408 | }
|
14409 | };
|
14410 | return _extendStatics(d, b);
|
14411 | };
|
14412 | return function(d, b) {
|
14413 | _extendStatics(d, b);
|
14414 | function __() {
|
14415 | this.constructor = d;
|
14416 | }
|
14417 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
14418 | };
|
14419 | }();
|
14420 | Object.defineProperty(exports, "__esModule", {
|
14421 | value: true
|
14422 | });
|
14423 | var rtl_scroller_1 = __webpack_require__(21);
|
14424 | var MDCTabScrollerRTLNegative = function(_super) {
|
14425 | __extends(MDCTabScrollerRTLNegative, _super);
|
14426 | function MDCTabScrollerRTLNegative() {
|
14427 | return _super !== null && _super.apply(this, arguments) || this;
|
14428 | }
|
14429 | MDCTabScrollerRTLNegative.prototype.getScrollPositionRTL = function(translateX) {
|
14430 | var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
14431 | return Math.round(translateX - currentScrollLeft);
|
14432 | };
|
14433 | MDCTabScrollerRTLNegative.prototype.scrollToRTL = function(scrollX) {
|
14434 | var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
14435 | var clampedScrollLeft = this.clampScrollValue_(-scrollX);
|
14436 | return {
|
14437 | finalScrollPosition: clampedScrollLeft,
|
14438 | scrollDelta: clampedScrollLeft - currentScrollLeft
|
14439 | };
|
14440 | };
|
14441 | MDCTabScrollerRTLNegative.prototype.incrementScrollRTL = function(scrollX) {
|
14442 | var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
14443 | var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
|
14444 | return {
|
14445 | finalScrollPosition: clampedScrollLeft,
|
14446 | scrollDelta: clampedScrollLeft - currentScrollLeft
|
14447 | };
|
14448 | };
|
14449 | MDCTabScrollerRTLNegative.prototype.getAnimatingScrollPosition = function(scrollX, translateX) {
|
14450 | return scrollX - translateX;
|
14451 | };
|
14452 | MDCTabScrollerRTLNegative.prototype.calculateScrollEdges_ = function() {
|
14453 | var contentWidth = this.adapter_.getScrollContentOffsetWidth();
|
14454 | var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
|
14455 | return {
|
14456 | left: rootWidth - contentWidth,
|
14457 | right: 0
|
14458 | };
|
14459 | };
|
14460 | MDCTabScrollerRTLNegative.prototype.clampScrollValue_ = function(scrollX) {
|
14461 | var edges = this.calculateScrollEdges_();
|
14462 | return Math.max(Math.min(edges.right, scrollX), edges.left);
|
14463 | };
|
14464 | return MDCTabScrollerRTLNegative;
|
14465 | }(rtl_scroller_1.MDCTabScrollerRTL);
|
14466 | exports.MDCTabScrollerRTLNegative = MDCTabScrollerRTLNegative;
|
14467 | exports.default = MDCTabScrollerRTLNegative;
|
14468 | }, function(module, exports, __webpack_require__) {
|
14469 | "use strict";
|
14470 | var __extends = this && this.__extends || function() {
|
14471 | var _extendStatics = function extendStatics(d, b) {
|
14472 | _extendStatics = Object.setPrototypeOf || {
|
14473 | __proto__: []
|
14474 | } instanceof Array && function(d, b) {
|
14475 | d.__proto__ = b;
|
14476 | } || function(d, b) {
|
14477 | for (var p in b) {
|
14478 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
14479 | }
|
14480 | };
|
14481 | return _extendStatics(d, b);
|
14482 | };
|
14483 | return function(d, b) {
|
14484 | _extendStatics(d, b);
|
14485 | function __() {
|
14486 | this.constructor = d;
|
14487 | }
|
14488 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
14489 | };
|
14490 | }();
|
14491 | Object.defineProperty(exports, "__esModule", {
|
14492 | value: true
|
14493 | });
|
14494 | var rtl_scroller_1 = __webpack_require__(21);
|
14495 | var MDCTabScrollerRTLReverse = function(_super) {
|
14496 | __extends(MDCTabScrollerRTLReverse, _super);
|
14497 | function MDCTabScrollerRTLReverse() {
|
14498 | return _super !== null && _super.apply(this, arguments) || this;
|
14499 | }
|
14500 | MDCTabScrollerRTLReverse.prototype.getScrollPositionRTL = function(translateX) {
|
14501 | var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
14502 | return Math.round(currentScrollLeft - translateX);
|
14503 | };
|
14504 | MDCTabScrollerRTLReverse.prototype.scrollToRTL = function(scrollX) {
|
14505 | var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
14506 | var clampedScrollLeft = this.clampScrollValue_(scrollX);
|
14507 | return {
|
14508 | finalScrollPosition: clampedScrollLeft,
|
14509 | scrollDelta: currentScrollLeft - clampedScrollLeft
|
14510 | };
|
14511 | };
|
14512 | MDCTabScrollerRTLReverse.prototype.incrementScrollRTL = function(scrollX) {
|
14513 | var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
|
14514 | var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);
|
14515 | return {
|
14516 | finalScrollPosition: clampedScrollLeft,
|
14517 | scrollDelta: currentScrollLeft - clampedScrollLeft
|
14518 | };
|
14519 | };
|
14520 | MDCTabScrollerRTLReverse.prototype.getAnimatingScrollPosition = function(scrollX, translateX) {
|
14521 | return scrollX + translateX;
|
14522 | };
|
14523 | MDCTabScrollerRTLReverse.prototype.calculateScrollEdges_ = function() {
|
14524 | var contentWidth = this.adapter_.getScrollContentOffsetWidth();
|
14525 | var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
|
14526 | return {
|
14527 | left: contentWidth - rootWidth,
|
14528 | right: 0
|
14529 | };
|
14530 | };
|
14531 | MDCTabScrollerRTLReverse.prototype.clampScrollValue_ = function(scrollX) {
|
14532 | var edges = this.calculateScrollEdges_();
|
14533 | return Math.min(Math.max(edges.right, scrollX), edges.left);
|
14534 | };
|
14535 | return MDCTabScrollerRTLReverse;
|
14536 | }(rtl_scroller_1.MDCTabScrollerRTL);
|
14537 | exports.MDCTabScrollerRTLReverse = MDCTabScrollerRTLReverse;
|
14538 | exports.default = MDCTabScrollerRTLReverse;
|
14539 | }, function(module, exports, __webpack_require__) {
|
14540 | "use strict";
|
14541 | Object.defineProperty(exports, "__esModule", {
|
14542 | value: true
|
14543 | });
|
14544 | var cssClasses = {
|
14545 | ACTIVE: "mdc-tab-indicator--active",
|
14546 | FADE: "mdc-tab-indicator--fade",
|
14547 | NO_TRANSITION: "mdc-tab-indicator--no-transition"
|
14548 | };
|
14549 | exports.cssClasses = cssClasses;
|
14550 | var strings = {
|
14551 | CONTENT_SELECTOR: ".mdc-tab-indicator__content"
|
14552 | };
|
14553 | exports.strings = strings;
|
14554 | }, function(module, exports, __webpack_require__) {
|
14555 | "use strict";
|
14556 | Object.defineProperty(exports, "__esModule", {
|
14557 | value: true
|
14558 | });
|
14559 | var cssClasses = {
|
14560 | ACTIVE: "mdc-tab--active"
|
14561 | };
|
14562 | exports.cssClasses = cssClasses;
|
14563 | var strings = {
|
14564 | ARIA_SELECTED: "aria-selected",
|
14565 | CONTENT_SELECTOR: ".mdc-tab__content",
|
14566 | INTERACTED_EVENT: "MDCTab:interacted",
|
14567 | RIPPLE_SELECTOR: ".mdc-tab__ripple",
|
14568 | TABINDEX: "tabIndex",
|
14569 | TAB_INDICATOR_SELECTOR: ".mdc-tab-indicator"
|
14570 | };
|
14571 | exports.strings = strings;
|
14572 | }, function(module, exports, __webpack_require__) {
|
14573 | "use strict";
|
14574 | Object.defineProperty(exports, "__esModule", {
|
14575 | value: true
|
14576 | });
|
14577 | var strings = {
|
14578 | ARROW_LEFT_KEY: "ArrowLeft",
|
14579 | ARROW_RIGHT_KEY: "ArrowRight",
|
14580 | END_KEY: "End",
|
14581 | ENTER_KEY: "Enter",
|
14582 | HOME_KEY: "Home",
|
14583 | SPACE_KEY: "Space",
|
14584 | TAB_ACTIVATED_EVENT: "MDCTabBar:activated",
|
14585 | TAB_SCROLLER_SELECTOR: ".mdc-tab-scroller",
|
14586 | TAB_SELECTOR: ".mdc-tab"
|
14587 | };
|
14588 | exports.strings = strings;
|
14589 | var numbers = {
|
14590 | ARROW_LEFT_KEYCODE: 37,
|
14591 | ARROW_RIGHT_KEYCODE: 39,
|
14592 | END_KEYCODE: 35,
|
14593 | ENTER_KEYCODE: 13,
|
14594 | EXTRA_SCROLL_AMOUNT: 20,
|
14595 | HOME_KEYCODE: 36,
|
14596 | SPACE_KEYCODE: 32
|
14597 | };
|
14598 | exports.numbers = numbers;
|
14599 | }, function(module, exports, __webpack_require__) {
|
14600 | "use strict";
|
14601 | function __export(m) {
|
14602 | for (var p in m) {
|
14603 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
14604 | }
|
14605 | }
|
14606 | Object.defineProperty(exports, "__esModule", {
|
14607 | value: true
|
14608 | });
|
14609 | __export(__webpack_require__(65));
|
14610 | __export(__webpack_require__(9));
|
14611 | __export(__webpack_require__(66));
|
14612 | __export(__webpack_require__(67));
|
14613 | }, function(module, exports, __webpack_require__) {
|
14614 | "use strict";
|
14615 | function __export(m) {
|
14616 | for (var p in m) {
|
14617 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
14618 | }
|
14619 | }
|
14620 | var __importStar = this && this.__importStar || function(mod) {
|
14621 | if (mod && mod.__esModule) return mod;
|
14622 | var result = {};
|
14623 | if (mod != null) for (var k in mod) {
|
14624 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
14625 | }
|
14626 | result["default"] = mod;
|
14627 | return result;
|
14628 | };
|
14629 | Object.defineProperty(exports, "__esModule", {
|
14630 | value: true
|
14631 | });
|
14632 | var util = __importStar(__webpack_require__(63));
|
14633 | exports.util = util;
|
14634 | __export(__webpack_require__(60));
|
14635 | __export(__webpack_require__(61));
|
14636 | }, function(module, exports, __webpack_require__) {
|
14637 | "use strict";
|
14638 | function __export(m) {
|
14639 | for (var p in m) {
|
14640 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
14641 | }
|
14642 | }
|
14643 | Object.defineProperty(exports, "__esModule", {
|
14644 | value: true
|
14645 | });
|
14646 | __export(__webpack_require__(64));
|
14647 | __export(__webpack_require__(22));
|
14648 | }, function(module, exports, __webpack_require__) {
|
14649 | "use strict";
|
14650 | function __export(m) {
|
14651 | for (var p in m) {
|
14652 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
14653 | }
|
14654 | }
|
14655 | Object.defineProperty(exports, "__esModule", {
|
14656 | value: true
|
14657 | });
|
14658 | __export(__webpack_require__(151));
|
14659 | __export(__webpack_require__(71));
|
14660 | __export(__webpack_require__(155));
|
14661 | __export(__webpack_require__(156));
|
14662 | __export(__webpack_require__(157));
|
14663 | }, function(module, exports, __webpack_require__) {
|
14664 | "use strict";
|
14665 | var __extends = this && this.__extends || function() {
|
14666 | var _extendStatics = function extendStatics(d, b) {
|
14667 | _extendStatics = Object.setPrototypeOf || {
|
14668 | __proto__: []
|
14669 | } instanceof Array && function(d, b) {
|
14670 | d.__proto__ = b;
|
14671 | } || function(d, b) {
|
14672 | for (var p in b) {
|
14673 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
14674 | }
|
14675 | };
|
14676 | return _extendStatics(d, b);
|
14677 | };
|
14678 | return function(d, b) {
|
14679 | _extendStatics(d, b);
|
14680 | function __() {
|
14681 | this.constructor = d;
|
14682 | }
|
14683 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
14684 | };
|
14685 | }();
|
14686 | var __assign = this && this.__assign || function() {
|
14687 | __assign = Object.assign || function(t) {
|
14688 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
14689 | s = arguments[i];
|
14690 | for (var p in s) {
|
14691 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
14692 | }
|
14693 | }
|
14694 | return t;
|
14695 | };
|
14696 | return __assign.apply(this, arguments);
|
14697 | };
|
14698 | var __importStar = this && this.__importStar || function(mod) {
|
14699 | if (mod && mod.__esModule) return mod;
|
14700 | var result = {};
|
14701 | if (mod != null) for (var k in mod) {
|
14702 | if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
14703 | }
|
14704 | result["default"] = mod;
|
14705 | return result;
|
14706 | };
|
14707 | Object.defineProperty(exports, "__esModule", {
|
14708 | value: true
|
14709 | });
|
14710 | var component_1 = __webpack_require__(1);
|
14711 | var ponyfill = __importStar(__webpack_require__(3));
|
14712 | var component_2 = __webpack_require__(15);
|
14713 | var component_3 = __webpack_require__(17);
|
14714 | var component_4 = __webpack_require__(19);
|
14715 | var component_5 = __webpack_require__(2);
|
14716 | var foundation_1 = __webpack_require__(4);
|
14717 | var component_6 = __webpack_require__(69);
|
14718 | var foundation_2 = __webpack_require__(23);
|
14719 | var constants_1 = __webpack_require__(70);
|
14720 | var foundation_3 = __webpack_require__(71);
|
14721 | var component_7 = __webpack_require__(72);
|
14722 | var foundation_4 = __webpack_require__(24);
|
14723 | var component_8 = __webpack_require__(73);
|
14724 | var MDCTextField = function(_super) {
|
14725 | __extends(MDCTextField, _super);
|
14726 | function MDCTextField() {
|
14727 | return _super !== null && _super.apply(this, arguments) || this;
|
14728 | }
|
14729 | MDCTextField.attachTo = function(root) {
|
14730 | return new MDCTextField(root);
|
14731 | };
|
14732 | MDCTextField.prototype.initialize = function(rippleFactory, lineRippleFactory, helperTextFactory, characterCounterFactory, iconFactory, labelFactory, outlineFactory) {
|
14733 | if (rippleFactory === void 0) {
|
14734 | rippleFactory = function rippleFactory(el, foundation) {
|
14735 | return new component_5.MDCRipple(el, foundation);
|
14736 | };
|
14737 | }
|
14738 | if (lineRippleFactory === void 0) {
|
14739 | lineRippleFactory = function lineRippleFactory(el) {
|
14740 | return new component_3.MDCLineRipple(el);
|
14741 | };
|
14742 | }
|
14743 | if (helperTextFactory === void 0) {
|
14744 | helperTextFactory = function helperTextFactory(el) {
|
14745 | return new component_7.MDCTextFieldHelperText(el);
|
14746 | };
|
14747 | }
|
14748 | if (characterCounterFactory === void 0) {
|
14749 | characterCounterFactory = function characterCounterFactory(el) {
|
14750 | return new component_6.MDCTextFieldCharacterCounter(el);
|
14751 | };
|
14752 | }
|
14753 | if (iconFactory === void 0) {
|
14754 | iconFactory = function iconFactory(el) {
|
14755 | return new component_8.MDCTextFieldIcon(el);
|
14756 | };
|
14757 | }
|
14758 | if (labelFactory === void 0) {
|
14759 | labelFactory = function labelFactory(el) {
|
14760 | return new component_2.MDCFloatingLabel(el);
|
14761 | };
|
14762 | }
|
14763 | if (outlineFactory === void 0) {
|
14764 | outlineFactory = function outlineFactory(el) {
|
14765 | return new component_4.MDCNotchedOutline(el);
|
14766 | };
|
14767 | }
|
14768 | this.input_ = this.root_.querySelector(constants_1.strings.INPUT_SELECTOR);
|
14769 | var labelElement = this.root_.querySelector(constants_1.strings.LABEL_SELECTOR);
|
14770 | this.label_ = labelElement ? labelFactory(labelElement) : null;
|
14771 | var lineRippleElement = this.root_.querySelector(constants_1.strings.LINE_RIPPLE_SELECTOR);
|
14772 | this.lineRipple_ = lineRippleElement ? lineRippleFactory(lineRippleElement) : null;
|
14773 | var outlineElement = this.root_.querySelector(constants_1.strings.OUTLINE_SELECTOR);
|
14774 | this.outline_ = outlineElement ? outlineFactory(outlineElement) : null;
|
14775 | var helperTextStrings = foundation_4.MDCTextFieldHelperTextFoundation.strings;
|
14776 | var nextElementSibling = this.root_.nextElementSibling;
|
14777 | var hasHelperLine = nextElementSibling && nextElementSibling.classList.contains(constants_1.cssClasses.HELPER_LINE);
|
14778 | var helperTextEl = hasHelperLine && nextElementSibling && nextElementSibling.querySelector(helperTextStrings.ROOT_SELECTOR);
|
14779 | this.helperText_ = helperTextEl ? helperTextFactory(helperTextEl) : null;
|
14780 | var characterCounterStrings = foundation_2.MDCTextFieldCharacterCounterFoundation.strings;
|
14781 | var characterCounterEl = this.root_.querySelector(characterCounterStrings.ROOT_SELECTOR);
|
14782 | if (!characterCounterEl && hasHelperLine && nextElementSibling) {
|
14783 | characterCounterEl = nextElementSibling.querySelector(characterCounterStrings.ROOT_SELECTOR);
|
14784 | }
|
14785 | this.characterCounter_ = characterCounterEl ? characterCounterFactory(characterCounterEl) : null;
|
14786 | this.leadingIcon_ = null;
|
14787 | this.trailingIcon_ = null;
|
14788 | var iconElements = this.root_.querySelectorAll(constants_1.strings.ICON_SELECTOR);
|
14789 | if (iconElements.length > 0) {
|
14790 | if (iconElements.length > 1) {
|
14791 | this.leadingIcon_ = iconFactory(iconElements[0]);
|
14792 | this.trailingIcon_ = iconFactory(iconElements[1]);
|
14793 | } else {
|
14794 | if (this.root_.classList.contains(constants_1.cssClasses.WITH_LEADING_ICON)) {
|
14795 | this.leadingIcon_ = iconFactory(iconElements[0]);
|
14796 | } else {
|
14797 | this.trailingIcon_ = iconFactory(iconElements[0]);
|
14798 | }
|
14799 | }
|
14800 | }
|
14801 | this.ripple = this.createRipple_(rippleFactory);
|
14802 | };
|
14803 | MDCTextField.prototype.destroy = function() {
|
14804 | if (this.ripple) {
|
14805 | this.ripple.destroy();
|
14806 | }
|
14807 | if (this.lineRipple_) {
|
14808 | this.lineRipple_.destroy();
|
14809 | }
|
14810 | if (this.helperText_) {
|
14811 | this.helperText_.destroy();
|
14812 | }
|
14813 | if (this.characterCounter_) {
|
14814 | this.characterCounter_.destroy();
|
14815 | }
|
14816 | if (this.leadingIcon_) {
|
14817 | this.leadingIcon_.destroy();
|
14818 | }
|
14819 | if (this.trailingIcon_) {
|
14820 | this.trailingIcon_.destroy();
|
14821 | }
|
14822 | if (this.label_) {
|
14823 | this.label_.destroy();
|
14824 | }
|
14825 | if (this.outline_) {
|
14826 | this.outline_.destroy();
|
14827 | }
|
14828 | _super.prototype.destroy.call(this);
|
14829 | };
|
14830 | MDCTextField.prototype.initialSyncWithDOM = function() {
|
14831 | this.disabled = this.input_.disabled;
|
14832 | };
|
14833 | Object.defineProperty(MDCTextField.prototype, "value", {
|
14834 | get: function get() {
|
14835 | return this.foundation_.getValue();
|
14836 | },
|
14837 | set: function set(value) {
|
14838 | this.foundation_.setValue(value);
|
14839 | },
|
14840 | enumerable: true,
|
14841 | configurable: true
|
14842 | });
|
14843 | Object.defineProperty(MDCTextField.prototype, "disabled", {
|
14844 | get: function get() {
|
14845 | return this.foundation_.isDisabled();
|
14846 | },
|
14847 | set: function set(disabled) {
|
14848 | this.foundation_.setDisabled(disabled);
|
14849 | },
|
14850 | enumerable: true,
|
14851 | configurable: true
|
14852 | });
|
14853 | Object.defineProperty(MDCTextField.prototype, "valid", {
|
14854 | get: function get() {
|
14855 | return this.foundation_.isValid();
|
14856 | },
|
14857 | set: function set(valid) {
|
14858 | this.foundation_.setValid(valid);
|
14859 | },
|
14860 | enumerable: true,
|
14861 | configurable: true
|
14862 | });
|
14863 | Object.defineProperty(MDCTextField.prototype, "required", {
|
14864 | get: function get() {
|
14865 | return this.input_.required;
|
14866 | },
|
14867 | set: function set(required) {
|
14868 | this.input_.required = required;
|
14869 | },
|
14870 | enumerable: true,
|
14871 | configurable: true
|
14872 | });
|
14873 | Object.defineProperty(MDCTextField.prototype, "pattern", {
|
14874 | get: function get() {
|
14875 | return this.input_.pattern;
|
14876 | },
|
14877 | set: function set(pattern) {
|
14878 | this.input_.pattern = pattern;
|
14879 | },
|
14880 | enumerable: true,
|
14881 | configurable: true
|
14882 | });
|
14883 | Object.defineProperty(MDCTextField.prototype, "minLength", {
|
14884 | get: function get() {
|
14885 | return this.input_.minLength;
|
14886 | },
|
14887 | set: function set(minLength) {
|
14888 | this.input_.minLength = minLength;
|
14889 | },
|
14890 | enumerable: true,
|
14891 | configurable: true
|
14892 | });
|
14893 | Object.defineProperty(MDCTextField.prototype, "maxLength", {
|
14894 | get: function get() {
|
14895 | return this.input_.maxLength;
|
14896 | },
|
14897 | set: function set(maxLength) {
|
14898 | if (maxLength < 0) {
|
14899 | this.input_.removeAttribute("maxLength");
|
14900 | } else {
|
14901 | this.input_.maxLength = maxLength;
|
14902 | }
|
14903 | },
|
14904 | enumerable: true,
|
14905 | configurable: true
|
14906 | });
|
14907 | Object.defineProperty(MDCTextField.prototype, "min", {
|
14908 | get: function get() {
|
14909 | return this.input_.min;
|
14910 | },
|
14911 | set: function set(min) {
|
14912 | this.input_.min = min;
|
14913 | },
|
14914 | enumerable: true,
|
14915 | configurable: true
|
14916 | });
|
14917 | Object.defineProperty(MDCTextField.prototype, "max", {
|
14918 | get: function get() {
|
14919 | return this.input_.max;
|
14920 | },
|
14921 | set: function set(max) {
|
14922 | this.input_.max = max;
|
14923 | },
|
14924 | enumerable: true,
|
14925 | configurable: true
|
14926 | });
|
14927 | Object.defineProperty(MDCTextField.prototype, "step", {
|
14928 | get: function get() {
|
14929 | return this.input_.step;
|
14930 | },
|
14931 | set: function set(step) {
|
14932 | this.input_.step = step;
|
14933 | },
|
14934 | enumerable: true,
|
14935 | configurable: true
|
14936 | });
|
14937 | Object.defineProperty(MDCTextField.prototype, "helperTextContent", {
|
14938 | set: function set(content) {
|
14939 | this.foundation_.setHelperTextContent(content);
|
14940 | },
|
14941 | enumerable: true,
|
14942 | configurable: true
|
14943 | });
|
14944 | Object.defineProperty(MDCTextField.prototype, "leadingIconAriaLabel", {
|
14945 | set: function set(label) {
|
14946 | this.foundation_.setLeadingIconAriaLabel(label);
|
14947 | },
|
14948 | enumerable: true,
|
14949 | configurable: true
|
14950 | });
|
14951 | Object.defineProperty(MDCTextField.prototype, "leadingIconContent", {
|
14952 | set: function set(content) {
|
14953 | this.foundation_.setLeadingIconContent(content);
|
14954 | },
|
14955 | enumerable: true,
|
14956 | configurable: true
|
14957 | });
|
14958 | Object.defineProperty(MDCTextField.prototype, "trailingIconAriaLabel", {
|
14959 | set: function set(label) {
|
14960 | this.foundation_.setTrailingIconAriaLabel(label);
|
14961 | },
|
14962 | enumerable: true,
|
14963 | configurable: true
|
14964 | });
|
14965 | Object.defineProperty(MDCTextField.prototype, "trailingIconContent", {
|
14966 | set: function set(content) {
|
14967 | this.foundation_.setTrailingIconContent(content);
|
14968 | },
|
14969 | enumerable: true,
|
14970 | configurable: true
|
14971 | });
|
14972 | Object.defineProperty(MDCTextField.prototype, "useNativeValidation", {
|
14973 | set: function set(useNativeValidation) {
|
14974 | this.foundation_.setUseNativeValidation(useNativeValidation);
|
14975 | },
|
14976 | enumerable: true,
|
14977 | configurable: true
|
14978 | });
|
14979 | MDCTextField.prototype.focus = function() {
|
14980 | this.input_.focus();
|
14981 | };
|
14982 | MDCTextField.prototype.layout = function() {
|
14983 | var openNotch = this.foundation_.shouldFloat;
|
14984 | this.foundation_.notchOutline(openNotch);
|
14985 | };
|
14986 | MDCTextField.prototype.getDefaultFoundation = function() {
|
14987 | var adapter = __assign({}, this.getRootAdapterMethods_(), this.getInputAdapterMethods_(), this.getLabelAdapterMethods_(), this.getLineRippleAdapterMethods_(), this.getOutlineAdapterMethods_());
|
14988 | return new foundation_3.MDCTextFieldFoundation(adapter, this.getFoundationMap_());
|
14989 | };
|
14990 | MDCTextField.prototype.getRootAdapterMethods_ = function() {
|
14991 | var _this = this;
|
14992 | return {
|
14993 | addClass: function addClass(className) {
|
14994 | return _this.root_.classList.add(className);
|
14995 | },
|
14996 | removeClass: function removeClass(className) {
|
14997 | return _this.root_.classList.remove(className);
|
14998 | },
|
14999 | hasClass: function hasClass(className) {
|
15000 | return _this.root_.classList.contains(className);
|
15001 | },
|
15002 | registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) {
|
15003 | return _this.listen(evtType, handler);
|
15004 | },
|
15005 | deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) {
|
15006 | return _this.unlisten(evtType, handler);
|
15007 | },
|
15008 | registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) {
|
15009 | var getAttributesList = function getAttributesList(mutationsList) {
|
15010 | return mutationsList.map(function(mutation) {
|
15011 | return mutation.attributeName;
|
15012 | }).filter(function(attributeName) {
|
15013 | return attributeName;
|
15014 | });
|
15015 | };
|
15016 | var observer = new MutationObserver(function(mutationsList) {
|
15017 | return handler(getAttributesList(mutationsList));
|
15018 | });
|
15019 | var config = {
|
15020 | attributes: true
|
15021 | };
|
15022 | observer.observe(_this.input_, config);
|
15023 | return observer;
|
15024 | },
|
15025 | deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) {
|
15026 | return observer.disconnect();
|
15027 | }
|
15028 | };
|
15029 | };
|
15030 | MDCTextField.prototype.getInputAdapterMethods_ = function() {
|
15031 | var _this = this;
|
15032 | return {
|
15033 | getNativeInput: function getNativeInput() {
|
15034 | return _this.input_;
|
15035 | },
|
15036 | isFocused: function isFocused() {
|
15037 | return document.activeElement === _this.input_;
|
15038 | },
|
15039 | registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) {
|
15040 | return _this.input_.addEventListener(evtType, handler);
|
15041 | },
|
15042 | deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) {
|
15043 | return _this.input_.removeEventListener(evtType, handler);
|
15044 | }
|
15045 | };
|
15046 | };
|
15047 | MDCTextField.prototype.getLabelAdapterMethods_ = function() {
|
15048 | var _this = this;
|
15049 | return {
|
15050 | floatLabel: function floatLabel(shouldFloat) {
|
15051 | return _this.label_ && _this.label_.float(shouldFloat);
|
15052 | },
|
15053 | getLabelWidth: function getLabelWidth() {
|
15054 | return _this.label_ ? _this.label_.getWidth() : 0;
|
15055 | },
|
15056 | hasLabel: function hasLabel() {
|
15057 | return Boolean(_this.label_);
|
15058 | },
|
15059 | shakeLabel: function shakeLabel(shouldShake) {
|
15060 | return _this.label_ && _this.label_.shake(shouldShake);
|
15061 | }
|
15062 | };
|
15063 | };
|
15064 | MDCTextField.prototype.getLineRippleAdapterMethods_ = function() {
|
15065 | var _this = this;
|
15066 | return {
|
15067 | activateLineRipple: function activateLineRipple() {
|
15068 | if (_this.lineRipple_) {
|
15069 | _this.lineRipple_.activate();
|
15070 | }
|
15071 | },
|
15072 | deactivateLineRipple: function deactivateLineRipple() {
|
15073 | if (_this.lineRipple_) {
|
15074 | _this.lineRipple_.deactivate();
|
15075 | }
|
15076 | },
|
15077 | setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) {
|
15078 | if (_this.lineRipple_) {
|
15079 | _this.lineRipple_.setRippleCenter(normalizedX);
|
15080 | }
|
15081 | }
|
15082 | };
|
15083 | };
|
15084 | MDCTextField.prototype.getOutlineAdapterMethods_ = function() {
|
15085 | var _this = this;
|
15086 | return {
|
15087 | closeOutline: function closeOutline() {
|
15088 | return _this.outline_ && _this.outline_.closeNotch();
|
15089 | },
|
15090 | hasOutline: function hasOutline() {
|
15091 | return Boolean(_this.outline_);
|
15092 | },
|
15093 | notchOutline: function notchOutline(labelWidth) {
|
15094 | return _this.outline_ && _this.outline_.notch(labelWidth);
|
15095 | }
|
15096 | };
|
15097 | };
|
15098 | MDCTextField.prototype.getFoundationMap_ = function() {
|
15099 | return {
|
15100 | characterCounter: this.characterCounter_ ? this.characterCounter_.foundation : undefined,
|
15101 | helperText: this.helperText_ ? this.helperText_.foundation : undefined,
|
15102 | leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,
|
15103 | trailingIcon: this.trailingIcon_ ? this.trailingIcon_.foundation : undefined
|
15104 | };
|
15105 | };
|
15106 | MDCTextField.prototype.createRipple_ = function(rippleFactory) {
|
15107 | var _this = this;
|
15108 | var isTextArea = this.root_.classList.contains(constants_1.cssClasses.TEXTAREA);
|
15109 | var isOutlined = this.root_.classList.contains(constants_1.cssClasses.OUTLINED);
|
15110 | if (isTextArea || isOutlined) {
|
15111 | return null;
|
15112 | }
|
15113 | var adapter = __assign({}, component_5.MDCRipple.createAdapter(this), {
|
15114 | isSurfaceActive: function isSurfaceActive() {
|
15115 | return ponyfill.matches(_this.input_, ":active");
|
15116 | },
|
15117 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
15118 | return _this.input_.addEventListener(evtType, handler);
|
15119 | },
|
15120 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
15121 | return _this.input_.removeEventListener(evtType, handler);
|
15122 | }
|
15123 | });
|
15124 | return rippleFactory(this.root_, new foundation_1.MDCRippleFoundation(adapter));
|
15125 | };
|
15126 | return MDCTextField;
|
15127 | }(component_1.MDCComponent);
|
15128 | exports.MDCTextField = MDCTextField;
|
15129 | }, function(module, exports, __webpack_require__) {
|
15130 | "use strict";
|
15131 | Object.defineProperty(exports, "__esModule", {
|
15132 | value: true
|
15133 | });
|
15134 | var cssClasses = {
|
15135 | ROOT: "mdc-text-field-character-counter"
|
15136 | };
|
15137 | exports.cssClasses = cssClasses;
|
15138 | var strings = {
|
15139 | ROOT_SELECTOR: "." + cssClasses.ROOT
|
15140 | };
|
15141 | exports.strings = strings;
|
15142 | }, function(module, exports, __webpack_require__) {
|
15143 | "use strict";
|
15144 | Object.defineProperty(exports, "__esModule", {
|
15145 | value: true
|
15146 | });
|
15147 | var cssClasses = {
|
15148 | HELPER_TEXT_PERSISTENT: "mdc-text-field-helper-text--persistent",
|
15149 | HELPER_TEXT_VALIDATION_MSG: "mdc-text-field-helper-text--validation-msg",
|
15150 | ROOT: "mdc-text-field-helper-text"
|
15151 | };
|
15152 | exports.cssClasses = cssClasses;
|
15153 | var strings = {
|
15154 | ARIA_HIDDEN: "aria-hidden",
|
15155 | ROLE: "role",
|
15156 | ROOT_SELECTOR: "." + cssClasses.ROOT
|
15157 | };
|
15158 | exports.strings = strings;
|
15159 | }, function(module, exports, __webpack_require__) {
|
15160 | "use strict";
|
15161 | Object.defineProperty(exports, "__esModule", {
|
15162 | value: true
|
15163 | });
|
15164 | var strings = {
|
15165 | ICON_EVENT: "MDCTextField:icon",
|
15166 | ICON_ROLE: "button"
|
15167 | };
|
15168 | exports.strings = strings;
|
15169 | var cssClasses = {
|
15170 | ROOT: "mdc-text-field__icon"
|
15171 | };
|
15172 | exports.cssClasses = cssClasses;
|
15173 | }, function(module, exports, __webpack_require__) {
|
15174 | "use strict";
|
15175 | function __export(m) {
|
15176 | for (var p in m) {
|
15177 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
15178 | }
|
15179 | }
|
15180 | Object.defineProperty(exports, "__esModule", {
|
15181 | value: true
|
15182 | });
|
15183 | __export(__webpack_require__(69));
|
15184 | __export(__webpack_require__(23));
|
15185 | }, function(module, exports, __webpack_require__) {
|
15186 | "use strict";
|
15187 | function __export(m) {
|
15188 | for (var p in m) {
|
15189 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
15190 | }
|
15191 | }
|
15192 | Object.defineProperty(exports, "__esModule", {
|
15193 | value: true
|
15194 | });
|
15195 | __export(__webpack_require__(72));
|
15196 | __export(__webpack_require__(24));
|
15197 | }, function(module, exports, __webpack_require__) {
|
15198 | "use strict";
|
15199 | function __export(m) {
|
15200 | for (var p in m) {
|
15201 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
15202 | }
|
15203 | }
|
15204 | Object.defineProperty(exports, "__esModule", {
|
15205 | value: true
|
15206 | });
|
15207 | __export(__webpack_require__(73));
|
15208 | __export(__webpack_require__(74));
|
15209 | }, function(module, exports, __webpack_require__) {
|
15210 | "use strict";
|
15211 | function __export(m) {
|
15212 | for (var p in m) {
|
15213 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
15214 | }
|
15215 | }
|
15216 | Object.defineProperty(exports, "__esModule", {
|
15217 | value: true
|
15218 | });
|
15219 | __export(__webpack_require__(159));
|
15220 | __export(__webpack_require__(75));
|
15221 | }, function(module, exports, __webpack_require__) {
|
15222 | "use strict";
|
15223 | var __extends = this && this.__extends || function() {
|
15224 | var _extendStatics = function extendStatics(d, b) {
|
15225 | _extendStatics = Object.setPrototypeOf || {
|
15226 | __proto__: []
|
15227 | } instanceof Array && function(d, b) {
|
15228 | d.__proto__ = b;
|
15229 | } || function(d, b) {
|
15230 | for (var p in b) {
|
15231 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
15232 | }
|
15233 | };
|
15234 | return _extendStatics(d, b);
|
15235 | };
|
15236 | return function(d, b) {
|
15237 | _extendStatics(d, b);
|
15238 | function __() {
|
15239 | this.constructor = d;
|
15240 | }
|
15241 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15242 | };
|
15243 | }();
|
15244 | Object.defineProperty(exports, "__esModule", {
|
15245 | value: true
|
15246 | });
|
15247 | var component_1 = __webpack_require__(1);
|
15248 | var component_2 = __webpack_require__(2);
|
15249 | var foundation_1 = __webpack_require__(75);
|
15250 | var strings = foundation_1.MDCToolbarFoundation.strings;
|
15251 | var MDCToolbar = function(_super) {
|
15252 | __extends(MDCToolbar, _super);
|
15253 | function MDCToolbar() {
|
15254 | return _super !== null && _super.apply(this, arguments) || this;
|
15255 | }
|
15256 | MDCToolbar.attachTo = function(root) {
|
15257 | return new MDCToolbar(root);
|
15258 | };
|
15259 | MDCToolbar.prototype.initialize = function() {
|
15260 | var _this = this;
|
15261 | this.ripples_ = [];
|
15262 | this.fixedAdjustElement_ = null;
|
15263 | this.titleElement_ = this.root_.querySelector(strings.TITLE_SELECTOR);
|
15264 | var firstRowElement = this.root_.querySelector(strings.FIRST_ROW_SELECTOR);
|
15265 | if (!firstRowElement) {
|
15266 | throw new Error("MDCToolbar: Required sub-element '" + strings.FIRST_ROW_SELECTOR + "' is missing");
|
15267 | }
|
15268 | this.firstRowElement_ = firstRowElement;
|
15269 | [].forEach.call(this.root_.querySelectorAll(strings.ICON_SELECTOR), function(icon) {
|
15270 | var ripple = component_2.MDCRipple.attachTo(icon);
|
15271 | ripple.unbounded = true;
|
15272 | _this.ripples_.push(ripple);
|
15273 | });
|
15274 | };
|
15275 | MDCToolbar.prototype.destroy = function() {
|
15276 | this.ripples_.forEach(function(ripple) {
|
15277 | ripple.destroy();
|
15278 | });
|
15279 | _super.prototype.destroy.call(this);
|
15280 | };
|
15281 | Object.defineProperty(MDCToolbar.prototype, "fixedAdjustElement", {
|
15282 | get: function get() {
|
15283 | return this.fixedAdjustElement_;
|
15284 | },
|
15285 | set: function set(element) {
|
15286 | this.fixedAdjustElement_ = element;
|
15287 | this.foundation_.updateAdjustElementStyles();
|
15288 | },
|
15289 | enumerable: true,
|
15290 | configurable: true
|
15291 | });
|
15292 | MDCToolbar.prototype.getDefaultFoundation = function() {
|
15293 | var _this = this;
|
15294 | var adapter = {
|
15295 | hasClass: function hasClass(className) {
|
15296 | return _this.root_.classList.contains(className);
|
15297 | },
|
15298 | addClass: function addClass(className) {
|
15299 | return _this.root_.classList.add(className);
|
15300 | },
|
15301 | removeClass: function removeClass(className) {
|
15302 | return _this.root_.classList.remove(className);
|
15303 | },
|
15304 | registerScrollHandler: function registerScrollHandler(handler) {
|
15305 | return window.addEventListener("scroll", handler);
|
15306 | },
|
15307 | deregisterScrollHandler: function deregisterScrollHandler(handler) {
|
15308 | return window.removeEventListener("scroll", handler);
|
15309 | },
|
15310 | registerResizeHandler: function registerResizeHandler(handler) {
|
15311 | return window.addEventListener("resize", handler);
|
15312 | },
|
15313 | deregisterResizeHandler: function deregisterResizeHandler(handler) {
|
15314 | return window.removeEventListener("resize", handler);
|
15315 | },
|
15316 | getViewportWidth: function getViewportWidth() {
|
15317 | return window.innerWidth;
|
15318 | },
|
15319 | getViewportScrollY: function getViewportScrollY() {
|
15320 | return window.pageYOffset;
|
15321 | },
|
15322 | getOffsetHeight: function getOffsetHeight() {
|
15323 | return _this.root_.offsetHeight;
|
15324 | },
|
15325 | getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
|
15326 | return _this.firstRowElement_.offsetHeight;
|
15327 | },
|
15328 | notifyChange: function notifyChange(evtData) {
|
15329 | return _this.emit(strings.CHANGE_EVENT, evtData);
|
15330 | },
|
15331 | setStyle: function setStyle(property, value) {
|
15332 | return _this.root_.style.setProperty(property, value);
|
15333 | },
|
15334 | setStyleForTitleElement: function setStyleForTitleElement(property, value) {
|
15335 | if (_this.titleElement_) {
|
15336 | _this.titleElement_.style.setProperty(property, value);
|
15337 | }
|
15338 | },
|
15339 | setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement(property, value) {
|
15340 | return _this.firstRowElement_.style.setProperty(property, value);
|
15341 | },
|
15342 | setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement(property, value) {
|
15343 | if (_this.fixedAdjustElement) {
|
15344 | _this.fixedAdjustElement.style.setProperty(property, value);
|
15345 | }
|
15346 | }
|
15347 | };
|
15348 | return new foundation_1.MDCToolbarFoundation(adapter);
|
15349 | };
|
15350 | return MDCToolbar;
|
15351 | }(component_1.MDCComponent);
|
15352 | exports.MDCToolbar = MDCToolbar;
|
15353 | }, function(module, exports, __webpack_require__) {
|
15354 | "use strict";
|
15355 | Object.defineProperty(exports, "__esModule", {
|
15356 | value: true
|
15357 | });
|
15358 | exports.cssClasses = {
|
15359 | FIXED: "mdc-toolbar--fixed",
|
15360 | FIXED_AT_LAST_ROW: "mdc-toolbar--fixed-at-last-row",
|
15361 | FIXED_LASTROW: "mdc-toolbar--fixed-lastrow-only",
|
15362 | FLEXIBLE_DEFAULT_BEHAVIOR: "mdc-toolbar--flexible-default-behavior",
|
15363 | FLEXIBLE_MAX: "mdc-toolbar--flexible-space-maximized",
|
15364 | FLEXIBLE_MIN: "mdc-toolbar--flexible-space-minimized",
|
15365 | TOOLBAR_ROW_FLEXIBLE: "mdc-toolbar--flexible"
|
15366 | };
|
15367 | exports.strings = {
|
15368 | CHANGE_EVENT: "MDCToolbar:change",
|
15369 | FIRST_ROW_SELECTOR: ".mdc-toolbar__row:first-child",
|
15370 | ICON_SELECTOR: ".mdc-toolbar__icon",
|
15371 | TITLE_SELECTOR: ".mdc-toolbar__title"
|
15372 | };
|
15373 | exports.numbers = {
|
15374 | MAX_TITLE_SIZE: 2.125,
|
15375 | MIN_TITLE_SIZE: 1.25,
|
15376 | TOOLBAR_MOBILE_BREAKPOINT: 600,
|
15377 | TOOLBAR_ROW_HEIGHT: 64,
|
15378 | TOOLBAR_ROW_MOBILE_HEIGHT: 56
|
15379 | };
|
15380 | }, function(module, exports, __webpack_require__) {
|
15381 | "use strict";
|
15382 | function __export(m) {
|
15383 | for (var p in m) {
|
15384 | if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
15385 | }
|
15386 | }
|
15387 | Object.defineProperty(exports, "__esModule", {
|
15388 | value: true
|
15389 | });
|
15390 | __export(__webpack_require__(162));
|
15391 | __export(__webpack_require__(26));
|
15392 | __export(__webpack_require__(76));
|
15393 | __export(__webpack_require__(77));
|
15394 | __export(__webpack_require__(25));
|
15395 | }, function(module, exports, __webpack_require__) {
|
15396 | "use strict";
|
15397 | var __extends = this && this.__extends || function() {
|
15398 | var _extendStatics = function extendStatics(d, b) {
|
15399 | _extendStatics = Object.setPrototypeOf || {
|
15400 | __proto__: []
|
15401 | } instanceof Array && function(d, b) {
|
15402 | d.__proto__ = b;
|
15403 | } || function(d, b) {
|
15404 | for (var p in b) {
|
15405 | if (b.hasOwnProperty(p)) d[p] = b[p];
|
15406 | }
|
15407 | };
|
15408 | return _extendStatics(d, b);
|
15409 | };
|
15410 | return function(d, b) {
|
15411 | _extendStatics(d, b);
|
15412 | function __() {
|
15413 | this.constructor = d;
|
15414 | }
|
15415 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15416 | };
|
15417 | }();
|
15418 | Object.defineProperty(exports, "__esModule", {
|
15419 | value: true
|
15420 | });
|
15421 | var component_1 = __webpack_require__(1);
|
15422 | var component_2 = __webpack_require__(2);
|
15423 | var constants_1 = __webpack_require__(7);
|
15424 | var foundation_1 = __webpack_require__(76);
|
15425 | var foundation_2 = __webpack_require__(77);
|
15426 | var foundation_3 = __webpack_require__(25);
|
15427 | var MDCTopAppBar = function(_super) {
|
15428 | __extends(MDCTopAppBar, _super);
|
15429 | function MDCTopAppBar() {
|
15430 | return _super !== null && _super.apply(this, arguments) || this;
|
15431 | }
|
15432 | MDCTopAppBar.attachTo = function(root) {
|
15433 | return new MDCTopAppBar(root);
|
15434 | };
|
15435 | MDCTopAppBar.prototype.initialize = function(rippleFactory) {
|
15436 | if (rippleFactory === void 0) {
|
15437 | rippleFactory = function rippleFactory(el) {
|
15438 | return component_2.MDCRipple.attachTo(el);
|
15439 | };
|
15440 | }
|
15441 | this.navIcon_ = this.root_.querySelector(constants_1.strings.NAVIGATION_ICON_SELECTOR);
|
15442 | var icons = [].slice.call(this.root_.querySelectorAll(constants_1.strings.ACTION_ITEM_SELECTOR));
|
15443 | if (this.navIcon_) {
|
15444 | icons.push(this.navIcon_);
|
15445 | }
|
15446 | this.iconRipples_ = icons.map(function(icon) {
|
15447 | var ripple = rippleFactory(icon);
|
15448 | ripple.unbounded = true;
|
15449 | return ripple;
|
15450 | });
|
15451 | this.scrollTarget_ = window;
|
15452 | };
|
15453 | MDCTopAppBar.prototype.destroy = function() {
|
15454 | this.iconRipples_.forEach(function(iconRipple) {
|
15455 | return iconRipple.destroy();
|
15456 | });
|
15457 | _super.prototype.destroy.call(this);
|
15458 | };
|
15459 | MDCTopAppBar.prototype.setScrollTarget = function(target) {
|
15460 | this.foundation_.destroyScrollHandler();
|
15461 | this.scrollTarget_ = target;
|
15462 | this.foundation_.initScrollHandler();
|
15463 | };
|
15464 | MDCTopAppBar.prototype.getDefaultFoundation = function() {
|
15465 | var _this = this;
|
15466 | var adapter = {
|
15467 | hasClass: function hasClass(className) {
|
15468 | return _this.root_.classList.contains(className);
|
15469 | },
|
15470 | addClass: function addClass(className) {
|
15471 | return _this.root_.classList.add(className);
|
15472 | },
|
15473 | removeClass: function removeClass(className) {
|
15474 | return _this.root_.classList.remove(className);
|
15475 | },
|
15476 | setStyle: function setStyle(property, value) {
|
15477 | return _this.root_.style.setProperty(property, value);
|
15478 | },
|
15479 | getTopAppBarHeight: function getTopAppBarHeight() {
|
15480 | return _this.root_.clientHeight;
|
15481 | },
|
15482 | registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler(evtType, handler) {
|
15483 | if (_this.navIcon_) {
|
15484 | _this.navIcon_.addEventListener(evtType, handler);
|
15485 | }
|
15486 | },
|
15487 | deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler(evtType, handler) {
|
15488 | if (_this.navIcon_) {
|
15489 | _this.navIcon_.removeEventListener(evtType, handler);
|
15490 | }
|
15491 | },
|
15492 | notifyNavigationIconClicked: function notifyNavigationIconClicked() {
|
15493 | return _this.emit(constants_1.strings.NAVIGATION_EVENT, {});
|
15494 | },
|
15495 | registerScrollHandler: function registerScrollHandler(handler) {
|
15496 | return _this.scrollTarget_.addEventListener("scroll", handler);
|
15497 | },
|
15498 | deregisterScrollHandler: function deregisterScrollHandler(handler) {
|
15499 | return _this.scrollTarget_.removeEventListener("scroll", handler);
|
15500 | },
|
15501 | registerResizeHandler: function registerResizeHandler(handler) {
|
15502 | return window.addEventListener("resize", handler);
|
15503 | },
|
15504 | deregisterResizeHandler: function deregisterResizeHandler(handler) {
|
15505 | return window.removeEventListener("resize", handler);
|
15506 | },
|
15507 | getViewportScrollY: function getViewportScrollY() {
|
15508 | var win = _this.scrollTarget_;
|
15509 | var el = _this.scrollTarget_;
|
15510 | return win.pageYOffset !== undefined ? win.pageYOffset : el.scrollTop;
|
15511 | },
|
15512 | getTotalActionItems: function getTotalActionItems() {
|
15513 | return _this.root_.querySelectorAll(constants_1.strings.ACTION_ITEM_SELECTOR).length;
|
15514 | }
|
15515 | };
|
15516 | var foundation;
|
15517 | if (this.root_.classList.contains(constants_1.cssClasses.SHORT_CLASS)) {
|
15518 | foundation = new foundation_2.MDCShortTopAppBarFoundation(adapter);
|
15519 | } else if (this.root_.classList.contains(constants_1.cssClasses.FIXED_CLASS)) {
|
15520 | foundation = new foundation_1.MDCFixedTopAppBarFoundation(adapter);
|
15521 | } else {
|
15522 | foundation = new foundation_3.MDCTopAppBarFoundation(adapter);
|
15523 | }
|
15524 | return foundation;
|
15525 | };
|
15526 | return MDCTopAppBar;
|
15527 | }(component_1.MDCComponent);
|
15528 | exports.MDCTopAppBar = MDCTopAppBar;
|
15529 | } ]);
|
15530 | });
|
15531 |
|
\ | No newline at end of file |