Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lrnwebcomponents/simple-toast

Package Overview
Dependencies
Maintainers
4
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lrnwebcomponents/simple-toast - npm Package Compare versions

Comparing version 0.0.39 to 0.0.40

29

package.json

@@ -19,3 +19,3 @@ {

},
"version": "0.0.39",
"version": "0.0.40",
"description": "A singular toast / message for conistency",

@@ -32,3 +32,8 @@ "repository": {

"test": "../../node_modules/.bin/wct --configFile ../../wct.conf.json node_modules/@lrnwebcomponents/simple-toast/test/",
"start":"yarn run dev","build":"../../node_modules/.bin/gulp && ../../node_modules/.bin/rollup -c && ../../node_modules/.bin/prettier --ignore-path ../../.prettierignore --write '**/*.{js,json}'","dev":"concurrently --kill-others \"yarn run watch\" \"yarn run serve\"","watch":"../../node_modules/.bin/gulp dev","serve":"polymer serve --npm --module-resolution=node --open","lighthouse":"../../node_modules/.bin/gulp lighthouse"
"start": "yarn run dev",
"build": "../../node_modules/.bin/gulp && ../../node_modules/.bin/rollup -c && ../../node_modules/.bin/prettier --ignore-path ../../.prettierignore --write '**/*.{js,json}'",
"dev": "concurrently --kill-others \"yarn run watch\" \"yarn run serve\"",
"watch": "../../node_modules/.bin/gulp dev",
"serve": "polymer serve --npm --module-resolution=node --open",
"lighthouse": "../../node_modules/.bin/gulp lighthouse"
},

@@ -40,6 +45,19 @@ "author": {

"dependencies": {
"@polymer/polymer":"^3.0.5"
"@polymer/paper-button": "^3.0.1",
"@polymer/paper-toast": "^3.0.1",
"@polymer/polymer": "^3.0.5"
},
"devDependencies": {
"web-animations-js":"2.3.1","@lrnwebcomponents/deduping-fix":"0.0.39","@polymer/iron-demo-helpers":"3.0.2","@polymer/iron-component-page":"github:PolymerElements/iron-component-page","@webcomponents/webcomponentsjs":"2.2.1","concurrently":"4.1.0","gulp-babel":"8.0.0","gulp-sourcemaps":"2.6.4","lodash":"4.17.11","polymer-cli":"1.9.1","polymer-build":"3.1.1","wct-browser-legacy":"1.0.2"
"@lrnwebcomponents/deduping-fix": "^0.0.40",
"@polymer/iron-component-page": "github:PolymerElements/iron-component-page",
"@polymer/iron-demo-helpers": "3.0.2",
"@webcomponents/webcomponentsjs": "2.2.1",
"concurrently": "4.1.0",
"gulp-babel": "8.0.0",
"gulp-sourcemaps": "2.6.4",
"lodash": "4.17.11",
"polymer-build": "3.1.1",
"polymer-cli": "1.9.2",
"wct-browser-legacy": "1.0.2",
"web-animations-js": "2.3.1"
},

@@ -53,3 +71,4 @@ "private": false,

"html"
]
],
"gitHead": "31deee0fa61eb2dcfeb49f907618076bf3863495"
}

2

simple-toast.amd.js

@@ -1,1 +0,1 @@

define(["exports","./node_modules/@polymer/polymer/polymer-element.js","./node_modules/@polymer/paper-toast/paper-toast.js","./node_modules/@polymer/paper-button/paper-button.js","./node_modules/@polymer/polymer/lib/legacy/polymer.dom.js","./node_modules/@polymer/polymer/lib/utils/async.js"],function(_exports,_polymerElement,_paperToast,_paperButton,_polymerDom,async){"use strict";Object.defineProperty(_exports,"__esModule",{value:!0});_exports.SimpleToast=void 0;async=babelHelpers.interopRequireWildcard(async);function _templateObject_1f44d470022911e9b1edaba3fc704796(){var data=babelHelpers.taggedTemplateLiteral(["\n<style>:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n</style>\n<paper-toast id=\"toast\" text=\"[[text]]\" duration=\"[[duration]]\" opened=\"{{opened}}\">\n <slot></slot>\n <paper-button hidden$=\"[[!closeButton]]\" on-tap=\"hide\">[[closeText]]</paper-button>\n</paper-toast>"]);_templateObject_1f44d470022911e9b1edaba3fc704796=function _templateObject_1f44d470022911e9b1edaba3fc704796(){return data};return data}window.SimpleToast=window.SimpleToast||{};window.SimpleToast.requestAvailability=function(){if(!window.SimpleToast.instance){window.SimpleToast.instance=document.createElement("simple-toast");document.body.appendChild(window.SimpleToast.instance)}return window.SimpleToast.instance};var SimpleToast=function(_PolymerElement){babelHelpers.inherits(SimpleToast,_PolymerElement);function SimpleToast(){babelHelpers.classCallCheck(this,SimpleToast);return babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(SimpleToast).apply(this,arguments))}babelHelpers.createClass(SimpleToast,[{key:"connectedCallback",value:function connectedCallback(){babelHelpers.get(babelHelpers.getPrototypeOf(SimpleToast.prototype),"connectedCallback",this).call(this);window.addEventListener("simple-toast-hide",this.hideSimpleToast.bind(this));window.addEventListener("simple-toast-show",this.showSimpleToast.bind(this))}},{key:"disconnectedCallback",value:function disconnectedCallback(){babelHelpers.get(babelHelpers.getPrototypeOf(SimpleToast.prototype),"connectedCallback",this).call(this);window.removeEventListener("simple-toast-hide",this.hideSimpleToast.bind(this));window.removeEventListener("simple-toast-show",this.showSimpleToast.bind(this))}},{key:"hideSimpleToast",value:function hideSimpleToast(e){}},{key:"showSimpleToast",value:function showSimpleToast(e){var _this=this;if(e.detail.duration){this.duration=e.detail.duration}if(e.detail.text){this.text=e.detail.text}if(e.detail.closeText){this.closeText=e.detail.closeText}if(e.detail.closeButton){this.closeButton=e.detail.closeButton}while(null!==(0,_polymerDom.dom)(this).firstChild){(0,_polymerDom.dom)(this).removeChild((0,_polymerDom.dom)(this).firstChild)}if(e.detail.slot){(0,_polymerDom.dom)(this).appendChild(e.detail.slot)}async.microTask.run(function(){setTimeout(function(){_this.show()},50)})}},{key:"show",value:function show(){this.$.toast.show()}},{key:"hide",value:function hide(){this.$.toast.hide()}},{key:"_openedChanged",value:function _openedChanged(newValue,oldValue){if(babelHelpers.typeof(newValue)!==("undefined"===typeof void 0?"undefined":babelHelpers.typeof(void 0))){console.log(newValue)}}},{key:"_closeTextChanged",value:function _closeTextChanged(newValue,oldValue){if(babelHelpers.typeof(newValue)!==("undefined"===typeof void 0?"undefined":babelHelpers.typeof(void 0))){console.log(newValue)}}},{key:"_durationChanged",value:function _durationChanged(newValue,oldValue){if(babelHelpers.typeof(newValue)!==("undefined"===typeof void 0?"undefined":babelHelpers.typeof(void 0))){console.log(newValue)}}}],[{key:"template",get:function get(){return(0,_polymerElement.html)(_templateObject_1f44d470022911e9b1edaba3fc704796())}},{key:"properties",get:function get(){return{opened:{name:"opened",type:"Boolean",value:!1,reflectToAttribute:!0},text:{name:"text",type:"String",value:"Saved"},closeText:{name:"closeText",type:"String",value:"Close"},duration:{name:"duration",type:"Number",value:600},closeButton:{name:"closeButton",type:"Boolean",value:!0,reflectToAttribute:!0}}}},{key:"tag",get:function get(){return"simple-toast"}}]);return SimpleToast}(_polymerElement.PolymerElement);_exports.SimpleToast=SimpleToast;window.customElements.define(SimpleToast.tag,SimpleToast)});
define(["exports","./node_modules/@polymer/polymer/polymer-element.js","./node_modules/@polymer/paper-toast/paper-toast.js","./node_modules/@polymer/paper-button/paper-button.js","./node_modules/@polymer/polymer/lib/legacy/polymer.dom.js","./node_modules/@polymer/polymer/lib/utils/async.js"],function(_exports,_polymerElement,_paperToast,_paperButton,_polymerDom,async){"use strict";Object.defineProperty(_exports,"__esModule",{value:!0});_exports.SimpleToast=void 0;async=babelHelpers.interopRequireWildcard(async);function _templateObject_1e13216003cd11e99e6373669cc40332(){var data=babelHelpers.taggedTemplateLiteral(["\n<style>:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n</style>\n<paper-toast id=\"toast\" text=\"[[text]]\" duration=\"[[duration]]\" opened=\"{{opened}}\">\n <slot></slot>\n <paper-button hidden$=\"[[!closeButton]]\" on-tap=\"hide\">[[closeText]]</paper-button>\n</paper-toast>"]);_templateObject_1e13216003cd11e99e6373669cc40332=function _templateObject_1e13216003cd11e99e6373669cc40332(){return data};return data}window.SimpleToast=window.SimpleToast||{};window.SimpleToast.requestAvailability=function(){if(!window.SimpleToast.instance){window.SimpleToast.instance=document.createElement("simple-toast");document.body.appendChild(window.SimpleToast.instance)}return window.SimpleToast.instance};var SimpleToast=function(_PolymerElement){babelHelpers.inherits(SimpleToast,_PolymerElement);function SimpleToast(){babelHelpers.classCallCheck(this,SimpleToast);return babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(SimpleToast).apply(this,arguments))}babelHelpers.createClass(SimpleToast,[{key:"connectedCallback",value:function connectedCallback(){babelHelpers.get(babelHelpers.getPrototypeOf(SimpleToast.prototype),"connectedCallback",this).call(this);window.addEventListener("simple-toast-hide",this.hideSimpleToast.bind(this));window.addEventListener("simple-toast-show",this.showSimpleToast.bind(this))}},{key:"disconnectedCallback",value:function disconnectedCallback(){babelHelpers.get(babelHelpers.getPrototypeOf(SimpleToast.prototype),"connectedCallback",this).call(this);window.removeEventListener("simple-toast-hide",this.hideSimpleToast.bind(this));window.removeEventListener("simple-toast-show",this.showSimpleToast.bind(this))}},{key:"hideSimpleToast",value:function hideSimpleToast(e){}},{key:"showSimpleToast",value:function showSimpleToast(e){var _this=this;if(e.detail.duration){this.duration=e.detail.duration}if(e.detail.text){this.text=e.detail.text}if(e.detail.closeText){this.closeText=e.detail.closeText}if(e.detail.closeButton){this.closeButton=e.detail.closeButton}while(null!==(0,_polymerDom.dom)(this).firstChild){(0,_polymerDom.dom)(this).removeChild((0,_polymerDom.dom)(this).firstChild)}if(e.detail.slot){(0,_polymerDom.dom)(this).appendChild(e.detail.slot)}async.microTask.run(function(){setTimeout(function(){_this.show()},50)})}},{key:"show",value:function show(){this.$.toast.show()}},{key:"hide",value:function hide(){this.$.toast.hide()}},{key:"_openedChanged",value:function _openedChanged(newValue,oldValue){if(babelHelpers.typeof(newValue)!==("undefined"===typeof void 0?"undefined":babelHelpers.typeof(void 0))){console.log(newValue)}}},{key:"_closeTextChanged",value:function _closeTextChanged(newValue,oldValue){if(babelHelpers.typeof(newValue)!==("undefined"===typeof void 0?"undefined":babelHelpers.typeof(void 0))){console.log(newValue)}}},{key:"_durationChanged",value:function _durationChanged(newValue,oldValue){if(babelHelpers.typeof(newValue)!==("undefined"===typeof void 0?"undefined":babelHelpers.typeof(void 0))){console.log(newValue)}}}],[{key:"template",get:function get(){return(0,_polymerElement.html)(_templateObject_1e13216003cd11e99e6373669cc40332())}},{key:"properties",get:function get(){return{opened:{name:"opened",type:"Boolean",value:!1,reflectToAttribute:!0},text:{name:"text",type:"String",value:"Saved"},closeText:{name:"closeText",type:"String",value:"Close"},duration:{name:"duration",type:"Number",value:4e3},closeButton:{name:"closeButton",type:"Boolean",value:!0,reflectToAttribute:!0}}}},{key:"tag",get:function get(){return"simple-toast"}}]);return SimpleToast}(_polymerElement.PolymerElement);_exports.SimpleToast=SimpleToast;window.customElements.define(SimpleToast.tag,SimpleToast)});

@@ -13,2 +13,2 @@ import{html,PolymerElement}from"./node_modules/@polymer/polymer/polymer-element.js";import"./node_modules/@polymer/paper-toast/paper-toast.js";import"./node_modules/@polymer/paper-button/paper-button.js";import{dom}from"./node_modules/@polymer/polymer/lib/legacy/polymer.dom.js";import*as async from"./node_modules/@polymer/polymer/lib/utils/async.js";window.SimpleToast=window.SimpleToast||{};window.SimpleToast.requestAvailability=()=>{if(!window.SimpleToast.instance){window.SimpleToast.instance=document.createElement("simple-toast");document.body.appendChild(window.SimpleToast.instance)}return window.SimpleToast.instance};class SimpleToast extends PolymerElement{static get template(){return html`

<paper-button hidden$="[[!closeButton]]" on-tap="hide">[[closeText]]</paper-button>
</paper-toast>`}static get properties(){return{opened:{name:"opened",type:"Boolean",value:!1,reflectToAttribute:!0},text:{name:"text",type:"String",value:"Saved"},closeText:{name:"closeText",type:"String",value:"Close"},duration:{name:"duration",type:"Number",value:600},closeButton:{name:"closeButton",type:"Boolean",value:!0,reflectToAttribute:!0}}}static get tag(){return"simple-toast"}connectedCallback(){super.connectedCallback();window.addEventListener("simple-toast-hide",this.hideSimpleToast.bind(this));window.addEventListener("simple-toast-show",this.showSimpleToast.bind(this))}disconnectedCallback(){super.connectedCallback();window.removeEventListener("simple-toast-hide",this.hideSimpleToast.bind(this));window.removeEventListener("simple-toast-show",this.showSimpleToast.bind(this))}hideSimpleToast(e){}showSimpleToast(e){if(e.detail.duration){this.duration=e.detail.duration}if(e.detail.text){this.text=e.detail.text}if(e.detail.closeText){this.closeText=e.detail.closeText}if(e.detail.closeButton){this.closeButton=e.detail.closeButton}while(null!==dom(this).firstChild){dom(this).removeChild(dom(this).firstChild)}if(e.detail.slot){dom(this).appendChild(e.detail.slot)}async.microTask.run(()=>{setTimeout(()=>{this.show()},50)})}show(){this.$.toast.show()}hide(){this.$.toast.hide()}_openedChanged(newValue,oldValue){if(typeof newValue!==typeof void 0){console.log(newValue)}}_closeTextChanged(newValue,oldValue){if(typeof newValue!==typeof void 0){console.log(newValue)}}_durationChanged(newValue,oldValue){if(typeof newValue!==typeof void 0){console.log(newValue)}}}window.customElements.define(SimpleToast.tag,SimpleToast);export{SimpleToast};
</paper-toast>`}static get properties(){return{opened:{name:"opened",type:"Boolean",value:!1,reflectToAttribute:!0},text:{name:"text",type:"String",value:"Saved"},closeText:{name:"closeText",type:"String",value:"Close"},duration:{name:"duration",type:"Number",value:4e3},closeButton:{name:"closeButton",type:"Boolean",value:!0,reflectToAttribute:!0}}}static get tag(){return"simple-toast"}connectedCallback(){super.connectedCallback();window.addEventListener("simple-toast-hide",this.hideSimpleToast.bind(this));window.addEventListener("simple-toast-show",this.showSimpleToast.bind(this))}disconnectedCallback(){super.connectedCallback();window.removeEventListener("simple-toast-hide",this.hideSimpleToast.bind(this));window.removeEventListener("simple-toast-show",this.showSimpleToast.bind(this))}hideSimpleToast(e){}showSimpleToast(e){if(e.detail.duration){this.duration=e.detail.duration}if(e.detail.text){this.text=e.detail.text}if(e.detail.closeText){this.closeText=e.detail.closeText}if(e.detail.closeButton){this.closeButton=e.detail.closeButton}while(null!==dom(this).firstChild){dom(this).removeChild(dom(this).firstChild)}if(e.detail.slot){dom(this).appendChild(e.detail.slot)}async.microTask.run(()=>{setTimeout(()=>{this.show()},50)})}show(){this.$.toast.show()}hide(){this.$.toast.hide()}_openedChanged(newValue,oldValue){if(typeof newValue!==typeof void 0){console.log(newValue)}}_closeTextChanged(newValue,oldValue){if(typeof newValue!==typeof void 0){console.log(newValue)}}_durationChanged(newValue,oldValue){if(typeof newValue!==typeof void 0){console.log(newValue)}}}window.customElements.define(SimpleToast.tag,SimpleToast);export{SimpleToast};

@@ -97,3 +97,3 @@ /**

type: "Number",
value: 600
value: 4000
},

@@ -100,0 +100,0 @@ /**

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@polymer/polymer/polymer-element.js"),require("@polymer/paper-toast/paper-toast.js"),require("@polymer/paper-button/paper-button.js"),require("@polymer/polymer/lib/legacy/polymer.dom.js"),require("@polymer/polymer/lib/utils/async.js")):"function"==typeof define&&define.amd?define(["exports","@polymer/polymer/polymer-element.js","@polymer/paper-toast/paper-toast.js","@polymer/paper-button/paper-button.js","@polymer/polymer/lib/legacy/polymer.dom.js","@polymer/polymer/lib/utils/async.js"],t):t(e.SimpleToast={},e.polymerElement_js,null,null,e.polymer_dom_js,e.async)}(this,function(e,t,o,n,i,r){"use strict";function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e,t,o){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,o){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(o):i.value}})(e,t,o||e)}function d(){var e,t,o=(e=['\n<style>:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n</style>\n<paper-toast id="toast" text="[[text]]" duration="[[duration]]" opened="{{opened}}">\n <slot></slot>\n <paper-button hidden$="[[!closeButton]]" on-tap="hide">[[closeText]]</paper-button>\n</paper-toast>'],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return d=function(){return o},o}window.SimpleToast=window.SimpleToast||{},window.SimpleToast.requestAvailability=function(){return window.SimpleToast.instance||(window.SimpleToast.instance=document.createElement("simple-toast"),document.body.appendChild(window.SimpleToast.instance)),window.SimpleToast.instance};var f=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),p(this,a(o).apply(this,arguments))}var n,f,y;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(o,t.PolymerElement),n=o,y=[{key:"template",get:function(){return t.html(d())}},{key:"properties",get:function(){return{opened:{name:"opened",type:"Boolean",value:!1,reflectToAttribute:!0},text:{name:"text",type:"String",value:"Saved"},closeText:{name:"closeText",type:"String",value:"Close"},duration:{name:"duration",type:"Number",value:600},closeButton:{name:"closeButton",type:"Boolean",value:!0,reflectToAttribute:!0}}}},{key:"tag",get:function(){return"simple-toast"}}],(f=[{key:"connectedCallback",value:function(){c(a(o.prototype),"connectedCallback",this).call(this),window.addEventListener("simple-toast-hide",this.hideSimpleToast.bind(this)),window.addEventListener("simple-toast-show",this.showSimpleToast.bind(this))}},{key:"disconnectedCallback",value:function(){c(a(o.prototype),"connectedCallback",this).call(this),window.removeEventListener("simple-toast-hide",this.hideSimpleToast.bind(this)),window.removeEventListener("simple-toast-show",this.showSimpleToast.bind(this))}},{key:"hideSimpleToast",value:function(e){}},{key:"showSimpleToast",value:function(e){var t=this;for(e.detail.duration&&(this.duration=e.detail.duration),e.detail.text&&(this.text=e.detail.text),e.detail.closeText&&(this.closeText=e.detail.closeText),e.detail.closeButton&&(this.closeButton=e.detail.closeButton);null!==i.dom(this).firstChild;)i.dom(this).removeChild(i.dom(this).firstChild);e.detail.slot&&i.dom(this).appendChild(e.detail.slot),r.microTask.run(function(){setTimeout(function(){t.show()},50)})}},{key:"show",value:function(){this.$.toast.show()}},{key:"hide",value:function(){this.$.toast.hide()}},{key:"_openedChanged",value:function(e,t){"undefined"!==l(e)&&console.log(e)}},{key:"_closeTextChanged",value:function(e,t){"undefined"!==l(e)&&console.log(e)}},{key:"_durationChanged",value:function(e,t){"undefined"!==l(e)&&console.log(e)}}])&&s(n.prototype,f),y&&s(n,y),o}();window.customElements.define(f.tag,f),e.SimpleToast=f,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@polymer/polymer/polymer-element.js"),require("@polymer/paper-toast/paper-toast.js"),require("@polymer/paper-button/paper-button.js"),require("@polymer/polymer/lib/legacy/polymer.dom.js"),require("@polymer/polymer/lib/utils/async.js")):"function"==typeof define&&define.amd?define(["exports","@polymer/polymer/polymer-element.js","@polymer/paper-toast/paper-toast.js","@polymer/paper-button/paper-button.js","@polymer/polymer/lib/legacy/polymer.dom.js","@polymer/polymer/lib/utils/async.js"],t):t(e.SimpleToast={},e.polymerElement_js,null,null,e.polymer_dom_js,e.async)}("undefined"!=typeof self?self:this,function(e,t,o,n,i,r){"use strict";function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e,t,o){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,o){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(o):i.value}})(e,t,o||e)}function d(){var e,t,o=(e=['\n<style>:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n</style>\n<paper-toast id="toast" text="[[text]]" duration="[[duration]]" opened="{{opened}}">\n <slot></slot>\n <paper-button hidden$="[[!closeButton]]" on-tap="hide">[[closeText]]</paper-button>\n</paper-toast>'],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return d=function(){return o},o}window.SimpleToast=window.SimpleToast||{},window.SimpleToast.requestAvailability=function(){return window.SimpleToast.instance||(window.SimpleToast.instance=document.createElement("simple-toast"),document.body.appendChild(window.SimpleToast.instance)),window.SimpleToast.instance};var f=function(e){function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),p(this,a(o).apply(this,arguments))}var n,f,y;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(o,t.PolymerElement),n=o,y=[{key:"template",get:function(){return t.html(d())}},{key:"properties",get:function(){return{opened:{name:"opened",type:"Boolean",value:!1,reflectToAttribute:!0},text:{name:"text",type:"String",value:"Saved"},closeText:{name:"closeText",type:"String",value:"Close"},duration:{name:"duration",type:"Number",value:4e3},closeButton:{name:"closeButton",type:"Boolean",value:!0,reflectToAttribute:!0}}}},{key:"tag",get:function(){return"simple-toast"}}],(f=[{key:"connectedCallback",value:function(){c(a(o.prototype),"connectedCallback",this).call(this),window.addEventListener("simple-toast-hide",this.hideSimpleToast.bind(this)),window.addEventListener("simple-toast-show",this.showSimpleToast.bind(this))}},{key:"disconnectedCallback",value:function(){c(a(o.prototype),"connectedCallback",this).call(this),window.removeEventListener("simple-toast-hide",this.hideSimpleToast.bind(this)),window.removeEventListener("simple-toast-show",this.showSimpleToast.bind(this))}},{key:"hideSimpleToast",value:function(e){}},{key:"showSimpleToast",value:function(e){var t=this;for(e.detail.duration&&(this.duration=e.detail.duration),e.detail.text&&(this.text=e.detail.text),e.detail.closeText&&(this.closeText=e.detail.closeText),e.detail.closeButton&&(this.closeButton=e.detail.closeButton);null!==i.dom(this).firstChild;)i.dom(this).removeChild(i.dom(this).firstChild);e.detail.slot&&i.dom(this).appendChild(e.detail.slot),r.microTask.run(function(){setTimeout(function(){t.show()},50)})}},{key:"show",value:function(){this.$.toast.show()}},{key:"hide",value:function(){this.$.toast.hide()}},{key:"_openedChanged",value:function(e,t){"undefined"!==l(e)&&console.log(e)}},{key:"_closeTextChanged",value:function(e,t){"undefined"!==l(e)&&console.log(e)}},{key:"_durationChanged",value:function(e,t){"undefined"!==l(e)&&console.log(e)}}])&&s(n.prototype,f),y&&s(n,y),o}();window.customElements.define(f.tag,f),e.SimpleToast=f,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=simple-toast.umd.js.map

@@ -33,3 +33,3 @@ {

"type": "Number",
"value": 600
"value": 4000
},

@@ -36,0 +36,0 @@ /**

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

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