Socket
Socket
Sign inDemoInstall

@material/switch

Package Overview
Dependencies
Maintainers
13
Versions
1687
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/switch - npm Package Compare versions

Comparing version 0.43.0 to 0.44.0

2

dist/mdc.switch.min.js

@@ -6,3 +6,3 @@ /*!

*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.switch=t():(e.mdc=e.mdc||{},e.mdc.switch=t())}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=143)}({0:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.adapter_=t}return r(e,null,[{key:"cssClasses",get:function(){return{}}},{key:"strings",get:function(){return{}}},{key:"numbers",get:function(){return{}}},{key:"defaultAdapter",get:function(){return{}}}]),r(e,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),e}();t.a=a},1:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=n(0),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;i(this,e),this.root_=t;for(var r=arguments.length,a=Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];this.initialize.apply(this,a),this.foundation_=void 0===n?this.getDefaultFoundation():n,this.foundation_.init(),this.initialSyncWithDOM()}return a(e,null,[{key:"attachTo",value:function(t){return new e(t,new r.a)}}]),a(e,[{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(e,t){this.root_.addEventListener(e,t)}},{key:"unlisten",value:function(e,t){this.root_.removeEventListener(e,t)}},{key:"emit",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=void 0;"function"==typeof CustomEvent?i=new CustomEvent(e,{detail:t,bubbles:n}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(e,n,!1,t)),this.root_.dispatchEvent(i)}}]),e}();t.a=o},143:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"MDCSwitch",function(){return v});var o=n(1),s=(n(7),n(144)),u=n(4),c=n(2);n.d(t,"MDCSwitchFoundation",function(){return s.a});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},f=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),v=function(e){function t(){var e;i(this,t);for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a)));return s.ripple_=s.initRipple_(),s.changeHandler_,s}return a(t,e),f(t,null,[{key:"attachTo",value:function(e){return new t(e)}}]),f(t,[{key:"destroy",value:function(){d(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.changeHandler_)}},{key:"initialSyncWithDOM",value:function(){this.changeHandler_=this.foundation_.handleChange.bind(this.foundation_),this.nativeControl_.addEventListener("change",this.changeHandler_),this.checked=this.checked}},{key:"initRipple_",value:function(){var e=this,t=s.a.strings.RIPPLE_SURFACE_SELECTOR,n=this.root_.querySelector(t),i=Object(c.getMatchesProperty)(HTMLElement.prototype),r=l(u.MDCRipple.createAdapter(this),{isUnbounded:function(){return!0},isSurfaceActive:function(){return e.nativeControl_[i](":active")},addClass:function(e){return n.classList.add(e)},removeClass:function(e){return n.classList.remove(e)},registerInteractionHandler:function(t,n){return e.nativeControl_.addEventListener(t,n)},deregisterInteractionHandler:function(t,n){return e.nativeControl_.removeEventListener(t,n)},updateCssVariable:function(e,t){return n.style.setProperty(e,t)},computeBoundingRect:function(){return n.getBoundingClientRect()}}),a=new u.MDCRippleFoundation(r);return new u.MDCRipple(this.root_,a)}},{key:"getDefaultFoundation",value:function(){var e=this;return new s.a({addClass:function(t){return e.root_.classList.add(t)},removeClass:function(t){return e.root_.classList.remove(t)},setNativeControlChecked:function(t){return e.nativeControl_.checked=t},setNativeControlDisabled:function(t){return e.nativeControl_.disabled=t}})}},{key:"nativeControl_",get:function(){var e=s.a.strings.NATIVE_CONTROL_SELECTOR;return this.root_.querySelector(e)}},{key:"ripple",get:function(){return this.ripple_}},{key:"checked",get:function(){return this.nativeControl_.checked},set:function(e){this.foundation_.setChecked(e)}},{key:"disabled",get:function(){return this.nativeControl_.disabled},set:function(e){this.foundation_.setDisabled(e)}}]),t}(o.a)},144:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),s=(n(145),n(146)),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(e){function t(e){return i(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u(t.defaultAdapter,e)))}return a(t,e),c(t,null,[{key:"strings",get:function(){return s.b}},{key:"cssClasses",get:function(){return s.a}},{key:"defaultAdapter",get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){}}}}]),c(t,[{key:"setChecked",value:function(e){this.adapter_.setNativeControlChecked(e),this.updateCheckedStyling_(e)}},{key:"setDisabled",value:function(e){this.adapter_.setNativeControlDisabled(e),e?this.adapter_.addClass(s.a.DISABLED):this.adapter_.removeClass(s.a.DISABLED)}},{key:"handleChange",value:function(e){this.updateCheckedStyling_(e.target.checked)}},{key:"updateCheckedStyling_",value:function(e){e?this.adapter_.addClass(s.a.CHECKED):this.adapter_.removeClass(s.a.CHECKED)}}]),t}(o.a);t.a=l},145:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();!function(){function e(){i(this,e)}r(e,[{key:"addClass",value:function(e){}},{key:"removeClass",value:function(e){}},{key:"setNativeControlChecked",value:function(e){}},{key:"setNativeControlDisabled",value:function(e){}}])}()},146:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r});/**
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.switch=t():(e.mdc=e.mdc||{},e.mdc.switch=t())}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=145)}({0:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.adapter_=t}return r(e,null,[{key:"cssClasses",get:function(){return{}}},{key:"strings",get:function(){return{}}},{key:"numbers",get:function(){return{}}},{key:"defaultAdapter",get:function(){return{}}}]),r(e,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),e}();t.a=a},1:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=n(0),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;i(this,e),this.root_=t;for(var r=arguments.length,a=Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];this.initialize.apply(this,a),this.foundation_=void 0===n?this.getDefaultFoundation():n,this.foundation_.init(),this.initialSyncWithDOM()}return a(e,null,[{key:"attachTo",value:function(t){return new e(t,new r.a)}}]),a(e,[{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(e,t){this.root_.addEventListener(e,t)}},{key:"unlisten",value:function(e,t){this.root_.removeEventListener(e,t)}},{key:"emit",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=void 0;"function"==typeof CustomEvent?i=new CustomEvent(e,{detail:t,bubbles:n}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(e,n,!1,t)),this.root_.dispatchEvent(i)}}]),e}();t.a=o},145:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"MDCSwitch",function(){return v});var o=n(1),s=(n(7),n(146)),u=n(4),c=n(2);n.d(t,"MDCSwitchFoundation",function(){return s.a});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(i)},f=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),v=function(e){function t(){var e;i(this,t);for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a)));return s.ripple_=s.initRipple_(),s.changeHandler_,s}return a(t,e),f(t,null,[{key:"attachTo",value:function(e){return new t(e)}}]),f(t,[{key:"destroy",value:function(){d(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.changeHandler_)}},{key:"initialSyncWithDOM",value:function(){this.changeHandler_=this.foundation_.handleChange.bind(this.foundation_),this.nativeControl_.addEventListener("change",this.changeHandler_),this.checked=this.checked}},{key:"initRipple_",value:function(){var e=this,t=s.a.strings.RIPPLE_SURFACE_SELECTOR,n=this.root_.querySelector(t),i=Object(c.getMatchesProperty)(HTMLElement.prototype),r=l(u.MDCRipple.createAdapter(this),{isUnbounded:function(){return!0},isSurfaceActive:function(){return e.nativeControl_[i](":active")},addClass:function(e){return n.classList.add(e)},removeClass:function(e){return n.classList.remove(e)},registerInteractionHandler:function(t,n){return e.nativeControl_.addEventListener(t,n)},deregisterInteractionHandler:function(t,n){return e.nativeControl_.removeEventListener(t,n)},updateCssVariable:function(e,t){return n.style.setProperty(e,t)},computeBoundingRect:function(){return n.getBoundingClientRect()}}),a=new u.MDCRippleFoundation(r);return new u.MDCRipple(this.root_,a)}},{key:"getDefaultFoundation",value:function(){var e=this;return new s.a({addClass:function(t){return e.root_.classList.add(t)},removeClass:function(t){return e.root_.classList.remove(t)},setNativeControlChecked:function(t){return e.nativeControl_.checked=t},setNativeControlDisabled:function(t){return e.nativeControl_.disabled=t}})}},{key:"nativeControl_",get:function(){var e=s.a.strings.NATIVE_CONTROL_SELECTOR;return this.root_.querySelector(e)}},{key:"ripple",get:function(){return this.ripple_}},{key:"checked",get:function(){return this.nativeControl_.checked},set:function(e){this.foundation_.setChecked(e)}},{key:"disabled",get:function(){return this.nativeControl_.disabled},set:function(e){this.foundation_.setDisabled(e)}}]),t}(o.a)},146:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),s=(n(147),n(148)),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(e){function t(e){return i(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u(t.defaultAdapter,e)))}return a(t,e),c(t,null,[{key:"strings",get:function(){return s.b}},{key:"cssClasses",get:function(){return s.a}},{key:"defaultAdapter",get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){}}}}]),c(t,[{key:"setChecked",value:function(e){this.adapter_.setNativeControlChecked(e),this.updateCheckedStyling_(e)}},{key:"setDisabled",value:function(e){this.adapter_.setNativeControlDisabled(e),e?this.adapter_.addClass(s.a.DISABLED):this.adapter_.removeClass(s.a.DISABLED)}},{key:"handleChange",value:function(e){this.updateCheckedStyling_(e.target.checked)}},{key:"updateCheckedStyling_",value:function(e){e?this.adapter_.addClass(s.a.CHECKED):this.adapter_.removeClass(s.a.CHECKED)}}]),t}(o.a);t.a=l},147:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();!function(){function e(){i(this,e)}r(e,[{key:"addClass",value:function(e){}},{key:"removeClass",value:function(e){}},{key:"setNativeControlChecked",value:function(e){}},{key:"setNativeControlDisabled",value:function(e){}}])}()},148:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r});/**
* @license

@@ -9,0 +9,0 @@ * Copyright 2018 Google Inc.

{
"name": "@material/switch",
"description": "The Material Components for the web switch component",
"version": "0.43.0",
"version": "0.44.0",
"license": "MIT",

@@ -19,6 +19,6 @@ "keywords": [

"@material/base": "^0.41.0",
"@material/elevation": "^0.43.0",
"@material/ripple": "^0.43.0",
"@material/elevation": "^0.44.0",
"@material/ripple": "^0.44.0",
"@material/rtl": "^0.42.0",
"@material/selection-control": "^0.43.0",
"@material/selection-control": "^0.44.0",
"@material/theme": "^0.43.0"

@@ -25,0 +25,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc