@lrnwebcomponents/simple-toast
Advanced tools
Comparing version 2.0.10 to 2.1.0
@@ -65,4 +65,8 @@ const gulp = require("gulp"); | ||
// properties available to the custom element for data binding | ||
static get properties() { | ||
return ${props}; | ||
static get properties() { | ||
let props = ${props}; | ||
if (super.properties) { | ||
props = Object.assign(props, super.properties); | ||
} | ||
return props; | ||
}`; | ||
@@ -69,0 +73,0 @@ } |
@@ -19,3 +19,3 @@ { | ||
}, | ||
"version": "2.0.10", | ||
"version": "2.1.0", | ||
"description": "A singular toast / message for conistency", | ||
@@ -50,6 +50,6 @@ "repository": { | ||
"@lrnwebcomponents/deduping-fix": "^2.0.9", | ||
"@lrnwebcomponents/storybook-utilities": "^2.0.10", | ||
"@lrnwebcomponents/storybook-utilities": "^2.1.0", | ||
"@polymer/iron-component-page": "github:PolymerElements/iron-component-page", | ||
"@polymer/iron-demo-helpers": "^3.1.0", | ||
"@webcomponents/webcomponentsjs": "^2.2.9", | ||
"@webcomponents/webcomponentsjs": "2.2.10", | ||
"concurrently": "4.1.0", | ||
@@ -59,3 +59,3 @@ "gulp-babel": "8.0.0", | ||
"lodash": "4.17.11", | ||
"polymer-cli": "1.9.8", | ||
"polymer-cli": "1.9.9", | ||
"wct-browser-legacy": "1.0.2", | ||
@@ -72,3 +72,3 @@ "web-animations-js": "2.3.1" | ||
], | ||
"gitHead": "8571f08ce381877be732c2b5407233bcc3c58d99" | ||
"gitHead": "38a0c3ad00e8447837037bde2dc1172273a3a311" | ||
} |
@@ -1,2 +0,2 @@ | ||
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_63b866406a8311e9bcea9bed8df7d7d7(){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}}\" class$=\"[[classStyle]]\">\n <slot></slot>\n <paper-button hidden$=\"[[!closeButton]]\" on-tap=\"hide\">[[closeText]]</paper-button>\n</paper-toast>"]);_templateObject_63b866406a8311e9bcea9bed8df7d7d7=function _templateObject_63b866406a8311e9bcea9bed8df7d7d7(){return data};return data}// register globally so we can make sure there is only one | ||
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_4e0cbe4081c111e98fa00f47d54ac77c(){var data=babelHelpers.taggedTemplateLiteral(["\n<style>:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\npaper-toast {\n @apply --simple-toast-toast;\n}</style>\n<paper-toast id=\"toast\" text=\"[[text]]\" duration$=\"[[duration]]\" opened=\"{{opened}}\" class$=\"[[classStyle]]\">\n <slot></slot>\n <paper-button hidden$=\"[[!closeButton]]\" on-click=\"hide\">[[closeText]]</paper-button>\n</paper-toast>"]);_templateObject_4e0cbe4081c111e98fa00f47d54ac77c=function _templateObject_4e0cbe4081c111e98fa00f47d54ac77c(){return data};return data}// register globally so we can make sure there is only one | ||
window.SimpleToast=window.SimpleToast||{};// request if this exists. This helps invoke the element existing in the dom | ||
@@ -26,3 +26,3 @@ // as well as that there is only one of them. That way we can ensure everything | ||
if(e.detail.duration){this.duration=e.detail.duration}if(e.detail.text){this.text=e.detail.text}if(e.detail.classStyle){this.classStyle=e.detail.classStyle}if(e.detail.closeText){this.closeText=e.detail.closeText}if(e.detail.closeButton){this.closeButton=e.detail.closeButton}if(e.detail.eventCallback){this.eventCallback=e.detail.eventCallback}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(){if(this.eventCallback){var evt=new CustomEvent(this.eventCallback,{bubbles:!0,cancelable:!0,detail:!0});this.dispatchEvent(evt)}this.$.toast.hide()}}],[{key:"template",// render function | ||
get:function get(){return(0,_polymerElement.html)(_templateObject_63b866406a8311e9bcea9bed8df7d7d7())}// properties available to the custom element for data binding | ||
get:function get(){return(0,_polymerElement.html)(_templateObject_4e0cbe4081c111e98fa00f47d54ac77c())}// properties available to the custom element for data binding | ||
},{key:"properties",get:function get(){return{/** | ||
@@ -29,0 +29,0 @@ * Opened state of the toast, use event to change |
@@ -28,6 +28,9 @@ /** | ||
} | ||
</style> | ||
paper-toast { | ||
@apply --simple-toast-toast; | ||
}</style> | ||
<paper-toast id="toast" text="[[text]]" duration$="[[duration]]" opened="{{opened}}" class$="[[classStyle]]"> | ||
<slot></slot> | ||
<paper-button hidden$="[[!closeButton]]" on-tap="hide">[[closeText]]</paper-button> | ||
<paper-button hidden$="[[!closeButton]]" on-click="hide">[[closeText]]</paper-button> | ||
</paper-toast>`}// properties available to the custom element for data binding | ||
@@ -34,0 +37,0 @@ static get properties(){return{/** |
@@ -48,2 +48,6 @@ /** | ||
} | ||
paper-toast { | ||
@apply --simple-toast-toast; | ||
} | ||
</style> | ||
@@ -58,3 +62,3 @@ <paper-toast | ||
<slot></slot> | ||
<paper-button hidden$="[[!closeButton]]" on-tap="hide" | ||
<paper-button hidden$="[[!closeButton]]" on-click="hide" | ||
>[[closeText]]</paper-button | ||
@@ -61,0 +65,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=e||self).SimpleToast={},e.polymerElement_js,null,null,e.polymer_dom_js,e.async)}(this,function(e,t,n,o,i,l){"use strict";function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=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,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function u(){var e,t,n=(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}}" class$="[[classStyle]]">\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 u=function(){return n},n}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 d=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),p(this,r(n).apply(this,arguments))}var o,d,m;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&&s(e,t)}(n,t.PolymerElement),o=n,m=[{key:"template",get:function(){return t.html(u())}},{key:"properties",get:function(){return{opened:{name:"opened",type:"Boolean",value:!1,reflectToAttribute:!0},text:{name:"text",type:"String",value:"Saved"},classStyle:{name:"classStyle",type:"String",value:""},closeText:{name:"closeText",type:"String",value:"Close"},duration:{name:"duration",type:"Number",value:4e3},eventCallback:{name:"eventCallback",type:"String"},closeButton:{name:"closeButton",type:"Boolean",value:!0,reflectToAttribute:!0}}}},{key:"tag",get:function(){return"simple-toast"}}],(d=[{key:"connectedCallback",value:function(){c(r(n.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(r(n.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){this.hide()}},{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.classStyle&&(this.classStyle=e.detail.classStyle),e.detail.closeText&&(this.closeText=e.detail.closeText),e.detail.closeButton&&(this.closeButton=e.detail.closeButton),e.detail.eventCallback&&(this.eventCallback=e.detail.eventCallback);null!==i.dom(this).firstChild;)i.dom(this).removeChild(i.dom(this).firstChild);e.detail.slot&&i.dom(this).appendChild(e.detail.slot),l.microTask.run(function(){setTimeout(function(){t.show()},50)})}},{key:"show",value:function(){this.$.toast.show()}},{key:"hide",value:function(){if(this.eventCallback){var e=new CustomEvent(this.eventCallback,{bubbles:!0,cancelable:!0,detail:!0});this.dispatchEvent(e)}this.$.toast.hide()}}])&&a(o.prototype,d),m&&a(o,m),n}();window.customElements.define(d.tag,d),e.SimpleToast=d,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=e||self).SimpleToast={},e.polymerElement_js,null,null,e.polymer_dom_js,e.async)}(this,function(e,t,n,o,i,l){"use strict";function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=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,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function u(){var e,t,n=(e=['\n<style>:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\npaper-toast {\n @apply --simple-toast-toast;\n}</style>\n<paper-toast id="toast" text="[[text]]" duration$="[[duration]]" opened="{{opened}}" class$="[[classStyle]]">\n <slot></slot>\n <paper-button hidden$="[[!closeButton]]" on-click="hide">[[closeText]]</paper-button>\n</paper-toast>'],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return u=function(){return n},n}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 d=function(e){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),p(this,r(n).apply(this,arguments))}var o,d,m;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&&s(e,t)}(n,t.PolymerElement),o=n,m=[{key:"template",get:function(){return t.html(u())}},{key:"properties",get:function(){return{opened:{name:"opened",type:"Boolean",value:!1,reflectToAttribute:!0},text:{name:"text",type:"String",value:"Saved"},classStyle:{name:"classStyle",type:"String",value:""},closeText:{name:"closeText",type:"String",value:"Close"},duration:{name:"duration",type:"Number",value:4e3},eventCallback:{name:"eventCallback",type:"String"},closeButton:{name:"closeButton",type:"Boolean",value:!0,reflectToAttribute:!0}}}},{key:"tag",get:function(){return"simple-toast"}}],(d=[{key:"connectedCallback",value:function(){c(r(n.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(r(n.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){this.hide()}},{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.classStyle&&(this.classStyle=e.detail.classStyle),e.detail.closeText&&(this.closeText=e.detail.closeText),e.detail.closeButton&&(this.closeButton=e.detail.closeButton),e.detail.eventCallback&&(this.eventCallback=e.detail.eventCallback);null!==i.dom(this).firstChild;)i.dom(this).removeChild(i.dom(this).firstChild);e.detail.slot&&i.dom(this).appendChild(e.detail.slot),l.microTask.run(function(){setTimeout(function(){t.show()},50)})}},{key:"show",value:function(){this.$.toast.show()}},{key:"hide",value:function(){if(this.eventCallback){var e=new CustomEvent(this.eventCallback,{bubbles:!0,cancelable:!0,detail:!0});this.dispatchEvent(e)}this.$.toast.hide()}}])&&a(o.prototype,d),m&&a(o,m),n}();window.customElements.define(d.tag,d),e.SimpleToast=d,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=simple-toast.umd.js.map |
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
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
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
205857
4995