969 lines
41 KiB
JavaScript
969 lines
41 KiB
JavaScript
/**
|
|
* @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/notched-outline", [], factory);
|
|
else if(typeof exports === 'object')
|
|
exports["notched-outline"] = factory();
|
|
else
|
|
root["mdc"] = root["mdc"] || {}, root["mdc"]["notched-outline"] = 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-notched-outline/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-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-notched-outline/adapter.ts":
|
|
/*!*************************************************!*\
|
|
!*** ./packages/mdc-notched-outline/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-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<MDCFooAdapter>.
|
|
// 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-notched-outline/index.ts":
|
|
/*!***********************************************!*\
|
|
!*** ./packages/mdc-notched-outline/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-notched-outline/adapter.ts"), exports);
|
|
__exportStar(__webpack_require__(/*! ./component */ "./packages/mdc-notched-outline/component.ts"), exports);
|
|
__exportStar(__webpack_require__(/*! ./constants */ "./packages/mdc-notched-outline/constants.ts"), exports);
|
|
__exportStar(__webpack_require__(/*! ./foundation */ "./packages/mdc-notched-outline/foundation.ts"), exports);
|
|
|
|
/***/ })
|
|
|
|
/******/ });
|
|
});
|
|
//# sourceMappingURL=mdc.notchedOutline.js.map
|