1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | (function webpackUniversalModuleDefinition(root, factory) {
|
9 | if(typeof exports === 'object' && typeof module === 'object')
|
10 | module.exports = factory();
|
11 | else if(typeof define === 'function' && define.amd)
|
12 | define("@material/textfield", [], factory);
|
13 | else if(typeof exports === 'object')
|
14 | exports["textfield"] = factory();
|
15 | else
|
16 | root["mdc"] = root["mdc"] || {}, root["mdc"]["textfield"] = factory();
|
17 | })(this, function() {
|
18 | return (function(modules) {
|
19 |
|
20 | var installedModules = {};
|
21 |
|
22 |
|
23 | function __webpack_require__(moduleId) {
|
24 |
|
25 |
|
26 | if(installedModules[moduleId]) {
|
27 | return installedModules[moduleId].exports;
|
28 | }
|
29 |
|
30 | var module = installedModules[moduleId] = {
|
31 | i: moduleId,
|
32 | l: false,
|
33 | exports: {}
|
34 | };
|
35 |
|
36 |
|
37 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
38 |
|
39 |
|
40 | module.l = true;
|
41 |
|
42 |
|
43 | return module.exports;
|
44 | }
|
45 |
|
46 |
|
47 |
|
48 | __webpack_require__.m = modules;
|
49 |
|
50 |
|
51 | __webpack_require__.c = installedModules;
|
52 |
|
53 |
|
54 | __webpack_require__.d = function(exports, name, getter) {
|
55 | if(!__webpack_require__.o(exports, name)) {
|
56 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
57 | }
|
58 | };
|
59 |
|
60 |
|
61 | __webpack_require__.r = function(exports) {
|
62 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
63 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
64 | }
|
65 | Object.defineProperty(exports, '__esModule', { value: true });
|
66 | };
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | __webpack_require__.t = function(value, mode) {
|
74 | if(mode & 1) value = __webpack_require__(value);
|
75 | if(mode & 8) return value;
|
76 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
77 | var ns = Object.create(null);
|
78 | __webpack_require__.r(ns);
|
79 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
80 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
81 | return ns;
|
82 | };
|
83 |
|
84 |
|
85 | __webpack_require__.n = function(module) {
|
86 | var getter = module && module.__esModule ?
|
87 | function getDefault() { return module['default']; } :
|
88 | function getModuleExports() { return module; };
|
89 | __webpack_require__.d(getter, 'a', getter);
|
90 | return getter;
|
91 | };
|
92 |
|
93 |
|
94 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
95 |
|
96 |
|
97 | __webpack_require__.p = "";
|
98 |
|
99 |
|
100 |
|
101 | return __webpack_require__(__webpack_require__.s = "./packages/mdc-textfield/index.ts");
|
102 | })
|
103 |
|
104 | ({
|
105 |
|
106 | "./packages/mdc-base/component.ts":
|
107 |
|
108 |
|
109 |
|
110 |
|
111 | (function(module, exports, __webpack_require__) {
|
112 |
|
113 | "use strict";
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 | var __read = this && this.__read || function (o, n) {
|
139 | var m = typeof Symbol === "function" && o[Symbol.iterator];
|
140 | if (!m) return o;
|
141 | var i = m.call(o),
|
142 | r,
|
143 | ar = [],
|
144 | e;
|
145 | try {
|
146 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
147 | ar.push(r.value);
|
148 | }
|
149 | } catch (error) {
|
150 | e = { error: error };
|
151 | } finally {
|
152 | try {
|
153 | if (r && !r.done && (m = i["return"])) m.call(i);
|
154 | } finally {
|
155 | if (e) throw e.error;
|
156 | }
|
157 | }
|
158 | return ar;
|
159 | };
|
160 | var __spreadArray = this && this.__spreadArray || function (to, from) {
|
161 | for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {
|
162 | to[j] = from[i];
|
163 | }return to;
|
164 | };
|
165 | Object.defineProperty(exports, "__esModule", { value: true });
|
166 | exports.MDCComponent = void 0;
|
167 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
168 | var MDCComponent = function () {
|
169 | function MDCComponent(root, foundation) {
|
170 | var args = [];
|
171 | for (var _i = 2; _i < arguments.length; _i++) {
|
172 | args[_i - 2] = arguments[_i];
|
173 | }
|
174 | this.root = root;
|
175 | this.initialize.apply(this, __spreadArray([], __read(args)));
|
176 |
|
177 |
|
178 |
|
179 | this.foundation = foundation === undefined ? this.getDefaultFoundation() : foundation;
|
180 | this.foundation.init();
|
181 | this.initialSyncWithDOM();
|
182 | }
|
183 | MDCComponent.attachTo = function (root) {
|
184 |
|
185 |
|
186 |
|
187 |
|
188 | return new MDCComponent(root, new foundation_1.MDCFoundation({}));
|
189 | };
|
190 |
|
191 | MDCComponent.prototype.initialize = function () {
|
192 | var _args = [];
|
193 | for (var _i = 0; _i < arguments.length; _i++) {
|
194 | _args[_i] = arguments[_i];
|
195 | }
|
196 |
|
197 |
|
198 |
|
199 | };
|
200 | MDCComponent.prototype.getDefaultFoundation = function () {
|
201 |
|
202 |
|
203 | throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class');
|
204 | };
|
205 | MDCComponent.prototype.initialSyncWithDOM = function () {
|
206 |
|
207 |
|
208 |
|
209 |
|
210 | };
|
211 | MDCComponent.prototype.destroy = function () {
|
212 |
|
213 |
|
214 | this.foundation.destroy();
|
215 | };
|
216 | MDCComponent.prototype.listen = function (evtType, handler, options) {
|
217 | this.root.addEventListener(evtType, handler, options);
|
218 | };
|
219 | MDCComponent.prototype.unlisten = function (evtType, handler, options) {
|
220 | this.root.removeEventListener(evtType, handler, options);
|
221 | };
|
222 | |
223 |
|
224 |
|
225 | MDCComponent.prototype.emit = function (evtType, evtData, shouldBubble) {
|
226 | if (shouldBubble === void 0) {
|
227 | shouldBubble = false;
|
228 | }
|
229 | var evt;
|
230 | if (typeof CustomEvent === 'function') {
|
231 | evt = new CustomEvent(evtType, {
|
232 | bubbles: shouldBubble,
|
233 | detail: evtData
|
234 | });
|
235 | } else {
|
236 | evt = document.createEvent('CustomEvent');
|
237 | evt.initCustomEvent(evtType, shouldBubble, false, evtData);
|
238 | }
|
239 | this.root.dispatchEvent(evt);
|
240 | };
|
241 | return MDCComponent;
|
242 | }();
|
243 | exports.MDCComponent = MDCComponent;
|
244 |
|
245 | exports.default = MDCComponent;
|
246 |
|
247 | }),
|
248 |
|
249 | "./packages/mdc-base/foundation.ts":
|
250 |
|
251 |
|
252 |
|
253 |
|
254 | (function(module, exports, __webpack_require__) {
|
255 |
|
256 | "use strict";
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 | Object.defineProperty(exports, "__esModule", { value: true });
|
282 | exports.MDCFoundation = void 0;
|
283 | var MDCFoundation = function () {
|
284 | function MDCFoundation(adapter) {
|
285 | if (adapter === void 0) {
|
286 | adapter = {};
|
287 | }
|
288 | this.adapter = adapter;
|
289 | }
|
290 | Object.defineProperty(MDCFoundation, "cssClasses", {
|
291 | get: function get() {
|
292 |
|
293 |
|
294 | return {};
|
295 | },
|
296 | enumerable: false,
|
297 | configurable: true
|
298 | });
|
299 | Object.defineProperty(MDCFoundation, "strings", {
|
300 | get: function get() {
|
301 |
|
302 |
|
303 | return {};
|
304 | },
|
305 | enumerable: false,
|
306 | configurable: true
|
307 | });
|
308 | Object.defineProperty(MDCFoundation, "numbers", {
|
309 | get: function get() {
|
310 |
|
311 |
|
312 | return {};
|
313 | },
|
314 | enumerable: false,
|
315 | configurable: true
|
316 | });
|
317 | Object.defineProperty(MDCFoundation, "defaultAdapter", {
|
318 | get: function get() {
|
319 |
|
320 |
|
321 |
|
322 | return {};
|
323 | },
|
324 | enumerable: false,
|
325 | configurable: true
|
326 | });
|
327 | MDCFoundation.prototype.init = function () {
|
328 |
|
329 | };
|
330 | MDCFoundation.prototype.destroy = function () {
|
331 |
|
332 | };
|
333 | return MDCFoundation;
|
334 | }();
|
335 | exports.MDCFoundation = MDCFoundation;
|
336 |
|
337 | exports.default = MDCFoundation;
|
338 |
|
339 | }),
|
340 |
|
341 | "./packages/mdc-dom/events.ts":
|
342 |
|
343 |
|
344 |
|
345 |
|
346 | (function(module, exports, __webpack_require__) {
|
347 |
|
348 | "use strict";
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 | Object.defineProperty(exports, "__esModule", { value: true });
|
374 | exports.applyPassive = void 0;
|
375 |
|
376 |
|
377 |
|
378 |
|
379 | function applyPassive(globalObj) {
|
380 | if (globalObj === void 0) {
|
381 | globalObj = window;
|
382 | }
|
383 | return supportsPassiveOption(globalObj) ? { passive: true } : false;
|
384 | }
|
385 | exports.applyPassive = applyPassive;
|
386 | function supportsPassiveOption(globalObj) {
|
387 | if (globalObj === void 0) {
|
388 | globalObj = window;
|
389 | }
|
390 |
|
391 |
|
392 | var passiveSupported = false;
|
393 | try {
|
394 | var options = {
|
395 |
|
396 |
|
397 | get passive() {
|
398 | passiveSupported = true;
|
399 | return false;
|
400 | }
|
401 | };
|
402 | var handler = function handler() {};
|
403 | globalObj.document.addEventListener('test', handler, options);
|
404 | globalObj.document.removeEventListener('test', handler, options);
|
405 | } catch (err) {
|
406 | passiveSupported = false;
|
407 | }
|
408 | return passiveSupported;
|
409 | }
|
410 |
|
411 | }),
|
412 |
|
413 | "./packages/mdc-dom/ponyfill.ts":
|
414 |
|
415 |
|
416 |
|
417 |
|
418 | (function(module, exports, __webpack_require__) {
|
419 |
|
420 | "use strict";
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 | Object.defineProperty(exports, "__esModule", { value: true });
|
446 | exports.estimateScrollWidth = exports.matches = exports.closest = void 0;
|
447 |
|
448 |
|
449 |
|
450 |
|
451 | function closest(element, selector) {
|
452 | if (element.closest) {
|
453 | return element.closest(selector);
|
454 | }
|
455 | var el = element;
|
456 | while (el) {
|
457 | if (matches(el, selector)) {
|
458 | return el;
|
459 | }
|
460 | el = el.parentElement;
|
461 | }
|
462 | return null;
|
463 | }
|
464 | exports.closest = closest;
|
465 | function matches(element, selector) {
|
466 | var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
|
467 | return nativeMatches.call(element, selector);
|
468 | }
|
469 | exports.matches = matches;
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 | function estimateScrollWidth(element) {
|
479 |
|
480 |
|
481 |
|
482 |
|
483 | var htmlEl = element;
|
484 | if (htmlEl.offsetParent !== null) {
|
485 | return htmlEl.scrollWidth;
|
486 | }
|
487 | var clone = htmlEl.cloneNode(true);
|
488 | clone.style.setProperty('position', 'absolute');
|
489 | clone.style.setProperty('transform', 'translate(-9999px, -9999px)');
|
490 | document.documentElement.appendChild(clone);
|
491 | var scrollWidth = clone.scrollWidth;
|
492 | document.documentElement.removeChild(clone);
|
493 | return scrollWidth;
|
494 | }
|
495 | exports.estimateScrollWidth = estimateScrollWidth;
|
496 |
|
497 | }),
|
498 |
|
499 | "./packages/mdc-floating-label/component.ts":
|
500 |
|
501 |
|
502 |
|
503 |
|
504 | (function(module, exports, __webpack_require__) {
|
505 |
|
506 | "use strict";
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 | var __extends = this && this.__extends || function () {
|
532 | var _extendStatics = function extendStatics(d, b) {
|
533 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
534 | d.__proto__ = b;
|
535 | } || function (d, b) {
|
536 | for (var p in b) {
|
537 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
538 | }
|
539 | };
|
540 | return _extendStatics(d, b);
|
541 | };
|
542 | return function (d, b) {
|
543 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
544 | _extendStatics(d, b);
|
545 | function __() {
|
546 | this.constructor = d;
|
547 | }
|
548 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
549 | };
|
550 | }();
|
551 | Object.defineProperty(exports, "__esModule", { value: true });
|
552 | exports.MDCFloatingLabel = void 0;
|
553 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
554 | var ponyfill_1 = __webpack_require__( "./packages/mdc-dom/ponyfill.ts");
|
555 | var foundation_1 = __webpack_require__( "./packages/mdc-floating-label/foundation.ts");
|
556 | var MDCFloatingLabel = function (_super) {
|
557 | __extends(MDCFloatingLabel, _super);
|
558 | function MDCFloatingLabel() {
|
559 | return _super !== null && _super.apply(this, arguments) || this;
|
560 | }
|
561 | MDCFloatingLabel.attachTo = function (root) {
|
562 | return new MDCFloatingLabel(root);
|
563 | };
|
564 | |
565 |
|
566 |
|
567 |
|
568 | MDCFloatingLabel.prototype.shake = function (shouldShake) {
|
569 | this.foundation.shake(shouldShake);
|
570 | };
|
571 | |
572 |
|
573 |
|
574 |
|
575 | MDCFloatingLabel.prototype.float = function (shouldFloat) {
|
576 | this.foundation.float(shouldFloat);
|
577 | };
|
578 | |
579 |
|
580 |
|
581 |
|
582 | MDCFloatingLabel.prototype.setRequired = function (isRequired) {
|
583 | this.foundation.setRequired(isRequired);
|
584 | };
|
585 | MDCFloatingLabel.prototype.getWidth = function () {
|
586 | return this.foundation.getWidth();
|
587 | };
|
588 | MDCFloatingLabel.prototype.getDefaultFoundation = function () {
|
589 | var _this = this;
|
590 |
|
591 |
|
592 |
|
593 | var adapter = {
|
594 | addClass: function addClass(className) {
|
595 | return _this.root.classList.add(className);
|
596 | },
|
597 | removeClass: function removeClass(className) {
|
598 | return _this.root.classList.remove(className);
|
599 | },
|
600 | getWidth: function getWidth() {
|
601 | return ponyfill_1.estimateScrollWidth(_this.root);
|
602 | },
|
603 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
604 | return _this.listen(evtType, handler);
|
605 | },
|
606 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
607 | return _this.unlisten(evtType, handler);
|
608 | }
|
609 | };
|
610 |
|
611 | return new foundation_1.MDCFloatingLabelFoundation(adapter);
|
612 | };
|
613 | return MDCFloatingLabel;
|
614 | }(component_1.MDCComponent);
|
615 | exports.MDCFloatingLabel = MDCFloatingLabel;
|
616 |
|
617 | }),
|
618 |
|
619 | "./packages/mdc-floating-label/constants.ts":
|
620 |
|
621 |
|
622 |
|
623 |
|
624 | (function(module, exports, __webpack_require__) {
|
625 |
|
626 | "use strict";
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 |
|
649 |
|
650 |
|
651 | Object.defineProperty(exports, "__esModule", { value: true });
|
652 | exports.cssClasses = void 0;
|
653 | exports.cssClasses = {
|
654 | LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above',
|
655 | LABEL_REQUIRED: 'mdc-floating-label--required',
|
656 | LABEL_SHAKE: 'mdc-floating-label--shake',
|
657 | ROOT: 'mdc-floating-label'
|
658 | };
|
659 |
|
660 | }),
|
661 |
|
662 | "./packages/mdc-floating-label/foundation.ts":
|
663 |
|
664 |
|
665 |
|
666 |
|
667 | (function(module, exports, __webpack_require__) {
|
668 |
|
669 | "use strict";
|
670 |
|
671 |
|
672 |
|
673 |
|
674 |
|
675 |
|
676 |
|
677 |
|
678 |
|
679 |
|
680 |
|
681 |
|
682 |
|
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 |
|
694 | var __extends = this && this.__extends || function () {
|
695 | var _extendStatics = function extendStatics(d, b) {
|
696 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
697 | d.__proto__ = b;
|
698 | } || function (d, b) {
|
699 | for (var p in b) {
|
700 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
701 | }
|
702 | };
|
703 | return _extendStatics(d, b);
|
704 | };
|
705 | return function (d, b) {
|
706 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
707 | _extendStatics(d, b);
|
708 | function __() {
|
709 | this.constructor = d;
|
710 | }
|
711 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
712 | };
|
713 | }();
|
714 | var __assign = this && this.__assign || function () {
|
715 | __assign = Object.assign || function (t) {
|
716 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
717 | s = arguments[i];
|
718 | for (var p in s) {
|
719 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
720 | }
|
721 | }
|
722 | return t;
|
723 | };
|
724 | return __assign.apply(this, arguments);
|
725 | };
|
726 | Object.defineProperty(exports, "__esModule", { value: true });
|
727 | exports.MDCFloatingLabelFoundation = void 0;
|
728 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
729 | var constants_1 = __webpack_require__( "./packages/mdc-floating-label/constants.ts");
|
730 | var MDCFloatingLabelFoundation = function (_super) {
|
731 | __extends(MDCFloatingLabelFoundation, _super);
|
732 | function MDCFloatingLabelFoundation(adapter) {
|
733 | var _this = _super.call(this, __assign(__assign({}, MDCFloatingLabelFoundation.defaultAdapter), adapter)) || this;
|
734 | _this.shakeAnimationEndHandler = function () {
|
735 | _this.handleShakeAnimationEnd();
|
736 | };
|
737 | return _this;
|
738 | }
|
739 | Object.defineProperty(MDCFloatingLabelFoundation, "cssClasses", {
|
740 | get: function get() {
|
741 | return constants_1.cssClasses;
|
742 | },
|
743 | enumerable: false,
|
744 | configurable: true
|
745 | });
|
746 | Object.defineProperty(MDCFloatingLabelFoundation, "defaultAdapter", {
|
747 | |
748 |
|
749 |
|
750 | get: function get() {
|
751 |
|
752 | return {
|
753 | addClass: function addClass() {
|
754 | return undefined;
|
755 | },
|
756 | removeClass: function removeClass() {
|
757 | return undefined;
|
758 | },
|
759 | getWidth: function getWidth() {
|
760 | return 0;
|
761 | },
|
762 | registerInteractionHandler: function registerInteractionHandler() {
|
763 | return undefined;
|
764 | },
|
765 | deregisterInteractionHandler: function deregisterInteractionHandler() {
|
766 | return undefined;
|
767 | }
|
768 | };
|
769 |
|
770 | },
|
771 | enumerable: false,
|
772 | configurable: true
|
773 | });
|
774 | MDCFloatingLabelFoundation.prototype.init = function () {
|
775 | this.adapter.registerInteractionHandler('animationend', this.shakeAnimationEndHandler);
|
776 | };
|
777 | MDCFloatingLabelFoundation.prototype.destroy = function () {
|
778 | this.adapter.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler);
|
779 | };
|
780 | |
781 |
|
782 |
|
783 | MDCFloatingLabelFoundation.prototype.getWidth = function () {
|
784 | return this.adapter.getWidth();
|
785 | };
|
786 | |
787 |
|
788 |
|
789 |
|
790 | MDCFloatingLabelFoundation.prototype.shake = function (shouldShake) {
|
791 | var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
|
792 | if (shouldShake) {
|
793 | this.adapter.addClass(LABEL_SHAKE);
|
794 | } else {
|
795 | this.adapter.removeClass(LABEL_SHAKE);
|
796 | }
|
797 | };
|
798 | |
799 |
|
800 |
|
801 |
|
802 | MDCFloatingLabelFoundation.prototype.float = function (shouldFloat) {
|
803 | var _a = MDCFloatingLabelFoundation.cssClasses,
|
804 | LABEL_FLOAT_ABOVE = _a.LABEL_FLOAT_ABOVE,
|
805 | LABEL_SHAKE = _a.LABEL_SHAKE;
|
806 | if (shouldFloat) {
|
807 | this.adapter.addClass(LABEL_FLOAT_ABOVE);
|
808 | } else {
|
809 | this.adapter.removeClass(LABEL_FLOAT_ABOVE);
|
810 | this.adapter.removeClass(LABEL_SHAKE);
|
811 | }
|
812 | };
|
813 | |
814 |
|
815 |
|
816 |
|
817 | MDCFloatingLabelFoundation.prototype.setRequired = function (isRequired) {
|
818 | var LABEL_REQUIRED = MDCFloatingLabelFoundation.cssClasses.LABEL_REQUIRED;
|
819 | if (isRequired) {
|
820 | this.adapter.addClass(LABEL_REQUIRED);
|
821 | } else {
|
822 | this.adapter.removeClass(LABEL_REQUIRED);
|
823 | }
|
824 | };
|
825 | MDCFloatingLabelFoundation.prototype.handleShakeAnimationEnd = function () {
|
826 | var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
|
827 | this.adapter.removeClass(LABEL_SHAKE);
|
828 | };
|
829 | return MDCFloatingLabelFoundation;
|
830 | }(foundation_1.MDCFoundation);
|
831 | exports.MDCFloatingLabelFoundation = MDCFloatingLabelFoundation;
|
832 |
|
833 | exports.default = MDCFloatingLabelFoundation;
|
834 |
|
835 | }),
|
836 |
|
837 | "./packages/mdc-line-ripple/component.ts":
|
838 |
|
839 |
|
840 |
|
841 |
|
842 | (function(module, exports, __webpack_require__) {
|
843 |
|
844 | "use strict";
|
845 |
|
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 | var __extends = this && this.__extends || function () {
|
870 | var _extendStatics = function extendStatics(d, b) {
|
871 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
872 | d.__proto__ = b;
|
873 | } || function (d, b) {
|
874 | for (var p in b) {
|
875 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
876 | }
|
877 | };
|
878 | return _extendStatics(d, b);
|
879 | };
|
880 | return function (d, b) {
|
881 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
882 | _extendStatics(d, b);
|
883 | function __() {
|
884 | this.constructor = d;
|
885 | }
|
886 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
887 | };
|
888 | }();
|
889 | Object.defineProperty(exports, "__esModule", { value: true });
|
890 | exports.MDCLineRipple = void 0;
|
891 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
892 | var foundation_1 = __webpack_require__( "./packages/mdc-line-ripple/foundation.ts");
|
893 | var MDCLineRipple = function (_super) {
|
894 | __extends(MDCLineRipple, _super);
|
895 | function MDCLineRipple() {
|
896 | return _super !== null && _super.apply(this, arguments) || this;
|
897 | }
|
898 | MDCLineRipple.attachTo = function (root) {
|
899 | return new MDCLineRipple(root);
|
900 | };
|
901 | |
902 |
|
903 |
|
904 | MDCLineRipple.prototype.activate = function () {
|
905 | this.foundation.activate();
|
906 | };
|
907 | |
908 |
|
909 |
|
910 | MDCLineRipple.prototype.deactivate = function () {
|
911 | this.foundation.deactivate();
|
912 | };
|
913 | |
914 |
|
915 |
|
916 |
|
917 | MDCLineRipple.prototype.setRippleCenter = function (xCoordinate) {
|
918 | this.foundation.setRippleCenter(xCoordinate);
|
919 | };
|
920 | MDCLineRipple.prototype.getDefaultFoundation = function () {
|
921 | var _this = this;
|
922 |
|
923 |
|
924 |
|
925 | var adapter = {
|
926 | addClass: function addClass(className) {
|
927 | return _this.root.classList.add(className);
|
928 | },
|
929 | removeClass: function removeClass(className) {
|
930 | return _this.root.classList.remove(className);
|
931 | },
|
932 | hasClass: function hasClass(className) {
|
933 | return _this.root.classList.contains(className);
|
934 | },
|
935 | setStyle: function setStyle(propertyName, value) {
|
936 | return _this.root.style.setProperty(propertyName, value);
|
937 | },
|
938 | registerEventHandler: function registerEventHandler(evtType, handler) {
|
939 | return _this.listen(evtType, handler);
|
940 | },
|
941 | deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
|
942 | return _this.unlisten(evtType, handler);
|
943 | }
|
944 | };
|
945 |
|
946 | return new foundation_1.MDCLineRippleFoundation(adapter);
|
947 | };
|
948 | return MDCLineRipple;
|
949 | }(component_1.MDCComponent);
|
950 | exports.MDCLineRipple = MDCLineRipple;
|
951 |
|
952 | }),
|
953 |
|
954 | "./packages/mdc-line-ripple/constants.ts":
|
955 |
|
956 |
|
957 |
|
958 |
|
959 | (function(module, exports, __webpack_require__) {
|
960 |
|
961 | "use strict";
|
962 |
|
963 |
|
964 |
|
965 |
|
966 |
|
967 |
|
968 |
|
969 |
|
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 |
|
976 |
|
977 |
|
978 |
|
979 |
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 |
|
986 | Object.defineProperty(exports, "__esModule", { value: true });
|
987 | exports.cssClasses = void 0;
|
988 | var cssClasses = {
|
989 | LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active',
|
990 | LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating'
|
991 | };
|
992 | exports.cssClasses = cssClasses;
|
993 |
|
994 | }),
|
995 |
|
996 | "./packages/mdc-line-ripple/foundation.ts":
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 | (function(module, exports, __webpack_require__) {
|
1002 |
|
1003 | "use strict";
|
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 |
|
1027 |
|
1028 | var __extends = this && this.__extends || function () {
|
1029 | var _extendStatics = function extendStatics(d, b) {
|
1030 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
1031 | d.__proto__ = b;
|
1032 | } || function (d, b) {
|
1033 | for (var p in b) {
|
1034 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
1035 | }
|
1036 | };
|
1037 | return _extendStatics(d, b);
|
1038 | };
|
1039 | return function (d, b) {
|
1040 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
1041 | _extendStatics(d, b);
|
1042 | function __() {
|
1043 | this.constructor = d;
|
1044 | }
|
1045 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
1046 | };
|
1047 | }();
|
1048 | var __assign = this && this.__assign || function () {
|
1049 | __assign = Object.assign || function (t) {
|
1050 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
1051 | s = arguments[i];
|
1052 | for (var p in s) {
|
1053 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
1054 | }
|
1055 | }
|
1056 | return t;
|
1057 | };
|
1058 | return __assign.apply(this, arguments);
|
1059 | };
|
1060 | Object.defineProperty(exports, "__esModule", { value: true });
|
1061 | exports.MDCLineRippleFoundation = void 0;
|
1062 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
1063 | var constants_1 = __webpack_require__( "./packages/mdc-line-ripple/constants.ts");
|
1064 | var MDCLineRippleFoundation = function (_super) {
|
1065 | __extends(MDCLineRippleFoundation, _super);
|
1066 | function MDCLineRippleFoundation(adapter) {
|
1067 | var _this = _super.call(this, __assign(__assign({}, MDCLineRippleFoundation.defaultAdapter), adapter)) || this;
|
1068 | _this.transitionEndHandler = function (evt) {
|
1069 | _this.handleTransitionEnd(evt);
|
1070 | };
|
1071 | return _this;
|
1072 | }
|
1073 | Object.defineProperty(MDCLineRippleFoundation, "cssClasses", {
|
1074 | get: function get() {
|
1075 | return constants_1.cssClasses;
|
1076 | },
|
1077 | enumerable: false,
|
1078 | configurable: true
|
1079 | });
|
1080 | Object.defineProperty(MDCLineRippleFoundation, "defaultAdapter", {
|
1081 | |
1082 |
|
1083 |
|
1084 | get: function get() {
|
1085 |
|
1086 | return {
|
1087 | addClass: function addClass() {
|
1088 | return undefined;
|
1089 | },
|
1090 | removeClass: function removeClass() {
|
1091 | return undefined;
|
1092 | },
|
1093 | hasClass: function hasClass() {
|
1094 | return false;
|
1095 | },
|
1096 | setStyle: function setStyle() {
|
1097 | return undefined;
|
1098 | },
|
1099 | registerEventHandler: function registerEventHandler() {
|
1100 | return undefined;
|
1101 | },
|
1102 | deregisterEventHandler: function deregisterEventHandler() {
|
1103 | return undefined;
|
1104 | }
|
1105 | };
|
1106 |
|
1107 | },
|
1108 | enumerable: false,
|
1109 | configurable: true
|
1110 | });
|
1111 | MDCLineRippleFoundation.prototype.init = function () {
|
1112 | this.adapter.registerEventHandler('transitionend', this.transitionEndHandler);
|
1113 | };
|
1114 | MDCLineRippleFoundation.prototype.destroy = function () {
|
1115 | this.adapter.deregisterEventHandler('transitionend', this.transitionEndHandler);
|
1116 | };
|
1117 | MDCLineRippleFoundation.prototype.activate = function () {
|
1118 | this.adapter.removeClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
|
1119 | this.adapter.addClass(constants_1.cssClasses.LINE_RIPPLE_ACTIVE);
|
1120 | };
|
1121 | MDCLineRippleFoundation.prototype.setRippleCenter = function (xCoordinate) {
|
1122 | this.adapter.setStyle('transform-origin', xCoordinate + "px center");
|
1123 | };
|
1124 | MDCLineRippleFoundation.prototype.deactivate = function () {
|
1125 | this.adapter.addClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
|
1126 | };
|
1127 | MDCLineRippleFoundation.prototype.handleTransitionEnd = function (evt) {
|
1128 |
|
1129 |
|
1130 | var isDeactivating = this.adapter.hasClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
|
1131 | if (evt.propertyName === 'opacity') {
|
1132 | if (isDeactivating) {
|
1133 | this.adapter.removeClass(constants_1.cssClasses.LINE_RIPPLE_ACTIVE);
|
1134 | this.adapter.removeClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
|
1135 | }
|
1136 | }
|
1137 | };
|
1138 | return MDCLineRippleFoundation;
|
1139 | }(foundation_1.MDCFoundation);
|
1140 | exports.MDCLineRippleFoundation = MDCLineRippleFoundation;
|
1141 |
|
1142 | exports.default = MDCLineRippleFoundation;
|
1143 |
|
1144 | }),
|
1145 |
|
1146 | "./packages/mdc-notched-outline/component.ts":
|
1147 |
|
1148 |
|
1149 |
|
1150 |
|
1151 | (function(module, exports, __webpack_require__) {
|
1152 |
|
1153 | "use strict";
|
1154 |
|
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 |
|
1167 |
|
1168 |
|
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 |
|
1176 |
|
1177 |
|
1178 | var __extends = this && this.__extends || function () {
|
1179 | var _extendStatics = function extendStatics(d, b) {
|
1180 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
1181 | d.__proto__ = b;
|
1182 | } || function (d, b) {
|
1183 | for (var p in b) {
|
1184 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
1185 | }
|
1186 | };
|
1187 | return _extendStatics(d, b);
|
1188 | };
|
1189 | return function (d, b) {
|
1190 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
1191 | _extendStatics(d, b);
|
1192 | function __() {
|
1193 | this.constructor = d;
|
1194 | }
|
1195 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
1196 | };
|
1197 | }();
|
1198 | Object.defineProperty(exports, "__esModule", { value: true });
|
1199 | exports.MDCNotchedOutline = void 0;
|
1200 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
1201 | var foundation_1 = __webpack_require__( "./packages/mdc-floating-label/foundation.ts");
|
1202 | var constants_1 = __webpack_require__( "./packages/mdc-notched-outline/constants.ts");
|
1203 | var foundation_2 = __webpack_require__( "./packages/mdc-notched-outline/foundation.ts");
|
1204 | var MDCNotchedOutline = function (_super) {
|
1205 | __extends(MDCNotchedOutline, _super);
|
1206 | function MDCNotchedOutline() {
|
1207 | return _super !== null && _super.apply(this, arguments) || this;
|
1208 | }
|
1209 | MDCNotchedOutline.attachTo = function (root) {
|
1210 | return new MDCNotchedOutline(root);
|
1211 | };
|
1212 | MDCNotchedOutline.prototype.initialSyncWithDOM = function () {
|
1213 | this.notchElement = this.root.querySelector(constants_1.strings.NOTCH_ELEMENT_SELECTOR);
|
1214 | var label = this.root.querySelector('.' + foundation_1.MDCFloatingLabelFoundation.cssClasses.ROOT);
|
1215 | if (label) {
|
1216 | label.style.transitionDuration = '0s';
|
1217 | this.root.classList.add(constants_1.cssClasses.OUTLINE_UPGRADED);
|
1218 | requestAnimationFrame(function () {
|
1219 | label.style.transitionDuration = '';
|
1220 | });
|
1221 | } else {
|
1222 | this.root.classList.add(constants_1.cssClasses.NO_LABEL);
|
1223 | }
|
1224 | };
|
1225 | |
1226 |
|
1227 |
|
1228 |
|
1229 | MDCNotchedOutline.prototype.notch = function (notchWidth) {
|
1230 | this.foundation.notch(notchWidth);
|
1231 | };
|
1232 | |
1233 |
|
1234 |
|
1235 | MDCNotchedOutline.prototype.closeNotch = function () {
|
1236 | this.foundation.closeNotch();
|
1237 | };
|
1238 | MDCNotchedOutline.prototype.getDefaultFoundation = function () {
|
1239 | var _this = this;
|
1240 |
|
1241 |
|
1242 |
|
1243 | var adapter = {
|
1244 | addClass: function addClass(className) {
|
1245 | return _this.root.classList.add(className);
|
1246 | },
|
1247 | removeClass: function removeClass(className) {
|
1248 | return _this.root.classList.remove(className);
|
1249 | },
|
1250 | setNotchWidthProperty: function setNotchWidthProperty(width) {
|
1251 | _this.notchElement.style.setProperty('width', width + 'px');
|
1252 | },
|
1253 | removeNotchWidthProperty: function removeNotchWidthProperty() {
|
1254 | _this.notchElement.style.removeProperty('width');
|
1255 | }
|
1256 | };
|
1257 |
|
1258 | return new foundation_2.MDCNotchedOutlineFoundation(adapter);
|
1259 | };
|
1260 | return MDCNotchedOutline;
|
1261 | }(component_1.MDCComponent);
|
1262 | exports.MDCNotchedOutline = MDCNotchedOutline;
|
1263 |
|
1264 | }),
|
1265 |
|
1266 | "./packages/mdc-notched-outline/constants.ts":
|
1267 |
|
1268 |
|
1269 |
|
1270 |
|
1271 | (function(module, exports, __webpack_require__) {
|
1272 |
|
1273 | "use strict";
|
1274 |
|
1275 |
|
1276 |
|
1277 |
|
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 |
|
1284 |
|
1285 |
|
1286 |
|
1287 |
|
1288 |
|
1289 |
|
1290 |
|
1291 |
|
1292 |
|
1293 |
|
1294 |
|
1295 |
|
1296 |
|
1297 |
|
1298 | Object.defineProperty(exports, "__esModule", { value: true });
|
1299 | exports.strings = exports.numbers = exports.cssClasses = void 0;
|
1300 | var strings = {
|
1301 | NOTCH_ELEMENT_SELECTOR: '.mdc-notched-outline__notch'
|
1302 | };
|
1303 | exports.strings = strings;
|
1304 | var numbers = {
|
1305 |
|
1306 | NOTCH_ELEMENT_PADDING: 8
|
1307 | };
|
1308 | exports.numbers = numbers;
|
1309 | var cssClasses = {
|
1310 | NO_LABEL: 'mdc-notched-outline--no-label',
|
1311 | OUTLINE_NOTCHED: 'mdc-notched-outline--notched',
|
1312 | OUTLINE_UPGRADED: 'mdc-notched-outline--upgraded'
|
1313 | };
|
1314 | exports.cssClasses = cssClasses;
|
1315 |
|
1316 | }),
|
1317 |
|
1318 | "./packages/mdc-notched-outline/foundation.ts":
|
1319 |
|
1320 |
|
1321 |
|
1322 |
|
1323 | (function(module, exports, __webpack_require__) {
|
1324 |
|
1325 | "use strict";
|
1326 |
|
1327 |
|
1328 |
|
1329 |
|
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 |
|
1344 |
|
1345 |
|
1346 |
|
1347 |
|
1348 |
|
1349 |
|
1350 | var __extends = this && this.__extends || function () {
|
1351 | var _extendStatics = function extendStatics(d, b) {
|
1352 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
1353 | d.__proto__ = b;
|
1354 | } || function (d, b) {
|
1355 | for (var p in b) {
|
1356 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
1357 | }
|
1358 | };
|
1359 | return _extendStatics(d, b);
|
1360 | };
|
1361 | return function (d, b) {
|
1362 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
1363 | _extendStatics(d, b);
|
1364 | function __() {
|
1365 | this.constructor = d;
|
1366 | }
|
1367 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
1368 | };
|
1369 | }();
|
1370 | var __assign = this && this.__assign || function () {
|
1371 | __assign = Object.assign || function (t) {
|
1372 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
1373 | s = arguments[i];
|
1374 | for (var p in s) {
|
1375 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
1376 | }
|
1377 | }
|
1378 | return t;
|
1379 | };
|
1380 | return __assign.apply(this, arguments);
|
1381 | };
|
1382 | Object.defineProperty(exports, "__esModule", { value: true });
|
1383 | exports.MDCNotchedOutlineFoundation = void 0;
|
1384 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
1385 | var constants_1 = __webpack_require__( "./packages/mdc-notched-outline/constants.ts");
|
1386 | var MDCNotchedOutlineFoundation = function (_super) {
|
1387 | __extends(MDCNotchedOutlineFoundation, _super);
|
1388 | function MDCNotchedOutlineFoundation(adapter) {
|
1389 | return _super.call(this, __assign(__assign({}, MDCNotchedOutlineFoundation.defaultAdapter), adapter)) || this;
|
1390 | }
|
1391 | Object.defineProperty(MDCNotchedOutlineFoundation, "strings", {
|
1392 | get: function get() {
|
1393 | return constants_1.strings;
|
1394 | },
|
1395 | enumerable: false,
|
1396 | configurable: true
|
1397 | });
|
1398 | Object.defineProperty(MDCNotchedOutlineFoundation, "cssClasses", {
|
1399 | get: function get() {
|
1400 | return constants_1.cssClasses;
|
1401 | },
|
1402 | enumerable: false,
|
1403 | configurable: true
|
1404 | });
|
1405 | Object.defineProperty(MDCNotchedOutlineFoundation, "numbers", {
|
1406 | get: function get() {
|
1407 | return constants_1.numbers;
|
1408 | },
|
1409 | enumerable: false,
|
1410 | configurable: true
|
1411 | });
|
1412 | Object.defineProperty(MDCNotchedOutlineFoundation, "defaultAdapter", {
|
1413 | |
1414 |
|
1415 |
|
1416 | get: function get() {
|
1417 |
|
1418 | return {
|
1419 | addClass: function addClass() {
|
1420 | return undefined;
|
1421 | },
|
1422 | removeClass: function removeClass() {
|
1423 | return undefined;
|
1424 | },
|
1425 | setNotchWidthProperty: function setNotchWidthProperty() {
|
1426 | return undefined;
|
1427 | },
|
1428 | removeNotchWidthProperty: function removeNotchWidthProperty() {
|
1429 | return undefined;
|
1430 | }
|
1431 | };
|
1432 |
|
1433 | },
|
1434 | enumerable: false,
|
1435 | configurable: true
|
1436 | });
|
1437 | |
1438 |
|
1439 |
|
1440 | MDCNotchedOutlineFoundation.prototype.notch = function (notchWidth) {
|
1441 | var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
|
1442 | if (notchWidth > 0) {
|
1443 | notchWidth += constants_1.numbers.NOTCH_ELEMENT_PADDING;
|
1444 | }
|
1445 | this.adapter.setNotchWidthProperty(notchWidth);
|
1446 | this.adapter.addClass(OUTLINE_NOTCHED);
|
1447 | };
|
1448 | |
1449 |
|
1450 |
|
1451 | MDCNotchedOutlineFoundation.prototype.closeNotch = function () {
|
1452 | var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
|
1453 | this.adapter.removeClass(OUTLINE_NOTCHED);
|
1454 | this.adapter.removeNotchWidthProperty();
|
1455 | };
|
1456 | return MDCNotchedOutlineFoundation;
|
1457 | }(foundation_1.MDCFoundation);
|
1458 | exports.MDCNotchedOutlineFoundation = MDCNotchedOutlineFoundation;
|
1459 |
|
1460 | exports.default = MDCNotchedOutlineFoundation;
|
1461 |
|
1462 | }),
|
1463 |
|
1464 | "./packages/mdc-ripple/component.ts":
|
1465 |
|
1466 |
|
1467 |
|
1468 |
|
1469 | (function(module, exports, __webpack_require__) {
|
1470 |
|
1471 | "use strict";
|
1472 |
|
1473 |
|
1474 |
|
1475 |
|
1476 |
|
1477 |
|
1478 |
|
1479 |
|
1480 |
|
1481 |
|
1482 |
|
1483 |
|
1484 |
|
1485 |
|
1486 |
|
1487 |
|
1488 |
|
1489 |
|
1490 |
|
1491 |
|
1492 |
|
1493 |
|
1494 |
|
1495 |
|
1496 | var __extends = this && this.__extends || function () {
|
1497 | var _extendStatics = function extendStatics(d, b) {
|
1498 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
1499 | d.__proto__ = b;
|
1500 | } || function (d, b) {
|
1501 | for (var p in b) {
|
1502 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
1503 | }
|
1504 | };
|
1505 | return _extendStatics(d, b);
|
1506 | };
|
1507 | return function (d, b) {
|
1508 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
1509 | _extendStatics(d, b);
|
1510 | function __() {
|
1511 | this.constructor = d;
|
1512 | }
|
1513 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
1514 | };
|
1515 | }();
|
1516 | var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
1517 | if (k2 === undefined) k2 = k;
|
1518 | Object.defineProperty(o, k2, { enumerable: true, get: function get() {
|
1519 | return m[k];
|
1520 | } });
|
1521 | } : function (o, m, k, k2) {
|
1522 | if (k2 === undefined) k2 = k;
|
1523 | o[k2] = m[k];
|
1524 | });
|
1525 | var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
1526 | Object.defineProperty(o, "default", { enumerable: true, value: v });
|
1527 | } : function (o, v) {
|
1528 | o["default"] = v;
|
1529 | });
|
1530 | var __importStar = this && this.__importStar || function (mod) {
|
1531 | if (mod && mod.__esModule) return mod;
|
1532 | var result = {};
|
1533 | if (mod != null) for (var k in mod) {
|
1534 | if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
1535 | }__setModuleDefault(result, mod);
|
1536 | return result;
|
1537 | };
|
1538 | Object.defineProperty(exports, "__esModule", { value: true });
|
1539 | exports.MDCRipple = void 0;
|
1540 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
1541 | var events_1 = __webpack_require__( "./packages/mdc-dom/events.ts");
|
1542 | var ponyfill_1 = __webpack_require__( "./packages/mdc-dom/ponyfill.ts");
|
1543 | var foundation_1 = __webpack_require__( "./packages/mdc-ripple/foundation.ts");
|
1544 | var util = __importStar(__webpack_require__( "./packages/mdc-ripple/util.ts"));
|
1545 | var MDCRipple = function (_super) {
|
1546 | __extends(MDCRipple, _super);
|
1547 | function MDCRipple() {
|
1548 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
1549 | _this.disabled = false;
|
1550 | return _this;
|
1551 | }
|
1552 | MDCRipple.attachTo = function (root, opts) {
|
1553 | if (opts === void 0) {
|
1554 | opts = {
|
1555 | isUnbounded: undefined
|
1556 | };
|
1557 | }
|
1558 | var ripple = new MDCRipple(root);
|
1559 |
|
1560 | if (opts.isUnbounded !== undefined) {
|
1561 | ripple.unbounded = opts.isUnbounded;
|
1562 | }
|
1563 | return ripple;
|
1564 | };
|
1565 | MDCRipple.createAdapter = function (instance) {
|
1566 | return {
|
1567 | addClass: function addClass(className) {
|
1568 | return instance.root.classList.add(className);
|
1569 | },
|
1570 | browserSupportsCssVars: function browserSupportsCssVars() {
|
1571 | return util.supportsCssVariables(window);
|
1572 | },
|
1573 | computeBoundingRect: function computeBoundingRect() {
|
1574 | return instance.root.getBoundingClientRect();
|
1575 | },
|
1576 | containsEventTarget: function containsEventTarget(target) {
|
1577 | return instance.root.contains(target);
|
1578 | },
|
1579 | deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) {
|
1580 | return document.documentElement.removeEventListener(evtType, handler, events_1.applyPassive());
|
1581 | },
|
1582 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
1583 | return instance.root.removeEventListener(evtType, handler, events_1.applyPassive());
|
1584 | },
|
1585 | deregisterResizeHandler: function deregisterResizeHandler(handler) {
|
1586 | return window.removeEventListener('resize', handler);
|
1587 | },
|
1588 | getWindowPageOffset: function getWindowPageOffset() {
|
1589 | return { x: window.pageXOffset, y: window.pageYOffset };
|
1590 | },
|
1591 | isSurfaceActive: function isSurfaceActive() {
|
1592 | return ponyfill_1.matches(instance.root, ':active');
|
1593 | },
|
1594 | isSurfaceDisabled: function isSurfaceDisabled() {
|
1595 | return Boolean(instance.disabled);
|
1596 | },
|
1597 | isUnbounded: function isUnbounded() {
|
1598 | return Boolean(instance.unbounded);
|
1599 | },
|
1600 | registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) {
|
1601 | return document.documentElement.addEventListener(evtType, handler, events_1.applyPassive());
|
1602 | },
|
1603 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
1604 | return instance.root.addEventListener(evtType, handler, events_1.applyPassive());
|
1605 | },
|
1606 | registerResizeHandler: function registerResizeHandler(handler) {
|
1607 | return window.addEventListener('resize', handler);
|
1608 | },
|
1609 | removeClass: function removeClass(className) {
|
1610 | return instance.root.classList.remove(className);
|
1611 | },
|
1612 | updateCssVariable: function updateCssVariable(varName, value) {
|
1613 | return instance.root.style.setProperty(varName, value);
|
1614 | }
|
1615 | };
|
1616 | };
|
1617 | Object.defineProperty(MDCRipple.prototype, "unbounded", {
|
1618 | get: function get() {
|
1619 | return Boolean(this.isUnbounded);
|
1620 | },
|
1621 | set: function set(unbounded) {
|
1622 | this.isUnbounded = Boolean(unbounded);
|
1623 | this.setUnbounded();
|
1624 | },
|
1625 | enumerable: false,
|
1626 | configurable: true
|
1627 | });
|
1628 | MDCRipple.prototype.activate = function () {
|
1629 | this.foundation.activate();
|
1630 | };
|
1631 | MDCRipple.prototype.deactivate = function () {
|
1632 | this.foundation.deactivate();
|
1633 | };
|
1634 | MDCRipple.prototype.layout = function () {
|
1635 | this.foundation.layout();
|
1636 | };
|
1637 | MDCRipple.prototype.getDefaultFoundation = function () {
|
1638 | return new foundation_1.MDCRippleFoundation(MDCRipple.createAdapter(this));
|
1639 | };
|
1640 | MDCRipple.prototype.initialSyncWithDOM = function () {
|
1641 | var root = this.root;
|
1642 | this.isUnbounded = 'mdcRippleIsUnbounded' in root.dataset;
|
1643 | };
|
1644 | |
1645 |
|
1646 |
|
1647 |
|
1648 |
|
1649 |
|
1650 | MDCRipple.prototype.setUnbounded = function () {
|
1651 | this.foundation.setUnbounded(Boolean(this.isUnbounded));
|
1652 | };
|
1653 | return MDCRipple;
|
1654 | }(component_1.MDCComponent);
|
1655 | exports.MDCRipple = MDCRipple;
|
1656 |
|
1657 | }),
|
1658 |
|
1659 | "./packages/mdc-ripple/constants.ts":
|
1660 |
|
1661 |
|
1662 |
|
1663 |
|
1664 | (function(module, exports, __webpack_require__) {
|
1665 |
|
1666 | "use strict";
|
1667 |
|
1668 |
|
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 |
|
1691 | Object.defineProperty(exports, "__esModule", { value: true });
|
1692 | exports.numbers = exports.strings = exports.cssClasses = void 0;
|
1693 | exports.cssClasses = {
|
1694 |
|
1695 |
|
1696 |
|
1697 | BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',
|
1698 | FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',
|
1699 | FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation',
|
1700 | ROOT: 'mdc-ripple-upgraded',
|
1701 | UNBOUNDED: 'mdc-ripple-upgraded--unbounded'
|
1702 | };
|
1703 | exports.strings = {
|
1704 | VAR_FG_SCALE: '--mdc-ripple-fg-scale',
|
1705 | VAR_FG_SIZE: '--mdc-ripple-fg-size',
|
1706 | VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end',
|
1707 | VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',
|
1708 | VAR_LEFT: '--mdc-ripple-left',
|
1709 | VAR_TOP: '--mdc-ripple-top'
|
1710 | };
|
1711 | exports.numbers = {
|
1712 | DEACTIVATION_TIMEOUT_MS: 225,
|
1713 | FG_DEACTIVATION_MS: 150,
|
1714 | INITIAL_ORIGIN_SCALE: 0.6,
|
1715 | PADDING: 10,
|
1716 | TAP_DELAY_MS: 300 };
|
1717 |
|
1718 | }),
|
1719 |
|
1720 | "./packages/mdc-ripple/foundation.ts":
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 | (function(module, exports, __webpack_require__) {
|
1726 |
|
1727 | "use strict";
|
1728 |
|
1729 |
|
1730 |
|
1731 |
|
1732 |
|
1733 |
|
1734 |
|
1735 |
|
1736 |
|
1737 |
|
1738 |
|
1739 |
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 |
|
1745 |
|
1746 |
|
1747 |
|
1748 |
|
1749 |
|
1750 |
|
1751 |
|
1752 | var __extends = this && this.__extends || function () {
|
1753 | var _extendStatics = function extendStatics(d, b) {
|
1754 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
1755 | d.__proto__ = b;
|
1756 | } || function (d, b) {
|
1757 | for (var p in b) {
|
1758 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
1759 | }
|
1760 | };
|
1761 | return _extendStatics(d, b);
|
1762 | };
|
1763 | return function (d, b) {
|
1764 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
1765 | _extendStatics(d, b);
|
1766 | function __() {
|
1767 | this.constructor = d;
|
1768 | }
|
1769 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
1770 | };
|
1771 | }();
|
1772 | var __assign = this && this.__assign || function () {
|
1773 | __assign = Object.assign || function (t) {
|
1774 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
1775 | s = arguments[i];
|
1776 | for (var p in s) {
|
1777 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
1778 | }
|
1779 | }
|
1780 | return t;
|
1781 | };
|
1782 | return __assign.apply(this, arguments);
|
1783 | };
|
1784 | var __values = this && this.__values || function (o) {
|
1785 | var s = typeof Symbol === "function" && Symbol.iterator,
|
1786 | m = s && o[s],
|
1787 | i = 0;
|
1788 | if (m) return m.call(o);
|
1789 | if (o && typeof o.length === "number") return {
|
1790 | next: function next() {
|
1791 | if (o && i >= o.length) o = void 0;
|
1792 | return { value: o && o[i++], done: !o };
|
1793 | }
|
1794 | };
|
1795 | throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
1796 | };
|
1797 | Object.defineProperty(exports, "__esModule", { value: true });
|
1798 | exports.MDCRippleFoundation = void 0;
|
1799 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
1800 | var constants_1 = __webpack_require__( "./packages/mdc-ripple/constants.ts");
|
1801 | var util_1 = __webpack_require__( "./packages/mdc-ripple/util.ts");
|
1802 |
|
1803 | var ACTIVATION_EVENT_TYPES = ['touchstart', 'pointerdown', 'mousedown', 'keydown'];
|
1804 |
|
1805 | var POINTER_DEACTIVATION_EVENT_TYPES = ['touchend', 'pointerup', 'mouseup', 'contextmenu'];
|
1806 |
|
1807 | var activatedTargets = [];
|
1808 | var MDCRippleFoundation = function (_super) {
|
1809 | __extends(MDCRippleFoundation, _super);
|
1810 | function MDCRippleFoundation(adapter) {
|
1811 | var _this = _super.call(this, __assign(__assign({}, MDCRippleFoundation.defaultAdapter), adapter)) || this;
|
1812 | _this.activationAnimationHasEnded = false;
|
1813 | _this.activationTimer = 0;
|
1814 | _this.fgDeactivationRemovalTimer = 0;
|
1815 | _this.fgScale = '0';
|
1816 | _this.frame = { width: 0, height: 0 };
|
1817 | _this.initialSize = 0;
|
1818 | _this.layoutFrame = 0;
|
1819 | _this.maxRadius = 0;
|
1820 | _this.unboundedCoords = { left: 0, top: 0 };
|
1821 | _this.activationState = _this.defaultActivationState();
|
1822 | _this.activationTimerCallback = function () {
|
1823 | _this.activationAnimationHasEnded = true;
|
1824 | _this.runDeactivationUXLogicIfReady();
|
1825 | };
|
1826 | _this.activateHandler = function (e) {
|
1827 | _this.activateImpl(e);
|
1828 | };
|
1829 | _this.deactivateHandler = function () {
|
1830 | _this.deactivateImpl();
|
1831 | };
|
1832 | _this.focusHandler = function () {
|
1833 | _this.handleFocus();
|
1834 | };
|
1835 | _this.blurHandler = function () {
|
1836 | _this.handleBlur();
|
1837 | };
|
1838 | _this.resizeHandler = function () {
|
1839 | _this.layout();
|
1840 | };
|
1841 | return _this;
|
1842 | }
|
1843 | Object.defineProperty(MDCRippleFoundation, "cssClasses", {
|
1844 | get: function get() {
|
1845 | return constants_1.cssClasses;
|
1846 | },
|
1847 | enumerable: false,
|
1848 | configurable: true
|
1849 | });
|
1850 | Object.defineProperty(MDCRippleFoundation, "strings", {
|
1851 | get: function get() {
|
1852 | return constants_1.strings;
|
1853 | },
|
1854 | enumerable: false,
|
1855 | configurable: true
|
1856 | });
|
1857 | Object.defineProperty(MDCRippleFoundation, "numbers", {
|
1858 | get: function get() {
|
1859 | return constants_1.numbers;
|
1860 | },
|
1861 | enumerable: false,
|
1862 | configurable: true
|
1863 | });
|
1864 | Object.defineProperty(MDCRippleFoundation, "defaultAdapter", {
|
1865 | get: function get() {
|
1866 | return {
|
1867 | addClass: function addClass() {
|
1868 | return undefined;
|
1869 | },
|
1870 | browserSupportsCssVars: function browserSupportsCssVars() {
|
1871 | return true;
|
1872 | },
|
1873 | computeBoundingRect: function computeBoundingRect() {
|
1874 | return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 };
|
1875 | },
|
1876 | containsEventTarget: function containsEventTarget() {
|
1877 | return true;
|
1878 | },
|
1879 | deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() {
|
1880 | return undefined;
|
1881 | },
|
1882 | deregisterInteractionHandler: function deregisterInteractionHandler() {
|
1883 | return undefined;
|
1884 | },
|
1885 | deregisterResizeHandler: function deregisterResizeHandler() {
|
1886 | return undefined;
|
1887 | },
|
1888 | getWindowPageOffset: function getWindowPageOffset() {
|
1889 | return { x: 0, y: 0 };
|
1890 | },
|
1891 | isSurfaceActive: function isSurfaceActive() {
|
1892 | return true;
|
1893 | },
|
1894 | isSurfaceDisabled: function isSurfaceDisabled() {
|
1895 | return true;
|
1896 | },
|
1897 | isUnbounded: function isUnbounded() {
|
1898 | return true;
|
1899 | },
|
1900 | registerDocumentInteractionHandler: function registerDocumentInteractionHandler() {
|
1901 | return undefined;
|
1902 | },
|
1903 | registerInteractionHandler: function registerInteractionHandler() {
|
1904 | return undefined;
|
1905 | },
|
1906 | registerResizeHandler: function registerResizeHandler() {
|
1907 | return undefined;
|
1908 | },
|
1909 | removeClass: function removeClass() {
|
1910 | return undefined;
|
1911 | },
|
1912 | updateCssVariable: function updateCssVariable() {
|
1913 | return undefined;
|
1914 | }
|
1915 | };
|
1916 | },
|
1917 | enumerable: false,
|
1918 | configurable: true
|
1919 | });
|
1920 | MDCRippleFoundation.prototype.init = function () {
|
1921 | var _this = this;
|
1922 | var supportsPressRipple = this.supportsPressRipple();
|
1923 | this.registerRootHandlers(supportsPressRipple);
|
1924 | if (supportsPressRipple) {
|
1925 | var _a = MDCRippleFoundation.cssClasses,
|
1926 | ROOT_1 = _a.ROOT,
|
1927 | UNBOUNDED_1 = _a.UNBOUNDED;
|
1928 | requestAnimationFrame(function () {
|
1929 | _this.adapter.addClass(ROOT_1);
|
1930 | if (_this.adapter.isUnbounded()) {
|
1931 | _this.adapter.addClass(UNBOUNDED_1);
|
1932 |
|
1933 | _this.layoutInternal();
|
1934 | }
|
1935 | });
|
1936 | }
|
1937 | };
|
1938 | MDCRippleFoundation.prototype.destroy = function () {
|
1939 | var _this = this;
|
1940 | if (this.supportsPressRipple()) {
|
1941 | if (this.activationTimer) {
|
1942 | clearTimeout(this.activationTimer);
|
1943 | this.activationTimer = 0;
|
1944 | this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);
|
1945 | }
|
1946 | if (this.fgDeactivationRemovalTimer) {
|
1947 | clearTimeout(this.fgDeactivationRemovalTimer);
|
1948 | this.fgDeactivationRemovalTimer = 0;
|
1949 | this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);
|
1950 | }
|
1951 | var _a = MDCRippleFoundation.cssClasses,
|
1952 | ROOT_2 = _a.ROOT,
|
1953 | UNBOUNDED_2 = _a.UNBOUNDED;
|
1954 | requestAnimationFrame(function () {
|
1955 | _this.adapter.removeClass(ROOT_2);
|
1956 | _this.adapter.removeClass(UNBOUNDED_2);
|
1957 | _this.removeCssVars();
|
1958 | });
|
1959 | }
|
1960 | this.deregisterRootHandlers();
|
1961 | this.deregisterDeactivationHandlers();
|
1962 | };
|
1963 | |
1964 |
|
1965 |
|
1966 | MDCRippleFoundation.prototype.activate = function (evt) {
|
1967 | this.activateImpl(evt);
|
1968 | };
|
1969 | MDCRippleFoundation.prototype.deactivate = function () {
|
1970 | this.deactivateImpl();
|
1971 | };
|
1972 | MDCRippleFoundation.prototype.layout = function () {
|
1973 | var _this = this;
|
1974 | if (this.layoutFrame) {
|
1975 | cancelAnimationFrame(this.layoutFrame);
|
1976 | }
|
1977 | this.layoutFrame = requestAnimationFrame(function () {
|
1978 | _this.layoutInternal();
|
1979 | _this.layoutFrame = 0;
|
1980 | });
|
1981 | };
|
1982 | MDCRippleFoundation.prototype.setUnbounded = function (unbounded) {
|
1983 | var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;
|
1984 | if (unbounded) {
|
1985 | this.adapter.addClass(UNBOUNDED);
|
1986 | } else {
|
1987 | this.adapter.removeClass(UNBOUNDED);
|
1988 | }
|
1989 | };
|
1990 | MDCRippleFoundation.prototype.handleFocus = function () {
|
1991 | var _this = this;
|
1992 | requestAnimationFrame(function () {
|
1993 | return _this.adapter.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
|
1994 | });
|
1995 | };
|
1996 | MDCRippleFoundation.prototype.handleBlur = function () {
|
1997 | var _this = this;
|
1998 | requestAnimationFrame(function () {
|
1999 | return _this.adapter.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
|
2000 | });
|
2001 | };
|
2002 | |
2003 |
|
2004 |
|
2005 |
|
2006 |
|
2007 |
|
2008 | MDCRippleFoundation.prototype.supportsPressRipple = function () {
|
2009 | return this.adapter.browserSupportsCssVars();
|
2010 | };
|
2011 | MDCRippleFoundation.prototype.defaultActivationState = function () {
|
2012 | return {
|
2013 | activationEvent: undefined,
|
2014 | hasDeactivationUXRun: false,
|
2015 | isActivated: false,
|
2016 | isProgrammatic: false,
|
2017 | wasActivatedByPointer: false,
|
2018 | wasElementMadeActive: false
|
2019 | };
|
2020 | };
|
2021 | |
2022 |
|
2023 |
|
2024 | MDCRippleFoundation.prototype.registerRootHandlers = function (supportsPressRipple) {
|
2025 | var e_1, _a;
|
2026 | if (supportsPressRipple) {
|
2027 | try {
|
2028 | for (var ACTIVATION_EVENT_TYPES_1 = __values(ACTIVATION_EVENT_TYPES), ACTIVATION_EVENT_TYPES_1_1 = ACTIVATION_EVENT_TYPES_1.next(); !ACTIVATION_EVENT_TYPES_1_1.done; ACTIVATION_EVENT_TYPES_1_1 = ACTIVATION_EVENT_TYPES_1.next()) {
|
2029 | var evtType = ACTIVATION_EVENT_TYPES_1_1.value;
|
2030 | this.adapter.registerInteractionHandler(evtType, this.activateHandler);
|
2031 | }
|
2032 | } catch (e_1_1) {
|
2033 | e_1 = { error: e_1_1 };
|
2034 | } finally {
|
2035 | try {
|
2036 | if (ACTIVATION_EVENT_TYPES_1_1 && !ACTIVATION_EVENT_TYPES_1_1.done && (_a = ACTIVATION_EVENT_TYPES_1.return)) _a.call(ACTIVATION_EVENT_TYPES_1);
|
2037 | } finally {
|
2038 | if (e_1) throw e_1.error;
|
2039 | }
|
2040 | }
|
2041 | if (this.adapter.isUnbounded()) {
|
2042 | this.adapter.registerResizeHandler(this.resizeHandler);
|
2043 | }
|
2044 | }
|
2045 | this.adapter.registerInteractionHandler('focus', this.focusHandler);
|
2046 | this.adapter.registerInteractionHandler('blur', this.blurHandler);
|
2047 | };
|
2048 | MDCRippleFoundation.prototype.registerDeactivationHandlers = function (evt) {
|
2049 | var e_2, _a;
|
2050 | if (evt.type === 'keydown') {
|
2051 | this.adapter.registerInteractionHandler('keyup', this.deactivateHandler);
|
2052 | } else {
|
2053 | try {
|
2054 | for (var POINTER_DEACTIVATION_EVENT_TYPES_1 = __values(POINTER_DEACTIVATION_EVENT_TYPES), POINTER_DEACTIVATION_EVENT_TYPES_1_1 = POINTER_DEACTIVATION_EVENT_TYPES_1.next(); !POINTER_DEACTIVATION_EVENT_TYPES_1_1.done; POINTER_DEACTIVATION_EVENT_TYPES_1_1 = POINTER_DEACTIVATION_EVENT_TYPES_1.next()) {
|
2055 | var evtType = POINTER_DEACTIVATION_EVENT_TYPES_1_1.value;
|
2056 | this.adapter.registerDocumentInteractionHandler(evtType, this.deactivateHandler);
|
2057 | }
|
2058 | } catch (e_2_1) {
|
2059 | e_2 = { error: e_2_1 };
|
2060 | } finally {
|
2061 | try {
|
2062 | if (POINTER_DEACTIVATION_EVENT_TYPES_1_1 && !POINTER_DEACTIVATION_EVENT_TYPES_1_1.done && (_a = POINTER_DEACTIVATION_EVENT_TYPES_1.return)) _a.call(POINTER_DEACTIVATION_EVENT_TYPES_1);
|
2063 | } finally {
|
2064 | if (e_2) throw e_2.error;
|
2065 | }
|
2066 | }
|
2067 | }
|
2068 | };
|
2069 | MDCRippleFoundation.prototype.deregisterRootHandlers = function () {
|
2070 | var e_3, _a;
|
2071 | try {
|
2072 | for (var ACTIVATION_EVENT_TYPES_2 = __values(ACTIVATION_EVENT_TYPES), ACTIVATION_EVENT_TYPES_2_1 = ACTIVATION_EVENT_TYPES_2.next(); !ACTIVATION_EVENT_TYPES_2_1.done; ACTIVATION_EVENT_TYPES_2_1 = ACTIVATION_EVENT_TYPES_2.next()) {
|
2073 | var evtType = ACTIVATION_EVENT_TYPES_2_1.value;
|
2074 | this.adapter.deregisterInteractionHandler(evtType, this.activateHandler);
|
2075 | }
|
2076 | } catch (e_3_1) {
|
2077 | e_3 = { error: e_3_1 };
|
2078 | } finally {
|
2079 | try {
|
2080 | if (ACTIVATION_EVENT_TYPES_2_1 && !ACTIVATION_EVENT_TYPES_2_1.done && (_a = ACTIVATION_EVENT_TYPES_2.return)) _a.call(ACTIVATION_EVENT_TYPES_2);
|
2081 | } finally {
|
2082 | if (e_3) throw e_3.error;
|
2083 | }
|
2084 | }
|
2085 | this.adapter.deregisterInteractionHandler('focus', this.focusHandler);
|
2086 | this.adapter.deregisterInteractionHandler('blur', this.blurHandler);
|
2087 | if (this.adapter.isUnbounded()) {
|
2088 | this.adapter.deregisterResizeHandler(this.resizeHandler);
|
2089 | }
|
2090 | };
|
2091 | MDCRippleFoundation.prototype.deregisterDeactivationHandlers = function () {
|
2092 | var e_4, _a;
|
2093 | this.adapter.deregisterInteractionHandler('keyup', this.deactivateHandler);
|
2094 | try {
|
2095 | for (var POINTER_DEACTIVATION_EVENT_TYPES_2 = __values(POINTER_DEACTIVATION_EVENT_TYPES), POINTER_DEACTIVATION_EVENT_TYPES_2_1 = POINTER_DEACTIVATION_EVENT_TYPES_2.next(); !POINTER_DEACTIVATION_EVENT_TYPES_2_1.done; POINTER_DEACTIVATION_EVENT_TYPES_2_1 = POINTER_DEACTIVATION_EVENT_TYPES_2.next()) {
|
2096 | var evtType = POINTER_DEACTIVATION_EVENT_TYPES_2_1.value;
|
2097 | this.adapter.deregisterDocumentInteractionHandler(evtType, this.deactivateHandler);
|
2098 | }
|
2099 | } catch (e_4_1) {
|
2100 | e_4 = { error: e_4_1 };
|
2101 | } finally {
|
2102 | try {
|
2103 | if (POINTER_DEACTIVATION_EVENT_TYPES_2_1 && !POINTER_DEACTIVATION_EVENT_TYPES_2_1.done && (_a = POINTER_DEACTIVATION_EVENT_TYPES_2.return)) _a.call(POINTER_DEACTIVATION_EVENT_TYPES_2);
|
2104 | } finally {
|
2105 | if (e_4) throw e_4.error;
|
2106 | }
|
2107 | }
|
2108 | };
|
2109 | MDCRippleFoundation.prototype.removeCssVars = function () {
|
2110 | var _this = this;
|
2111 | var rippleStrings = MDCRippleFoundation.strings;
|
2112 | var keys = Object.keys(rippleStrings);
|
2113 | keys.forEach(function (key) {
|
2114 | if (key.indexOf('VAR_') === 0) {
|
2115 | _this.adapter.updateCssVariable(rippleStrings[key], null);
|
2116 | }
|
2117 | });
|
2118 | };
|
2119 | MDCRippleFoundation.prototype.activateImpl = function (evt) {
|
2120 | var _this = this;
|
2121 | if (this.adapter.isSurfaceDisabled()) {
|
2122 | return;
|
2123 | }
|
2124 | var activationState = this.activationState;
|
2125 | if (activationState.isActivated) {
|
2126 | return;
|
2127 | }
|
2128 |
|
2129 | var previousActivationEvent = this.previousActivationEvent;
|
2130 | var isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type;
|
2131 | if (isSameInteraction) {
|
2132 | return;
|
2133 | }
|
2134 | activationState.isActivated = true;
|
2135 | activationState.isProgrammatic = evt === undefined;
|
2136 | activationState.activationEvent = evt;
|
2137 | activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown');
|
2138 | var hasActivatedChild = evt !== undefined && activatedTargets.length > 0 && activatedTargets.some(function (target) {
|
2139 | return _this.adapter.containsEventTarget(target);
|
2140 | });
|
2141 | if (hasActivatedChild) {
|
2142 |
|
2143 | this.resetActivationState();
|
2144 | return;
|
2145 | }
|
2146 | if (evt !== undefined) {
|
2147 | activatedTargets.push(evt.target);
|
2148 | this.registerDeactivationHandlers(evt);
|
2149 | }
|
2150 | activationState.wasElementMadeActive = this.checkElementMadeActive(evt);
|
2151 | if (activationState.wasElementMadeActive) {
|
2152 | this.animateActivation();
|
2153 | }
|
2154 | requestAnimationFrame(function () {
|
2155 |
|
2156 | activatedTargets = [];
|
2157 | if (!activationState.wasElementMadeActive && evt !== undefined && (evt.key === ' ' || evt.keyCode === 32)) {
|
2158 |
|
2159 |
|
2160 |
|
2161 |
|
2162 |
|
2163 |
|
2164 | activationState.wasElementMadeActive = _this.checkElementMadeActive(evt);
|
2165 | if (activationState.wasElementMadeActive) {
|
2166 | _this.animateActivation();
|
2167 | }
|
2168 | }
|
2169 | if (!activationState.wasElementMadeActive) {
|
2170 |
|
2171 | _this.activationState = _this.defaultActivationState();
|
2172 | }
|
2173 | });
|
2174 | };
|
2175 | MDCRippleFoundation.prototype.checkElementMadeActive = function (evt) {
|
2176 | return evt !== undefined && evt.type === 'keydown' ? this.adapter.isSurfaceActive() : true;
|
2177 | };
|
2178 | MDCRippleFoundation.prototype.animateActivation = function () {
|
2179 | var _this = this;
|
2180 | var _a = MDCRippleFoundation.strings,
|
2181 | VAR_FG_TRANSLATE_START = _a.VAR_FG_TRANSLATE_START,
|
2182 | VAR_FG_TRANSLATE_END = _a.VAR_FG_TRANSLATE_END;
|
2183 | var _b = MDCRippleFoundation.cssClasses,
|
2184 | FG_DEACTIVATION = _b.FG_DEACTIVATION,
|
2185 | FG_ACTIVATION = _b.FG_ACTIVATION;
|
2186 | var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
|
2187 | this.layoutInternal();
|
2188 | var translateStart = '';
|
2189 | var translateEnd = '';
|
2190 | if (!this.adapter.isUnbounded()) {
|
2191 | var _c = this.getFgTranslationCoordinates(),
|
2192 | startPoint = _c.startPoint,
|
2193 | endPoint = _c.endPoint;
|
2194 | translateStart = startPoint.x + "px, " + startPoint.y + "px";
|
2195 | translateEnd = endPoint.x + "px, " + endPoint.y + "px";
|
2196 | }
|
2197 | this.adapter.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
|
2198 | this.adapter.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
|
2199 |
|
2200 | clearTimeout(this.activationTimer);
|
2201 | clearTimeout(this.fgDeactivationRemovalTimer);
|
2202 | this.rmBoundedActivationClasses();
|
2203 | this.adapter.removeClass(FG_DEACTIVATION);
|
2204 |
|
2205 | this.adapter.computeBoundingRect();
|
2206 | this.adapter.addClass(FG_ACTIVATION);
|
2207 | this.activationTimer = setTimeout(function () {
|
2208 | _this.activationTimerCallback();
|
2209 | }, DEACTIVATION_TIMEOUT_MS);
|
2210 | };
|
2211 | MDCRippleFoundation.prototype.getFgTranslationCoordinates = function () {
|
2212 | var _a = this.activationState,
|
2213 | activationEvent = _a.activationEvent,
|
2214 | wasActivatedByPointer = _a.wasActivatedByPointer;
|
2215 | var startPoint;
|
2216 | if (wasActivatedByPointer) {
|
2217 | startPoint = util_1.getNormalizedEventCoords(activationEvent, this.adapter.getWindowPageOffset(), this.adapter.computeBoundingRect());
|
2218 | } else {
|
2219 | startPoint = {
|
2220 | x: this.frame.width / 2,
|
2221 | y: this.frame.height / 2
|
2222 | };
|
2223 | }
|
2224 |
|
2225 | startPoint = {
|
2226 | x: startPoint.x - this.initialSize / 2,
|
2227 | y: startPoint.y - this.initialSize / 2
|
2228 | };
|
2229 | var endPoint = {
|
2230 | x: this.frame.width / 2 - this.initialSize / 2,
|
2231 | y: this.frame.height / 2 - this.initialSize / 2
|
2232 | };
|
2233 | return { startPoint: startPoint, endPoint: endPoint };
|
2234 | };
|
2235 | MDCRippleFoundation.prototype.runDeactivationUXLogicIfReady = function () {
|
2236 | var _this = this;
|
2237 |
|
2238 |
|
2239 | var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
|
2240 | var _a = this.activationState,
|
2241 | hasDeactivationUXRun = _a.hasDeactivationUXRun,
|
2242 | isActivated = _a.isActivated;
|
2243 | var activationHasEnded = hasDeactivationUXRun || !isActivated;
|
2244 | if (activationHasEnded && this.activationAnimationHasEnded) {
|
2245 | this.rmBoundedActivationClasses();
|
2246 | this.adapter.addClass(FG_DEACTIVATION);
|
2247 | this.fgDeactivationRemovalTimer = setTimeout(function () {
|
2248 | _this.adapter.removeClass(FG_DEACTIVATION);
|
2249 | }, constants_1.numbers.FG_DEACTIVATION_MS);
|
2250 | }
|
2251 | };
|
2252 | MDCRippleFoundation.prototype.rmBoundedActivationClasses = function () {
|
2253 | var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
|
2254 | this.adapter.removeClass(FG_ACTIVATION);
|
2255 | this.activationAnimationHasEnded = false;
|
2256 | this.adapter.computeBoundingRect();
|
2257 | };
|
2258 | MDCRippleFoundation.prototype.resetActivationState = function () {
|
2259 | var _this = this;
|
2260 | this.previousActivationEvent = this.activationState.activationEvent;
|
2261 | this.activationState = this.defaultActivationState();
|
2262 |
|
2263 |
|
2264 | setTimeout(function () {
|
2265 | return _this.previousActivationEvent = undefined;
|
2266 | }, MDCRippleFoundation.numbers.TAP_DELAY_MS);
|
2267 | };
|
2268 | MDCRippleFoundation.prototype.deactivateImpl = function () {
|
2269 | var _this = this;
|
2270 | var activationState = this.activationState;
|
2271 |
|
2272 | if (!activationState.isActivated) {
|
2273 | return;
|
2274 | }
|
2275 | var state = __assign({}, activationState);
|
2276 | if (activationState.isProgrammatic) {
|
2277 | requestAnimationFrame(function () {
|
2278 | _this.animateDeactivation(state);
|
2279 | });
|
2280 | this.resetActivationState();
|
2281 | } else {
|
2282 | this.deregisterDeactivationHandlers();
|
2283 | requestAnimationFrame(function () {
|
2284 | _this.activationState.hasDeactivationUXRun = true;
|
2285 | _this.animateDeactivation(state);
|
2286 | _this.resetActivationState();
|
2287 | });
|
2288 | }
|
2289 | };
|
2290 | MDCRippleFoundation.prototype.animateDeactivation = function (_a) {
|
2291 | var wasActivatedByPointer = _a.wasActivatedByPointer,
|
2292 | wasElementMadeActive = _a.wasElementMadeActive;
|
2293 | if (wasActivatedByPointer || wasElementMadeActive) {
|
2294 | this.runDeactivationUXLogicIfReady();
|
2295 | }
|
2296 | };
|
2297 | MDCRippleFoundation.prototype.layoutInternal = function () {
|
2298 | var _this = this;
|
2299 | this.frame = this.adapter.computeBoundingRect();
|
2300 | var maxDim = Math.max(this.frame.height, this.frame.width);
|
2301 |
|
2302 |
|
2303 |
|
2304 |
|
2305 |
|
2306 |
|
2307 | var getBoundedRadius = function getBoundedRadius() {
|
2308 | var hypotenuse = Math.sqrt(Math.pow(_this.frame.width, 2) + Math.pow(_this.frame.height, 2));
|
2309 | return hypotenuse + MDCRippleFoundation.numbers.PADDING;
|
2310 | };
|
2311 | this.maxRadius = this.adapter.isUnbounded() ? maxDim : getBoundedRadius();
|
2312 |
|
2313 | var initialSize = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);
|
2314 |
|
2315 | if (this.adapter.isUnbounded() && initialSize % 2 !== 0) {
|
2316 | this.initialSize = initialSize - 1;
|
2317 | } else {
|
2318 | this.initialSize = initialSize;
|
2319 | }
|
2320 | this.fgScale = "" + this.maxRadius / this.initialSize;
|
2321 | this.updateLayoutCssVars();
|
2322 | };
|
2323 | MDCRippleFoundation.prototype.updateLayoutCssVars = function () {
|
2324 | var _a = MDCRippleFoundation.strings,
|
2325 | VAR_FG_SIZE = _a.VAR_FG_SIZE,
|
2326 | VAR_LEFT = _a.VAR_LEFT,
|
2327 | VAR_TOP = _a.VAR_TOP,
|
2328 | VAR_FG_SCALE = _a.VAR_FG_SCALE;
|
2329 | this.adapter.updateCssVariable(VAR_FG_SIZE, this.initialSize + "px");
|
2330 | this.adapter.updateCssVariable(VAR_FG_SCALE, this.fgScale);
|
2331 | if (this.adapter.isUnbounded()) {
|
2332 | this.unboundedCoords = {
|
2333 | left: Math.round(this.frame.width / 2 - this.initialSize / 2),
|
2334 | top: Math.round(this.frame.height / 2 - this.initialSize / 2)
|
2335 | };
|
2336 | this.adapter.updateCssVariable(VAR_LEFT, this.unboundedCoords.left + "px");
|
2337 | this.adapter.updateCssVariable(VAR_TOP, this.unboundedCoords.top + "px");
|
2338 | }
|
2339 | };
|
2340 | return MDCRippleFoundation;
|
2341 | }(foundation_1.MDCFoundation);
|
2342 | exports.MDCRippleFoundation = MDCRippleFoundation;
|
2343 |
|
2344 | exports.default = MDCRippleFoundation;
|
2345 |
|
2346 | }),
|
2347 |
|
2348 | "./packages/mdc-ripple/util.ts":
|
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 | (function(module, exports, __webpack_require__) {
|
2354 |
|
2355 | "use strict";
|
2356 |
|
2357 |
|
2358 | Object.defineProperty(exports, "__esModule", { value: true });
|
2359 | exports.getNormalizedEventCoords = exports.supportsCssVariables = void 0;
|
2360 |
|
2361 |
|
2362 |
|
2363 |
|
2364 | var supportsCssVariables_;
|
2365 | function supportsCssVariables(windowObj, forceRefresh) {
|
2366 | if (forceRefresh === void 0) {
|
2367 | forceRefresh = false;
|
2368 | }
|
2369 | var CSS = windowObj.CSS;
|
2370 | var supportsCssVars = supportsCssVariables_;
|
2371 | if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {
|
2372 | return supportsCssVariables_;
|
2373 | }
|
2374 | var supportsFunctionPresent = CSS && typeof CSS.supports === 'function';
|
2375 | if (!supportsFunctionPresent) {
|
2376 | return false;
|
2377 | }
|
2378 | var explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes');
|
2379 |
|
2380 |
|
2381 | var weAreFeatureDetectingSafari10plus = CSS.supports('(--css-vars: yes)') && CSS.supports('color', '#00000000');
|
2382 | supportsCssVars = explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus;
|
2383 | if (!forceRefresh) {
|
2384 | supportsCssVariables_ = supportsCssVars;
|
2385 | }
|
2386 | return supportsCssVars;
|
2387 | }
|
2388 | exports.supportsCssVariables = supportsCssVariables;
|
2389 | function getNormalizedEventCoords(evt, pageOffset, clientRect) {
|
2390 | if (!evt) {
|
2391 | return { x: 0, y: 0 };
|
2392 | }
|
2393 | var x = pageOffset.x,
|
2394 | y = pageOffset.y;
|
2395 | var documentX = x + clientRect.left;
|
2396 | var documentY = y + clientRect.top;
|
2397 | var normalizedX;
|
2398 | var normalizedY;
|
2399 |
|
2400 | if (evt.type === 'touchstart') {
|
2401 | var touchEvent = evt;
|
2402 | normalizedX = touchEvent.changedTouches[0].pageX - documentX;
|
2403 | normalizedY = touchEvent.changedTouches[0].pageY - documentY;
|
2404 | } else {
|
2405 | var mouseEvent = evt;
|
2406 | normalizedX = mouseEvent.pageX - documentX;
|
2407 | normalizedY = mouseEvent.pageY - documentY;
|
2408 | }
|
2409 | return { x: normalizedX, y: normalizedY };
|
2410 | }
|
2411 | exports.getNormalizedEventCoords = getNormalizedEventCoords;
|
2412 |
|
2413 | }),
|
2414 |
|
2415 | "./packages/mdc-textfield/adapter.ts":
|
2416 |
|
2417 |
|
2418 |
|
2419 |
|
2420 | (function(module, exports, __webpack_require__) {
|
2421 |
|
2422 | "use strict";
|
2423 |
|
2424 |
|
2425 |
|
2426 |
|
2427 |
|
2428 |
|
2429 |
|
2430 |
|
2431 |
|
2432 |
|
2433 |
|
2434 |
|
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 |
|
2442 |
|
2443 |
|
2444 |
|
2445 |
|
2446 |
|
2447 | Object.defineProperty(exports, "__esModule", { value: true });
|
2448 |
|
2449 | }),
|
2450 |
|
2451 | "./packages/mdc-textfield/character-counter/adapter.ts":
|
2452 |
|
2453 |
|
2454 |
|
2455 |
|
2456 | (function(module, exports, __webpack_require__) {
|
2457 |
|
2458 | "use strict";
|
2459 |
|
2460 |
|
2461 |
|
2462 |
|
2463 |
|
2464 |
|
2465 |
|
2466 |
|
2467 |
|
2468 |
|
2469 |
|
2470 |
|
2471 |
|
2472 |
|
2473 |
|
2474 |
|
2475 |
|
2476 |
|
2477 |
|
2478 |
|
2479 |
|
2480 |
|
2481 |
|
2482 |
|
2483 | Object.defineProperty(exports, "__esModule", { value: true });
|
2484 |
|
2485 | }),
|
2486 |
|
2487 | "./packages/mdc-textfield/character-counter/component.ts":
|
2488 |
|
2489 |
|
2490 |
|
2491 |
|
2492 | (function(module, exports, __webpack_require__) {
|
2493 |
|
2494 | "use strict";
|
2495 |
|
2496 |
|
2497 |
|
2498 |
|
2499 |
|
2500 |
|
2501 |
|
2502 |
|
2503 |
|
2504 |
|
2505 |
|
2506 |
|
2507 |
|
2508 |
|
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 | var __extends = this && this.__extends || function () {
|
2520 | var _extendStatics = function extendStatics(d, b) {
|
2521 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
2522 | d.__proto__ = b;
|
2523 | } || function (d, b) {
|
2524 | for (var p in b) {
|
2525 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
2526 | }
|
2527 | };
|
2528 | return _extendStatics(d, b);
|
2529 | };
|
2530 | return function (d, b) {
|
2531 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
2532 | _extendStatics(d, b);
|
2533 | function __() {
|
2534 | this.constructor = d;
|
2535 | }
|
2536 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
2537 | };
|
2538 | }();
|
2539 | Object.defineProperty(exports, "__esModule", { value: true });
|
2540 | exports.MDCTextFieldCharacterCounter = void 0;
|
2541 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
2542 | var foundation_1 = __webpack_require__( "./packages/mdc-textfield/character-counter/foundation.ts");
|
2543 | var MDCTextFieldCharacterCounter = function (_super) {
|
2544 | __extends(MDCTextFieldCharacterCounter, _super);
|
2545 | function MDCTextFieldCharacterCounter() {
|
2546 | return _super !== null && _super.apply(this, arguments) || this;
|
2547 | }
|
2548 | MDCTextFieldCharacterCounter.attachTo = function (root) {
|
2549 | return new MDCTextFieldCharacterCounter(root);
|
2550 | };
|
2551 | Object.defineProperty(MDCTextFieldCharacterCounter.prototype, "foundationForTextField", {
|
2552 |
|
2553 | get: function get() {
|
2554 | return this.foundation;
|
2555 | },
|
2556 | enumerable: false,
|
2557 | configurable: true
|
2558 | });
|
2559 | MDCTextFieldCharacterCounter.prototype.getDefaultFoundation = function () {
|
2560 | var _this = this;
|
2561 |
|
2562 |
|
2563 | var adapter = {
|
2564 | setContent: function setContent(content) {
|
2565 | _this.root.textContent = content;
|
2566 | }
|
2567 | };
|
2568 | return new foundation_1.MDCTextFieldCharacterCounterFoundation(adapter);
|
2569 | };
|
2570 | return MDCTextFieldCharacterCounter;
|
2571 | }(component_1.MDCComponent);
|
2572 | exports.MDCTextFieldCharacterCounter = MDCTextFieldCharacterCounter;
|
2573 |
|
2574 | }),
|
2575 |
|
2576 | "./packages/mdc-textfield/character-counter/constants.ts":
|
2577 |
|
2578 |
|
2579 |
|
2580 |
|
2581 | (function(module, exports, __webpack_require__) {
|
2582 |
|
2583 | "use strict";
|
2584 |
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 |
|
2593 |
|
2594 |
|
2595 |
|
2596 |
|
2597 |
|
2598 |
|
2599 |
|
2600 |
|
2601 |
|
2602 |
|
2603 |
|
2604 |
|
2605 |
|
2606 |
|
2607 |
|
2608 | Object.defineProperty(exports, "__esModule", { value: true });
|
2609 | exports.cssClasses = exports.strings = void 0;
|
2610 | var cssClasses = {
|
2611 | ROOT: 'mdc-text-field-character-counter'
|
2612 | };
|
2613 | exports.cssClasses = cssClasses;
|
2614 | var strings = {
|
2615 | ROOT_SELECTOR: "." + cssClasses.ROOT
|
2616 | };
|
2617 | exports.strings = strings;
|
2618 |
|
2619 | }),
|
2620 |
|
2621 | "./packages/mdc-textfield/character-counter/foundation.ts":
|
2622 |
|
2623 |
|
2624 |
|
2625 |
|
2626 | (function(module, exports, __webpack_require__) {
|
2627 |
|
2628 | "use strict";
|
2629 |
|
2630 |
|
2631 |
|
2632 |
|
2633 |
|
2634 |
|
2635 |
|
2636 |
|
2637 |
|
2638 |
|
2639 |
|
2640 |
|
2641 |
|
2642 |
|
2643 |
|
2644 |
|
2645 |
|
2646 |
|
2647 |
|
2648 |
|
2649 |
|
2650 |
|
2651 |
|
2652 |
|
2653 | var __extends = this && this.__extends || function () {
|
2654 | var _extendStatics = function extendStatics(d, b) {
|
2655 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
2656 | d.__proto__ = b;
|
2657 | } || function (d, b) {
|
2658 | for (var p in b) {
|
2659 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
2660 | }
|
2661 | };
|
2662 | return _extendStatics(d, b);
|
2663 | };
|
2664 | return function (d, b) {
|
2665 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
2666 | _extendStatics(d, b);
|
2667 | function __() {
|
2668 | this.constructor = d;
|
2669 | }
|
2670 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
2671 | };
|
2672 | }();
|
2673 | var __assign = this && this.__assign || function () {
|
2674 | __assign = Object.assign || function (t) {
|
2675 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
2676 | s = arguments[i];
|
2677 | for (var p in s) {
|
2678 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
2679 | }
|
2680 | }
|
2681 | return t;
|
2682 | };
|
2683 | return __assign.apply(this, arguments);
|
2684 | };
|
2685 | Object.defineProperty(exports, "__esModule", { value: true });
|
2686 | exports.MDCTextFieldCharacterCounterFoundation = void 0;
|
2687 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
2688 | var constants_1 = __webpack_require__( "./packages/mdc-textfield/character-counter/constants.ts");
|
2689 | var MDCTextFieldCharacterCounterFoundation = function (_super) {
|
2690 | __extends(MDCTextFieldCharacterCounterFoundation, _super);
|
2691 | function MDCTextFieldCharacterCounterFoundation(adapter) {
|
2692 | return _super.call(this, __assign(__assign({}, MDCTextFieldCharacterCounterFoundation.defaultAdapter), adapter)) || this;
|
2693 | }
|
2694 | Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "cssClasses", {
|
2695 | get: function get() {
|
2696 | return constants_1.cssClasses;
|
2697 | },
|
2698 | enumerable: false,
|
2699 | configurable: true
|
2700 | });
|
2701 | Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "strings", {
|
2702 | get: function get() {
|
2703 | return constants_1.strings;
|
2704 | },
|
2705 | enumerable: false,
|
2706 | configurable: true
|
2707 | });
|
2708 | Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "defaultAdapter", {
|
2709 | |
2710 |
|
2711 |
|
2712 | get: function get() {
|
2713 | return {
|
2714 | setContent: function setContent() {
|
2715 | return undefined;
|
2716 | }
|
2717 | };
|
2718 | },
|
2719 | enumerable: false,
|
2720 | configurable: true
|
2721 | });
|
2722 | MDCTextFieldCharacterCounterFoundation.prototype.setCounterValue = function (currentLength, maxLength) {
|
2723 | currentLength = Math.min(currentLength, maxLength);
|
2724 | this.adapter.setContent(currentLength + " / " + maxLength);
|
2725 | };
|
2726 | return MDCTextFieldCharacterCounterFoundation;
|
2727 | }(foundation_1.MDCFoundation);
|
2728 | exports.MDCTextFieldCharacterCounterFoundation = MDCTextFieldCharacterCounterFoundation;
|
2729 |
|
2730 | exports.default = MDCTextFieldCharacterCounterFoundation;
|
2731 |
|
2732 | }),
|
2733 |
|
2734 | "./packages/mdc-textfield/character-counter/index.ts":
|
2735 |
|
2736 |
|
2737 |
|
2738 |
|
2739 | (function(module, exports, __webpack_require__) {
|
2740 |
|
2741 | "use strict";
|
2742 |
|
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 |
|
2750 |
|
2751 |
|
2752 |
|
2753 |
|
2754 |
|
2755 |
|
2756 |
|
2757 |
|
2758 |
|
2759 |
|
2760 |
|
2761 |
|
2762 |
|
2763 |
|
2764 |
|
2765 |
|
2766 | var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
2767 | if (k2 === undefined) k2 = k;
|
2768 | Object.defineProperty(o, k2, { enumerable: true, get: function get() {
|
2769 | return m[k];
|
2770 | } });
|
2771 | } : function (o, m, k, k2) {
|
2772 | if (k2 === undefined) k2 = k;
|
2773 | o[k2] = m[k];
|
2774 | });
|
2775 | var __exportStar = this && this.__exportStar || function (m, exports) {
|
2776 | for (var p in m) {
|
2777 | if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
2778 | }
|
2779 | };
|
2780 | Object.defineProperty(exports, "__esModule", { value: true });
|
2781 | exports.characterCountStrings = exports.characterCountCssClasses = void 0;
|
2782 | __exportStar(__webpack_require__( "./packages/mdc-textfield/character-counter/adapter.ts"), exports);
|
2783 | __exportStar(__webpack_require__( "./packages/mdc-textfield/character-counter/component.ts"), exports);
|
2784 | __exportStar(__webpack_require__( "./packages/mdc-textfield/character-counter/foundation.ts"), exports);
|
2785 | var constants_1 = __webpack_require__( "./packages/mdc-textfield/character-counter/constants.ts");
|
2786 | Object.defineProperty(exports, "characterCountCssClasses", { enumerable: true, get: function get() {
|
2787 | return constants_1.cssClasses;
|
2788 | } });
|
2789 | Object.defineProperty(exports, "characterCountStrings", { enumerable: true, get: function get() {
|
2790 | return constants_1.strings;
|
2791 | } });
|
2792 |
|
2793 | }),
|
2794 |
|
2795 | "./packages/mdc-textfield/component.ts":
|
2796 |
|
2797 |
|
2798 |
|
2799 |
|
2800 | (function(module, exports, __webpack_require__) {
|
2801 |
|
2802 | "use strict";
|
2803 |
|
2804 |
|
2805 |
|
2806 |
|
2807 |
|
2808 |
|
2809 |
|
2810 |
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 |
|
2819 |
|
2820 |
|
2821 |
|
2822 |
|
2823 |
|
2824 |
|
2825 |
|
2826 |
|
2827 | var __extends = this && this.__extends || function () {
|
2828 | var _extendStatics = function extendStatics(d, b) {
|
2829 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
2830 | d.__proto__ = b;
|
2831 | } || function (d, b) {
|
2832 | for (var p in b) {
|
2833 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
2834 | }
|
2835 | };
|
2836 | return _extendStatics(d, b);
|
2837 | };
|
2838 | return function (d, b) {
|
2839 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
2840 | _extendStatics(d, b);
|
2841 | function __() {
|
2842 | this.constructor = d;
|
2843 | }
|
2844 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
2845 | };
|
2846 | }();
|
2847 | var __assign = this && this.__assign || function () {
|
2848 | __assign = Object.assign || function (t) {
|
2849 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
2850 | s = arguments[i];
|
2851 | for (var p in s) {
|
2852 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
2853 | }
|
2854 | }
|
2855 | return t;
|
2856 | };
|
2857 | return __assign.apply(this, arguments);
|
2858 | };
|
2859 | var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
2860 | if (k2 === undefined) k2 = k;
|
2861 | Object.defineProperty(o, k2, { enumerable: true, get: function get() {
|
2862 | return m[k];
|
2863 | } });
|
2864 | } : function (o, m, k, k2) {
|
2865 | if (k2 === undefined) k2 = k;
|
2866 | o[k2] = m[k];
|
2867 | });
|
2868 | var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
2869 | Object.defineProperty(o, "default", { enumerable: true, value: v });
|
2870 | } : function (o, v) {
|
2871 | o["default"] = v;
|
2872 | });
|
2873 | var __importStar = this && this.__importStar || function (mod) {
|
2874 | if (mod && mod.__esModule) return mod;
|
2875 | var result = {};
|
2876 | if (mod != null) for (var k in mod) {
|
2877 | if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
2878 | }__setModuleDefault(result, mod);
|
2879 | return result;
|
2880 | };
|
2881 | Object.defineProperty(exports, "__esModule", { value: true });
|
2882 | exports.MDCTextField = void 0;
|
2883 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
2884 | var events_1 = __webpack_require__( "./packages/mdc-dom/events.ts");
|
2885 | var ponyfill = __importStar(__webpack_require__( "./packages/mdc-dom/ponyfill.ts"));
|
2886 | var component_2 = __webpack_require__( "./packages/mdc-floating-label/component.ts");
|
2887 | var component_3 = __webpack_require__( "./packages/mdc-line-ripple/component.ts");
|
2888 | var component_4 = __webpack_require__( "./packages/mdc-notched-outline/component.ts");
|
2889 | var component_5 = __webpack_require__( "./packages/mdc-ripple/component.ts");
|
2890 | var foundation_1 = __webpack_require__( "./packages/mdc-ripple/foundation.ts");
|
2891 | var component_6 = __webpack_require__( "./packages/mdc-textfield/character-counter/component.ts");
|
2892 | var foundation_2 = __webpack_require__( "./packages/mdc-textfield/character-counter/foundation.ts");
|
2893 | var constants_1 = __webpack_require__( "./packages/mdc-textfield/constants.ts");
|
2894 | var foundation_3 = __webpack_require__( "./packages/mdc-textfield/foundation.ts");
|
2895 | var component_7 = __webpack_require__( "./packages/mdc-textfield/helper-text/component.ts");
|
2896 | var foundation_4 = __webpack_require__( "./packages/mdc-textfield/helper-text/foundation.ts");
|
2897 | var component_8 = __webpack_require__( "./packages/mdc-textfield/icon/component.ts");
|
2898 | var MDCTextField = function (_super) {
|
2899 | __extends(MDCTextField, _super);
|
2900 | function MDCTextField() {
|
2901 | return _super !== null && _super.apply(this, arguments) || this;
|
2902 | }
|
2903 | MDCTextField.attachTo = function (root) {
|
2904 | return new MDCTextField(root);
|
2905 | };
|
2906 | MDCTextField.prototype.initialize = function (rippleFactory, lineRippleFactory, helperTextFactory, characterCounterFactory, iconFactory, labelFactory, outlineFactory) {
|
2907 | if (rippleFactory === void 0) {
|
2908 | rippleFactory = function rippleFactory(el, foundation) {
|
2909 | return new component_5.MDCRipple(el, foundation);
|
2910 | };
|
2911 | }
|
2912 | if (lineRippleFactory === void 0) {
|
2913 | lineRippleFactory = function lineRippleFactory(el) {
|
2914 | return new component_3.MDCLineRipple(el);
|
2915 | };
|
2916 | }
|
2917 | if (helperTextFactory === void 0) {
|
2918 | helperTextFactory = function helperTextFactory(el) {
|
2919 | return new component_7.MDCTextFieldHelperText(el);
|
2920 | };
|
2921 | }
|
2922 | if (characterCounterFactory === void 0) {
|
2923 | characterCounterFactory = function characterCounterFactory(el) {
|
2924 | return new component_6.MDCTextFieldCharacterCounter(el);
|
2925 | };
|
2926 | }
|
2927 | if (iconFactory === void 0) {
|
2928 | iconFactory = function iconFactory(el) {
|
2929 | return new component_8.MDCTextFieldIcon(el);
|
2930 | };
|
2931 | }
|
2932 | if (labelFactory === void 0) {
|
2933 | labelFactory = function labelFactory(el) {
|
2934 | return new component_2.MDCFloatingLabel(el);
|
2935 | };
|
2936 | }
|
2937 | if (outlineFactory === void 0) {
|
2938 | outlineFactory = function outlineFactory(el) {
|
2939 | return new component_4.MDCNotchedOutline(el);
|
2940 | };
|
2941 | }
|
2942 | this.input = this.root.querySelector(constants_1.strings.INPUT_SELECTOR);
|
2943 | var labelElement = this.root.querySelector(constants_1.strings.LABEL_SELECTOR);
|
2944 | this.label = labelElement ? labelFactory(labelElement) : null;
|
2945 | var lineRippleElement = this.root.querySelector(constants_1.strings.LINE_RIPPLE_SELECTOR);
|
2946 | this.lineRipple = lineRippleElement ? lineRippleFactory(lineRippleElement) : null;
|
2947 | var outlineElement = this.root.querySelector(constants_1.strings.OUTLINE_SELECTOR);
|
2948 | this.outline = outlineElement ? outlineFactory(outlineElement) : null;
|
2949 |
|
2950 | var helperTextStrings = foundation_4.MDCTextFieldHelperTextFoundation.strings;
|
2951 | var nextElementSibling = this.root.nextElementSibling;
|
2952 | var hasHelperLine = nextElementSibling && nextElementSibling.classList.contains(constants_1.cssClasses.HELPER_LINE);
|
2953 | var helperTextEl = hasHelperLine && nextElementSibling && nextElementSibling.querySelector(helperTextStrings.ROOT_SELECTOR);
|
2954 | this.helperText = helperTextEl ? helperTextFactory(helperTextEl) : null;
|
2955 |
|
2956 | var characterCounterStrings = foundation_2.MDCTextFieldCharacterCounterFoundation.strings;
|
2957 | var characterCounterEl = this.root.querySelector(characterCounterStrings.ROOT_SELECTOR);
|
2958 |
|
2959 | if (!characterCounterEl && hasHelperLine && nextElementSibling) {
|
2960 | characterCounterEl = nextElementSibling.querySelector(characterCounterStrings.ROOT_SELECTOR);
|
2961 | }
|
2962 | this.characterCounter = characterCounterEl ? characterCounterFactory(characterCounterEl) : null;
|
2963 |
|
2964 | var leadingIconEl = this.root.querySelector(constants_1.strings.LEADING_ICON_SELECTOR);
|
2965 | this.leadingIcon = leadingIconEl ? iconFactory(leadingIconEl) : null;
|
2966 |
|
2967 | var trailingIconEl = this.root.querySelector(constants_1.strings.TRAILING_ICON_SELECTOR);
|
2968 | this.trailingIcon = trailingIconEl ? iconFactory(trailingIconEl) : null;
|
2969 |
|
2970 | this.prefix = this.root.querySelector(constants_1.strings.PREFIX_SELECTOR);
|
2971 | this.suffix = this.root.querySelector(constants_1.strings.SUFFIX_SELECTOR);
|
2972 | this.ripple = this.createRipple(rippleFactory);
|
2973 | };
|
2974 | MDCTextField.prototype.destroy = function () {
|
2975 | if (this.ripple) {
|
2976 | this.ripple.destroy();
|
2977 | }
|
2978 | if (this.lineRipple) {
|
2979 | this.lineRipple.destroy();
|
2980 | }
|
2981 | if (this.helperText) {
|
2982 | this.helperText.destroy();
|
2983 | }
|
2984 | if (this.characterCounter) {
|
2985 | this.characterCounter.destroy();
|
2986 | }
|
2987 | if (this.leadingIcon) {
|
2988 | this.leadingIcon.destroy();
|
2989 | }
|
2990 | if (this.trailingIcon) {
|
2991 | this.trailingIcon.destroy();
|
2992 | }
|
2993 | if (this.label) {
|
2994 | this.label.destroy();
|
2995 | }
|
2996 | if (this.outline) {
|
2997 | this.outline.destroy();
|
2998 | }
|
2999 | _super.prototype.destroy.call(this);
|
3000 | };
|
3001 | |
3002 |
|
3003 |
|
3004 |
|
3005 | MDCTextField.prototype.initialSyncWithDOM = function () {
|
3006 | this.disabled = this.input.disabled;
|
3007 | };
|
3008 | Object.defineProperty(MDCTextField.prototype, "value", {
|
3009 | get: function get() {
|
3010 | return this.foundation.getValue();
|
3011 | },
|
3012 | |
3013 |
|
3014 |
|
3015 | set: function set(value) {
|
3016 | this.foundation.setValue(value);
|
3017 | },
|
3018 | enumerable: false,
|
3019 | configurable: true
|
3020 | });
|
3021 | Object.defineProperty(MDCTextField.prototype, "disabled", {
|
3022 | get: function get() {
|
3023 | return this.foundation.isDisabled();
|
3024 | },
|
3025 | |
3026 |
|
3027 |
|
3028 | set: function set(disabled) {
|
3029 | this.foundation.setDisabled(disabled);
|
3030 | },
|
3031 | enumerable: false,
|
3032 | configurable: true
|
3033 | });
|
3034 | Object.defineProperty(MDCTextField.prototype, "valid", {
|
3035 | get: function get() {
|
3036 | return this.foundation.isValid();
|
3037 | },
|
3038 | |
3039 |
|
3040 |
|
3041 | set: function set(valid) {
|
3042 | this.foundation.setValid(valid);
|
3043 | },
|
3044 | enumerable: false,
|
3045 | configurable: true
|
3046 | });
|
3047 | Object.defineProperty(MDCTextField.prototype, "required", {
|
3048 | get: function get() {
|
3049 | return this.input.required;
|
3050 | },
|
3051 | |
3052 |
|
3053 |
|
3054 | set: function set(required) {
|
3055 | this.input.required = required;
|
3056 | },
|
3057 | enumerable: false,
|
3058 | configurable: true
|
3059 | });
|
3060 | Object.defineProperty(MDCTextField.prototype, "pattern", {
|
3061 | get: function get() {
|
3062 | return this.input.pattern;
|
3063 | },
|
3064 | |
3065 |
|
3066 |
|
3067 | set: function set(pattern) {
|
3068 | this.input.pattern = pattern;
|
3069 | },
|
3070 | enumerable: false,
|
3071 | configurable: true
|
3072 | });
|
3073 | Object.defineProperty(MDCTextField.prototype, "minLength", {
|
3074 | get: function get() {
|
3075 | return this.input.minLength;
|
3076 | },
|
3077 | |
3078 |
|
3079 |
|
3080 | set: function set(minLength) {
|
3081 | this.input.minLength = minLength;
|
3082 | },
|
3083 | enumerable: false,
|
3084 | configurable: true
|
3085 | });
|
3086 | Object.defineProperty(MDCTextField.prototype, "maxLength", {
|
3087 | get: function get() {
|
3088 | return this.input.maxLength;
|
3089 | },
|
3090 | |
3091 |
|
3092 |
|
3093 | set: function set(maxLength) {
|
3094 |
|
3095 | if (maxLength < 0) {
|
3096 | this.input.removeAttribute('maxLength');
|
3097 | } else {
|
3098 | this.input.maxLength = maxLength;
|
3099 | }
|
3100 | },
|
3101 | enumerable: false,
|
3102 | configurable: true
|
3103 | });
|
3104 | Object.defineProperty(MDCTextField.prototype, "min", {
|
3105 | get: function get() {
|
3106 | return this.input.min;
|
3107 | },
|
3108 | |
3109 |
|
3110 |
|
3111 | set: function set(min) {
|
3112 | this.input.min = min;
|
3113 | },
|
3114 | enumerable: false,
|
3115 | configurable: true
|
3116 | });
|
3117 | Object.defineProperty(MDCTextField.prototype, "max", {
|
3118 | get: function get() {
|
3119 | return this.input.max;
|
3120 | },
|
3121 | |
3122 |
|
3123 |
|
3124 | set: function set(max) {
|
3125 | this.input.max = max;
|
3126 | },
|
3127 | enumerable: false,
|
3128 | configurable: true
|
3129 | });
|
3130 | Object.defineProperty(MDCTextField.prototype, "step", {
|
3131 | get: function get() {
|
3132 | return this.input.step;
|
3133 | },
|
3134 | |
3135 |
|
3136 |
|
3137 | set: function set(step) {
|
3138 | this.input.step = step;
|
3139 | },
|
3140 | enumerable: false,
|
3141 | configurable: true
|
3142 | });
|
3143 | Object.defineProperty(MDCTextField.prototype, "helperTextContent", {
|
3144 | |
3145 |
|
3146 |
|
3147 | set: function set(content) {
|
3148 | this.foundation.setHelperTextContent(content);
|
3149 | },
|
3150 | enumerable: false,
|
3151 | configurable: true
|
3152 | });
|
3153 | Object.defineProperty(MDCTextField.prototype, "leadingIconAriaLabel", {
|
3154 | |
3155 |
|
3156 |
|
3157 | set: function set(label) {
|
3158 | this.foundation.setLeadingIconAriaLabel(label);
|
3159 | },
|
3160 | enumerable: false,
|
3161 | configurable: true
|
3162 | });
|
3163 | Object.defineProperty(MDCTextField.prototype, "leadingIconContent", {
|
3164 | |
3165 |
|
3166 |
|
3167 | set: function set(content) {
|
3168 | this.foundation.setLeadingIconContent(content);
|
3169 | },
|
3170 | enumerable: false,
|
3171 | configurable: true
|
3172 | });
|
3173 | Object.defineProperty(MDCTextField.prototype, "trailingIconAriaLabel", {
|
3174 | |
3175 |
|
3176 |
|
3177 | set: function set(label) {
|
3178 | this.foundation.setTrailingIconAriaLabel(label);
|
3179 | },
|
3180 | enumerable: false,
|
3181 | configurable: true
|
3182 | });
|
3183 | Object.defineProperty(MDCTextField.prototype, "trailingIconContent", {
|
3184 | |
3185 |
|
3186 |
|
3187 | set: function set(content) {
|
3188 | this.foundation.setTrailingIconContent(content);
|
3189 | },
|
3190 | enumerable: false,
|
3191 | configurable: true
|
3192 | });
|
3193 | Object.defineProperty(MDCTextField.prototype, "useNativeValidation", {
|
3194 | |
3195 |
|
3196 |
|
3197 |
|
3198 | set: function set(useNativeValidation) {
|
3199 | this.foundation.setUseNativeValidation(useNativeValidation);
|
3200 | },
|
3201 | enumerable: false,
|
3202 | configurable: true
|
3203 | });
|
3204 | Object.defineProperty(MDCTextField.prototype, "prefixText", {
|
3205 | |
3206 |
|
3207 |
|
3208 | get: function get() {
|
3209 | return this.prefix ? this.prefix.textContent : null;
|
3210 | },
|
3211 | |
3212 |
|
3213 |
|
3214 | set: function set(prefixText) {
|
3215 | if (this.prefix) {
|
3216 | this.prefix.textContent = prefixText;
|
3217 | }
|
3218 | },
|
3219 | enumerable: false,
|
3220 | configurable: true
|
3221 | });
|
3222 | Object.defineProperty(MDCTextField.prototype, "suffixText", {
|
3223 | |
3224 |
|
3225 |
|
3226 | get: function get() {
|
3227 | return this.suffix ? this.suffix.textContent : null;
|
3228 | },
|
3229 | |
3230 |
|
3231 |
|
3232 | set: function set(suffixText) {
|
3233 | if (this.suffix) {
|
3234 | this.suffix.textContent = suffixText;
|
3235 | }
|
3236 | },
|
3237 | enumerable: false,
|
3238 | configurable: true
|
3239 | });
|
3240 | |
3241 |
|
3242 |
|
3243 | MDCTextField.prototype.focus = function () {
|
3244 | this.input.focus();
|
3245 | };
|
3246 | |
3247 |
|
3248 |
|
3249 | MDCTextField.prototype.layout = function () {
|
3250 | var openNotch = this.foundation.shouldFloat;
|
3251 | this.foundation.notchOutline(openNotch);
|
3252 | };
|
3253 | MDCTextField.prototype.getDefaultFoundation = function () {
|
3254 |
|
3255 |
|
3256 |
|
3257 | var adapter = __assign(__assign(__assign(__assign(__assign({}, this.getRootAdapterMethods()), this.getInputAdapterMethods()), this.getLabelAdapterMethods()), this.getLineRippleAdapterMethods()), this.getOutlineAdapterMethods());
|
3258 |
|
3259 | return new foundation_3.MDCTextFieldFoundation(adapter, this.getFoundationMap());
|
3260 | };
|
3261 | MDCTextField.prototype.getRootAdapterMethods = function () {
|
3262 | var _this = this;
|
3263 |
|
3264 | return {
|
3265 | addClass: function addClass(className) {
|
3266 | return _this.root.classList.add(className);
|
3267 | },
|
3268 | removeClass: function removeClass(className) {
|
3269 | return _this.root.classList.remove(className);
|
3270 | },
|
3271 | hasClass: function hasClass(className) {
|
3272 | return _this.root.classList.contains(className);
|
3273 | },
|
3274 | registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) {
|
3275 | _this.listen(evtType, handler);
|
3276 | },
|
3277 | deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) {
|
3278 | _this.unlisten(evtType, handler);
|
3279 | },
|
3280 | registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) {
|
3281 | var getAttributesList = function getAttributesList(mutationsList) {
|
3282 | return mutationsList.map(function (mutation) {
|
3283 | return mutation.attributeName;
|
3284 | }).filter(function (attributeName) {
|
3285 | return attributeName;
|
3286 | });
|
3287 | };
|
3288 | var observer = new MutationObserver(function (mutationsList) {
|
3289 | return handler(getAttributesList(mutationsList));
|
3290 | });
|
3291 | var config = { attributes: true };
|
3292 | observer.observe(_this.input, config);
|
3293 | return observer;
|
3294 | },
|
3295 | deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) {
|
3296 | observer.disconnect();
|
3297 | }
|
3298 | };
|
3299 |
|
3300 | };
|
3301 | MDCTextField.prototype.getInputAdapterMethods = function () {
|
3302 | var _this = this;
|
3303 |
|
3304 | return {
|
3305 | getNativeInput: function getNativeInput() {
|
3306 | return _this.input;
|
3307 | },
|
3308 | setInputAttr: function setInputAttr(attr, value) {
|
3309 | _this.input.setAttribute(attr, value);
|
3310 | },
|
3311 | removeInputAttr: function removeInputAttr(attr) {
|
3312 | _this.input.removeAttribute(attr);
|
3313 | },
|
3314 | isFocused: function isFocused() {
|
3315 | return document.activeElement === _this.input;
|
3316 | },
|
3317 | registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) {
|
3318 | _this.input.addEventListener(evtType, handler, events_1.applyPassive());
|
3319 | },
|
3320 | deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) {
|
3321 | _this.input.removeEventListener(evtType, handler, events_1.applyPassive());
|
3322 | }
|
3323 | };
|
3324 |
|
3325 | };
|
3326 | MDCTextField.prototype.getLabelAdapterMethods = function () {
|
3327 | var _this = this;
|
3328 | return {
|
3329 | floatLabel: function floatLabel(shouldFloat) {
|
3330 | _this.label && _this.label.float(shouldFloat);
|
3331 | },
|
3332 | getLabelWidth: function getLabelWidth() {
|
3333 | return _this.label ? _this.label.getWidth() : 0;
|
3334 | },
|
3335 | hasLabel: function hasLabel() {
|
3336 | return Boolean(_this.label);
|
3337 | },
|
3338 | shakeLabel: function shakeLabel(shouldShake) {
|
3339 | _this.label && _this.label.shake(shouldShake);
|
3340 | },
|
3341 | setLabelRequired: function setLabelRequired(isRequired) {
|
3342 | _this.label && _this.label.setRequired(isRequired);
|
3343 | }
|
3344 | };
|
3345 | };
|
3346 | MDCTextField.prototype.getLineRippleAdapterMethods = function () {
|
3347 | var _this = this;
|
3348 | return {
|
3349 | activateLineRipple: function activateLineRipple() {
|
3350 | if (_this.lineRipple) {
|
3351 | _this.lineRipple.activate();
|
3352 | }
|
3353 | },
|
3354 | deactivateLineRipple: function deactivateLineRipple() {
|
3355 | if (_this.lineRipple) {
|
3356 | _this.lineRipple.deactivate();
|
3357 | }
|
3358 | },
|
3359 | setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) {
|
3360 | if (_this.lineRipple) {
|
3361 | _this.lineRipple.setRippleCenter(normalizedX);
|
3362 | }
|
3363 | }
|
3364 | };
|
3365 | };
|
3366 | MDCTextField.prototype.getOutlineAdapterMethods = function () {
|
3367 | var _this = this;
|
3368 | return {
|
3369 | closeOutline: function closeOutline() {
|
3370 | _this.outline && _this.outline.closeNotch();
|
3371 | },
|
3372 | hasOutline: function hasOutline() {
|
3373 | return Boolean(_this.outline);
|
3374 | },
|
3375 | notchOutline: function notchOutline(labelWidth) {
|
3376 | _this.outline && _this.outline.notch(labelWidth);
|
3377 | }
|
3378 | };
|
3379 | };
|
3380 | |
3381 |
|
3382 |
|
3383 | MDCTextField.prototype.getFoundationMap = function () {
|
3384 | return {
|
3385 | characterCounter: this.characterCounter ? this.characterCounter.foundationForTextField : undefined,
|
3386 | helperText: this.helperText ? this.helperText.foundationForTextField : undefined,
|
3387 | leadingIcon: this.leadingIcon ? this.leadingIcon.foundationForTextField : undefined,
|
3388 | trailingIcon: this.trailingIcon ? this.trailingIcon.foundationForTextField : undefined
|
3389 | };
|
3390 | };
|
3391 | MDCTextField.prototype.createRipple = function (rippleFactory) {
|
3392 | var _this = this;
|
3393 | var isTextArea = this.root.classList.contains(constants_1.cssClasses.TEXTAREA);
|
3394 | var isOutlined = this.root.classList.contains(constants_1.cssClasses.OUTLINED);
|
3395 | if (isTextArea || isOutlined) {
|
3396 | return null;
|
3397 | }
|
3398 |
|
3399 |
|
3400 |
|
3401 | var adapter = __assign(__assign({}, component_5.MDCRipple.createAdapter(this)), { isSurfaceActive: function isSurfaceActive() {
|
3402 | return ponyfill.matches(_this.input, ':active');
|
3403 | }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
3404 | _this.input.addEventListener(evtType, handler, events_1.applyPassive());
|
3405 | }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
3406 | _this.input.removeEventListener(evtType, handler, events_1.applyPassive());
|
3407 | } });
|
3408 |
|
3409 | return rippleFactory(this.root, new foundation_1.MDCRippleFoundation(adapter));
|
3410 | };
|
3411 | return MDCTextField;
|
3412 | }(component_1.MDCComponent);
|
3413 | exports.MDCTextField = MDCTextField;
|
3414 |
|
3415 | }),
|
3416 |
|
3417 | "./packages/mdc-textfield/constants.ts":
|
3418 |
|
3419 |
|
3420 |
|
3421 |
|
3422 | (function(module, exports, __webpack_require__) {
|
3423 |
|
3424 | "use strict";
|
3425 |
|
3426 |
|
3427 |
|
3428 |
|
3429 |
|
3430 |
|
3431 |
|
3432 |
|
3433 |
|
3434 |
|
3435 |
|
3436 |
|
3437 |
|
3438 |
|
3439 |
|
3440 |
|
3441 |
|
3442 |
|
3443 |
|
3444 |
|
3445 |
|
3446 |
|
3447 |
|
3448 |
|
3449 | Object.defineProperty(exports, "__esModule", { value: true });
|
3450 | exports.ALWAYS_FLOAT_TYPES = exports.VALIDATION_ATTR_WHITELIST = exports.numbers = exports.strings = exports.cssClasses = void 0;
|
3451 | var strings = {
|
3452 | ARIA_CONTROLS: 'aria-controls',
|
3453 | ARIA_DESCRIBEDBY: 'aria-describedby',
|
3454 | INPUT_SELECTOR: '.mdc-text-field__input',
|
3455 | LABEL_SELECTOR: '.mdc-floating-label',
|
3456 | LEADING_ICON_SELECTOR: '.mdc-text-field__icon--leading',
|
3457 | LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',
|
3458 | OUTLINE_SELECTOR: '.mdc-notched-outline',
|
3459 | PREFIX_SELECTOR: '.mdc-text-field__affix--prefix',
|
3460 | SUFFIX_SELECTOR: '.mdc-text-field__affix--suffix',
|
3461 | TRAILING_ICON_SELECTOR: '.mdc-text-field__icon--trailing'
|
3462 | };
|
3463 | exports.strings = strings;
|
3464 | var cssClasses = {
|
3465 | DISABLED: 'mdc-text-field--disabled',
|
3466 | FOCUSED: 'mdc-text-field--focused',
|
3467 | HELPER_LINE: 'mdc-text-field-helper-line',
|
3468 | INVALID: 'mdc-text-field--invalid',
|
3469 | LABEL_FLOATING: 'mdc-text-field--label-floating',
|
3470 | NO_LABEL: 'mdc-text-field--no-label',
|
3471 | OUTLINED: 'mdc-text-field--outlined',
|
3472 | ROOT: 'mdc-text-field',
|
3473 | TEXTAREA: 'mdc-text-field--textarea',
|
3474 | WITH_LEADING_ICON: 'mdc-text-field--with-leading-icon',
|
3475 | WITH_TRAILING_ICON: 'mdc-text-field--with-trailing-icon',
|
3476 | WITH_INTERNAL_COUNTER: 'mdc-text-field--with-internal-counter'
|
3477 | };
|
3478 | exports.cssClasses = cssClasses;
|
3479 | var numbers = {
|
3480 | LABEL_SCALE: 0.75
|
3481 | };
|
3482 | exports.numbers = numbers;
|
3483 |
|
3484 |
|
3485 |
|
3486 |
|
3487 |
|
3488 | var VALIDATION_ATTR_WHITELIST = ['pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength'];
|
3489 | exports.VALIDATION_ATTR_WHITELIST = VALIDATION_ATTR_WHITELIST;
|
3490 |
|
3491 |
|
3492 |
|
3493 |
|
3494 | var ALWAYS_FLOAT_TYPES = ['color', 'date', 'datetime-local', 'month', 'range', 'time', 'week'];
|
3495 | exports.ALWAYS_FLOAT_TYPES = ALWAYS_FLOAT_TYPES;
|
3496 |
|
3497 | }),
|
3498 |
|
3499 | "./packages/mdc-textfield/foundation.ts":
|
3500 |
|
3501 |
|
3502 |
|
3503 |
|
3504 | (function(module, exports, __webpack_require__) {
|
3505 |
|
3506 | "use strict";
|
3507 |
|
3508 |
|
3509 |
|
3510 |
|
3511 |
|
3512 |
|
3513 |
|
3514 |
|
3515 |
|
3516 |
|
3517 |
|
3518 |
|
3519 |
|
3520 |
|
3521 |
|
3522 |
|
3523 |
|
3524 |
|
3525 |
|
3526 |
|
3527 |
|
3528 |
|
3529 |
|
3530 |
|
3531 | var __extends = this && this.__extends || function () {
|
3532 | var _extendStatics = function extendStatics(d, b) {
|
3533 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
3534 | d.__proto__ = b;
|
3535 | } || function (d, b) {
|
3536 | for (var p in b) {
|
3537 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
3538 | }
|
3539 | };
|
3540 | return _extendStatics(d, b);
|
3541 | };
|
3542 | return function (d, b) {
|
3543 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
3544 | _extendStatics(d, b);
|
3545 | function __() {
|
3546 | this.constructor = d;
|
3547 | }
|
3548 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
3549 | };
|
3550 | }();
|
3551 | var __assign = this && this.__assign || function () {
|
3552 | __assign = Object.assign || function (t) {
|
3553 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
3554 | s = arguments[i];
|
3555 | for (var p in s) {
|
3556 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
3557 | }
|
3558 | }
|
3559 | return t;
|
3560 | };
|
3561 | return __assign.apply(this, arguments);
|
3562 | };
|
3563 | var __values = this && this.__values || function (o) {
|
3564 | var s = typeof Symbol === "function" && Symbol.iterator,
|
3565 | m = s && o[s],
|
3566 | i = 0;
|
3567 | if (m) return m.call(o);
|
3568 | if (o && typeof o.length === "number") return {
|
3569 | next: function next() {
|
3570 | if (o && i >= o.length) o = void 0;
|
3571 | return { value: o && o[i++], done: !o };
|
3572 | }
|
3573 | };
|
3574 | throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
3575 | };
|
3576 | Object.defineProperty(exports, "__esModule", { value: true });
|
3577 | exports.MDCTextFieldFoundation = void 0;
|
3578 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
3579 | var constants_1 = __webpack_require__( "./packages/mdc-textfield/constants.ts");
|
3580 | var POINTERDOWN_EVENTS = ['mousedown', 'touchstart'];
|
3581 | var INTERACTION_EVENTS = ['click', 'keydown'];
|
3582 | var MDCTextFieldFoundation = function (_super) {
|
3583 | __extends(MDCTextFieldFoundation, _super);
|
3584 | |
3585 |
|
3586 |
|
3587 |
|
3588 | function MDCTextFieldFoundation(adapter, foundationMap) {
|
3589 | if (foundationMap === void 0) {
|
3590 | foundationMap = {};
|
3591 | }
|
3592 | var _this = _super.call(this, __assign(__assign({}, MDCTextFieldFoundation.defaultAdapter), adapter)) || this;
|
3593 | _this.isFocused = false;
|
3594 | _this.receivedUserInput = false;
|
3595 | _this.valid = true;
|
3596 | _this.useNativeValidation = true;
|
3597 | _this.validateOnValueChange = true;
|
3598 | _this.helperText = foundationMap.helperText;
|
3599 | _this.characterCounter = foundationMap.characterCounter;
|
3600 | _this.leadingIcon = foundationMap.leadingIcon;
|
3601 | _this.trailingIcon = foundationMap.trailingIcon;
|
3602 | _this.inputFocusHandler = function () {
|
3603 | _this.activateFocus();
|
3604 | };
|
3605 | _this.inputBlurHandler = function () {
|
3606 | _this.deactivateFocus();
|
3607 | };
|
3608 | _this.inputInputHandler = function () {
|
3609 | _this.handleInput();
|
3610 | };
|
3611 | _this.setPointerXOffset = function (evt) {
|
3612 | _this.setTransformOrigin(evt);
|
3613 | };
|
3614 | _this.textFieldInteractionHandler = function () {
|
3615 | _this.handleTextFieldInteraction();
|
3616 | };
|
3617 | _this.validationAttributeChangeHandler = function (attributesList) {
|
3618 | _this.handleValidationAttributeChange(attributesList);
|
3619 | };
|
3620 | return _this;
|
3621 | }
|
3622 | Object.defineProperty(MDCTextFieldFoundation, "cssClasses", {
|
3623 | get: function get() {
|
3624 | return constants_1.cssClasses;
|
3625 | },
|
3626 | enumerable: false,
|
3627 | configurable: true
|
3628 | });
|
3629 | Object.defineProperty(MDCTextFieldFoundation, "strings", {
|
3630 | get: function get() {
|
3631 | return constants_1.strings;
|
3632 | },
|
3633 | enumerable: false,
|
3634 | configurable: true
|
3635 | });
|
3636 | Object.defineProperty(MDCTextFieldFoundation, "numbers", {
|
3637 | get: function get() {
|
3638 | return constants_1.numbers;
|
3639 | },
|
3640 | enumerable: false,
|
3641 | configurable: true
|
3642 | });
|
3643 | Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldAlwaysFloat", {
|
3644 | get: function get() {
|
3645 | var type = this.getNativeInput().type;
|
3646 | return constants_1.ALWAYS_FLOAT_TYPES.indexOf(type) >= 0;
|
3647 | },
|
3648 | enumerable: false,
|
3649 | configurable: true
|
3650 | });
|
3651 | Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldFloat", {
|
3652 | get: function get() {
|
3653 | return this.shouldAlwaysFloat || this.isFocused || !!this.getValue() || this.isBadInput();
|
3654 | },
|
3655 | enumerable: false,
|
3656 | configurable: true
|
3657 | });
|
3658 | Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldShake", {
|
3659 | get: function get() {
|
3660 | return !this.isFocused && !this.isValid() && !!this.getValue();
|
3661 | },
|
3662 | enumerable: false,
|
3663 | configurable: true
|
3664 | });
|
3665 | Object.defineProperty(MDCTextFieldFoundation, "defaultAdapter", {
|
3666 | |
3667 |
|
3668 |
|
3669 |
|
3670 | get: function get() {
|
3671 |
|
3672 | return {
|
3673 | addClass: function addClass() {
|
3674 | return undefined;
|
3675 | },
|
3676 | removeClass: function removeClass() {
|
3677 | return undefined;
|
3678 | },
|
3679 | hasClass: function hasClass() {
|
3680 | return true;
|
3681 | },
|
3682 | setInputAttr: function setInputAttr() {
|
3683 | return undefined;
|
3684 | },
|
3685 | removeInputAttr: function removeInputAttr() {
|
3686 | return undefined;
|
3687 | },
|
3688 | registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() {
|
3689 | return undefined;
|
3690 | },
|
3691 | deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() {
|
3692 | return undefined;
|
3693 | },
|
3694 | registerInputInteractionHandler: function registerInputInteractionHandler() {
|
3695 | return undefined;
|
3696 | },
|
3697 | deregisterInputInteractionHandler: function deregisterInputInteractionHandler() {
|
3698 | return undefined;
|
3699 | },
|
3700 | registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() {
|
3701 | return new MutationObserver(function () {
|
3702 | return undefined;
|
3703 | });
|
3704 | },
|
3705 | deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() {
|
3706 | return undefined;
|
3707 | },
|
3708 | getNativeInput: function getNativeInput() {
|
3709 | return null;
|
3710 | },
|
3711 | isFocused: function isFocused() {
|
3712 | return false;
|
3713 | },
|
3714 | activateLineRipple: function activateLineRipple() {
|
3715 | return undefined;
|
3716 | },
|
3717 | deactivateLineRipple: function deactivateLineRipple() {
|
3718 | return undefined;
|
3719 | },
|
3720 | setLineRippleTransformOrigin: function setLineRippleTransformOrigin() {
|
3721 | return undefined;
|
3722 | },
|
3723 | shakeLabel: function shakeLabel() {
|
3724 | return undefined;
|
3725 | },
|
3726 | floatLabel: function floatLabel() {
|
3727 | return undefined;
|
3728 | },
|
3729 | setLabelRequired: function setLabelRequired() {
|
3730 | return undefined;
|
3731 | },
|
3732 | hasLabel: function hasLabel() {
|
3733 | return false;
|
3734 | },
|
3735 | getLabelWidth: function getLabelWidth() {
|
3736 | return 0;
|
3737 | },
|
3738 | hasOutline: function hasOutline() {
|
3739 | return false;
|
3740 | },
|
3741 | notchOutline: function notchOutline() {
|
3742 | return undefined;
|
3743 | },
|
3744 | closeOutline: function closeOutline() {
|
3745 | return undefined;
|
3746 | }
|
3747 | };
|
3748 |
|
3749 | },
|
3750 | enumerable: false,
|
3751 | configurable: true
|
3752 | });
|
3753 | MDCTextFieldFoundation.prototype.init = function () {
|
3754 | var e_1, _a, e_2, _b;
|
3755 | if (this.adapter.hasLabel() && this.getNativeInput().required) {
|
3756 | this.adapter.setLabelRequired(true);
|
3757 | }
|
3758 | if (this.adapter.isFocused()) {
|
3759 | this.inputFocusHandler();
|
3760 | } else if (this.adapter.hasLabel() && this.shouldFloat) {
|
3761 | this.notchOutline(true);
|
3762 | this.adapter.floatLabel(true);
|
3763 | this.styleFloating(true);
|
3764 | }
|
3765 | this.adapter.registerInputInteractionHandler('focus', this.inputFocusHandler);
|
3766 | this.adapter.registerInputInteractionHandler('blur', this.inputBlurHandler);
|
3767 | this.adapter.registerInputInteractionHandler('input', this.inputInputHandler);
|
3768 | try {
|
3769 | for (var POINTERDOWN_EVENTS_1 = __values(POINTERDOWN_EVENTS), POINTERDOWN_EVENTS_1_1 = POINTERDOWN_EVENTS_1.next(); !POINTERDOWN_EVENTS_1_1.done; POINTERDOWN_EVENTS_1_1 = POINTERDOWN_EVENTS_1.next()) {
|
3770 | var evtType = POINTERDOWN_EVENTS_1_1.value;
|
3771 | this.adapter.registerInputInteractionHandler(evtType, this.setPointerXOffset);
|
3772 | }
|
3773 | } catch (e_1_1) {
|
3774 | e_1 = { error: e_1_1 };
|
3775 | } finally {
|
3776 | try {
|
3777 | if (POINTERDOWN_EVENTS_1_1 && !POINTERDOWN_EVENTS_1_1.done && (_a = POINTERDOWN_EVENTS_1.return)) _a.call(POINTERDOWN_EVENTS_1);
|
3778 | } finally {
|
3779 | if (e_1) throw e_1.error;
|
3780 | }
|
3781 | }
|
3782 | try {
|
3783 | for (var INTERACTION_EVENTS_1 = __values(INTERACTION_EVENTS), INTERACTION_EVENTS_1_1 = INTERACTION_EVENTS_1.next(); !INTERACTION_EVENTS_1_1.done; INTERACTION_EVENTS_1_1 = INTERACTION_EVENTS_1.next()) {
|
3784 | var evtType = INTERACTION_EVENTS_1_1.value;
|
3785 | this.adapter.registerTextFieldInteractionHandler(evtType, this.textFieldInteractionHandler);
|
3786 | }
|
3787 | } catch (e_2_1) {
|
3788 | e_2 = { error: e_2_1 };
|
3789 | } finally {
|
3790 | try {
|
3791 | if (INTERACTION_EVENTS_1_1 && !INTERACTION_EVENTS_1_1.done && (_b = INTERACTION_EVENTS_1.return)) _b.call(INTERACTION_EVENTS_1);
|
3792 | } finally {
|
3793 | if (e_2) throw e_2.error;
|
3794 | }
|
3795 | }
|
3796 | this.validationObserver = this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler);
|
3797 | this.setcharacterCounter(this.getValue().length);
|
3798 | };
|
3799 | MDCTextFieldFoundation.prototype.destroy = function () {
|
3800 | var e_3, _a, e_4, _b;
|
3801 | this.adapter.deregisterInputInteractionHandler('focus', this.inputFocusHandler);
|
3802 | this.adapter.deregisterInputInteractionHandler('blur', this.inputBlurHandler);
|
3803 | this.adapter.deregisterInputInteractionHandler('input', this.inputInputHandler);
|
3804 | try {
|
3805 | for (var POINTERDOWN_EVENTS_2 = __values(POINTERDOWN_EVENTS), POINTERDOWN_EVENTS_2_1 = POINTERDOWN_EVENTS_2.next(); !POINTERDOWN_EVENTS_2_1.done; POINTERDOWN_EVENTS_2_1 = POINTERDOWN_EVENTS_2.next()) {
|
3806 | var evtType = POINTERDOWN_EVENTS_2_1.value;
|
3807 | this.adapter.deregisterInputInteractionHandler(evtType, this.setPointerXOffset);
|
3808 | }
|
3809 | } catch (e_3_1) {
|
3810 | e_3 = { error: e_3_1 };
|
3811 | } finally {
|
3812 | try {
|
3813 | if (POINTERDOWN_EVENTS_2_1 && !POINTERDOWN_EVENTS_2_1.done && (_a = POINTERDOWN_EVENTS_2.return)) _a.call(POINTERDOWN_EVENTS_2);
|
3814 | } finally {
|
3815 | if (e_3) throw e_3.error;
|
3816 | }
|
3817 | }
|
3818 | try {
|
3819 | for (var INTERACTION_EVENTS_2 = __values(INTERACTION_EVENTS), INTERACTION_EVENTS_2_1 = INTERACTION_EVENTS_2.next(); !INTERACTION_EVENTS_2_1.done; INTERACTION_EVENTS_2_1 = INTERACTION_EVENTS_2.next()) {
|
3820 | var evtType = INTERACTION_EVENTS_2_1.value;
|
3821 | this.adapter.deregisterTextFieldInteractionHandler(evtType, this.textFieldInteractionHandler);
|
3822 | }
|
3823 | } catch (e_4_1) {
|
3824 | e_4 = { error: e_4_1 };
|
3825 | } finally {
|
3826 | try {
|
3827 | if (INTERACTION_EVENTS_2_1 && !INTERACTION_EVENTS_2_1.done && (_b = INTERACTION_EVENTS_2.return)) _b.call(INTERACTION_EVENTS_2);
|
3828 | } finally {
|
3829 | if (e_4) throw e_4.error;
|
3830 | }
|
3831 | }
|
3832 | this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver);
|
3833 | };
|
3834 | |
3835 |
|
3836 |
|
3837 | MDCTextFieldFoundation.prototype.handleTextFieldInteraction = function () {
|
3838 | var nativeInput = this.adapter.getNativeInput();
|
3839 | if (nativeInput && nativeInput.disabled) {
|
3840 | return;
|
3841 | }
|
3842 | this.receivedUserInput = true;
|
3843 | };
|
3844 | |
3845 |
|
3846 |
|
3847 | MDCTextFieldFoundation.prototype.handleValidationAttributeChange = function (attributesList) {
|
3848 | var _this = this;
|
3849 | attributesList.some(function (attributeName) {
|
3850 | if (constants_1.VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) {
|
3851 | _this.styleValidity(true);
|
3852 | _this.adapter.setLabelRequired(_this.getNativeInput().required);
|
3853 | return true;
|
3854 | }
|
3855 | return false;
|
3856 | });
|
3857 | if (attributesList.indexOf('maxlength') > -1) {
|
3858 | this.setcharacterCounter(this.getValue().length);
|
3859 | }
|
3860 | };
|
3861 | |
3862 |
|
3863 |
|
3864 | MDCTextFieldFoundation.prototype.notchOutline = function (openNotch) {
|
3865 | if (!this.adapter.hasOutline() || !this.adapter.hasLabel()) {
|
3866 | return;
|
3867 | }
|
3868 | if (openNotch) {
|
3869 | var labelWidth = this.adapter.getLabelWidth() * constants_1.numbers.LABEL_SCALE;
|
3870 | this.adapter.notchOutline(labelWidth);
|
3871 | } else {
|
3872 | this.adapter.closeOutline();
|
3873 | }
|
3874 | };
|
3875 | |
3876 |
|
3877 |
|
3878 | MDCTextFieldFoundation.prototype.activateFocus = function () {
|
3879 | this.isFocused = true;
|
3880 | this.styleFocused(this.isFocused);
|
3881 | this.adapter.activateLineRipple();
|
3882 | if (this.adapter.hasLabel()) {
|
3883 | this.notchOutline(this.shouldFloat);
|
3884 | this.adapter.floatLabel(this.shouldFloat);
|
3885 | this.styleFloating(this.shouldFloat);
|
3886 | this.adapter.shakeLabel(this.shouldShake);
|
3887 | }
|
3888 | if (this.helperText && (this.helperText.isPersistent() || !this.helperText.isValidation() || !this.valid)) {
|
3889 | this.helperText.showToScreenReader();
|
3890 | }
|
3891 | };
|
3892 | |
3893 |
|
3894 |
|
3895 |
|
3896 | MDCTextFieldFoundation.prototype.setTransformOrigin = function (evt) {
|
3897 | if (this.isDisabled() || this.adapter.hasOutline()) {
|
3898 | return;
|
3899 | }
|
3900 | var touches = evt.touches;
|
3901 | var targetEvent = touches ? touches[0] : evt;
|
3902 | var targetClientRect = targetEvent.target.getBoundingClientRect();
|
3903 | var normalizedX = targetEvent.clientX - targetClientRect.left;
|
3904 | this.adapter.setLineRippleTransformOrigin(normalizedX);
|
3905 | };
|
3906 | |
3907 |
|
3908 |
|
3909 | MDCTextFieldFoundation.prototype.handleInput = function () {
|
3910 | this.autoCompleteFocus();
|
3911 | this.setcharacterCounter(this.getValue().length);
|
3912 | };
|
3913 | |
3914 |
|
3915 |
|
3916 |
|
3917 | MDCTextFieldFoundation.prototype.autoCompleteFocus = function () {
|
3918 | if (!this.receivedUserInput) {
|
3919 | this.activateFocus();
|
3920 | }
|
3921 | };
|
3922 | |
3923 |
|
3924 |
|
3925 | MDCTextFieldFoundation.prototype.deactivateFocus = function () {
|
3926 | this.isFocused = false;
|
3927 | this.adapter.deactivateLineRipple();
|
3928 | var isValid = this.isValid();
|
3929 | this.styleValidity(isValid);
|
3930 | this.styleFocused(this.isFocused);
|
3931 | if (this.adapter.hasLabel()) {
|
3932 | this.notchOutline(this.shouldFloat);
|
3933 | this.adapter.floatLabel(this.shouldFloat);
|
3934 | this.styleFloating(this.shouldFloat);
|
3935 | this.adapter.shakeLabel(this.shouldShake);
|
3936 | }
|
3937 | if (!this.shouldFloat) {
|
3938 | this.receivedUserInput = false;
|
3939 | }
|
3940 | };
|
3941 | MDCTextFieldFoundation.prototype.getValue = function () {
|
3942 | return this.getNativeInput().value;
|
3943 | };
|
3944 | |
3945 |
|
3946 |
|
3947 | MDCTextFieldFoundation.prototype.setValue = function (value) {
|
3948 |
|
3949 |
|
3950 | if (this.getValue() !== value) {
|
3951 | this.getNativeInput().value = value;
|
3952 | }
|
3953 | this.setcharacterCounter(value.length);
|
3954 | if (this.validateOnValueChange) {
|
3955 | var isValid = this.isValid();
|
3956 | this.styleValidity(isValid);
|
3957 | }
|
3958 | if (this.adapter.hasLabel()) {
|
3959 | this.notchOutline(this.shouldFloat);
|
3960 | this.adapter.floatLabel(this.shouldFloat);
|
3961 | this.styleFloating(this.shouldFloat);
|
3962 | if (this.validateOnValueChange) {
|
3963 | this.adapter.shakeLabel(this.shouldShake);
|
3964 | }
|
3965 | }
|
3966 | };
|
3967 | |
3968 |
|
3969 |
|
3970 |
|
3971 | MDCTextFieldFoundation.prototype.isValid = function () {
|
3972 | return this.useNativeValidation ? this.isNativeInputValid() : this.valid;
|
3973 | };
|
3974 | |
3975 |
|
3976 |
|
3977 | MDCTextFieldFoundation.prototype.setValid = function (isValid) {
|
3978 | this.valid = isValid;
|
3979 | this.styleValidity(isValid);
|
3980 | var shouldShake = !isValid && !this.isFocused && !!this.getValue();
|
3981 | if (this.adapter.hasLabel()) {
|
3982 | this.adapter.shakeLabel(shouldShake);
|
3983 | }
|
3984 | };
|
3985 | |
3986 |
|
3987 |
|
3988 |
|
3989 | MDCTextFieldFoundation.prototype.setValidateOnValueChange = function (shouldValidate) {
|
3990 | this.validateOnValueChange = shouldValidate;
|
3991 | };
|
3992 | |
3993 |
|
3994 |
|
3995 |
|
3996 | MDCTextFieldFoundation.prototype.getValidateOnValueChange = function () {
|
3997 | return this.validateOnValueChange;
|
3998 | };
|
3999 | |
4000 |
|
4001 |
|
4002 |
|
4003 |
|
4004 |
|
4005 | MDCTextFieldFoundation.prototype.setUseNativeValidation = function (useNativeValidation) {
|
4006 | this.useNativeValidation = useNativeValidation;
|
4007 | };
|
4008 | MDCTextFieldFoundation.prototype.isDisabled = function () {
|
4009 | return this.getNativeInput().disabled;
|
4010 | };
|
4011 | |
4012 |
|
4013 |
|
4014 | MDCTextFieldFoundation.prototype.setDisabled = function (disabled) {
|
4015 | this.getNativeInput().disabled = disabled;
|
4016 | this.styleDisabled(disabled);
|
4017 | };
|
4018 | |
4019 |
|
4020 |
|
4021 | MDCTextFieldFoundation.prototype.setHelperTextContent = function (content) {
|
4022 | if (this.helperText) {
|
4023 | this.helperText.setContent(content);
|
4024 | }
|
4025 | };
|
4026 | |
4027 |
|
4028 |
|
4029 | MDCTextFieldFoundation.prototype.setLeadingIconAriaLabel = function (label) {
|
4030 | if (this.leadingIcon) {
|
4031 | this.leadingIcon.setAriaLabel(label);
|
4032 | }
|
4033 | };
|
4034 | |
4035 |
|
4036 |
|
4037 | MDCTextFieldFoundation.prototype.setLeadingIconContent = function (content) {
|
4038 | if (this.leadingIcon) {
|
4039 | this.leadingIcon.setContent(content);
|
4040 | }
|
4041 | };
|
4042 | |
4043 |
|
4044 |
|
4045 | MDCTextFieldFoundation.prototype.setTrailingIconAriaLabel = function (label) {
|
4046 | if (this.trailingIcon) {
|
4047 | this.trailingIcon.setAriaLabel(label);
|
4048 | }
|
4049 | };
|
4050 | |
4051 |
|
4052 |
|
4053 | MDCTextFieldFoundation.prototype.setTrailingIconContent = function (content) {
|
4054 | if (this.trailingIcon) {
|
4055 | this.trailingIcon.setContent(content);
|
4056 | }
|
4057 | };
|
4058 | |
4059 |
|
4060 |
|
4061 |
|
4062 | MDCTextFieldFoundation.prototype.setcharacterCounter = function (currentLength) {
|
4063 | if (!this.characterCounter) {
|
4064 | return;
|
4065 | }
|
4066 | var maxLength = this.getNativeInput().maxLength;
|
4067 | if (maxLength === -1) {
|
4068 | throw new Error('MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.');
|
4069 | }
|
4070 | this.characterCounter.setCounterValue(currentLength, maxLength);
|
4071 | };
|
4072 | |
4073 |
|
4074 |
|
4075 |
|
4076 | MDCTextFieldFoundation.prototype.isBadInput = function () {
|
4077 |
|
4078 | return this.getNativeInput().validity.badInput || false;
|
4079 | };
|
4080 | |
4081 |
|
4082 |
|
4083 | MDCTextFieldFoundation.prototype.isNativeInputValid = function () {
|
4084 | return this.getNativeInput().validity.valid;
|
4085 | };
|
4086 | |
4087 |
|
4088 |
|
4089 | MDCTextFieldFoundation.prototype.styleValidity = function (isValid) {
|
4090 | var INVALID = MDCTextFieldFoundation.cssClasses.INVALID;
|
4091 | if (isValid) {
|
4092 | this.adapter.removeClass(INVALID);
|
4093 | } else {
|
4094 | this.adapter.addClass(INVALID);
|
4095 | }
|
4096 | if (this.helperText) {
|
4097 | this.helperText.setValidity(isValid);
|
4098 |
|
4099 |
|
4100 | var helperTextValidation = this.helperText.isValidation();
|
4101 | if (!helperTextValidation) {
|
4102 | return;
|
4103 | }
|
4104 | var helperTextVisible = this.helperText.isVisible();
|
4105 | var helperTextId = this.helperText.getId();
|
4106 | if (helperTextVisible && helperTextId) {
|
4107 | this.adapter.setInputAttr(constants_1.strings.ARIA_DESCRIBEDBY, helperTextId);
|
4108 | } else {
|
4109 | this.adapter.removeInputAttr(constants_1.strings.ARIA_DESCRIBEDBY);
|
4110 | }
|
4111 | }
|
4112 | };
|
4113 | |
4114 |
|
4115 |
|
4116 | MDCTextFieldFoundation.prototype.styleFocused = function (isFocused) {
|
4117 | var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED;
|
4118 | if (isFocused) {
|
4119 | this.adapter.addClass(FOCUSED);
|
4120 | } else {
|
4121 | this.adapter.removeClass(FOCUSED);
|
4122 | }
|
4123 | };
|
4124 | |
4125 |
|
4126 |
|
4127 | MDCTextFieldFoundation.prototype.styleDisabled = function (isDisabled) {
|
4128 | var _a = MDCTextFieldFoundation.cssClasses,
|
4129 | DISABLED = _a.DISABLED,
|
4130 | INVALID = _a.INVALID;
|
4131 | if (isDisabled) {
|
4132 | this.adapter.addClass(DISABLED);
|
4133 | this.adapter.removeClass(INVALID);
|
4134 | } else {
|
4135 | this.adapter.removeClass(DISABLED);
|
4136 | }
|
4137 | if (this.leadingIcon) {
|
4138 | this.leadingIcon.setDisabled(isDisabled);
|
4139 | }
|
4140 | if (this.trailingIcon) {
|
4141 | this.trailingIcon.setDisabled(isDisabled);
|
4142 | }
|
4143 | };
|
4144 | |
4145 |
|
4146 |
|
4147 | MDCTextFieldFoundation.prototype.styleFloating = function (isFloating) {
|
4148 | var LABEL_FLOATING = MDCTextFieldFoundation.cssClasses.LABEL_FLOATING;
|
4149 | if (isFloating) {
|
4150 | this.adapter.addClass(LABEL_FLOATING);
|
4151 | } else {
|
4152 | this.adapter.removeClass(LABEL_FLOATING);
|
4153 | }
|
4154 | };
|
4155 | |
4156 |
|
4157 |
|
4158 |
|
4159 | MDCTextFieldFoundation.prototype.getNativeInput = function () {
|
4160 |
|
4161 |
|
4162 |
|
4163 |
|
4164 |
|
4165 | var nativeInput = this.adapter ? this.adapter.getNativeInput() : null;
|
4166 | return nativeInput || {
|
4167 | disabled: false,
|
4168 | maxLength: -1,
|
4169 | required: false,
|
4170 | type: 'input',
|
4171 | validity: {
|
4172 | badInput: false,
|
4173 | valid: true
|
4174 | },
|
4175 | value: ''
|
4176 | };
|
4177 | };
|
4178 | return MDCTextFieldFoundation;
|
4179 | }(foundation_1.MDCFoundation);
|
4180 | exports.MDCTextFieldFoundation = MDCTextFieldFoundation;
|
4181 |
|
4182 | exports.default = MDCTextFieldFoundation;
|
4183 |
|
4184 | }),
|
4185 |
|
4186 | "./packages/mdc-textfield/helper-text/adapter.ts":
|
4187 |
|
4188 |
|
4189 |
|
4190 |
|
4191 | (function(module, exports, __webpack_require__) {
|
4192 |
|
4193 | "use strict";
|
4194 |
|
4195 |
|
4196 |
|
4197 |
|
4198 |
|
4199 |
|
4200 |
|
4201 |
|
4202 |
|
4203 |
|
4204 |
|
4205 |
|
4206 |
|
4207 |
|
4208 |
|
4209 |
|
4210 |
|
4211 |
|
4212 |
|
4213 |
|
4214 |
|
4215 |
|
4216 |
|
4217 |
|
4218 | Object.defineProperty(exports, "__esModule", { value: true });
|
4219 |
|
4220 | }),
|
4221 |
|
4222 | "./packages/mdc-textfield/helper-text/component.ts":
|
4223 |
|
4224 |
|
4225 |
|
4226 |
|
4227 | (function(module, exports, __webpack_require__) {
|
4228 |
|
4229 | "use strict";
|
4230 |
|
4231 |
|
4232 |
|
4233 |
|
4234 |
|
4235 |
|
4236 |
|
4237 |
|
4238 |
|
4239 |
|
4240 |
|
4241 |
|
4242 |
|
4243 |
|
4244 |
|
4245 |
|
4246 |
|
4247 |
|
4248 |
|
4249 |
|
4250 |
|
4251 |
|
4252 |
|
4253 |
|
4254 | var __extends = this && this.__extends || function () {
|
4255 | var _extendStatics = function extendStatics(d, b) {
|
4256 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
4257 | d.__proto__ = b;
|
4258 | } || function (d, b) {
|
4259 | for (var p in b) {
|
4260 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
4261 | }
|
4262 | };
|
4263 | return _extendStatics(d, b);
|
4264 | };
|
4265 | return function (d, b) {
|
4266 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
4267 | _extendStatics(d, b);
|
4268 | function __() {
|
4269 | this.constructor = d;
|
4270 | }
|
4271 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
4272 | };
|
4273 | }();
|
4274 | Object.defineProperty(exports, "__esModule", { value: true });
|
4275 | exports.MDCTextFieldHelperText = void 0;
|
4276 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
4277 | var foundation_1 = __webpack_require__( "./packages/mdc-textfield/helper-text/foundation.ts");
|
4278 | var MDCTextFieldHelperText = function (_super) {
|
4279 | __extends(MDCTextFieldHelperText, _super);
|
4280 | function MDCTextFieldHelperText() {
|
4281 | return _super !== null && _super.apply(this, arguments) || this;
|
4282 | }
|
4283 | MDCTextFieldHelperText.attachTo = function (root) {
|
4284 | return new MDCTextFieldHelperText(root);
|
4285 | };
|
4286 | Object.defineProperty(MDCTextFieldHelperText.prototype, "foundationForTextField", {
|
4287 |
|
4288 | get: function get() {
|
4289 | return this.foundation;
|
4290 | },
|
4291 | enumerable: false,
|
4292 | configurable: true
|
4293 | });
|
4294 | MDCTextFieldHelperText.prototype.getDefaultFoundation = function () {
|
4295 | var _this = this;
|
4296 |
|
4297 |
|
4298 |
|
4299 | var adapter = {
|
4300 | addClass: function addClass(className) {
|
4301 | return _this.root.classList.add(className);
|
4302 | },
|
4303 | removeClass: function removeClass(className) {
|
4304 | return _this.root.classList.remove(className);
|
4305 | },
|
4306 | hasClass: function hasClass(className) {
|
4307 | return _this.root.classList.contains(className);
|
4308 | },
|
4309 | getAttr: function getAttr(attr) {
|
4310 | return _this.root.getAttribute(attr);
|
4311 | },
|
4312 | setAttr: function setAttr(attr, value) {
|
4313 | return _this.root.setAttribute(attr, value);
|
4314 | },
|
4315 | removeAttr: function removeAttr(attr) {
|
4316 | return _this.root.removeAttribute(attr);
|
4317 | },
|
4318 | setContent: function setContent(content) {
|
4319 | _this.root.textContent = content;
|
4320 | }
|
4321 | };
|
4322 |
|
4323 | return new foundation_1.MDCTextFieldHelperTextFoundation(adapter);
|
4324 | };
|
4325 | return MDCTextFieldHelperText;
|
4326 | }(component_1.MDCComponent);
|
4327 | exports.MDCTextFieldHelperText = MDCTextFieldHelperText;
|
4328 |
|
4329 | }),
|
4330 |
|
4331 | "./packages/mdc-textfield/helper-text/constants.ts":
|
4332 |
|
4333 |
|
4334 |
|
4335 |
|
4336 | (function(module, exports, __webpack_require__) {
|
4337 |
|
4338 | "use strict";
|
4339 |
|
4340 |
|
4341 |
|
4342 |
|
4343 |
|
4344 |
|
4345 |
|
4346 |
|
4347 |
|
4348 |
|
4349 |
|
4350 |
|
4351 |
|
4352 |
|
4353 |
|
4354 |
|
4355 |
|
4356 |
|
4357 |
|
4358 |
|
4359 |
|
4360 |
|
4361 |
|
4362 |
|
4363 | Object.defineProperty(exports, "__esModule", { value: true });
|
4364 | exports.cssClasses = exports.strings = void 0;
|
4365 | var cssClasses = {
|
4366 | HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',
|
4367 | HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg',
|
4368 | ROOT: 'mdc-text-field-helper-text'
|
4369 | };
|
4370 | exports.cssClasses = cssClasses;
|
4371 | var strings = {
|
4372 | ARIA_HIDDEN: 'aria-hidden',
|
4373 | ROLE: 'role',
|
4374 | ROOT_SELECTOR: "." + cssClasses.ROOT
|
4375 | };
|
4376 | exports.strings = strings;
|
4377 |
|
4378 | }),
|
4379 |
|
4380 | "./packages/mdc-textfield/helper-text/foundation.ts":
|
4381 |
|
4382 |
|
4383 |
|
4384 |
|
4385 | (function(module, exports, __webpack_require__) {
|
4386 |
|
4387 | "use strict";
|
4388 |
|
4389 |
|
4390 |
|
4391 |
|
4392 |
|
4393 |
|
4394 |
|
4395 |
|
4396 |
|
4397 |
|
4398 |
|
4399 |
|
4400 |
|
4401 |
|
4402 |
|
4403 |
|
4404 |
|
4405 |
|
4406 |
|
4407 |
|
4408 |
|
4409 |
|
4410 |
|
4411 |
|
4412 | var __extends = this && this.__extends || function () {
|
4413 | var _extendStatics = function extendStatics(d, b) {
|
4414 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
4415 | d.__proto__ = b;
|
4416 | } || function (d, b) {
|
4417 | for (var p in b) {
|
4418 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
4419 | }
|
4420 | };
|
4421 | return _extendStatics(d, b);
|
4422 | };
|
4423 | return function (d, b) {
|
4424 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
4425 | _extendStatics(d, b);
|
4426 | function __() {
|
4427 | this.constructor = d;
|
4428 | }
|
4429 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
4430 | };
|
4431 | }();
|
4432 | var __assign = this && this.__assign || function () {
|
4433 | __assign = Object.assign || function (t) {
|
4434 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4435 | s = arguments[i];
|
4436 | for (var p in s) {
|
4437 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
4438 | }
|
4439 | }
|
4440 | return t;
|
4441 | };
|
4442 | return __assign.apply(this, arguments);
|
4443 | };
|
4444 | Object.defineProperty(exports, "__esModule", { value: true });
|
4445 | exports.MDCTextFieldHelperTextFoundation = void 0;
|
4446 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
4447 | var constants_1 = __webpack_require__( "./packages/mdc-textfield/helper-text/constants.ts");
|
4448 | var MDCTextFieldHelperTextFoundation = function (_super) {
|
4449 | __extends(MDCTextFieldHelperTextFoundation, _super);
|
4450 | function MDCTextFieldHelperTextFoundation(adapter) {
|
4451 | return _super.call(this, __assign(__assign({}, MDCTextFieldHelperTextFoundation.defaultAdapter), adapter)) || this;
|
4452 | }
|
4453 | Object.defineProperty(MDCTextFieldHelperTextFoundation, "cssClasses", {
|
4454 | get: function get() {
|
4455 | return constants_1.cssClasses;
|
4456 | },
|
4457 | enumerable: false,
|
4458 | configurable: true
|
4459 | });
|
4460 | Object.defineProperty(MDCTextFieldHelperTextFoundation, "strings", {
|
4461 | get: function get() {
|
4462 | return constants_1.strings;
|
4463 | },
|
4464 | enumerable: false,
|
4465 | configurable: true
|
4466 | });
|
4467 | Object.defineProperty(MDCTextFieldHelperTextFoundation, "defaultAdapter", {
|
4468 | |
4469 |
|
4470 |
|
4471 | get: function get() {
|
4472 |
|
4473 | return {
|
4474 | addClass: function addClass() {
|
4475 | return undefined;
|
4476 | },
|
4477 | removeClass: function removeClass() {
|
4478 | return undefined;
|
4479 | },
|
4480 | hasClass: function hasClass() {
|
4481 | return false;
|
4482 | },
|
4483 | getAttr: function getAttr() {
|
4484 | return null;
|
4485 | },
|
4486 | setAttr: function setAttr() {
|
4487 | return undefined;
|
4488 | },
|
4489 | removeAttr: function removeAttr() {
|
4490 | return undefined;
|
4491 | },
|
4492 | setContent: function setContent() {
|
4493 | return undefined;
|
4494 | }
|
4495 | };
|
4496 |
|
4497 | },
|
4498 | enumerable: false,
|
4499 | configurable: true
|
4500 | });
|
4501 | MDCTextFieldHelperTextFoundation.prototype.getId = function () {
|
4502 | return this.adapter.getAttr('id');
|
4503 | };
|
4504 | MDCTextFieldHelperTextFoundation.prototype.isVisible = function () {
|
4505 | return this.adapter.getAttr(constants_1.strings.ARIA_HIDDEN) !== 'true';
|
4506 | };
|
4507 | |
4508 |
|
4509 |
|
4510 | MDCTextFieldHelperTextFoundation.prototype.setContent = function (content) {
|
4511 | this.adapter.setContent(content);
|
4512 | };
|
4513 | MDCTextFieldHelperTextFoundation.prototype.isPersistent = function () {
|
4514 | return this.adapter.hasClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
|
4515 | };
|
4516 | |
4517 |
|
4518 |
|
4519 | MDCTextFieldHelperTextFoundation.prototype.setPersistent = function (isPersistent) {
|
4520 | if (isPersistent) {
|
4521 | this.adapter.addClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
|
4522 | } else {
|
4523 | this.adapter.removeClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
|
4524 | }
|
4525 | };
|
4526 | |
4527 |
|
4528 |
|
4529 | MDCTextFieldHelperTextFoundation.prototype.isValidation = function () {
|
4530 | return this.adapter.hasClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
|
4531 | };
|
4532 | |
4533 |
|
4534 |
|
4535 | MDCTextFieldHelperTextFoundation.prototype.setValidation = function (isValidation) {
|
4536 | if (isValidation) {
|
4537 | this.adapter.addClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
|
4538 | } else {
|
4539 | this.adapter.removeClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
|
4540 | }
|
4541 | };
|
4542 | |
4543 |
|
4544 |
|
4545 | MDCTextFieldHelperTextFoundation.prototype.showToScreenReader = function () {
|
4546 | this.adapter.removeAttr(constants_1.strings.ARIA_HIDDEN);
|
4547 | };
|
4548 | |
4549 |
|
4550 |
|
4551 | MDCTextFieldHelperTextFoundation.prototype.setValidity = function (inputIsValid) {
|
4552 | var helperTextIsPersistent = this.adapter.hasClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
|
4553 | var helperTextIsValidationMsg = this.adapter.hasClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
|
4554 | var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;
|
4555 | if (validationMsgNeedsDisplay) {
|
4556 | this.showToScreenReader();
|
4557 |
|
4558 |
|
4559 | if (this.adapter.getAttr(constants_1.strings.ROLE) === 'alert') {
|
4560 | this.refreshAlertRole();
|
4561 | } else {
|
4562 | this.adapter.setAttr(constants_1.strings.ROLE, 'alert');
|
4563 | }
|
4564 | } else {
|
4565 | this.adapter.removeAttr(constants_1.strings.ROLE);
|
4566 | }
|
4567 | if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
|
4568 | this.hide();
|
4569 | }
|
4570 | };
|
4571 | |
4572 |
|
4573 |
|
4574 | MDCTextFieldHelperTextFoundation.prototype.hide = function () {
|
4575 | this.adapter.setAttr(constants_1.strings.ARIA_HIDDEN, 'true');
|
4576 | };
|
4577 | MDCTextFieldHelperTextFoundation.prototype.refreshAlertRole = function () {
|
4578 | var _this = this;
|
4579 | this.adapter.removeAttr(constants_1.strings.ROLE);
|
4580 | requestAnimationFrame(function () {
|
4581 | _this.adapter.setAttr(constants_1.strings.ROLE, 'alert');
|
4582 | });
|
4583 | };
|
4584 | return MDCTextFieldHelperTextFoundation;
|
4585 | }(foundation_1.MDCFoundation);
|
4586 | exports.MDCTextFieldHelperTextFoundation = MDCTextFieldHelperTextFoundation;
|
4587 |
|
4588 | exports.default = MDCTextFieldHelperTextFoundation;
|
4589 |
|
4590 | }),
|
4591 |
|
4592 | "./packages/mdc-textfield/helper-text/index.ts":
|
4593 |
|
4594 |
|
4595 |
|
4596 |
|
4597 | (function(module, exports, __webpack_require__) {
|
4598 |
|
4599 | "use strict";
|
4600 |
|
4601 |
|
4602 |
|
4603 |
|
4604 |
|
4605 |
|
4606 |
|
4607 |
|
4608 |
|
4609 |
|
4610 |
|
4611 |
|
4612 |
|
4613 |
|
4614 |
|
4615 |
|
4616 |
|
4617 |
|
4618 |
|
4619 |
|
4620 |
|
4621 |
|
4622 |
|
4623 |
|
4624 | var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
4625 | if (k2 === undefined) k2 = k;
|
4626 | Object.defineProperty(o, k2, { enumerable: true, get: function get() {
|
4627 | return m[k];
|
4628 | } });
|
4629 | } : function (o, m, k, k2) {
|
4630 | if (k2 === undefined) k2 = k;
|
4631 | o[k2] = m[k];
|
4632 | });
|
4633 | var __exportStar = this && this.__exportStar || function (m, exports) {
|
4634 | for (var p in m) {
|
4635 | if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
4636 | }
|
4637 | };
|
4638 | Object.defineProperty(exports, "__esModule", { value: true });
|
4639 | exports.helperTextStrings = exports.helperTextCssClasses = void 0;
|
4640 | __exportStar(__webpack_require__( "./packages/mdc-textfield/helper-text/adapter.ts"), exports);
|
4641 | __exportStar(__webpack_require__( "./packages/mdc-textfield/helper-text/component.ts"), exports);
|
4642 | __exportStar(__webpack_require__( "./packages/mdc-textfield/helper-text/foundation.ts"), exports);
|
4643 | var constants_1 = __webpack_require__( "./packages/mdc-textfield/helper-text/constants.ts");
|
4644 | Object.defineProperty(exports, "helperTextCssClasses", { enumerable: true, get: function get() {
|
4645 | return constants_1.cssClasses;
|
4646 | } });
|
4647 | Object.defineProperty(exports, "helperTextStrings", { enumerable: true, get: function get() {
|
4648 | return constants_1.strings;
|
4649 | } });
|
4650 |
|
4651 | }),
|
4652 |
|
4653 | "./packages/mdc-textfield/icon/adapter.ts":
|
4654 |
|
4655 |
|
4656 |
|
4657 |
|
4658 | (function(module, exports, __webpack_require__) {
|
4659 |
|
4660 | "use strict";
|
4661 |
|
4662 |
|
4663 |
|
4664 |
|
4665 |
|
4666 |
|
4667 |
|
4668 |
|
4669 |
|
4670 |
|
4671 |
|
4672 |
|
4673 |
|
4674 |
|
4675 |
|
4676 |
|
4677 |
|
4678 |
|
4679 |
|
4680 |
|
4681 |
|
4682 |
|
4683 |
|
4684 |
|
4685 | Object.defineProperty(exports, "__esModule", { value: true });
|
4686 |
|
4687 | }),
|
4688 |
|
4689 | "./packages/mdc-textfield/icon/component.ts":
|
4690 |
|
4691 |
|
4692 |
|
4693 |
|
4694 | (function(module, exports, __webpack_require__) {
|
4695 |
|
4696 | "use strict";
|
4697 |
|
4698 |
|
4699 |
|
4700 |
|
4701 |
|
4702 |
|
4703 |
|
4704 |
|
4705 |
|
4706 |
|
4707 |
|
4708 |
|
4709 |
|
4710 |
|
4711 |
|
4712 |
|
4713 |
|
4714 |
|
4715 |
|
4716 |
|
4717 |
|
4718 |
|
4719 |
|
4720 |
|
4721 | var __extends = this && this.__extends || function () {
|
4722 | var _extendStatics = function extendStatics(d, b) {
|
4723 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
4724 | d.__proto__ = b;
|
4725 | } || function (d, b) {
|
4726 | for (var p in b) {
|
4727 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
4728 | }
|
4729 | };
|
4730 | return _extendStatics(d, b);
|
4731 | };
|
4732 | return function (d, b) {
|
4733 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
4734 | _extendStatics(d, b);
|
4735 | function __() {
|
4736 | this.constructor = d;
|
4737 | }
|
4738 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
4739 | };
|
4740 | }();
|
4741 | Object.defineProperty(exports, "__esModule", { value: true });
|
4742 | exports.MDCTextFieldIcon = void 0;
|
4743 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
4744 | var foundation_1 = __webpack_require__( "./packages/mdc-textfield/icon/foundation.ts");
|
4745 | var MDCTextFieldIcon = function (_super) {
|
4746 | __extends(MDCTextFieldIcon, _super);
|
4747 | function MDCTextFieldIcon() {
|
4748 | return _super !== null && _super.apply(this, arguments) || this;
|
4749 | }
|
4750 | MDCTextFieldIcon.attachTo = function (root) {
|
4751 | return new MDCTextFieldIcon(root);
|
4752 | };
|
4753 | Object.defineProperty(MDCTextFieldIcon.prototype, "foundationForTextField", {
|
4754 |
|
4755 | get: function get() {
|
4756 | return this.foundation;
|
4757 | },
|
4758 | enumerable: false,
|
4759 | configurable: true
|
4760 | });
|
4761 | MDCTextFieldIcon.prototype.getDefaultFoundation = function () {
|
4762 | var _this = this;
|
4763 |
|
4764 |
|
4765 |
|
4766 | var adapter = {
|
4767 | getAttr: function getAttr(attr) {
|
4768 | return _this.root.getAttribute(attr);
|
4769 | },
|
4770 | setAttr: function setAttr(attr, value) {
|
4771 | return _this.root.setAttribute(attr, value);
|
4772 | },
|
4773 | removeAttr: function removeAttr(attr) {
|
4774 | return _this.root.removeAttribute(attr);
|
4775 | },
|
4776 | setContent: function setContent(content) {
|
4777 | _this.root.textContent = content;
|
4778 | },
|
4779 | registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
|
4780 | return _this.listen(evtType, handler);
|
4781 | },
|
4782 | deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
|
4783 | return _this.unlisten(evtType, handler);
|
4784 | },
|
4785 | notifyIconAction: function notifyIconAction() {
|
4786 | return _this.emit(foundation_1.MDCTextFieldIconFoundation.strings.ICON_EVENT, {} , true );
|
4787 | }
|
4788 | };
|
4789 |
|
4790 | return new foundation_1.MDCTextFieldIconFoundation(adapter);
|
4791 | };
|
4792 | return MDCTextFieldIcon;
|
4793 | }(component_1.MDCComponent);
|
4794 | exports.MDCTextFieldIcon = MDCTextFieldIcon;
|
4795 |
|
4796 | }),
|
4797 |
|
4798 | "./packages/mdc-textfield/icon/constants.ts":
|
4799 |
|
4800 |
|
4801 |
|
4802 |
|
4803 | (function(module, exports, __webpack_require__) {
|
4804 |
|
4805 | "use strict";
|
4806 |
|
4807 |
|
4808 |
|
4809 |
|
4810 |
|
4811 |
|
4812 |
|
4813 |
|
4814 |
|
4815 |
|
4816 |
|
4817 |
|
4818 |
|
4819 |
|
4820 |
|
4821 |
|
4822 |
|
4823 |
|
4824 |
|
4825 |
|
4826 |
|
4827 |
|
4828 |
|
4829 |
|
4830 | Object.defineProperty(exports, "__esModule", { value: true });
|
4831 | exports.cssClasses = exports.strings = void 0;
|
4832 | var strings = {
|
4833 | ICON_EVENT: 'MDCTextField:icon',
|
4834 | ICON_ROLE: 'button'
|
4835 | };
|
4836 | exports.strings = strings;
|
4837 | var cssClasses = {
|
4838 | ROOT: 'mdc-text-field__icon'
|
4839 | };
|
4840 | exports.cssClasses = cssClasses;
|
4841 |
|
4842 | }),
|
4843 |
|
4844 | "./packages/mdc-textfield/icon/foundation.ts":
|
4845 |
|
4846 |
|
4847 |
|
4848 |
|
4849 | (function(module, exports, __webpack_require__) {
|
4850 |
|
4851 | "use strict";
|
4852 |
|
4853 |
|
4854 |
|
4855 |
|
4856 |
|
4857 |
|
4858 |
|
4859 |
|
4860 |
|
4861 |
|
4862 |
|
4863 |
|
4864 |
|
4865 |
|
4866 |
|
4867 |
|
4868 |
|
4869 |
|
4870 |
|
4871 |
|
4872 |
|
4873 |
|
4874 |
|
4875 |
|
4876 | var __extends = this && this.__extends || function () {
|
4877 | var _extendStatics = function extendStatics(d, b) {
|
4878 | _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
|
4879 | d.__proto__ = b;
|
4880 | } || function (d, b) {
|
4881 | for (var p in b) {
|
4882 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
4883 | }
|
4884 | };
|
4885 | return _extendStatics(d, b);
|
4886 | };
|
4887 | return function (d, b) {
|
4888 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
4889 | _extendStatics(d, b);
|
4890 | function __() {
|
4891 | this.constructor = d;
|
4892 | }
|
4893 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
4894 | };
|
4895 | }();
|
4896 | var __assign = this && this.__assign || function () {
|
4897 | __assign = Object.assign || function (t) {
|
4898 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4899 | s = arguments[i];
|
4900 | for (var p in s) {
|
4901 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
4902 | }
|
4903 | }
|
4904 | return t;
|
4905 | };
|
4906 | return __assign.apply(this, arguments);
|
4907 | };
|
4908 | var __values = this && this.__values || function (o) {
|
4909 | var s = typeof Symbol === "function" && Symbol.iterator,
|
4910 | m = s && o[s],
|
4911 | i = 0;
|
4912 | if (m) return m.call(o);
|
4913 | if (o && typeof o.length === "number") return {
|
4914 | next: function next() {
|
4915 | if (o && i >= o.length) o = void 0;
|
4916 | return { value: o && o[i++], done: !o };
|
4917 | }
|
4918 | };
|
4919 | throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
4920 | };
|
4921 | Object.defineProperty(exports, "__esModule", { value: true });
|
4922 | exports.MDCTextFieldIconFoundation = void 0;
|
4923 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
4924 | var constants_1 = __webpack_require__( "./packages/mdc-textfield/icon/constants.ts");
|
4925 | var INTERACTION_EVENTS = ['click', 'keydown'];
|
4926 | var MDCTextFieldIconFoundation = function (_super) {
|
4927 | __extends(MDCTextFieldIconFoundation, _super);
|
4928 | function MDCTextFieldIconFoundation(adapter) {
|
4929 | var _this = _super.call(this, __assign(__assign({}, MDCTextFieldIconFoundation.defaultAdapter), adapter)) || this;
|
4930 | _this.savedTabIndex = null;
|
4931 | _this.interactionHandler = function (evt) {
|
4932 | _this.handleInteraction(evt);
|
4933 | };
|
4934 | return _this;
|
4935 | }
|
4936 | Object.defineProperty(MDCTextFieldIconFoundation, "strings", {
|
4937 | get: function get() {
|
4938 | return constants_1.strings;
|
4939 | },
|
4940 | enumerable: false,
|
4941 | configurable: true
|
4942 | });
|
4943 | Object.defineProperty(MDCTextFieldIconFoundation, "cssClasses", {
|
4944 | get: function get() {
|
4945 | return constants_1.cssClasses;
|
4946 | },
|
4947 | enumerable: false,
|
4948 | configurable: true
|
4949 | });
|
4950 | Object.defineProperty(MDCTextFieldIconFoundation, "defaultAdapter", {
|
4951 | |
4952 |
|
4953 |
|
4954 | get: function get() {
|
4955 |
|
4956 | return {
|
4957 | getAttr: function getAttr() {
|
4958 | return null;
|
4959 | },
|
4960 | setAttr: function setAttr() {
|
4961 | return undefined;
|
4962 | },
|
4963 | removeAttr: function removeAttr() {
|
4964 | return undefined;
|
4965 | },
|
4966 | setContent: function setContent() {
|
4967 | return undefined;
|
4968 | },
|
4969 | registerInteractionHandler: function registerInteractionHandler() {
|
4970 | return undefined;
|
4971 | },
|
4972 | deregisterInteractionHandler: function deregisterInteractionHandler() {
|
4973 | return undefined;
|
4974 | },
|
4975 | notifyIconAction: function notifyIconAction() {
|
4976 | return undefined;
|
4977 | }
|
4978 | };
|
4979 |
|
4980 | },
|
4981 | enumerable: false,
|
4982 | configurable: true
|
4983 | });
|
4984 | MDCTextFieldIconFoundation.prototype.init = function () {
|
4985 | var e_1, _a;
|
4986 | this.savedTabIndex = this.adapter.getAttr('tabindex');
|
4987 | try {
|
4988 | for (var INTERACTION_EVENTS_1 = __values(INTERACTION_EVENTS), INTERACTION_EVENTS_1_1 = INTERACTION_EVENTS_1.next(); !INTERACTION_EVENTS_1_1.done; INTERACTION_EVENTS_1_1 = INTERACTION_EVENTS_1.next()) {
|
4989 | var evtType = INTERACTION_EVENTS_1_1.value;
|
4990 | this.adapter.registerInteractionHandler(evtType, this.interactionHandler);
|
4991 | }
|
4992 | } catch (e_1_1) {
|
4993 | e_1 = { error: e_1_1 };
|
4994 | } finally {
|
4995 | try {
|
4996 | if (INTERACTION_EVENTS_1_1 && !INTERACTION_EVENTS_1_1.done && (_a = INTERACTION_EVENTS_1.return)) _a.call(INTERACTION_EVENTS_1);
|
4997 | } finally {
|
4998 | if (e_1) throw e_1.error;
|
4999 | }
|
5000 | }
|
5001 | };
|
5002 | MDCTextFieldIconFoundation.prototype.destroy = function () {
|
5003 | var e_2, _a;
|
5004 | try {
|
5005 | for (var INTERACTION_EVENTS_2 = __values(INTERACTION_EVENTS), INTERACTION_EVENTS_2_1 = INTERACTION_EVENTS_2.next(); !INTERACTION_EVENTS_2_1.done; INTERACTION_EVENTS_2_1 = INTERACTION_EVENTS_2.next()) {
|
5006 | var evtType = INTERACTION_EVENTS_2_1.value;
|
5007 | this.adapter.deregisterInteractionHandler(evtType, this.interactionHandler);
|
5008 | }
|
5009 | } catch (e_2_1) {
|
5010 | e_2 = { error: e_2_1 };
|
5011 | } finally {
|
5012 | try {
|
5013 | if (INTERACTION_EVENTS_2_1 && !INTERACTION_EVENTS_2_1.done && (_a = INTERACTION_EVENTS_2.return)) _a.call(INTERACTION_EVENTS_2);
|
5014 | } finally {
|
5015 | if (e_2) throw e_2.error;
|
5016 | }
|
5017 | }
|
5018 | };
|
5019 | MDCTextFieldIconFoundation.prototype.setDisabled = function (disabled) {
|
5020 | if (!this.savedTabIndex) {
|
5021 | return;
|
5022 | }
|
5023 | if (disabled) {
|
5024 | this.adapter.setAttr('tabindex', '-1');
|
5025 | this.adapter.removeAttr('role');
|
5026 | } else {
|
5027 | this.adapter.setAttr('tabindex', this.savedTabIndex);
|
5028 | this.adapter.setAttr('role', constants_1.strings.ICON_ROLE);
|
5029 | }
|
5030 | };
|
5031 | MDCTextFieldIconFoundation.prototype.setAriaLabel = function (label) {
|
5032 | this.adapter.setAttr('aria-label', label);
|
5033 | };
|
5034 | MDCTextFieldIconFoundation.prototype.setContent = function (content) {
|
5035 | this.adapter.setContent(content);
|
5036 | };
|
5037 | MDCTextFieldIconFoundation.prototype.handleInteraction = function (evt) {
|
5038 | var isEnterKey = evt.key === 'Enter' || evt.keyCode === 13;
|
5039 | if (evt.type === 'click' || isEnterKey) {
|
5040 | evt.preventDefault();
|
5041 |
|
5042 | this.adapter.notifyIconAction();
|
5043 | }
|
5044 | };
|
5045 | return MDCTextFieldIconFoundation;
|
5046 | }(foundation_1.MDCFoundation);
|
5047 | exports.MDCTextFieldIconFoundation = MDCTextFieldIconFoundation;
|
5048 |
|
5049 | exports.default = MDCTextFieldIconFoundation;
|
5050 |
|
5051 | }),
|
5052 |
|
5053 | "./packages/mdc-textfield/icon/index.ts":
|
5054 |
|
5055 |
|
5056 |
|
5057 |
|
5058 | (function(module, exports, __webpack_require__) {
|
5059 |
|
5060 | "use strict";
|
5061 |
|
5062 |
|
5063 |
|
5064 |
|
5065 |
|
5066 |
|
5067 |
|
5068 |
|
5069 |
|
5070 |
|
5071 |
|
5072 |
|
5073 |
|
5074 |
|
5075 |
|
5076 |
|
5077 |
|
5078 |
|
5079 |
|
5080 |
|
5081 |
|
5082 |
|
5083 |
|
5084 |
|
5085 | var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
5086 | if (k2 === undefined) k2 = k;
|
5087 | Object.defineProperty(o, k2, { enumerable: true, get: function get() {
|
5088 | return m[k];
|
5089 | } });
|
5090 | } : function (o, m, k, k2) {
|
5091 | if (k2 === undefined) k2 = k;
|
5092 | o[k2] = m[k];
|
5093 | });
|
5094 | var __exportStar = this && this.__exportStar || function (m, exports) {
|
5095 | for (var p in m) {
|
5096 | if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
5097 | }
|
5098 | };
|
5099 | Object.defineProperty(exports, "__esModule", { value: true });
|
5100 | exports.iconStrings = exports.iconCssClasses = void 0;
|
5101 | __exportStar(__webpack_require__( "./packages/mdc-textfield/icon/adapter.ts"), exports);
|
5102 | __exportStar(__webpack_require__( "./packages/mdc-textfield/icon/component.ts"), exports);
|
5103 | __exportStar(__webpack_require__( "./packages/mdc-textfield/icon/foundation.ts"), exports);
|
5104 | var constants_1 = __webpack_require__( "./packages/mdc-textfield/icon/constants.ts");
|
5105 | Object.defineProperty(exports, "iconCssClasses", { enumerable: true, get: function get() {
|
5106 | return constants_1.cssClasses;
|
5107 | } });
|
5108 | Object.defineProperty(exports, "iconStrings", { enumerable: true, get: function get() {
|
5109 | return constants_1.strings;
|
5110 | } });
|
5111 |
|
5112 | }),
|
5113 |
|
5114 | "./packages/mdc-textfield/index.ts":
|
5115 |
|
5116 |
|
5117 |
|
5118 |
|
5119 | (function(module, exports, __webpack_require__) {
|
5120 |
|
5121 | "use strict";
|
5122 |
|
5123 |
|
5124 |
|
5125 |
|
5126 |
|
5127 |
|
5128 |
|
5129 |
|
5130 |
|
5131 |
|
5132 |
|
5133 |
|
5134 |
|
5135 |
|
5136 |
|
5137 |
|
5138 |
|
5139 |
|
5140 |
|
5141 |
|
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 | var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
5147 | if (k2 === undefined) k2 = k;
|
5148 | Object.defineProperty(o, k2, { enumerable: true, get: function get() {
|
5149 | return m[k];
|
5150 | } });
|
5151 | } : function (o, m, k, k2) {
|
5152 | if (k2 === undefined) k2 = k;
|
5153 | o[k2] = m[k];
|
5154 | });
|
5155 | var __exportStar = this && this.__exportStar || function (m, exports) {
|
5156 | for (var p in m) {
|
5157 | if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
5158 | }
|
5159 | };
|
5160 | Object.defineProperty(exports, "__esModule", { value: true });
|
5161 | __exportStar(__webpack_require__( "./packages/mdc-textfield/adapter.ts"), exports);
|
5162 | __exportStar(__webpack_require__( "./packages/mdc-textfield/component.ts"), exports);
|
5163 | __exportStar(__webpack_require__( "./packages/mdc-textfield/constants.ts"), exports);
|
5164 | __exportStar(__webpack_require__( "./packages/mdc-textfield/foundation.ts"), exports);
|
5165 | __exportStar(__webpack_require__( "./packages/mdc-textfield/types.ts"), exports);
|
5166 | __exportStar(__webpack_require__( "./packages/mdc-textfield/character-counter/index.ts"), exports);
|
5167 | __exportStar(__webpack_require__( "./packages/mdc-textfield/helper-text/index.ts"), exports);
|
5168 | __exportStar(__webpack_require__( "./packages/mdc-textfield/icon/index.ts"), exports);
|
5169 |
|
5170 | }),
|
5171 |
|
5172 | "./packages/mdc-textfield/types.ts":
|
5173 |
|
5174 |
|
5175 |
|
5176 |
|
5177 | (function(module, exports, __webpack_require__) {
|
5178 |
|
5179 | "use strict";
|
5180 |
|
5181 |
|
5182 |
|
5183 |
|
5184 |
|
5185 |
|
5186 |
|
5187 |
|
5188 |
|
5189 |
|
5190 |
|
5191 |
|
5192 |
|
5193 |
|
5194 |
|
5195 |
|
5196 |
|
5197 |
|
5198 |
|
5199 |
|
5200 |
|
5201 |
|
5202 |
|
5203 |
|
5204 | Object.defineProperty(exports, "__esModule", { value: true });
|
5205 |
|
5206 | })
|
5207 |
|
5208 | });
|
5209 | });
|
5210 |
|
\ | No newline at end of file |