@material/form-field
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -24,5 +24,5 @@ /*! | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ } | ||
/******/ | ||
/******/ // Create a new module (and put it into the cache) | ||
@@ -82,3 +82,3 @@ /******/ var module = installedModules[moduleId] = { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 72); | ||
/******/ return __webpack_require__(__webpack_require__.s = 75); | ||
/******/ }) | ||
@@ -142,5 +142,11 @@ /************************************************************************/ | ||
/** | ||
* @template A | ||
*/ | ||
var MDCFoundation = function () { | ||
_createClass(MDCFoundation, null, [{ | ||
key: "cssClasses", | ||
/** @return enum{cssClasses} */ | ||
get: function get() { | ||
@@ -151,2 +157,5 @@ // Classes extending MDCFoundation should implement this method to return an object which exports every | ||
} | ||
/** @return enum{strings} */ | ||
}, { | ||
@@ -159,2 +168,5 @@ key: "strings", | ||
} | ||
/** @return enum{numbers} */ | ||
}, { | ||
@@ -167,2 +179,5 @@ key: "numbers", | ||
} | ||
/** @return {!Object} */ | ||
}, { | ||
@@ -176,2 +191,7 @@ key: "defaultAdapter", | ||
} | ||
/** | ||
* @param {!A} adapter | ||
*/ | ||
}]); | ||
@@ -184,2 +204,3 @@ | ||
/** @private {!A} */ | ||
this.adapter_ = adapter; | ||
@@ -234,5 +255,15 @@ } | ||
/** | ||
* @template F | ||
*/ | ||
var MDCComponent = function () { | ||
_createClass(MDCComponent, null, [{ | ||
key: 'attachTo', | ||
/** | ||
* @param {!Element} root | ||
* @return {!MDCComponent} | ||
*/ | ||
value: function attachTo(root) { | ||
@@ -245,2 +276,9 @@ // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and | ||
} | ||
/** | ||
* @param {!Element} root | ||
* @param {!F} foundation | ||
* @param {...?} args | ||
*/ | ||
}]); | ||
@@ -253,2 +291,3 @@ | ||
/** @private {!Element} */ | ||
this.root_ = root; | ||
@@ -263,2 +302,3 @@ | ||
// this.root_ is defined and can be used within the foundation class. | ||
/** @private {!F} */ | ||
this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation; | ||
@@ -271,7 +311,12 @@ this.foundation_.init(); | ||
key: 'initialize', | ||
value: function initialize() /* ...args */{ | ||
// 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. | ||
} | ||
value: function initialize() /* ...args */{} | ||
// 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. | ||
/** | ||
* @return {!F} foundation | ||
*/ | ||
}, { | ||
@@ -300,4 +345,8 @@ key: 'getDefaultFoundation', | ||
// Wrapper method to add an event listener to the component's root element. This is most useful when | ||
// listening for custom events. | ||
/** | ||
* Wrapper method to add an event listener to the component's root element. This is most useful when | ||
* listening for custom events. | ||
* @param {string} evtType | ||
* @param {!Function} handler | ||
*/ | ||
@@ -310,4 +359,8 @@ }, { | ||
// Wrapper method to remove an event listener to the component's root element. This is most useful when | ||
// unlistening for custom events. | ||
/** | ||
* Wrapper method to remove an event listener to the component's root element. This is most useful when | ||
* unlistening for custom events. | ||
* @param {string} evtType | ||
* @param {!Function} handler | ||
*/ | ||
@@ -320,4 +373,9 @@ }, { | ||
// Fires a cross-browser-compatible custom event from the component root of the given type, | ||
// with the given data. | ||
/** | ||
* Fires a cross-browser-compatible custom event from the component root of the given type, | ||
* with the given data. | ||
* @param {string} evtType | ||
* @param {!Object} evtData | ||
* @param {boolean} shouldBubble | ||
*/ | ||
@@ -356,6 +414,6 @@ }, { | ||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormField", function() { return MDCFormField; }); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(0); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(45); | ||
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormField", function() { return MDCFormField; }); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
@@ -580,3 +638,3 @@ | ||
/***/ 72: | ||
/***/ 75: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -583,0 +641,0 @@ |
@@ -6,2 +6,2 @@ /*! | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.formField=e():(t.mdc=t.mdc||{},t.mdc.formField=e())}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/assets/",e(e.s=72)}({0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1);n.d(e,"MDCFoundation",function(){return r.a});var o=n(2);n.d(e,"MDCComponent",function(){return o.a})},1:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t),this.adapter_=e}return o(t,null,[{key:"cssClasses",get:function(){return{}}},{key:"strings",get:function(){return{}}},{key:"numbers",get:function(){return{}}},{key:"defaultAdapter",get:function(){return{}}}]),o(t,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),t}();e.a=i},2:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=n(1),i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;r(this,t),this.root_=e;for(var o=arguments.length,i=Array(o>2?o-2:0),u=2;u<o;u++)i[u-2]=arguments[u];this.initialize.apply(this,i),this.foundation_=void 0===n?this.getDefaultFoundation():n,this.foundation_.init(),this.initialSyncWithDOM()}return i(t,null,[{key:"attachTo",value:function(e){return new t(e,new o.a)}}]),i(t,[{key:"initialize",value:function(){}},{key:"getDefaultFoundation",value:function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")}},{key:"initialSyncWithDOM",value:function(){}},{key:"destroy",value:function(){this.foundation_.destroy()}},{key:"listen",value:function(t,e){this.root_.addEventListener(t,e)}},{key:"unlisten",value:function(t,e){this.root_.removeEventListener(t,e)}},{key:"emit",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=void 0;"function"==typeof CustomEvent?r=new CustomEvent(t,{detail:e,bubbles:n}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(t,n,!1,e)),this.root_.dispatchEvent(r)}}]),t}();e.a=u},22:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"MDCFormField",function(){return f});var u=n(0),a=n(45);n.d(e,"MDCFormFieldFoundation",function(){return a.a});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),c(e,[{key:"getDefaultFoundation",value:function(){var t=this;return new a.a({registerInteractionHandler:function(e,n){return t.label_.addEventListener(e,n)},deregisterInteractionHandler:function(e,n){return t.label_.removeEventListener(e,n)},activateInputRipple:function(){t.input_&&t.input_.ripple&&t.input_.ripple.activate()},deactivateInputRipple:function(){t.input_&&t.input_.ripple&&t.input_.ripple.deactivate()}})}},{key:"input",set:function(t){this.input_=t},get:function(){return this.input_}},{key:"label_",get:function(){return this.root_.querySelector(a.a.strings.LABEL_SELECTOR)}}],[{key:"attachTo",value:function(t){return new e(t)}}]),e}(u.MDCComponent)},44:function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return o});var r={ROOT:"mdc-form-field"},o={LABEL_SELECTOR:".mdc-form-field > label"}},45:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(0),a=n(44),c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=function(t){function e(t){r(this,e);var n=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,c(e.defaultAdapter,t)));return n.clickHandler_=function(t){return n.handleClick_(t)},n}return i(e,t),f(e,null,[{key:"cssClasses",get:function(){return a.a}},{key:"strings",get:function(){return a.b}},{key:"defaultAdapter",get:function(){return{registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},activateInputRipple:function(){},deactivateInputRipple:function(){}}}}]),f(e,[{key:"init",value:function(){this.adapter_.registerInteractionHandler("click",this.clickHandler_)}},{key:"destroy",value:function(){this.adapter_.deregisterInteractionHandler("click",this.clickHandler_)}},{key:"handleClick_",value:function(){var t=this;this.adapter_.activateInputRipple(),requestAnimationFrame(function(){return t.adapter_.deactivateInputRipple()})}}]),e}(u.MDCFoundation);e.a=l},72:function(t,e,n){t.exports=n(22)}})}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.formField=e():(t.mdc=t.mdc||{},t.mdc.formField=e())}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/assets/",e(e.s=75)}({0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1);n.d(e,"MDCFoundation",function(){return r.a});var o=n(2);n.d(e,"MDCComponent",function(){return o.a})},1:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t),this.adapter_=e}return o(t,null,[{key:"cssClasses",get:function(){return{}}},{key:"strings",get:function(){return{}}},{key:"numbers",get:function(){return{}}},{key:"defaultAdapter",get:function(){return{}}}]),o(t,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),t}();e.a=i},2:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=n(1),i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;r(this,t),this.root_=e;for(var o=arguments.length,i=Array(o>2?o-2:0),u=2;u<o;u++)i[u-2]=arguments[u];this.initialize.apply(this,i),this.foundation_=void 0===n?this.getDefaultFoundation():n,this.foundation_.init(),this.initialSyncWithDOM()}return i(t,null,[{key:"attachTo",value:function(e){return new t(e,new o.a)}}]),i(t,[{key:"initialize",value:function(){}},{key:"getDefaultFoundation",value:function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")}},{key:"initialSyncWithDOM",value:function(){}},{key:"destroy",value:function(){this.foundation_.destroy()}},{key:"listen",value:function(t,e){this.root_.addEventListener(t,e)}},{key:"unlisten",value:function(t,e){this.root_.removeEventListener(t,e)}},{key:"emit",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=void 0;"function"==typeof CustomEvent?r=new CustomEvent(t,{detail:e,bubbles:n}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(t,n,!1,e)),this.root_.dispatchEvent(r)}}]),t}();e.a=u},22:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=n(0),a=n(45);n.d(e,"MDCFormFieldFoundation",function(){return a.a}),n.d(e,"MDCFormField",function(){return f});var c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),c(e,[{key:"getDefaultFoundation",value:function(){var t=this;return new a.a({registerInteractionHandler:function(e,n){return t.label_.addEventListener(e,n)},deregisterInteractionHandler:function(e,n){return t.label_.removeEventListener(e,n)},activateInputRipple:function(){t.input_&&t.input_.ripple&&t.input_.ripple.activate()},deactivateInputRipple:function(){t.input_&&t.input_.ripple&&t.input_.ripple.deactivate()}})}},{key:"input",set:function(t){this.input_=t},get:function(){return this.input_}},{key:"label_",get:function(){return this.root_.querySelector(a.a.strings.LABEL_SELECTOR)}}],[{key:"attachTo",value:function(t){return new e(t)}}]),e}(u.MDCComponent)},44:function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return o});var r={ROOT:"mdc-form-field"},o={LABEL_SELECTOR:".mdc-form-field > label"}},45:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(0),a=n(44),c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=function(t){function e(t){r(this,e);var n=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,c(e.defaultAdapter,t)));return n.clickHandler_=function(t){return n.handleClick_(t)},n}return i(e,t),f(e,null,[{key:"cssClasses",get:function(){return a.a}},{key:"strings",get:function(){return a.b}},{key:"defaultAdapter",get:function(){return{registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},activateInputRipple:function(){},deactivateInputRipple:function(){}}}}]),f(e,[{key:"init",value:function(){this.adapter_.registerInteractionHandler("click",this.clickHandler_)}},{key:"destroy",value:function(){this.adapter_.deregisterInteractionHandler("click",this.clickHandler_)}},{key:"handleClick_",value:function(){var t=this;this.adapter_.activateInputRipple(),requestAnimationFrame(function(){return t.adapter_.deactivateInputRipple()})}}]),e}(u.MDCFoundation);e.a=l},75:function(t,e,n){t.exports=n(22)}})}); |
{ | ||
"name": "@material/form-field", | ||
"description": "Material Components for the web wrapper for laying out form fields and labels next to one another", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"license": "Apache-2.0", | ||
@@ -17,3 +17,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@material/base": "^0.1.3", | ||
"@material/base": "^0.2.0", | ||
"@material/rtl": "^0.1.4", | ||
@@ -20,0 +20,0 @@ "@material/theme": "^0.1.5", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
51144
923
+ Added@material/base@0.2.6(transitive)
- Removed@material/base@0.1.3(transitive)
Updated@material/base@^0.2.0