/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/material-components/material-components-web/blob/master/LICENSE */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define("@material/textfield", [], factory); else if(typeof exports === 'object') exports["textfield"] = factory(); else root["mdc"] = root["mdc"] || {}, root["mdc"]["textfield"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./packages/mdc-textfield/index.ts"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./packages/mdc-base/component.ts": /*!****************************************!*\ !*** ./packages/mdc-base/component.ts ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __read = this && this.__read || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { ar.push(r.value); } } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spreadArray = this && this.__spreadArray || function (to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; }return to; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCComponent = void 0; var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-base/foundation.ts"); var MDCComponent = /** @class */function () { function MDCComponent(root, foundation) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.root = root; this.initialize.apply(this, __spreadArray([], __read(args))); // Note that we initialize foundation here and not within the constructor's // default param so that this.root is defined and can be used within the // foundation class. this.foundation = foundation === undefined ? this.getDefaultFoundation() : foundation; this.foundation.init(); this.initialSyncWithDOM(); } MDCComponent.attachTo = function (root) { // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and // returns an instantiated component with its root set to that element. Also note that in the cases of // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized // from getDefaultFoundation(). return new MDCComponent(root, new foundation_1.MDCFoundation({})); }; /* istanbul ignore next: method param only exists for typing purposes; it does not need to be unit tested */ MDCComponent.prototype.initialize = function () { var _args = []; for (var _i = 0; _i < arguments.length; _i++) { _args[_i] = arguments[_i]; } // Subclasses can override this to do any additional setup work that would be considered part of a // "constructor". Essentially, it is a hook into the parent constructor before the foundation is // initialized. Any additional arguments besides root and foundation will be passed in here. }; MDCComponent.prototype.getDefaultFoundation = function () { // Subclasses must override this method to return a properly configured foundation class for the // component. throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class'); }; MDCComponent.prototype.initialSyncWithDOM = function () { // Subclasses should override this method if they need to perform work to synchronize with a host DOM // object. An example of this would be a form control wrapper that needs to synchronize its internal state // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor. }; MDCComponent.prototype.destroy = function () { // Subclasses may implement this method to release any resources / deregister any listeners they have // attached. An example of this might be deregistering a resize event from the window object. this.foundation.destroy(); }; MDCComponent.prototype.listen = function (evtType, handler, options) { this.root.addEventListener(evtType, handler, options); }; MDCComponent.prototype.unlisten = function (evtType, handler, options) { this.root.removeEventListener(evtType, handler, options); }; /** * Fires a cross-browser-compatible custom event from the component root of the given type, with the given data. */ MDCComponent.prototype.emit = function (evtType, evtData, shouldBubble) { if (shouldBubble === void 0) { shouldBubble = false; } var evt; if (typeof CustomEvent === 'function') { evt = new CustomEvent(evtType, { bubbles: shouldBubble, detail: evtData }); } else { evt = document.createEvent('CustomEvent'); evt.initCustomEvent(evtType, shouldBubble, false, evtData); } this.root.dispatchEvent(evt); }; return MDCComponent; }(); exports.MDCComponent = MDCComponent; // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. exports.default = MDCComponent; /***/ }), /***/ "./packages/mdc-base/foundation.ts": /*!*****************************************!*\ !*** ./packages/mdc-base/foundation.ts ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCFoundation = void 0; var MDCFoundation = /** @class */function () { function MDCFoundation(adapter) { if (adapter === void 0) { adapter = {}; } this.adapter = adapter; } Object.defineProperty(MDCFoundation, "cssClasses", { get: function get() { // Classes extending MDCFoundation should implement this method to return an object which exports every // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'} return {}; }, enumerable: false, configurable: true }); Object.defineProperty(MDCFoundation, "strings", { get: function get() { // Classes extending MDCFoundation should implement this method to return an object which exports all // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'} return {}; }, enumerable: false, configurable: true }); Object.defineProperty(MDCFoundation, "numbers", { get: function get() { // Classes extending MDCFoundation should implement this method to return an object which exports all // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350} return {}; }, enumerable: false, configurable: true }); Object.defineProperty(MDCFoundation, "defaultAdapter", { get: function get() { // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter // validation. return {}; }, enumerable: false, configurable: true }); MDCFoundation.prototype.init = function () { // Subclasses should override this method to perform initialization routines (registering events, etc.) }; MDCFoundation.prototype.destroy = function () { // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.) }; return MDCFoundation; }(); exports.MDCFoundation = MDCFoundation; // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. exports.default = MDCFoundation; /***/ }), /***/ "./packages/mdc-dom/events.ts": /*!************************************!*\ !*** ./packages/mdc-dom/events.ts ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.applyPassive = void 0; /** * Determine whether the current browser supports passive event listeners, and * if so, use them. */ function applyPassive(globalObj) { if (globalObj === void 0) { globalObj = window; } return supportsPassiveOption(globalObj) ? { passive: true } : false; } exports.applyPassive = applyPassive; function supportsPassiveOption(globalObj) { if (globalObj === void 0) { globalObj = window; } // See // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener var passiveSupported = false; try { var options = { // This function will be called when the browser // attempts to access the passive property. get passive() { passiveSupported = true; return false; } }; var handler = function handler() {}; globalObj.document.addEventListener('test', handler, options); globalObj.document.removeEventListener('test', handler, options); } catch (err) { passiveSupported = false; } return passiveSupported; } /***/ }), /***/ "./packages/mdc-dom/ponyfill.ts": /*!**************************************!*\ !*** ./packages/mdc-dom/ponyfill.ts ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.estimateScrollWidth = exports.matches = exports.closest = void 0; /** * @fileoverview A "ponyfill" is a polyfill that doesn't modify the global prototype chain. * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC. */ function closest(element, selector) { if (element.closest) { return element.closest(selector); } var el = element; while (el) { if (matches(el, selector)) { return el; } el = el.parentElement; } return null; } exports.closest = closest; function matches(element, selector) { var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector; return nativeMatches.call(element, selector); } exports.matches = matches; /** * Used to compute the estimated scroll width of elements. When an element is * hidden due to display: none; being applied to a parent element, the width is * returned as 0. However, the element will have a true width once no longer * inside a display: none context. This method computes an estimated width when * the element is hidden or returns the true width when the element is visble. * @param {Element} element the element whose width to estimate */ function estimateScrollWidth(element) { // Check the offsetParent. If the element inherits display: none from any // parent, the offsetParent property will be null (see // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent). // This check ensures we only clone the node when necessary. var htmlEl = element; if (htmlEl.offsetParent !== null) { return htmlEl.scrollWidth; } var clone = htmlEl.cloneNode(true); clone.style.setProperty('position', 'absolute'); clone.style.setProperty('transform', 'translate(-9999px, -9999px)'); document.documentElement.appendChild(clone); var scrollWidth = clone.scrollWidth; document.documentElement.removeChild(clone); return scrollWidth; } exports.estimateScrollWidth = estimateScrollWidth; /***/ }), /***/ "./packages/mdc-floating-label/component.ts": /*!**************************************************!*\ !*** ./packages/mdc-floating-label/component.ts ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCFloatingLabel = void 0; var component_1 = __webpack_require__(/*! @material/base/component */ "./packages/mdc-base/component.ts"); var ponyfill_1 = __webpack_require__(/*! @material/dom/ponyfill */ "./packages/mdc-dom/ponyfill.ts"); var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-floating-label/foundation.ts"); var MDCFloatingLabel = /** @class */function (_super) { __extends(MDCFloatingLabel, _super); function MDCFloatingLabel() { return _super !== null && _super.apply(this, arguments) || this; } MDCFloatingLabel.attachTo = function (root) { return new MDCFloatingLabel(root); }; /** * Styles the label to produce the label shake for errors. * @param shouldShake If true, shakes the label by adding a CSS class; otherwise, stops shaking by removing the class. */ MDCFloatingLabel.prototype.shake = function (shouldShake) { this.foundation.shake(shouldShake); }; /** * Styles the label to float/dock. * @param shouldFloat If true, floats the label by adding a CSS class; otherwise, docks it by removing the class. */ MDCFloatingLabel.prototype.float = function (shouldFloat) { this.foundation.float(shouldFloat); }; /** * Styles the label as required. * @param isRequired If true, adds an asterisk to the label, indicating that it is required. */ MDCFloatingLabel.prototype.setRequired = function (isRequired) { this.foundation.setRequired(isRequired); }; MDCFloatingLabel.prototype.getWidth = function () { return this.foundation.getWidth(); }; MDCFloatingLabel.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root.classList.add(className); }, removeClass: function removeClass(className) { return _this.root.classList.remove(className); }, getWidth: function getWidth() { return ponyfill_1.estimateScrollWidth(_this.root); }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.listen(evtType, handler); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.unlisten(evtType, handler); } }; // tslint:enable:object-literal-sort-keys return new foundation_1.MDCFloatingLabelFoundation(adapter); }; return MDCFloatingLabel; }(component_1.MDCComponent); exports.MDCFloatingLabel = MDCFloatingLabel; /***/ }), /***/ "./packages/mdc-floating-label/constants.ts": /*!**************************************************!*\ !*** ./packages/mdc-floating-label/constants.ts ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.cssClasses = void 0; exports.cssClasses = { LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above', LABEL_REQUIRED: 'mdc-floating-label--required', LABEL_SHAKE: 'mdc-floating-label--shake', ROOT: 'mdc-floating-label' }; /***/ }), /***/ "./packages/mdc-floating-label/foundation.ts": /*!***************************************************!*\ !*** ./packages/mdc-floating-label/foundation.ts ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCFloatingLabelFoundation = void 0; var foundation_1 = __webpack_require__(/*! @material/base/foundation */ "./packages/mdc-base/foundation.ts"); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-floating-label/constants.ts"); var MDCFloatingLabelFoundation = /** @class */function (_super) { __extends(MDCFloatingLabelFoundation, _super); function MDCFloatingLabelFoundation(adapter) { var _this = _super.call(this, __assign(__assign({}, MDCFloatingLabelFoundation.defaultAdapter), adapter)) || this; _this.shakeAnimationEndHandler = function () { _this.handleShakeAnimationEnd(); }; return _this; } Object.defineProperty(MDCFloatingLabelFoundation, "cssClasses", { get: function get() { return constants_1.cssClasses; }, enumerable: false, configurable: true }); Object.defineProperty(MDCFloatingLabelFoundation, "defaultAdapter", { /** * See {@link MDCFloatingLabelAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, getWidth: function getWidth() { return 0; }, registerInteractionHandler: function registerInteractionHandler() { return undefined; }, deregisterInteractionHandler: function deregisterInteractionHandler() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: false, configurable: true }); MDCFloatingLabelFoundation.prototype.init = function () { this.adapter.registerInteractionHandler('animationend', this.shakeAnimationEndHandler); }; MDCFloatingLabelFoundation.prototype.destroy = function () { this.adapter.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler); }; /** * Returns the width of the label element. */ MDCFloatingLabelFoundation.prototype.getWidth = function () { return this.adapter.getWidth(); }; /** * Styles the label to produce a shake animation to indicate an error. * @param shouldShake If true, adds the shake CSS class; otherwise, removes shake class. */ MDCFloatingLabelFoundation.prototype.shake = function (shouldShake) { var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE; if (shouldShake) { this.adapter.addClass(LABEL_SHAKE); } else { this.adapter.removeClass(LABEL_SHAKE); } }; /** * Styles the label to float or dock. * @param shouldFloat If true, adds the float CSS class; otherwise, removes float and shake classes to dock the label. */ MDCFloatingLabelFoundation.prototype.float = function (shouldFloat) { var _a = MDCFloatingLabelFoundation.cssClasses, LABEL_FLOAT_ABOVE = _a.LABEL_FLOAT_ABOVE, LABEL_SHAKE = _a.LABEL_SHAKE; if (shouldFloat) { this.adapter.addClass(LABEL_FLOAT_ABOVE); } else { this.adapter.removeClass(LABEL_FLOAT_ABOVE); this.adapter.removeClass(LABEL_SHAKE); } }; /** * Styles the label as required. * @param isRequired If true, adds an asterisk to the label, indicating that it is required. */ MDCFloatingLabelFoundation.prototype.setRequired = function (isRequired) { var LABEL_REQUIRED = MDCFloatingLabelFoundation.cssClasses.LABEL_REQUIRED; if (isRequired) { this.adapter.addClass(LABEL_REQUIRED); } else { this.adapter.removeClass(LABEL_REQUIRED); } }; MDCFloatingLabelFoundation.prototype.handleShakeAnimationEnd = function () { var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE; this.adapter.removeClass(LABEL_SHAKE); }; return MDCFloatingLabelFoundation; }(foundation_1.MDCFoundation); exports.MDCFloatingLabelFoundation = MDCFloatingLabelFoundation; // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. exports.default = MDCFloatingLabelFoundation; /***/ }), /***/ "./packages/mdc-line-ripple/component.ts": /*!***********************************************!*\ !*** ./packages/mdc-line-ripple/component.ts ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCLineRipple = void 0; var component_1 = __webpack_require__(/*! @material/base/component */ "./packages/mdc-base/component.ts"); var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-line-ripple/foundation.ts"); var MDCLineRipple = /** @class */function (_super) { __extends(MDCLineRipple, _super); function MDCLineRipple() { return _super !== null && _super.apply(this, arguments) || this; } MDCLineRipple.attachTo = function (root) { return new MDCLineRipple(root); }; /** * Activates the line ripple */ MDCLineRipple.prototype.activate = function () { this.foundation.activate(); }; /** * Deactivates the line ripple */ MDCLineRipple.prototype.deactivate = function () { this.foundation.deactivate(); }; /** * Sets the transform origin given a user's click location. * The `rippleCenter` is the x-coordinate of the middle of the ripple. */ MDCLineRipple.prototype.setRippleCenter = function (xCoordinate) { this.foundation.setRippleCenter(xCoordinate); }; MDCLineRipple.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root.classList.add(className); }, removeClass: function removeClass(className) { return _this.root.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root.classList.contains(className); }, setStyle: function setStyle(propertyName, value) { return _this.root.style.setProperty(propertyName, value); }, registerEventHandler: function registerEventHandler(evtType, handler) { return _this.listen(evtType, handler); }, deregisterEventHandler: function deregisterEventHandler(evtType, handler) { return _this.unlisten(evtType, handler); } }; // tslint:enable:object-literal-sort-keys return new foundation_1.MDCLineRippleFoundation(adapter); }; return MDCLineRipple; }(component_1.MDCComponent); exports.MDCLineRipple = MDCLineRipple; /***/ }), /***/ "./packages/mdc-line-ripple/constants.ts": /*!***********************************************!*\ !*** ./packages/mdc-line-ripple/constants.ts ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.cssClasses = void 0; var cssClasses = { LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active', LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating' }; exports.cssClasses = cssClasses; /***/ }), /***/ "./packages/mdc-line-ripple/foundation.ts": /*!************************************************!*\ !*** ./packages/mdc-line-ripple/foundation.ts ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCLineRippleFoundation = void 0; var foundation_1 = __webpack_require__(/*! @material/base/foundation */ "./packages/mdc-base/foundation.ts"); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-line-ripple/constants.ts"); var MDCLineRippleFoundation = /** @class */function (_super) { __extends(MDCLineRippleFoundation, _super); function MDCLineRippleFoundation(adapter) { var _this = _super.call(this, __assign(__assign({}, MDCLineRippleFoundation.defaultAdapter), adapter)) || this; _this.transitionEndHandler = function (evt) { _this.handleTransitionEnd(evt); }; return _this; } Object.defineProperty(MDCLineRippleFoundation, "cssClasses", { get: function get() { return constants_1.cssClasses; }, enumerable: false, configurable: true }); Object.defineProperty(MDCLineRippleFoundation, "defaultAdapter", { /** * See {@link MDCLineRippleAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return false; }, setStyle: function setStyle() { return undefined; }, registerEventHandler: function registerEventHandler() { return undefined; }, deregisterEventHandler: function deregisterEventHandler() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: false, configurable: true }); MDCLineRippleFoundation.prototype.init = function () { this.adapter.registerEventHandler('transitionend', this.transitionEndHandler); }; MDCLineRippleFoundation.prototype.destroy = function () { this.adapter.deregisterEventHandler('transitionend', this.transitionEndHandler); }; MDCLineRippleFoundation.prototype.activate = function () { this.adapter.removeClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING); this.adapter.addClass(constants_1.cssClasses.LINE_RIPPLE_ACTIVE); }; MDCLineRippleFoundation.prototype.setRippleCenter = function (xCoordinate) { this.adapter.setStyle('transform-origin', xCoordinate + "px center"); }; MDCLineRippleFoundation.prototype.deactivate = function () { this.adapter.addClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING); }; MDCLineRippleFoundation.prototype.handleTransitionEnd = function (evt) { // Wait for the line ripple to be either transparent or opaque // before emitting the animation end event var isDeactivating = this.adapter.hasClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING); if (evt.propertyName === 'opacity') { if (isDeactivating) { this.adapter.removeClass(constants_1.cssClasses.LINE_RIPPLE_ACTIVE); this.adapter.removeClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING); } } }; return MDCLineRippleFoundation; }(foundation_1.MDCFoundation); exports.MDCLineRippleFoundation = MDCLineRippleFoundation; // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. exports.default = MDCLineRippleFoundation; /***/ }), /***/ "./packages/mdc-notched-outline/component.ts": /*!***************************************************!*\ !*** ./packages/mdc-notched-outline/component.ts ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCNotchedOutline = void 0; var component_1 = __webpack_require__(/*! @material/base/component */ "./packages/mdc-base/component.ts"); var foundation_1 = __webpack_require__(/*! @material/floating-label/foundation */ "./packages/mdc-floating-label/foundation.ts"); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-notched-outline/constants.ts"); var foundation_2 = __webpack_require__(/*! ./foundation */ "./packages/mdc-notched-outline/foundation.ts"); var MDCNotchedOutline = /** @class */function (_super) { __extends(MDCNotchedOutline, _super); function MDCNotchedOutline() { return _super !== null && _super.apply(this, arguments) || this; } MDCNotchedOutline.attachTo = function (root) { return new MDCNotchedOutline(root); }; MDCNotchedOutline.prototype.initialSyncWithDOM = function () { this.notchElement = this.root.querySelector(constants_1.strings.NOTCH_ELEMENT_SELECTOR); var label = this.root.querySelector('.' + foundation_1.MDCFloatingLabelFoundation.cssClasses.ROOT); if (label) { label.style.transitionDuration = '0s'; this.root.classList.add(constants_1.cssClasses.OUTLINE_UPGRADED); requestAnimationFrame(function () { label.style.transitionDuration = ''; }); } else { this.root.classList.add(constants_1.cssClasses.NO_LABEL); } }; /** * Updates classes and styles to open the notch to the specified width. * @param notchWidth The notch width in the outline. */ MDCNotchedOutline.prototype.notch = function (notchWidth) { this.foundation.notch(notchWidth); }; /** * Updates classes and styles to close the notch. */ MDCNotchedOutline.prototype.closeNotch = function () { this.foundation.closeNotch(); }; MDCNotchedOutline.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root.classList.add(className); }, removeClass: function removeClass(className) { return _this.root.classList.remove(className); }, setNotchWidthProperty: function setNotchWidthProperty(width) { _this.notchElement.style.setProperty('width', width + 'px'); }, removeNotchWidthProperty: function removeNotchWidthProperty() { _this.notchElement.style.removeProperty('width'); } }; // tslint:enable:object-literal-sort-keys return new foundation_2.MDCNotchedOutlineFoundation(adapter); }; return MDCNotchedOutline; }(component_1.MDCComponent); exports.MDCNotchedOutline = MDCNotchedOutline; /***/ }), /***/ "./packages/mdc-notched-outline/constants.ts": /*!***************************************************!*\ !*** ./packages/mdc-notched-outline/constants.ts ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2018 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.strings = exports.numbers = exports.cssClasses = void 0; var strings = { NOTCH_ELEMENT_SELECTOR: '.mdc-notched-outline__notch' }; exports.strings = strings; var numbers = { // This should stay in sync with $mdc-notched-outline-padding * 2. NOTCH_ELEMENT_PADDING: 8 }; exports.numbers = numbers; var cssClasses = { NO_LABEL: 'mdc-notched-outline--no-label', OUTLINE_NOTCHED: 'mdc-notched-outline--notched', OUTLINE_UPGRADED: 'mdc-notched-outline--upgraded' }; exports.cssClasses = cssClasses; /***/ }), /***/ "./packages/mdc-notched-outline/foundation.ts": /*!****************************************************!*\ !*** ./packages/mdc-notched-outline/foundation.ts ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCNotchedOutlineFoundation = void 0; var foundation_1 = __webpack_require__(/*! @material/base/foundation */ "./packages/mdc-base/foundation.ts"); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-notched-outline/constants.ts"); var MDCNotchedOutlineFoundation = /** @class */function (_super) { __extends(MDCNotchedOutlineFoundation, _super); function MDCNotchedOutlineFoundation(adapter) { return _super.call(this, __assign(__assign({}, MDCNotchedOutlineFoundation.defaultAdapter), adapter)) || this; } Object.defineProperty(MDCNotchedOutlineFoundation, "strings", { get: function get() { return constants_1.strings; }, enumerable: false, configurable: true }); Object.defineProperty(MDCNotchedOutlineFoundation, "cssClasses", { get: function get() { return constants_1.cssClasses; }, enumerable: false, configurable: true }); Object.defineProperty(MDCNotchedOutlineFoundation, "numbers", { get: function get() { return constants_1.numbers; }, enumerable: false, configurable: true }); Object.defineProperty(MDCNotchedOutlineFoundation, "defaultAdapter", { /** * See {@link MDCNotchedOutlineAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, setNotchWidthProperty: function setNotchWidthProperty() { return undefined; }, removeNotchWidthProperty: function removeNotchWidthProperty() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: false, configurable: true }); /** * Adds the outline notched selector and updates the notch width calculated based off of notchWidth. */ MDCNotchedOutlineFoundation.prototype.notch = function (notchWidth) { var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED; if (notchWidth > 0) { notchWidth += constants_1.numbers.NOTCH_ELEMENT_PADDING; // Add padding from left/right. } this.adapter.setNotchWidthProperty(notchWidth); this.adapter.addClass(OUTLINE_NOTCHED); }; /** * Removes notched outline selector to close the notch in the outline. */ MDCNotchedOutlineFoundation.prototype.closeNotch = function () { var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED; this.adapter.removeClass(OUTLINE_NOTCHED); this.adapter.removeNotchWidthProperty(); }; return MDCNotchedOutlineFoundation; }(foundation_1.MDCFoundation); exports.MDCNotchedOutlineFoundation = MDCNotchedOutlineFoundation; // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. exports.default = MDCNotchedOutlineFoundation; /***/ }), /***/ "./packages/mdc-ripple/component.ts": /*!******************************************!*\ !*** ./packages/mdc-ripple/component.ts ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function get() { return m[k]; } }); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); } : function (o, v) { o["default"] = v; }); var __importStar = this && this.__importStar || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) { if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); }__setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCRipple = void 0; var component_1 = __webpack_require__(/*! @material/base/component */ "./packages/mdc-base/component.ts"); var events_1 = __webpack_require__(/*! @material/dom/events */ "./packages/mdc-dom/events.ts"); var ponyfill_1 = __webpack_require__(/*! @material/dom/ponyfill */ "./packages/mdc-dom/ponyfill.ts"); var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-ripple/foundation.ts"); var util = __importStar(__webpack_require__(/*! ./util */ "./packages/mdc-ripple/util.ts")); var MDCRipple = /** @class */function (_super) { __extends(MDCRipple, _super); function MDCRipple() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.disabled = false; return _this; } MDCRipple.attachTo = function (root, opts) { if (opts === void 0) { opts = { isUnbounded: undefined }; } var ripple = new MDCRipple(root); // Only override unbounded behavior if option is explicitly specified if (opts.isUnbounded !== undefined) { ripple.unbounded = opts.isUnbounded; } return ripple; }; MDCRipple.createAdapter = function (instance) { return { addClass: function addClass(className) { return instance.root.classList.add(className); }, browserSupportsCssVars: function browserSupportsCssVars() { return util.supportsCssVariables(window); }, computeBoundingRect: function computeBoundingRect() { return instance.root.getBoundingClientRect(); }, containsEventTarget: function containsEventTarget(target) { return instance.root.contains(target); }, deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) { return document.documentElement.removeEventListener(evtType, handler, events_1.applyPassive()); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return instance.root.removeEventListener(evtType, handler, events_1.applyPassive()); }, deregisterResizeHandler: function deregisterResizeHandler(handler) { return window.removeEventListener('resize', handler); }, getWindowPageOffset: function getWindowPageOffset() { return { x: window.pageXOffset, y: window.pageYOffset }; }, isSurfaceActive: function isSurfaceActive() { return ponyfill_1.matches(instance.root, ':active'); }, isSurfaceDisabled: function isSurfaceDisabled() { return Boolean(instance.disabled); }, isUnbounded: function isUnbounded() { return Boolean(instance.unbounded); }, registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) { return document.documentElement.addEventListener(evtType, handler, events_1.applyPassive()); }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return instance.root.addEventListener(evtType, handler, events_1.applyPassive()); }, registerResizeHandler: function registerResizeHandler(handler) { return window.addEventListener('resize', handler); }, removeClass: function removeClass(className) { return instance.root.classList.remove(className); }, updateCssVariable: function updateCssVariable(varName, value) { return instance.root.style.setProperty(varName, value); } }; }; Object.defineProperty(MDCRipple.prototype, "unbounded", { get: function get() { return Boolean(this.isUnbounded); }, set: function set(unbounded) { this.isUnbounded = Boolean(unbounded); this.setUnbounded(); }, enumerable: false, configurable: true }); MDCRipple.prototype.activate = function () { this.foundation.activate(); }; MDCRipple.prototype.deactivate = function () { this.foundation.deactivate(); }; MDCRipple.prototype.layout = function () { this.foundation.layout(); }; MDCRipple.prototype.getDefaultFoundation = function () { return new foundation_1.MDCRippleFoundation(MDCRipple.createAdapter(this)); }; MDCRipple.prototype.initialSyncWithDOM = function () { var root = this.root; this.isUnbounded = 'mdcRippleIsUnbounded' in root.dataset; }; /** * Closure Compiler throws an access control error when directly accessing a * protected or private property inside a getter/setter, like unbounded above. * By accessing the protected property inside a method, we solve that problem. * That's why this function exists. */ MDCRipple.prototype.setUnbounded = function () { this.foundation.setUnbounded(Boolean(this.isUnbounded)); }; return MDCRipple; }(component_1.MDCComponent); exports.MDCRipple = MDCRipple; /***/ }), /***/ "./packages/mdc-ripple/constants.ts": /*!******************************************!*\ !*** ./packages/mdc-ripple/constants.ts ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.numbers = exports.strings = exports.cssClasses = void 0; exports.cssClasses = { // Ripple is a special case where the "root" component is really a "mixin" of sorts, // given that it's an 'upgrade' to an existing component. That being said it is the root // CSS class that all other CSS classes derive from. BG_FOCUSED: 'mdc-ripple-upgraded--background-focused', FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation', FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation', ROOT: 'mdc-ripple-upgraded', UNBOUNDED: 'mdc-ripple-upgraded--unbounded' }; exports.strings = { VAR_FG_SCALE: '--mdc-ripple-fg-scale', VAR_FG_SIZE: '--mdc-ripple-fg-size', VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end', VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start', VAR_LEFT: '--mdc-ripple-left', VAR_TOP: '--mdc-ripple-top' }; exports.numbers = { DEACTIVATION_TIMEOUT_MS: 225, FG_DEACTIVATION_MS: 150, INITIAL_ORIGIN_SCALE: 0.6, PADDING: 10, TAP_DELAY_MS: 300 }; /***/ }), /***/ "./packages/mdc-ripple/foundation.ts": /*!*******************************************!*\ !*** ./packages/mdc-ripple/foundation.ts ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return __assign.apply(this, arguments); }; var __values = this && this.__values || function (o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function next() { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCRippleFoundation = void 0; var foundation_1 = __webpack_require__(/*! @material/base/foundation */ "./packages/mdc-base/foundation.ts"); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-ripple/constants.ts"); var util_1 = __webpack_require__(/*! ./util */ "./packages/mdc-ripple/util.ts"); // Activation events registered on the root element of each instance for activation var ACTIVATION_EVENT_TYPES = ['touchstart', 'pointerdown', 'mousedown', 'keydown']; // Deactivation events registered on documentElement when a pointer-related down event occurs var POINTER_DEACTIVATION_EVENT_TYPES = ['touchend', 'pointerup', 'mouseup', 'contextmenu']; // simultaneous nested activations var activatedTargets = []; var MDCRippleFoundation = /** @class */function (_super) { __extends(MDCRippleFoundation, _super); function MDCRippleFoundation(adapter) { var _this = _super.call(this, __assign(__assign({}, MDCRippleFoundation.defaultAdapter), adapter)) || this; _this.activationAnimationHasEnded = false; _this.activationTimer = 0; _this.fgDeactivationRemovalTimer = 0; _this.fgScale = '0'; _this.frame = { width: 0, height: 0 }; _this.initialSize = 0; _this.layoutFrame = 0; _this.maxRadius = 0; _this.unboundedCoords = { left: 0, top: 0 }; _this.activationState = _this.defaultActivationState(); _this.activationTimerCallback = function () { _this.activationAnimationHasEnded = true; _this.runDeactivationUXLogicIfReady(); }; _this.activateHandler = function (e) { _this.activateImpl(e); }; _this.deactivateHandler = function () { _this.deactivateImpl(); }; _this.focusHandler = function () { _this.handleFocus(); }; _this.blurHandler = function () { _this.handleBlur(); }; _this.resizeHandler = function () { _this.layout(); }; return _this; } Object.defineProperty(MDCRippleFoundation, "cssClasses", { get: function get() { return constants_1.cssClasses; }, enumerable: false, configurable: true }); Object.defineProperty(MDCRippleFoundation, "strings", { get: function get() { return constants_1.strings; }, enumerable: false, configurable: true }); Object.defineProperty(MDCRippleFoundation, "numbers", { get: function get() { return constants_1.numbers; }, enumerable: false, configurable: true }); Object.defineProperty(MDCRippleFoundation, "defaultAdapter", { get: function get() { return { addClass: function addClass() { return undefined; }, browserSupportsCssVars: function browserSupportsCssVars() { return true; }, computeBoundingRect: function computeBoundingRect() { return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 }; }, containsEventTarget: function containsEventTarget() { return true; }, deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() { return undefined; }, deregisterInteractionHandler: function deregisterInteractionHandler() { return undefined; }, deregisterResizeHandler: function deregisterResizeHandler() { return undefined; }, getWindowPageOffset: function getWindowPageOffset() { return { x: 0, y: 0 }; }, isSurfaceActive: function isSurfaceActive() { return true; }, isSurfaceDisabled: function isSurfaceDisabled() { return true; }, isUnbounded: function isUnbounded() { return true; }, registerDocumentInteractionHandler: function registerDocumentInteractionHandler() { return undefined; }, registerInteractionHandler: function registerInteractionHandler() { return undefined; }, registerResizeHandler: function registerResizeHandler() { return undefined; }, removeClass: function removeClass() { return undefined; }, updateCssVariable: function updateCssVariable() { return undefined; } }; }, enumerable: false, configurable: true }); MDCRippleFoundation.prototype.init = function () { var _this = this; var supportsPressRipple = this.supportsPressRipple(); this.registerRootHandlers(supportsPressRipple); if (supportsPressRipple) { var _a = MDCRippleFoundation.cssClasses, ROOT_1 = _a.ROOT, UNBOUNDED_1 = _a.UNBOUNDED; requestAnimationFrame(function () { _this.adapter.addClass(ROOT_1); if (_this.adapter.isUnbounded()) { _this.adapter.addClass(UNBOUNDED_1); // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple _this.layoutInternal(); } }); } }; MDCRippleFoundation.prototype.destroy = function () { var _this = this; if (this.supportsPressRipple()) { if (this.activationTimer) { clearTimeout(this.activationTimer); this.activationTimer = 0; this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION); } if (this.fgDeactivationRemovalTimer) { clearTimeout(this.fgDeactivationRemovalTimer); this.fgDeactivationRemovalTimer = 0; this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION); } var _a = MDCRippleFoundation.cssClasses, ROOT_2 = _a.ROOT, UNBOUNDED_2 = _a.UNBOUNDED; requestAnimationFrame(function () { _this.adapter.removeClass(ROOT_2); _this.adapter.removeClass(UNBOUNDED_2); _this.removeCssVars(); }); } this.deregisterRootHandlers(); this.deregisterDeactivationHandlers(); }; /** * @param evt Optional event containing position information. */ MDCRippleFoundation.prototype.activate = function (evt) { this.activateImpl(evt); }; MDCRippleFoundation.prototype.deactivate = function () { this.deactivateImpl(); }; MDCRippleFoundation.prototype.layout = function () { var _this = this; if (this.layoutFrame) { cancelAnimationFrame(this.layoutFrame); } this.layoutFrame = requestAnimationFrame(function () { _this.layoutInternal(); _this.layoutFrame = 0; }); }; MDCRippleFoundation.prototype.setUnbounded = function (unbounded) { var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED; if (unbounded) { this.adapter.addClass(UNBOUNDED); } else { this.adapter.removeClass(UNBOUNDED); } }; MDCRippleFoundation.prototype.handleFocus = function () { var _this = this; requestAnimationFrame(function () { return _this.adapter.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED); }); }; MDCRippleFoundation.prototype.handleBlur = function () { var _this = this; requestAnimationFrame(function () { return _this.adapter.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED); }); }; /** * We compute this property so that we are not querying information about the client * until the point in time where the foundation requests it. This prevents scenarios where * client-side feature-detection may happen too early, such as when components are rendered on the server * and then initialized at mount time on the client. */ MDCRippleFoundation.prototype.supportsPressRipple = function () { return this.adapter.browserSupportsCssVars(); }; MDCRippleFoundation.prototype.defaultActivationState = function () { return { activationEvent: undefined, hasDeactivationUXRun: false, isActivated: false, isProgrammatic: false, wasActivatedByPointer: false, wasElementMadeActive: false }; }; /** * supportsPressRipple Passed from init to save a redundant function call */ MDCRippleFoundation.prototype.registerRootHandlers = function (supportsPressRipple) { var e_1, _a; if (supportsPressRipple) { try { 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()) { var evtType = ACTIVATION_EVENT_TYPES_1_1.value; this.adapter.registerInteractionHandler(evtType, this.activateHandler); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (ACTIVATION_EVENT_TYPES_1_1 && !ACTIVATION_EVENT_TYPES_1_1.done && (_a = ACTIVATION_EVENT_TYPES_1.return)) _a.call(ACTIVATION_EVENT_TYPES_1); } finally { if (e_1) throw e_1.error; } } if (this.adapter.isUnbounded()) { this.adapter.registerResizeHandler(this.resizeHandler); } } this.adapter.registerInteractionHandler('focus', this.focusHandler); this.adapter.registerInteractionHandler('blur', this.blurHandler); }; MDCRippleFoundation.prototype.registerDeactivationHandlers = function (evt) { var e_2, _a; if (evt.type === 'keydown') { this.adapter.registerInteractionHandler('keyup', this.deactivateHandler); } else { try { 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()) { var evtType = POINTER_DEACTIVATION_EVENT_TYPES_1_1.value; this.adapter.registerDocumentInteractionHandler(evtType, this.deactivateHandler); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { 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); } finally { if (e_2) throw e_2.error; } } } }; MDCRippleFoundation.prototype.deregisterRootHandlers = function () { var e_3, _a; try { 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()) { var evtType = ACTIVATION_EVENT_TYPES_2_1.value; this.adapter.deregisterInteractionHandler(evtType, this.activateHandler); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (ACTIVATION_EVENT_TYPES_2_1 && !ACTIVATION_EVENT_TYPES_2_1.done && (_a = ACTIVATION_EVENT_TYPES_2.return)) _a.call(ACTIVATION_EVENT_TYPES_2); } finally { if (e_3) throw e_3.error; } } this.adapter.deregisterInteractionHandler('focus', this.focusHandler); this.adapter.deregisterInteractionHandler('blur', this.blurHandler); if (this.adapter.isUnbounded()) { this.adapter.deregisterResizeHandler(this.resizeHandler); } }; MDCRippleFoundation.prototype.deregisterDeactivationHandlers = function () { var e_4, _a; this.adapter.deregisterInteractionHandler('keyup', this.deactivateHandler); try { 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()) { var evtType = POINTER_DEACTIVATION_EVENT_TYPES_2_1.value; this.adapter.deregisterDocumentInteractionHandler(evtType, this.deactivateHandler); } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { 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); } finally { if (e_4) throw e_4.error; } } }; MDCRippleFoundation.prototype.removeCssVars = function () { var _this = this; var rippleStrings = MDCRippleFoundation.strings; var keys = Object.keys(rippleStrings); keys.forEach(function (key) { if (key.indexOf('VAR_') === 0) { _this.adapter.updateCssVariable(rippleStrings[key], null); } }); }; MDCRippleFoundation.prototype.activateImpl = function (evt) { var _this = this; if (this.adapter.isSurfaceDisabled()) { return; } var activationState = this.activationState; if (activationState.isActivated) { return; } // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction var previousActivationEvent = this.previousActivationEvent; var isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type; if (isSameInteraction) { return; } activationState.isActivated = true; activationState.isProgrammatic = evt === undefined; activationState.activationEvent = evt; activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown'); var hasActivatedChild = evt !== undefined && activatedTargets.length > 0 && activatedTargets.some(function (target) { return _this.adapter.containsEventTarget(target); }); if (hasActivatedChild) { // Immediately reset activation state, while preserving logic that prevents touch follow-on events this.resetActivationState(); return; } if (evt !== undefined) { activatedTargets.push(evt.target); this.registerDeactivationHandlers(evt); } activationState.wasElementMadeActive = this.checkElementMadeActive(evt); if (activationState.wasElementMadeActive) { this.animateActivation(); } requestAnimationFrame(function () { // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples activatedTargets = []; if (!activationState.wasElementMadeActive && evt !== undefined && (evt.key === ' ' || evt.keyCode === 32)) { // If space was pressed, try again within an rAF call to detect :active, because different UAs report // active states inconsistently when they're called within event handling code: // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971 // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741 // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS // variable is set within a rAF callback for a submit button interaction (#2241). activationState.wasElementMadeActive = _this.checkElementMadeActive(evt); if (activationState.wasElementMadeActive) { _this.animateActivation(); } } if (!activationState.wasElementMadeActive) { // Reset activation state immediately if element was not made active. _this.activationState = _this.defaultActivationState(); } }); }; MDCRippleFoundation.prototype.checkElementMadeActive = function (evt) { return evt !== undefined && evt.type === 'keydown' ? this.adapter.isSurfaceActive() : true; }; MDCRippleFoundation.prototype.animateActivation = function () { var _this = this; var _a = MDCRippleFoundation.strings, VAR_FG_TRANSLATE_START = _a.VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END = _a.VAR_FG_TRANSLATE_END; var _b = MDCRippleFoundation.cssClasses, FG_DEACTIVATION = _b.FG_DEACTIVATION, FG_ACTIVATION = _b.FG_ACTIVATION; var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS; this.layoutInternal(); var translateStart = ''; var translateEnd = ''; if (!this.adapter.isUnbounded()) { var _c = this.getFgTranslationCoordinates(), startPoint = _c.startPoint, endPoint = _c.endPoint; translateStart = startPoint.x + "px, " + startPoint.y + "px"; translateEnd = endPoint.x + "px, " + endPoint.y + "px"; } this.adapter.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart); this.adapter.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd); // Cancel any ongoing activation/deactivation animations clearTimeout(this.activationTimer); clearTimeout(this.fgDeactivationRemovalTimer); this.rmBoundedActivationClasses(); this.adapter.removeClass(FG_DEACTIVATION); // Force layout in order to re-trigger the animation. this.adapter.computeBoundingRect(); this.adapter.addClass(FG_ACTIVATION); this.activationTimer = setTimeout(function () { _this.activationTimerCallback(); }, DEACTIVATION_TIMEOUT_MS); }; MDCRippleFoundation.prototype.getFgTranslationCoordinates = function () { var _a = this.activationState, activationEvent = _a.activationEvent, wasActivatedByPointer = _a.wasActivatedByPointer; var startPoint; if (wasActivatedByPointer) { startPoint = util_1.getNormalizedEventCoords(activationEvent, this.adapter.getWindowPageOffset(), this.adapter.computeBoundingRect()); } else { startPoint = { x: this.frame.width / 2, y: this.frame.height / 2 }; } // Center the element around the start point. startPoint = { x: startPoint.x - this.initialSize / 2, y: startPoint.y - this.initialSize / 2 }; var endPoint = { x: this.frame.width / 2 - this.initialSize / 2, y: this.frame.height / 2 - this.initialSize / 2 }; return { startPoint: startPoint, endPoint: endPoint }; }; MDCRippleFoundation.prototype.runDeactivationUXLogicIfReady = function () { var _this = this; // This method is called both when a pointing device is released, and when the activation animation ends. // The deactivation animation should only run after both of those occur. var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION; var _a = this.activationState, hasDeactivationUXRun = _a.hasDeactivationUXRun, isActivated = _a.isActivated; var activationHasEnded = hasDeactivationUXRun || !isActivated; if (activationHasEnded && this.activationAnimationHasEnded) { this.rmBoundedActivationClasses(); this.adapter.addClass(FG_DEACTIVATION); this.fgDeactivationRemovalTimer = setTimeout(function () { _this.adapter.removeClass(FG_DEACTIVATION); }, constants_1.numbers.FG_DEACTIVATION_MS); } }; MDCRippleFoundation.prototype.rmBoundedActivationClasses = function () { var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION; this.adapter.removeClass(FG_ACTIVATION); this.activationAnimationHasEnded = false; this.adapter.computeBoundingRect(); }; MDCRippleFoundation.prototype.resetActivationState = function () { var _this = this; this.previousActivationEvent = this.activationState.activationEvent; this.activationState = this.defaultActivationState(); // Touch devices may fire additional events for the same interaction within a short time. // Store the previous event until it's safe to assume that subsequent events are for new interactions. setTimeout(function () { return _this.previousActivationEvent = undefined; }, MDCRippleFoundation.numbers.TAP_DELAY_MS); }; MDCRippleFoundation.prototype.deactivateImpl = function () { var _this = this; var activationState = this.activationState; // This can happen in scenarios such as when you have a keyup event that blurs the element. if (!activationState.isActivated) { return; } var state = __assign({}, activationState); if (activationState.isProgrammatic) { requestAnimationFrame(function () { _this.animateDeactivation(state); }); this.resetActivationState(); } else { this.deregisterDeactivationHandlers(); requestAnimationFrame(function () { _this.activationState.hasDeactivationUXRun = true; _this.animateDeactivation(state); _this.resetActivationState(); }); } }; MDCRippleFoundation.prototype.animateDeactivation = function (_a) { var wasActivatedByPointer = _a.wasActivatedByPointer, wasElementMadeActive = _a.wasElementMadeActive; if (wasActivatedByPointer || wasElementMadeActive) { this.runDeactivationUXLogicIfReady(); } }; MDCRippleFoundation.prototype.layoutInternal = function () { var _this = this; this.frame = this.adapter.computeBoundingRect(); var maxDim = Math.max(this.frame.height, this.frame.width); // Surface diameter is treated differently for unbounded vs. bounded ripples. // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via // `overflow: hidden`. var getBoundedRadius = function getBoundedRadius() { var hypotenuse = Math.sqrt(Math.pow(_this.frame.width, 2) + Math.pow(_this.frame.height, 2)); return hypotenuse + MDCRippleFoundation.numbers.PADDING; }; this.maxRadius = this.adapter.isUnbounded() ? maxDim : getBoundedRadius(); // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform var initialSize = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE); // Unbounded ripple size should always be even number to equally center align. if (this.adapter.isUnbounded() && initialSize % 2 !== 0) { this.initialSize = initialSize - 1; } else { this.initialSize = initialSize; } this.fgScale = "" + this.maxRadius / this.initialSize; this.updateLayoutCssVars(); }; MDCRippleFoundation.prototype.updateLayoutCssVars = function () { var _a = MDCRippleFoundation.strings, VAR_FG_SIZE = _a.VAR_FG_SIZE, VAR_LEFT = _a.VAR_LEFT, VAR_TOP = _a.VAR_TOP, VAR_FG_SCALE = _a.VAR_FG_SCALE; this.adapter.updateCssVariable(VAR_FG_SIZE, this.initialSize + "px"); this.adapter.updateCssVariable(VAR_FG_SCALE, this.fgScale); if (this.adapter.isUnbounded()) { this.unboundedCoords = { left: Math.round(this.frame.width / 2 - this.initialSize / 2), top: Math.round(this.frame.height / 2 - this.initialSize / 2) }; this.adapter.updateCssVariable(VAR_LEFT, this.unboundedCoords.left + "px"); this.adapter.updateCssVariable(VAR_TOP, this.unboundedCoords.top + "px"); } }; return MDCRippleFoundation; }(foundation_1.MDCFoundation); exports.MDCRippleFoundation = MDCRippleFoundation; // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. exports.default = MDCRippleFoundation; /***/ }), /***/ "./packages/mdc-ripple/util.ts": /*!*************************************!*\ !*** ./packages/mdc-ripple/util.ts ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getNormalizedEventCoords = exports.supportsCssVariables = void 0; /** * Stores result from supportsCssVariables to avoid redundant processing to * detect CSS custom variable support. */ var supportsCssVariables_; function supportsCssVariables(windowObj, forceRefresh) { if (forceRefresh === void 0) { forceRefresh = false; } var CSS = windowObj.CSS; var supportsCssVars = supportsCssVariables_; if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) { return supportsCssVariables_; } var supportsFunctionPresent = CSS && typeof CSS.supports === 'function'; if (!supportsFunctionPresent) { return false; } var explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes'); // See: https://bugs.webkit.org/show_bug.cgi?id=154669 // See: README section on Safari var weAreFeatureDetectingSafari10plus = CSS.supports('(--css-vars: yes)') && CSS.supports('color', '#00000000'); supportsCssVars = explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus; if (!forceRefresh) { supportsCssVariables_ = supportsCssVars; } return supportsCssVars; } exports.supportsCssVariables = supportsCssVariables; function getNormalizedEventCoords(evt, pageOffset, clientRect) { if (!evt) { return { x: 0, y: 0 }; } var x = pageOffset.x, y = pageOffset.y; var documentX = x + clientRect.left; var documentY = y + clientRect.top; var normalizedX; var normalizedY; // Determine touch point relative to the ripple container. if (evt.type === 'touchstart') { var touchEvent = evt; normalizedX = touchEvent.changedTouches[0].pageX - documentX; normalizedY = touchEvent.changedTouches[0].pageY - documentY; } else { var mouseEvent = evt; normalizedX = mouseEvent.pageX - documentX; normalizedY = mouseEvent.pageY - documentY; } return { x: normalizedX, y: normalizedY }; } exports.getNormalizedEventCoords = getNormalizedEventCoords; /***/ }), /***/ "./packages/mdc-textfield/adapter.ts": /*!*******************************************!*\ !*** ./packages/mdc-textfield/adapter.ts ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); /***/ }), /***/ "./packages/mdc-textfield/character-counter/adapter.ts": /*!*************************************************************!*\ !*** ./packages/mdc-textfield/character-counter/adapter.ts ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); /***/ }), /***/ "./packages/mdc-textfield/character-counter/component.ts": /*!***************************************************************!*\ !*** ./packages/mdc-textfield/character-counter/component.ts ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCTextFieldCharacterCounter = void 0; var component_1 = __webpack_require__(/*! @material/base/component */ "./packages/mdc-base/component.ts"); var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-textfield/character-counter/foundation.ts"); var MDCTextFieldCharacterCounter = /** @class */function (_super) { __extends(MDCTextFieldCharacterCounter, _super); function MDCTextFieldCharacterCounter() { return _super !== null && _super.apply(this, arguments) || this; } MDCTextFieldCharacterCounter.attachTo = function (root) { return new MDCTextFieldCharacterCounter(root); }; Object.defineProperty(MDCTextFieldCharacterCounter.prototype, "foundationForTextField", { // Provided for access by MDCTextField component get: function get() { return this.foundation; }, enumerable: false, configurable: true }); MDCTextFieldCharacterCounter.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. var adapter = { setContent: function setContent(content) { _this.root.textContent = content; } }; return new foundation_1.MDCTextFieldCharacterCounterFoundation(adapter); }; return MDCTextFieldCharacterCounter; }(component_1.MDCComponent); exports.MDCTextFieldCharacterCounter = MDCTextFieldCharacterCounter; /***/ }), /***/ "./packages/mdc-textfield/character-counter/constants.ts": /*!***************************************************************!*\ !*** ./packages/mdc-textfield/character-counter/constants.ts ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.cssClasses = exports.strings = void 0; var cssClasses = { ROOT: 'mdc-text-field-character-counter' }; exports.cssClasses = cssClasses; var strings = { ROOT_SELECTOR: "." + cssClasses.ROOT }; exports.strings = strings; /***/ }), /***/ "./packages/mdc-textfield/character-counter/foundation.ts": /*!****************************************************************!*\ !*** ./packages/mdc-textfield/character-counter/foundation.ts ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCTextFieldCharacterCounterFoundation = void 0; var foundation_1 = __webpack_require__(/*! @material/base/foundation */ "./packages/mdc-base/foundation.ts"); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-textfield/character-counter/constants.ts"); var MDCTextFieldCharacterCounterFoundation = /** @class */function (_super) { __extends(MDCTextFieldCharacterCounterFoundation, _super); function MDCTextFieldCharacterCounterFoundation(adapter) { return _super.call(this, __assign(__assign({}, MDCTextFieldCharacterCounterFoundation.defaultAdapter), adapter)) || this; } Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "cssClasses", { get: function get() { return constants_1.cssClasses; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "strings", { get: function get() { return constants_1.strings; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "defaultAdapter", { /** * See {@link MDCTextFieldCharacterCounterAdapter} for typing information on parameters and return types. */ get: function get() { return { setContent: function setContent() { return undefined; } }; }, enumerable: false, configurable: true }); MDCTextFieldCharacterCounterFoundation.prototype.setCounterValue = function (currentLength, maxLength) { currentLength = Math.min(currentLength, maxLength); this.adapter.setContent(currentLength + " / " + maxLength); }; return MDCTextFieldCharacterCounterFoundation; }(foundation_1.MDCFoundation); exports.MDCTextFieldCharacterCounterFoundation = MDCTextFieldCharacterCounterFoundation; // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. exports.default = MDCTextFieldCharacterCounterFoundation; /***/ }), /***/ "./packages/mdc-textfield/character-counter/index.ts": /*!***********************************************************!*\ !*** ./packages/mdc-textfield/character-counter/index.ts ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function get() { return m[k]; } }); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); var __exportStar = this && this.__exportStar || function (m, exports) { for (var p in m) { if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.characterCountStrings = exports.characterCountCssClasses = void 0; __exportStar(__webpack_require__(/*! ./adapter */ "./packages/mdc-textfield/character-counter/adapter.ts"), exports); __exportStar(__webpack_require__(/*! ./component */ "./packages/mdc-textfield/character-counter/component.ts"), exports); __exportStar(__webpack_require__(/*! ./foundation */ "./packages/mdc-textfield/character-counter/foundation.ts"), exports); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-textfield/character-counter/constants.ts"); Object.defineProperty(exports, "characterCountCssClasses", { enumerable: true, get: function get() { return constants_1.cssClasses; } }); Object.defineProperty(exports, "characterCountStrings", { enumerable: true, get: function get() { return constants_1.strings; } }); /***/ }), /***/ "./packages/mdc-textfield/component.ts": /*!*********************************************!*\ !*** ./packages/mdc-textfield/component.ts ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return __assign.apply(this, arguments); }; var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function get() { return m[k]; } }); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); } : function (o, v) { o["default"] = v; }); var __importStar = this && this.__importStar || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) { if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); }__setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCTextField = void 0; var component_1 = __webpack_require__(/*! @material/base/component */ "./packages/mdc-base/component.ts"); var events_1 = __webpack_require__(/*! @material/dom/events */ "./packages/mdc-dom/events.ts"); var ponyfill = __importStar(__webpack_require__(/*! @material/dom/ponyfill */ "./packages/mdc-dom/ponyfill.ts")); var component_2 = __webpack_require__(/*! @material/floating-label/component */ "./packages/mdc-floating-label/component.ts"); var component_3 = __webpack_require__(/*! @material/line-ripple/component */ "./packages/mdc-line-ripple/component.ts"); var component_4 = __webpack_require__(/*! @material/notched-outline/component */ "./packages/mdc-notched-outline/component.ts"); var component_5 = __webpack_require__(/*! @material/ripple/component */ "./packages/mdc-ripple/component.ts"); var foundation_1 = __webpack_require__(/*! @material/ripple/foundation */ "./packages/mdc-ripple/foundation.ts"); var component_6 = __webpack_require__(/*! ./character-counter/component */ "./packages/mdc-textfield/character-counter/component.ts"); var foundation_2 = __webpack_require__(/*! ./character-counter/foundation */ "./packages/mdc-textfield/character-counter/foundation.ts"); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-textfield/constants.ts"); var foundation_3 = __webpack_require__(/*! ./foundation */ "./packages/mdc-textfield/foundation.ts"); var component_7 = __webpack_require__(/*! ./helper-text/component */ "./packages/mdc-textfield/helper-text/component.ts"); var foundation_4 = __webpack_require__(/*! ./helper-text/foundation */ "./packages/mdc-textfield/helper-text/foundation.ts"); var component_8 = __webpack_require__(/*! ./icon/component */ "./packages/mdc-textfield/icon/component.ts"); var MDCTextField = /** @class */function (_super) { __extends(MDCTextField, _super); function MDCTextField() { return _super !== null && _super.apply(this, arguments) || this; } MDCTextField.attachTo = function (root) { return new MDCTextField(root); }; MDCTextField.prototype.initialize = function (rippleFactory, lineRippleFactory, helperTextFactory, characterCounterFactory, iconFactory, labelFactory, outlineFactory) { if (rippleFactory === void 0) { rippleFactory = function rippleFactory(el, foundation) { return new component_5.MDCRipple(el, foundation); }; } if (lineRippleFactory === void 0) { lineRippleFactory = function lineRippleFactory(el) { return new component_3.MDCLineRipple(el); }; } if (helperTextFactory === void 0) { helperTextFactory = function helperTextFactory(el) { return new component_7.MDCTextFieldHelperText(el); }; } if (characterCounterFactory === void 0) { characterCounterFactory = function characterCounterFactory(el) { return new component_6.MDCTextFieldCharacterCounter(el); }; } if (iconFactory === void 0) { iconFactory = function iconFactory(el) { return new component_8.MDCTextFieldIcon(el); }; } if (labelFactory === void 0) { labelFactory = function labelFactory(el) { return new component_2.MDCFloatingLabel(el); }; } if (outlineFactory === void 0) { outlineFactory = function outlineFactory(el) { return new component_4.MDCNotchedOutline(el); }; } this.input = this.root.querySelector(constants_1.strings.INPUT_SELECTOR); var labelElement = this.root.querySelector(constants_1.strings.LABEL_SELECTOR); this.label = labelElement ? labelFactory(labelElement) : null; var lineRippleElement = this.root.querySelector(constants_1.strings.LINE_RIPPLE_SELECTOR); this.lineRipple = lineRippleElement ? lineRippleFactory(lineRippleElement) : null; var outlineElement = this.root.querySelector(constants_1.strings.OUTLINE_SELECTOR); this.outline = outlineElement ? outlineFactory(outlineElement) : null; // Helper text var helperTextStrings = foundation_4.MDCTextFieldHelperTextFoundation.strings; var nextElementSibling = this.root.nextElementSibling; var hasHelperLine = nextElementSibling && nextElementSibling.classList.contains(constants_1.cssClasses.HELPER_LINE); var helperTextEl = hasHelperLine && nextElementSibling && nextElementSibling.querySelector(helperTextStrings.ROOT_SELECTOR); this.helperText = helperTextEl ? helperTextFactory(helperTextEl) : null; // Character counter var characterCounterStrings = foundation_2.MDCTextFieldCharacterCounterFoundation.strings; var characterCounterEl = this.root.querySelector(characterCounterStrings.ROOT_SELECTOR); // If character counter is not found in root element search in sibling element. if (!characterCounterEl && hasHelperLine && nextElementSibling) { characterCounterEl = nextElementSibling.querySelector(characterCounterStrings.ROOT_SELECTOR); } this.characterCounter = characterCounterEl ? characterCounterFactory(characterCounterEl) : null; // Leading icon var leadingIconEl = this.root.querySelector(constants_1.strings.LEADING_ICON_SELECTOR); this.leadingIcon = leadingIconEl ? iconFactory(leadingIconEl) : null; // Trailing icon var trailingIconEl = this.root.querySelector(constants_1.strings.TRAILING_ICON_SELECTOR); this.trailingIcon = trailingIconEl ? iconFactory(trailingIconEl) : null; // Prefix and Suffix this.prefix = this.root.querySelector(constants_1.strings.PREFIX_SELECTOR); this.suffix = this.root.querySelector(constants_1.strings.SUFFIX_SELECTOR); this.ripple = this.createRipple(rippleFactory); }; MDCTextField.prototype.destroy = function () { if (this.ripple) { this.ripple.destroy(); } if (this.lineRipple) { this.lineRipple.destroy(); } if (this.helperText) { this.helperText.destroy(); } if (this.characterCounter) { this.characterCounter.destroy(); } if (this.leadingIcon) { this.leadingIcon.destroy(); } if (this.trailingIcon) { this.trailingIcon.destroy(); } if (this.label) { this.label.destroy(); } if (this.outline) { this.outline.destroy(); } _super.prototype.destroy.call(this); }; /** * Initializes the Text Field's internal state based on the environment's * state. */ MDCTextField.prototype.initialSyncWithDOM = function () { this.disabled = this.input.disabled; }; Object.defineProperty(MDCTextField.prototype, "value", { get: function get() { return this.foundation.getValue(); }, /** * @param value The value to set on the input. */ set: function set(value) { this.foundation.setValue(value); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "disabled", { get: function get() { return this.foundation.isDisabled(); }, /** * @param disabled Sets the Text Field disabled or enabled. */ set: function set(disabled) { this.foundation.setDisabled(disabled); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "valid", { get: function get() { return this.foundation.isValid(); }, /** * @param valid Sets the Text Field valid or invalid. */ set: function set(valid) { this.foundation.setValid(valid); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "required", { get: function get() { return this.input.required; }, /** * @param required Sets the Text Field to required. */ set: function set(required) { this.input.required = required; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "pattern", { get: function get() { return this.input.pattern; }, /** * @param pattern Sets the input element's validation pattern. */ set: function set(pattern) { this.input.pattern = pattern; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "minLength", { get: function get() { return this.input.minLength; }, /** * @param minLength Sets the input element's minLength. */ set: function set(minLength) { this.input.minLength = minLength; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "maxLength", { get: function get() { return this.input.maxLength; }, /** * @param maxLength Sets the input element's maxLength. */ set: function set(maxLength) { // Chrome throws exception if maxLength is set to a value less than zero if (maxLength < 0) { this.input.removeAttribute('maxLength'); } else { this.input.maxLength = maxLength; } }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "min", { get: function get() { return this.input.min; }, /** * @param min Sets the input element's min. */ set: function set(min) { this.input.min = min; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "max", { get: function get() { return this.input.max; }, /** * @param max Sets the input element's max. */ set: function set(max) { this.input.max = max; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "step", { get: function get() { return this.input.step; }, /** * @param step Sets the input element's step. */ set: function set(step) { this.input.step = step; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "helperTextContent", { /** * Sets the helper text element content. */ set: function set(content) { this.foundation.setHelperTextContent(content); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "leadingIconAriaLabel", { /** * Sets the aria label of the leading icon. */ set: function set(label) { this.foundation.setLeadingIconAriaLabel(label); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "leadingIconContent", { /** * Sets the text content of the leading icon. */ set: function set(content) { this.foundation.setLeadingIconContent(content); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "trailingIconAriaLabel", { /** * Sets the aria label of the trailing icon. */ set: function set(label) { this.foundation.setTrailingIconAriaLabel(label); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "trailingIconContent", { /** * Sets the text content of the trailing icon. */ set: function set(content) { this.foundation.setTrailingIconContent(content); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "useNativeValidation", { /** * Enables or disables the use of native validation. Use this for custom validation. * @param useNativeValidation Set this to false to ignore native input validation. */ set: function set(useNativeValidation) { this.foundation.setUseNativeValidation(useNativeValidation); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "prefixText", { /** * Gets the text content of the prefix, or null if it does not exist. */ get: function get() { return this.prefix ? this.prefix.textContent : null; }, /** * Sets the text content of the prefix, if it exists. */ set: function set(prefixText) { if (this.prefix) { this.prefix.textContent = prefixText; } }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextField.prototype, "suffixText", { /** * Gets the text content of the suffix, or null if it does not exist. */ get: function get() { return this.suffix ? this.suffix.textContent : null; }, /** * Sets the text content of the suffix, if it exists. */ set: function set(suffixText) { if (this.suffix) { this.suffix.textContent = suffixText; } }, enumerable: false, configurable: true }); /** * Focuses the input element. */ MDCTextField.prototype.focus = function () { this.input.focus(); }; /** * Recomputes the outline SVG path for the outline element. */ MDCTextField.prototype.layout = function () { var openNotch = this.foundation.shouldFloat; this.foundation.notchOutline(openNotch); }; MDCTextField.prototype.getDefaultFoundation = function () { // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = __assign(__assign(__assign(__assign(__assign({}, this.getRootAdapterMethods()), this.getInputAdapterMethods()), this.getLabelAdapterMethods()), this.getLineRippleAdapterMethods()), this.getOutlineAdapterMethods()); // tslint:enable:object-literal-sort-keys return new foundation_3.MDCTextFieldFoundation(adapter, this.getFoundationMap()); }; MDCTextField.prototype.getRootAdapterMethods = function () { var _this = this; // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass(className) { return _this.root.classList.add(className); }, removeClass: function removeClass(className) { return _this.root.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root.classList.contains(className); }, registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) { _this.listen(evtType, handler); }, deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) { _this.unlisten(evtType, handler); }, registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) { var getAttributesList = function getAttributesList(mutationsList) { return mutationsList.map(function (mutation) { return mutation.attributeName; }).filter(function (attributeName) { return attributeName; }); }; var observer = new MutationObserver(function (mutationsList) { return handler(getAttributesList(mutationsList)); }); var config = { attributes: true }; observer.observe(_this.input, config); return observer; }, deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) { observer.disconnect(); } }; // tslint:enable:object-literal-sort-keys }; MDCTextField.prototype.getInputAdapterMethods = function () { var _this = this; // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { getNativeInput: function getNativeInput() { return _this.input; }, setInputAttr: function setInputAttr(attr, value) { _this.input.setAttribute(attr, value); }, removeInputAttr: function removeInputAttr(attr) { _this.input.removeAttribute(attr); }, isFocused: function isFocused() { return document.activeElement === _this.input; }, registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) { _this.input.addEventListener(evtType, handler, events_1.applyPassive()); }, deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) { _this.input.removeEventListener(evtType, handler, events_1.applyPassive()); } }; // tslint:enable:object-literal-sort-keys }; MDCTextField.prototype.getLabelAdapterMethods = function () { var _this = this; return { floatLabel: function floatLabel(shouldFloat) { _this.label && _this.label.float(shouldFloat); }, getLabelWidth: function getLabelWidth() { return _this.label ? _this.label.getWidth() : 0; }, hasLabel: function hasLabel() { return Boolean(_this.label); }, shakeLabel: function shakeLabel(shouldShake) { _this.label && _this.label.shake(shouldShake); }, setLabelRequired: function setLabelRequired(isRequired) { _this.label && _this.label.setRequired(isRequired); } }; }; MDCTextField.prototype.getLineRippleAdapterMethods = function () { var _this = this; return { activateLineRipple: function activateLineRipple() { if (_this.lineRipple) { _this.lineRipple.activate(); } }, deactivateLineRipple: function deactivateLineRipple() { if (_this.lineRipple) { _this.lineRipple.deactivate(); } }, setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) { if (_this.lineRipple) { _this.lineRipple.setRippleCenter(normalizedX); } } }; }; MDCTextField.prototype.getOutlineAdapterMethods = function () { var _this = this; return { closeOutline: function closeOutline() { _this.outline && _this.outline.closeNotch(); }, hasOutline: function hasOutline() { return Boolean(_this.outline); }, notchOutline: function notchOutline(labelWidth) { _this.outline && _this.outline.notch(labelWidth); } }; }; /** * @return A map of all subcomponents to subfoundations. */ MDCTextField.prototype.getFoundationMap = function () { return { characterCounter: this.characterCounter ? this.characterCounter.foundationForTextField : undefined, helperText: this.helperText ? this.helperText.foundationForTextField : undefined, leadingIcon: this.leadingIcon ? this.leadingIcon.foundationForTextField : undefined, trailingIcon: this.trailingIcon ? this.trailingIcon.foundationForTextField : undefined }; }; MDCTextField.prototype.createRipple = function (rippleFactory) { var _this = this; var isTextArea = this.root.classList.contains(constants_1.cssClasses.TEXTAREA); var isOutlined = this.root.classList.contains(constants_1.cssClasses.OUTLINED); if (isTextArea || isOutlined) { return null; } // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = __assign(__assign({}, component_5.MDCRipple.createAdapter(this)), { isSurfaceActive: function isSurfaceActive() { return ponyfill.matches(_this.input, ':active'); }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { _this.input.addEventListener(evtType, handler, events_1.applyPassive()); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { _this.input.removeEventListener(evtType, handler, events_1.applyPassive()); } }); // tslint:enable:object-literal-sort-keys return rippleFactory(this.root, new foundation_1.MDCRippleFoundation(adapter)); }; return MDCTextField; }(component_1.MDCComponent); exports.MDCTextField = MDCTextField; /***/ }), /***/ "./packages/mdc-textfield/constants.ts": /*!*********************************************!*\ !*** ./packages/mdc-textfield/constants.ts ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.ALWAYS_FLOAT_TYPES = exports.VALIDATION_ATTR_WHITELIST = exports.numbers = exports.strings = exports.cssClasses = void 0; var strings = { ARIA_CONTROLS: 'aria-controls', ARIA_DESCRIBEDBY: 'aria-describedby', INPUT_SELECTOR: '.mdc-text-field__input', LABEL_SELECTOR: '.mdc-floating-label', LEADING_ICON_SELECTOR: '.mdc-text-field__icon--leading', LINE_RIPPLE_SELECTOR: '.mdc-line-ripple', OUTLINE_SELECTOR: '.mdc-notched-outline', PREFIX_SELECTOR: '.mdc-text-field__affix--prefix', SUFFIX_SELECTOR: '.mdc-text-field__affix--suffix', TRAILING_ICON_SELECTOR: '.mdc-text-field__icon--trailing' }; exports.strings = strings; var cssClasses = { DISABLED: 'mdc-text-field--disabled', FOCUSED: 'mdc-text-field--focused', HELPER_LINE: 'mdc-text-field-helper-line', INVALID: 'mdc-text-field--invalid', LABEL_FLOATING: 'mdc-text-field--label-floating', NO_LABEL: 'mdc-text-field--no-label', OUTLINED: 'mdc-text-field--outlined', ROOT: 'mdc-text-field', TEXTAREA: 'mdc-text-field--textarea', WITH_LEADING_ICON: 'mdc-text-field--with-leading-icon', WITH_TRAILING_ICON: 'mdc-text-field--with-trailing-icon', WITH_INTERNAL_COUNTER: 'mdc-text-field--with-internal-counter' }; exports.cssClasses = cssClasses; var numbers = { LABEL_SCALE: 0.75 }; exports.numbers = numbers; /** * Whitelist based off of * https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation * under the "Validation-related attributes" section. */ var VALIDATION_ATTR_WHITELIST = ['pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength']; exports.VALIDATION_ATTR_WHITELIST = VALIDATION_ATTR_WHITELIST; /** * Label should always float for these types as they show some UI even if value * is empty. */ var ALWAYS_FLOAT_TYPES = ['color', 'date', 'datetime-local', 'month', 'range', 'time', 'week']; exports.ALWAYS_FLOAT_TYPES = ALWAYS_FLOAT_TYPES; /***/ }), /***/ "./packages/mdc-textfield/foundation.ts": /*!**********************************************!*\ !*** ./packages/mdc-textfield/foundation.ts ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return __assign.apply(this, arguments); }; var __values = this && this.__values || function (o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function next() { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCTextFieldFoundation = void 0; var foundation_1 = __webpack_require__(/*! @material/base/foundation */ "./packages/mdc-base/foundation.ts"); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-textfield/constants.ts"); var POINTERDOWN_EVENTS = ['mousedown', 'touchstart']; var INTERACTION_EVENTS = ['click', 'keydown']; var MDCTextFieldFoundation = /** @class */function (_super) { __extends(MDCTextFieldFoundation, _super); /** * @param adapter * @param foundationMap Map from subcomponent names to their subfoundations. */ function MDCTextFieldFoundation(adapter, foundationMap) { if (foundationMap === void 0) { foundationMap = {}; } var _this = _super.call(this, __assign(__assign({}, MDCTextFieldFoundation.defaultAdapter), adapter)) || this; _this.isFocused = false; _this.receivedUserInput = false; _this.valid = true; _this.useNativeValidation = true; _this.validateOnValueChange = true; _this.helperText = foundationMap.helperText; _this.characterCounter = foundationMap.characterCounter; _this.leadingIcon = foundationMap.leadingIcon; _this.trailingIcon = foundationMap.trailingIcon; _this.inputFocusHandler = function () { _this.activateFocus(); }; _this.inputBlurHandler = function () { _this.deactivateFocus(); }; _this.inputInputHandler = function () { _this.handleInput(); }; _this.setPointerXOffset = function (evt) { _this.setTransformOrigin(evt); }; _this.textFieldInteractionHandler = function () { _this.handleTextFieldInteraction(); }; _this.validationAttributeChangeHandler = function (attributesList) { _this.handleValidationAttributeChange(attributesList); }; return _this; } Object.defineProperty(MDCTextFieldFoundation, "cssClasses", { get: function get() { return constants_1.cssClasses; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldFoundation, "strings", { get: function get() { return constants_1.strings; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldFoundation, "numbers", { get: function get() { return constants_1.numbers; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldAlwaysFloat", { get: function get() { var type = this.getNativeInput().type; return constants_1.ALWAYS_FLOAT_TYPES.indexOf(type) >= 0; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldFloat", { get: function get() { return this.shouldAlwaysFloat || this.isFocused || !!this.getValue() || this.isBadInput(); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldShake", { get: function get() { return !this.isFocused && !this.isValid() && !!this.getValue(); }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldFoundation, "defaultAdapter", { /** * See {@link MDCTextFieldAdapter} for typing information on parameters and * return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return true; }, setInputAttr: function setInputAttr() { return undefined; }, removeInputAttr: function removeInputAttr() { return undefined; }, registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() { return undefined; }, deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() { return undefined; }, registerInputInteractionHandler: function registerInputInteractionHandler() { return undefined; }, deregisterInputInteractionHandler: function deregisterInputInteractionHandler() { return undefined; }, registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() { return new MutationObserver(function () { return undefined; }); }, deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() { return undefined; }, getNativeInput: function getNativeInput() { return null; }, isFocused: function isFocused() { return false; }, activateLineRipple: function activateLineRipple() { return undefined; }, deactivateLineRipple: function deactivateLineRipple() { return undefined; }, setLineRippleTransformOrigin: function setLineRippleTransformOrigin() { return undefined; }, shakeLabel: function shakeLabel() { return undefined; }, floatLabel: function floatLabel() { return undefined; }, setLabelRequired: function setLabelRequired() { return undefined; }, hasLabel: function hasLabel() { return false; }, getLabelWidth: function getLabelWidth() { return 0; }, hasOutline: function hasOutline() { return false; }, notchOutline: function notchOutline() { return undefined; }, closeOutline: function closeOutline() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: false, configurable: true }); MDCTextFieldFoundation.prototype.init = function () { var e_1, _a, e_2, _b; if (this.adapter.hasLabel() && this.getNativeInput().required) { this.adapter.setLabelRequired(true); } if (this.adapter.isFocused()) { this.inputFocusHandler(); } else if (this.adapter.hasLabel() && this.shouldFloat) { this.notchOutline(true); this.adapter.floatLabel(true); this.styleFloating(true); } this.adapter.registerInputInteractionHandler('focus', this.inputFocusHandler); this.adapter.registerInputInteractionHandler('blur', this.inputBlurHandler); this.adapter.registerInputInteractionHandler('input', this.inputInputHandler); try { 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()) { var evtType = POINTERDOWN_EVENTS_1_1.value; this.adapter.registerInputInteractionHandler(evtType, this.setPointerXOffset); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (POINTERDOWN_EVENTS_1_1 && !POINTERDOWN_EVENTS_1_1.done && (_a = POINTERDOWN_EVENTS_1.return)) _a.call(POINTERDOWN_EVENTS_1); } finally { if (e_1) throw e_1.error; } } try { 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()) { var evtType = INTERACTION_EVENTS_1_1.value; this.adapter.registerTextFieldInteractionHandler(evtType, this.textFieldInteractionHandler); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (INTERACTION_EVENTS_1_1 && !INTERACTION_EVENTS_1_1.done && (_b = INTERACTION_EVENTS_1.return)) _b.call(INTERACTION_EVENTS_1); } finally { if (e_2) throw e_2.error; } } this.validationObserver = this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler); this.setcharacterCounter(this.getValue().length); }; MDCTextFieldFoundation.prototype.destroy = function () { var e_3, _a, e_4, _b; this.adapter.deregisterInputInteractionHandler('focus', this.inputFocusHandler); this.adapter.deregisterInputInteractionHandler('blur', this.inputBlurHandler); this.adapter.deregisterInputInteractionHandler('input', this.inputInputHandler); try { 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()) { var evtType = POINTERDOWN_EVENTS_2_1.value; this.adapter.deregisterInputInteractionHandler(evtType, this.setPointerXOffset); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (POINTERDOWN_EVENTS_2_1 && !POINTERDOWN_EVENTS_2_1.done && (_a = POINTERDOWN_EVENTS_2.return)) _a.call(POINTERDOWN_EVENTS_2); } finally { if (e_3) throw e_3.error; } } try { 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()) { var evtType = INTERACTION_EVENTS_2_1.value; this.adapter.deregisterTextFieldInteractionHandler(evtType, this.textFieldInteractionHandler); } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (INTERACTION_EVENTS_2_1 && !INTERACTION_EVENTS_2_1.done && (_b = INTERACTION_EVENTS_2.return)) _b.call(INTERACTION_EVENTS_2); } finally { if (e_4) throw e_4.error; } } this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver); }; /** * Handles user interactions with the Text Field. */ MDCTextFieldFoundation.prototype.handleTextFieldInteraction = function () { var nativeInput = this.adapter.getNativeInput(); if (nativeInput && nativeInput.disabled) { return; } this.receivedUserInput = true; }; /** * Handles validation attribute changes */ MDCTextFieldFoundation.prototype.handleValidationAttributeChange = function (attributesList) { var _this = this; attributesList.some(function (attributeName) { if (constants_1.VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) { _this.styleValidity(true); _this.adapter.setLabelRequired(_this.getNativeInput().required); return true; } return false; }); if (attributesList.indexOf('maxlength') > -1) { this.setcharacterCounter(this.getValue().length); } }; /** * Opens/closes the notched outline. */ MDCTextFieldFoundation.prototype.notchOutline = function (openNotch) { if (!this.adapter.hasOutline() || !this.adapter.hasLabel()) { return; } if (openNotch) { var labelWidth = this.adapter.getLabelWidth() * constants_1.numbers.LABEL_SCALE; this.adapter.notchOutline(labelWidth); } else { this.adapter.closeOutline(); } }; /** * Activates the text field focus state. */ MDCTextFieldFoundation.prototype.activateFocus = function () { this.isFocused = true; this.styleFocused(this.isFocused); this.adapter.activateLineRipple(); if (this.adapter.hasLabel()) { this.notchOutline(this.shouldFloat); this.adapter.floatLabel(this.shouldFloat); this.styleFloating(this.shouldFloat); this.adapter.shakeLabel(this.shouldShake); } if (this.helperText && (this.helperText.isPersistent() || !this.helperText.isValidation() || !this.valid)) { this.helperText.showToScreenReader(); } }; /** * Sets the line ripple's transform origin, so that the line ripple activate * animation will animate out from the user's click location. */ MDCTextFieldFoundation.prototype.setTransformOrigin = function (evt) { if (this.isDisabled() || this.adapter.hasOutline()) { return; } var touches = evt.touches; var targetEvent = touches ? touches[0] : evt; var targetClientRect = targetEvent.target.getBoundingClientRect(); var normalizedX = targetEvent.clientX - targetClientRect.left; this.adapter.setLineRippleTransformOrigin(normalizedX); }; /** * Handles input change of text input and text area. */ MDCTextFieldFoundation.prototype.handleInput = function () { this.autoCompleteFocus(); this.setcharacterCounter(this.getValue().length); }; /** * Activates the Text Field's focus state in cases when the input value * changes without user input (e.g. programmatically). */ MDCTextFieldFoundation.prototype.autoCompleteFocus = function () { if (!this.receivedUserInput) { this.activateFocus(); } }; /** * Deactivates the Text Field's focus state. */ MDCTextFieldFoundation.prototype.deactivateFocus = function () { this.isFocused = false; this.adapter.deactivateLineRipple(); var isValid = this.isValid(); this.styleValidity(isValid); this.styleFocused(this.isFocused); if (this.adapter.hasLabel()) { this.notchOutline(this.shouldFloat); this.adapter.floatLabel(this.shouldFloat); this.styleFloating(this.shouldFloat); this.adapter.shakeLabel(this.shouldShake); } if (!this.shouldFloat) { this.receivedUserInput = false; } }; MDCTextFieldFoundation.prototype.getValue = function () { return this.getNativeInput().value; }; /** * @param value The value to set on the input Element. */ MDCTextFieldFoundation.prototype.setValue = function (value) { // Prevent Safari from moving the caret to the end of the input when the // value has not changed. if (this.getValue() !== value) { this.getNativeInput().value = value; } this.setcharacterCounter(value.length); if (this.validateOnValueChange) { var isValid = this.isValid(); this.styleValidity(isValid); } if (this.adapter.hasLabel()) { this.notchOutline(this.shouldFloat); this.adapter.floatLabel(this.shouldFloat); this.styleFloating(this.shouldFloat); if (this.validateOnValueChange) { this.adapter.shakeLabel(this.shouldShake); } } }; /** * @return The custom validity state, if set; otherwise, the result of a * native validity check. */ MDCTextFieldFoundation.prototype.isValid = function () { return this.useNativeValidation ? this.isNativeInputValid() : this.valid; }; /** * @param isValid Sets the custom validity state of the Text Field. */ MDCTextFieldFoundation.prototype.setValid = function (isValid) { this.valid = isValid; this.styleValidity(isValid); var shouldShake = !isValid && !this.isFocused && !!this.getValue(); if (this.adapter.hasLabel()) { this.adapter.shakeLabel(shouldShake); } }; /** * @param shouldValidate Whether or not validity should be updated on * value change. */ MDCTextFieldFoundation.prototype.setValidateOnValueChange = function (shouldValidate) { this.validateOnValueChange = shouldValidate; }; /** * @return Whether or not validity should be updated on value change. `true` * by default. */ MDCTextFieldFoundation.prototype.getValidateOnValueChange = function () { return this.validateOnValueChange; }; /** * Enables or disables the use of native validation. Use this for custom * validation. * @param useNativeValidation Set this to false to ignore native input * validation. */ MDCTextFieldFoundation.prototype.setUseNativeValidation = function (useNativeValidation) { this.useNativeValidation = useNativeValidation; }; MDCTextFieldFoundation.prototype.isDisabled = function () { return this.getNativeInput().disabled; }; /** * @param disabled Sets the text-field disabled or enabled. */ MDCTextFieldFoundation.prototype.setDisabled = function (disabled) { this.getNativeInput().disabled = disabled; this.styleDisabled(disabled); }; /** * @param content Sets the content of the helper text. */ MDCTextFieldFoundation.prototype.setHelperTextContent = function (content) { if (this.helperText) { this.helperText.setContent(content); } }; /** * Sets the aria label of the leading icon. */ MDCTextFieldFoundation.prototype.setLeadingIconAriaLabel = function (label) { if (this.leadingIcon) { this.leadingIcon.setAriaLabel(label); } }; /** * Sets the text content of the leading icon. */ MDCTextFieldFoundation.prototype.setLeadingIconContent = function (content) { if (this.leadingIcon) { this.leadingIcon.setContent(content); } }; /** * Sets the aria label of the trailing icon. */ MDCTextFieldFoundation.prototype.setTrailingIconAriaLabel = function (label) { if (this.trailingIcon) { this.trailingIcon.setAriaLabel(label); } }; /** * Sets the text content of the trailing icon. */ MDCTextFieldFoundation.prototype.setTrailingIconContent = function (content) { if (this.trailingIcon) { this.trailingIcon.setContent(content); } }; /** * Sets character counter values that shows characters used and the total * character limit. */ MDCTextFieldFoundation.prototype.setcharacterCounter = function (currentLength) { if (!this.characterCounter) { return; } var maxLength = this.getNativeInput().maxLength; if (maxLength === -1) { throw new Error('MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.'); } this.characterCounter.setCounterValue(currentLength, maxLength); }; /** * @return True if the Text Field input fails in converting the user-supplied * value. */ MDCTextFieldFoundation.prototype.isBadInput = function () { // The badInput property is not supported in IE 11 💩. return this.getNativeInput().validity.badInput || false; }; /** * @return The result of native validity checking (ValidityState.valid). */ MDCTextFieldFoundation.prototype.isNativeInputValid = function () { return this.getNativeInput().validity.valid; }; /** * Styles the component based on the validity state. */ MDCTextFieldFoundation.prototype.styleValidity = function (isValid) { var INVALID = MDCTextFieldFoundation.cssClasses.INVALID; if (isValid) { this.adapter.removeClass(INVALID); } else { this.adapter.addClass(INVALID); } if (this.helperText) { this.helperText.setValidity(isValid); // We dynamically set or unset aria-describedby for validation helper text // only, based on whether the field is valid var helperTextValidation = this.helperText.isValidation(); if (!helperTextValidation) { return; } var helperTextVisible = this.helperText.isVisible(); var helperTextId = this.helperText.getId(); if (helperTextVisible && helperTextId) { this.adapter.setInputAttr(constants_1.strings.ARIA_DESCRIBEDBY, helperTextId); } else { this.adapter.removeInputAttr(constants_1.strings.ARIA_DESCRIBEDBY); } } }; /** * Styles the component based on the focused state. */ MDCTextFieldFoundation.prototype.styleFocused = function (isFocused) { var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED; if (isFocused) { this.adapter.addClass(FOCUSED); } else { this.adapter.removeClass(FOCUSED); } }; /** * Styles the component based on the disabled state. */ MDCTextFieldFoundation.prototype.styleDisabled = function (isDisabled) { var _a = MDCTextFieldFoundation.cssClasses, DISABLED = _a.DISABLED, INVALID = _a.INVALID; if (isDisabled) { this.adapter.addClass(DISABLED); this.adapter.removeClass(INVALID); } else { this.adapter.removeClass(DISABLED); } if (this.leadingIcon) { this.leadingIcon.setDisabled(isDisabled); } if (this.trailingIcon) { this.trailingIcon.setDisabled(isDisabled); } }; /** * Styles the component based on the label floating state. */ MDCTextFieldFoundation.prototype.styleFloating = function (isFloating) { var LABEL_FLOATING = MDCTextFieldFoundation.cssClasses.LABEL_FLOATING; if (isFloating) { this.adapter.addClass(LABEL_FLOATING); } else { this.adapter.removeClass(LABEL_FLOATING); } }; /** * @return The native text input element from the host environment, or an * object with the same shape for unit tests. */ MDCTextFieldFoundation.prototype.getNativeInput = function () { // this.adapter may be undefined in foundation unit tests. This happens when // testdouble is creating a mock object and invokes the // shouldShake/shouldFloat getters (which in turn call getValue(), which // calls this method) before init() has been called from the MDCTextField // constructor. To work around that issue, we return a dummy object. var nativeInput = this.adapter ? this.adapter.getNativeInput() : null; return nativeInput || { disabled: false, maxLength: -1, required: false, type: 'input', validity: { badInput: false, valid: true }, value: '' }; }; return MDCTextFieldFoundation; }(foundation_1.MDCFoundation); exports.MDCTextFieldFoundation = MDCTextFieldFoundation; // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. exports.default = MDCTextFieldFoundation; /***/ }), /***/ "./packages/mdc-textfield/helper-text/adapter.ts": /*!*******************************************************!*\ !*** ./packages/mdc-textfield/helper-text/adapter.ts ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); /***/ }), /***/ "./packages/mdc-textfield/helper-text/component.ts": /*!*********************************************************!*\ !*** ./packages/mdc-textfield/helper-text/component.ts ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCTextFieldHelperText = void 0; var component_1 = __webpack_require__(/*! @material/base/component */ "./packages/mdc-base/component.ts"); var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-textfield/helper-text/foundation.ts"); var MDCTextFieldHelperText = /** @class */function (_super) { __extends(MDCTextFieldHelperText, _super); function MDCTextFieldHelperText() { return _super !== null && _super.apply(this, arguments) || this; } MDCTextFieldHelperText.attachTo = function (root) { return new MDCTextFieldHelperText(root); }; Object.defineProperty(MDCTextFieldHelperText.prototype, "foundationForTextField", { // Provided for access by MDCTextField component get: function get() { return this.foundation; }, enumerable: false, configurable: true }); MDCTextFieldHelperText.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { addClass: function addClass(className) { return _this.root.classList.add(className); }, removeClass: function removeClass(className) { return _this.root.classList.remove(className); }, hasClass: function hasClass(className) { return _this.root.classList.contains(className); }, getAttr: function getAttr(attr) { return _this.root.getAttribute(attr); }, setAttr: function setAttr(attr, value) { return _this.root.setAttribute(attr, value); }, removeAttr: function removeAttr(attr) { return _this.root.removeAttribute(attr); }, setContent: function setContent(content) { _this.root.textContent = content; } }; // tslint:enable:object-literal-sort-keys return new foundation_1.MDCTextFieldHelperTextFoundation(adapter); }; return MDCTextFieldHelperText; }(component_1.MDCComponent); exports.MDCTextFieldHelperText = MDCTextFieldHelperText; /***/ }), /***/ "./packages/mdc-textfield/helper-text/constants.ts": /*!*********************************************************!*\ !*** ./packages/mdc-textfield/helper-text/constants.ts ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.cssClasses = exports.strings = void 0; var cssClasses = { HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent', HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg', ROOT: 'mdc-text-field-helper-text' }; exports.cssClasses = cssClasses; var strings = { ARIA_HIDDEN: 'aria-hidden', ROLE: 'role', ROOT_SELECTOR: "." + cssClasses.ROOT }; exports.strings = strings; /***/ }), /***/ "./packages/mdc-textfield/helper-text/foundation.ts": /*!**********************************************************!*\ !*** ./packages/mdc-textfield/helper-text/foundation.ts ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCTextFieldHelperTextFoundation = void 0; var foundation_1 = __webpack_require__(/*! @material/base/foundation */ "./packages/mdc-base/foundation.ts"); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-textfield/helper-text/constants.ts"); var MDCTextFieldHelperTextFoundation = /** @class */function (_super) { __extends(MDCTextFieldHelperTextFoundation, _super); function MDCTextFieldHelperTextFoundation(adapter) { return _super.call(this, __assign(__assign({}, MDCTextFieldHelperTextFoundation.defaultAdapter), adapter)) || this; } Object.defineProperty(MDCTextFieldHelperTextFoundation, "cssClasses", { get: function get() { return constants_1.cssClasses; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldHelperTextFoundation, "strings", { get: function get() { return constants_1.strings; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldHelperTextFoundation, "defaultAdapter", { /** * See {@link MDCTextFieldHelperTextAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { addClass: function addClass() { return undefined; }, removeClass: function removeClass() { return undefined; }, hasClass: function hasClass() { return false; }, getAttr: function getAttr() { return null; }, setAttr: function setAttr() { return undefined; }, removeAttr: function removeAttr() { return undefined; }, setContent: function setContent() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: false, configurable: true }); MDCTextFieldHelperTextFoundation.prototype.getId = function () { return this.adapter.getAttr('id'); }; MDCTextFieldHelperTextFoundation.prototype.isVisible = function () { return this.adapter.getAttr(constants_1.strings.ARIA_HIDDEN) !== 'true'; }; /** * Sets the content of the helper text field. */ MDCTextFieldHelperTextFoundation.prototype.setContent = function (content) { this.adapter.setContent(content); }; MDCTextFieldHelperTextFoundation.prototype.isPersistent = function () { return this.adapter.hasClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT); }; /** * @param isPersistent Sets the persistency of the helper text. */ MDCTextFieldHelperTextFoundation.prototype.setPersistent = function (isPersistent) { if (isPersistent) { this.adapter.addClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT); } else { this.adapter.removeClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT); } }; /** * @return whether the helper text acts as an error validation message. */ MDCTextFieldHelperTextFoundation.prototype.isValidation = function () { return this.adapter.hasClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG); }; /** * @param isValidation True to make the helper text act as an error validation message. */ MDCTextFieldHelperTextFoundation.prototype.setValidation = function (isValidation) { if (isValidation) { this.adapter.addClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG); } else { this.adapter.removeClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG); } }; /** * Makes the helper text visible to the screen reader. */ MDCTextFieldHelperTextFoundation.prototype.showToScreenReader = function () { this.adapter.removeAttr(constants_1.strings.ARIA_HIDDEN); }; /** * Sets the validity of the helper text based on the input validity. */ MDCTextFieldHelperTextFoundation.prototype.setValidity = function (inputIsValid) { var helperTextIsPersistent = this.adapter.hasClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT); var helperTextIsValidationMsg = this.adapter.hasClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG); var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid; if (validationMsgNeedsDisplay) { this.showToScreenReader(); // If role is already alert, refresh it to trigger another announcement // from screenreader. if (this.adapter.getAttr(constants_1.strings.ROLE) === 'alert') { this.refreshAlertRole(); } else { this.adapter.setAttr(constants_1.strings.ROLE, 'alert'); } } else { this.adapter.removeAttr(constants_1.strings.ROLE); } if (!helperTextIsPersistent && !validationMsgNeedsDisplay) { this.hide(); } }; /** * Hides the help text from screen readers. */ MDCTextFieldHelperTextFoundation.prototype.hide = function () { this.adapter.setAttr(constants_1.strings.ARIA_HIDDEN, 'true'); }; MDCTextFieldHelperTextFoundation.prototype.refreshAlertRole = function () { var _this = this; this.adapter.removeAttr(constants_1.strings.ROLE); requestAnimationFrame(function () { _this.adapter.setAttr(constants_1.strings.ROLE, 'alert'); }); }; return MDCTextFieldHelperTextFoundation; }(foundation_1.MDCFoundation); exports.MDCTextFieldHelperTextFoundation = MDCTextFieldHelperTextFoundation; // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. exports.default = MDCTextFieldHelperTextFoundation; /***/ }), /***/ "./packages/mdc-textfield/helper-text/index.ts": /*!*****************************************************!*\ !*** ./packages/mdc-textfield/helper-text/index.ts ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function get() { return m[k]; } }); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); var __exportStar = this && this.__exportStar || function (m, exports) { for (var p in m) { if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.helperTextStrings = exports.helperTextCssClasses = void 0; __exportStar(__webpack_require__(/*! ./adapter */ "./packages/mdc-textfield/helper-text/adapter.ts"), exports); __exportStar(__webpack_require__(/*! ./component */ "./packages/mdc-textfield/helper-text/component.ts"), exports); __exportStar(__webpack_require__(/*! ./foundation */ "./packages/mdc-textfield/helper-text/foundation.ts"), exports); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-textfield/helper-text/constants.ts"); Object.defineProperty(exports, "helperTextCssClasses", { enumerable: true, get: function get() { return constants_1.cssClasses; } }); Object.defineProperty(exports, "helperTextStrings", { enumerable: true, get: function get() { return constants_1.strings; } }); /***/ }), /***/ "./packages/mdc-textfield/icon/adapter.ts": /*!************************************************!*\ !*** ./packages/mdc-textfield/icon/adapter.ts ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); /***/ }), /***/ "./packages/mdc-textfield/icon/component.ts": /*!**************************************************!*\ !*** ./packages/mdc-textfield/icon/component.ts ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCTextFieldIcon = void 0; var component_1 = __webpack_require__(/*! @material/base/component */ "./packages/mdc-base/component.ts"); var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-textfield/icon/foundation.ts"); var MDCTextFieldIcon = /** @class */function (_super) { __extends(MDCTextFieldIcon, _super); function MDCTextFieldIcon() { return _super !== null && _super.apply(this, arguments) || this; } MDCTextFieldIcon.attachTo = function (root) { return new MDCTextFieldIcon(root); }; Object.defineProperty(MDCTextFieldIcon.prototype, "foundationForTextField", { // Provided for access by MDCTextField component get: function get() { return this.foundation; }, enumerable: false, configurable: true }); MDCTextFieldIcon.prototype.getDefaultFoundation = function () { var _this = this; // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial. // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. var adapter = { getAttr: function getAttr(attr) { return _this.root.getAttribute(attr); }, setAttr: function setAttr(attr, value) { return _this.root.setAttribute(attr, value); }, removeAttr: function removeAttr(attr) { return _this.root.removeAttribute(attr); }, setContent: function setContent(content) { _this.root.textContent = content; }, registerInteractionHandler: function registerInteractionHandler(evtType, handler) { return _this.listen(evtType, handler); }, deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) { return _this.unlisten(evtType, handler); }, notifyIconAction: function notifyIconAction() { return _this.emit(foundation_1.MDCTextFieldIconFoundation.strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */); } }; // tslint:enable:object-literal-sort-keys return new foundation_1.MDCTextFieldIconFoundation(adapter); }; return MDCTextFieldIcon; }(component_1.MDCComponent); exports.MDCTextFieldIcon = MDCTextFieldIcon; /***/ }), /***/ "./packages/mdc-textfield/icon/constants.ts": /*!**************************************************!*\ !*** ./packages/mdc-textfield/icon/constants.ts ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2016 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.cssClasses = exports.strings = void 0; var strings = { ICON_EVENT: 'MDCTextField:icon', ICON_ROLE: 'button' }; exports.strings = strings; var cssClasses = { ROOT: 'mdc-text-field__icon' }; exports.cssClasses = cssClasses; /***/ }), /***/ "./packages/mdc-textfield/icon/foundation.ts": /*!***************************************************!*\ !*** ./packages/mdc-textfield/icon/foundation.ts ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2017 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __extends = this && this.__extends || function () { var _extendStatics = function extendStatics(d, b) { _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; } }; return _extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); _extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; return __assign.apply(this, arguments); }; var __values = this && this.__values || function (o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function next() { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MDCTextFieldIconFoundation = void 0; var foundation_1 = __webpack_require__(/*! @material/base/foundation */ "./packages/mdc-base/foundation.ts"); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-textfield/icon/constants.ts"); var INTERACTION_EVENTS = ['click', 'keydown']; var MDCTextFieldIconFoundation = /** @class */function (_super) { __extends(MDCTextFieldIconFoundation, _super); function MDCTextFieldIconFoundation(adapter) { var _this = _super.call(this, __assign(__assign({}, MDCTextFieldIconFoundation.defaultAdapter), adapter)) || this; _this.savedTabIndex = null; _this.interactionHandler = function (evt) { _this.handleInteraction(evt); }; return _this; } Object.defineProperty(MDCTextFieldIconFoundation, "strings", { get: function get() { return constants_1.strings; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldIconFoundation, "cssClasses", { get: function get() { return constants_1.cssClasses; }, enumerable: false, configurable: true }); Object.defineProperty(MDCTextFieldIconFoundation, "defaultAdapter", { /** * See {@link MDCTextFieldIconAdapter} for typing information on parameters and return types. */ get: function get() { // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. return { getAttr: function getAttr() { return null; }, setAttr: function setAttr() { return undefined; }, removeAttr: function removeAttr() { return undefined; }, setContent: function setContent() { return undefined; }, registerInteractionHandler: function registerInteractionHandler() { return undefined; }, deregisterInteractionHandler: function deregisterInteractionHandler() { return undefined; }, notifyIconAction: function notifyIconAction() { return undefined; } }; // tslint:enable:object-literal-sort-keys }, enumerable: false, configurable: true }); MDCTextFieldIconFoundation.prototype.init = function () { var e_1, _a; this.savedTabIndex = this.adapter.getAttr('tabindex'); try { 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()) { var evtType = INTERACTION_EVENTS_1_1.value; this.adapter.registerInteractionHandler(evtType, this.interactionHandler); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (INTERACTION_EVENTS_1_1 && !INTERACTION_EVENTS_1_1.done && (_a = INTERACTION_EVENTS_1.return)) _a.call(INTERACTION_EVENTS_1); } finally { if (e_1) throw e_1.error; } } }; MDCTextFieldIconFoundation.prototype.destroy = function () { var e_2, _a; try { 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()) { var evtType = INTERACTION_EVENTS_2_1.value; this.adapter.deregisterInteractionHandler(evtType, this.interactionHandler); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (INTERACTION_EVENTS_2_1 && !INTERACTION_EVENTS_2_1.done && (_a = INTERACTION_EVENTS_2.return)) _a.call(INTERACTION_EVENTS_2); } finally { if (e_2) throw e_2.error; } } }; MDCTextFieldIconFoundation.prototype.setDisabled = function (disabled) { if (!this.savedTabIndex) { return; } if (disabled) { this.adapter.setAttr('tabindex', '-1'); this.adapter.removeAttr('role'); } else { this.adapter.setAttr('tabindex', this.savedTabIndex); this.adapter.setAttr('role', constants_1.strings.ICON_ROLE); } }; MDCTextFieldIconFoundation.prototype.setAriaLabel = function (label) { this.adapter.setAttr('aria-label', label); }; MDCTextFieldIconFoundation.prototype.setContent = function (content) { this.adapter.setContent(content); }; MDCTextFieldIconFoundation.prototype.handleInteraction = function (evt) { var isEnterKey = evt.key === 'Enter' || evt.keyCode === 13; if (evt.type === 'click' || isEnterKey) { evt.preventDefault(); // stop click from causing host label to focus // input this.adapter.notifyIconAction(); } }; return MDCTextFieldIconFoundation; }(foundation_1.MDCFoundation); exports.MDCTextFieldIconFoundation = MDCTextFieldIconFoundation; // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. exports.default = MDCTextFieldIconFoundation; /***/ }), /***/ "./packages/mdc-textfield/icon/index.ts": /*!**********************************************!*\ !*** ./packages/mdc-textfield/icon/index.ts ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function get() { return m[k]; } }); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); var __exportStar = this && this.__exportStar || function (m, exports) { for (var p in m) { if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.iconStrings = exports.iconCssClasses = void 0; __exportStar(__webpack_require__(/*! ./adapter */ "./packages/mdc-textfield/icon/adapter.ts"), exports); __exportStar(__webpack_require__(/*! ./component */ "./packages/mdc-textfield/icon/component.ts"), exports); __exportStar(__webpack_require__(/*! ./foundation */ "./packages/mdc-textfield/icon/foundation.ts"), exports); var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-textfield/icon/constants.ts"); Object.defineProperty(exports, "iconCssClasses", { enumerable: true, get: function get() { return constants_1.cssClasses; } }); Object.defineProperty(exports, "iconStrings", { enumerable: true, get: function get() { return constants_1.strings; } }); /***/ }), /***/ "./packages/mdc-textfield/index.ts": /*!*****************************************!*\ !*** ./packages/mdc-textfield/index.ts ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function get() { return m[k]; } }); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); var __exportStar = this && this.__exportStar || function (m, exports) { for (var p in m) { if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); } }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(__webpack_require__(/*! ./adapter */ "./packages/mdc-textfield/adapter.ts"), exports); __exportStar(__webpack_require__(/*! ./component */ "./packages/mdc-textfield/component.ts"), exports); __exportStar(__webpack_require__(/*! ./constants */ "./packages/mdc-textfield/constants.ts"), exports); __exportStar(__webpack_require__(/*! ./foundation */ "./packages/mdc-textfield/foundation.ts"), exports); __exportStar(__webpack_require__(/*! ./types */ "./packages/mdc-textfield/types.ts"), exports); __exportStar(__webpack_require__(/*! ./character-counter/index */ "./packages/mdc-textfield/character-counter/index.ts"), exports); __exportStar(__webpack_require__(/*! ./helper-text/index */ "./packages/mdc-textfield/helper-text/index.ts"), exports); __exportStar(__webpack_require__(/*! ./icon/index */ "./packages/mdc-textfield/icon/index.ts"), exports); /***/ }), /***/ "./packages/mdc-textfield/types.ts": /*!*****************************************!*\ !*** ./packages/mdc-textfield/types.ts ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @license * Copyright 2019 Google Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); /***/ }) /******/ }); }); //# sourceMappingURL=mdc.textfield.js.map