UNPKG

radh-ui

Version:

Stencil Component Starter

1 lines 3.56 kB
var __awaiter=this&&this.__awaiter||function(t,e,o,i){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,r){function a(t){try{f(i.next(t))}catch(e){r(e)}}function s(t){try{f(i["throw"](t))}catch(e){r(e)}}function f(t){t.done?o(t.value):n(t.value).then(a,s)}f((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return f([t,e])}}function f(a){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,n&&(r=a[0]&2?n["return"]:a[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;if(n=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(a[0]===6&&o.label<r[1]){o.label=r[1];r=a;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(a);break}if(r[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(s){a=[6,s];n=0}finally{i=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-72e8199d.system.js"],(function(t){"use strict";var e,o,i;return{setters:[function(t){e=t.r;o=t.h;i=t.g}],execute:function(){var n="#toast{visibility:hidden;max-width:50px;height:50px;margin:auto;background-color:#333;color:#fff;text-align:center;border-radius:2px;position:fixed;z-index:1;left:0;right:0;bottom:30px;font-size:17px;white-space:nowrap}#toast #img{width:50px;height:50px;float:left;padding-top:16px;padding-bottom:16px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#111;color:#fff}#toast #desc{color:#fff;padding:16px;overflow:hidden;white-space:nowrap}#toast.show{visibility:visible;-webkit-animation:fadein 0.5s, expand 0.5s 0.5s,stay 3s 1s, shrink 0.5s 2s, fadeout 0.5s 2.5s;animation:fadein 0.5s, expand 0.5s 0.5s,stay 3s 1s, shrink 0.5s 4s, fadeout 0.5s 4.5s}@-webkit-keyframes fadein{from{bottom:0;opacity:0}to{bottom:30px;opacity:1}}@keyframes fadein{from{bottom:0;opacity:0}to{bottom:30px;opacity:1}}@-webkit-keyframes expand{from{min-width:50px}to{min-width:350px}}@keyframes expand{from{min-width:50px}to{min-width:350px}}@-webkit-keyframes stay{from{min-width:350px}to{min-width:350px}}@keyframes stay{from{min-width:350px}to{min-width:350px}}@-webkit-keyframes shrink{from{min-width:350px}to{min-width:50px}}@keyframes shrink{from{min-width:350px}to{min-width:50px}}@-webkit-keyframes fadeout{from{bottom:30px;opacity:1}to{bottom:60px;opacity:0}}@keyframes fadeout{from{bottom:30px;opacity:1}to{bottom:60px;opacity:0}}";var r=function(){function t(t){e(this,t)}t.prototype.launchToast=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){this.desc=t;e=this.element.querySelector("#toast");e.className="show";setTimeout((function(){e.className=e.className.replace("show","")}),5e3);return[2]}))}))};t.prototype.render=function(){return o("div",{id:"toast"},o("div",{id:"img"},"Icon"),o("div",{id:"desc"},this.desc))};Object.defineProperty(t.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return t}();t("radh_toast",r);r.style=n}}}));