UNPKG

@rocketspark/domain-checker

Version:
13 lines 4.84 kB
/*! * * @rocketspark/domain-checker v1.0.12 * git+https://github.com/rocketspark/domain-checker.git * * Copyright (c) Lee Reichardt and project contributors. * * This source code is licensed under the no license license found in the * LICENSE file in the root directory of this source tree. * */ "use strict";(self.webpackChunkDomainChecker=self.webpackChunkDomainChecker||[]).push([[588],{6588:function(s,t,e){e.r(t),e.d(t,{rs_flint_popup:function(){return p}});var o=e(6919);const p=class{constructor(s){(0,o.r)(this,s),this.rsClose=(0,o.c)(this,"rsClose",7),this.rsOpen=(0,o.c)(this,"rsOpen",7),this.canCloseFromBackdrop=!0,this.closeIcon=!0,this.backIcon=!1,this.steps=3,this.progress=1,this.backdropClose=!0,this.closePopup=()=>{this.close()},this.closePopupFromBackdrop=()=>{this.canCloseFromBackdrop&&this.close()},this.runPreviousStep=()=>{this.previousStep()}}async open(){this.el.style.display="block",setTimeout((()=>{this.el.style.opacity="1"})),this.rsOpen.emit()}async close(){this.el.style.opacity="0",setTimeout((()=>{this.el.style.display="none",this.rsClose.emit()}),150)}async gotoStep(s){"step"===this.type&&this.showContent(s)}async previousStep(){"step"===this.type&&this.showContent(this.progress-=1)}async nextStep(){var s;"step"===this.type&&(null===(s=this.backButton)||void 0===s||s.style.setProperty("visibility","visible"),this.showContent(this.progress+=1))}renderCloseButton(){return this.closeIcon?(0,o.h)("rs-icon",{name:"x",color:"grey",onClick:this.closePopup,class:"rs-flint-popup__close"}):(0,o.h)("div",null)}renderBackButton(){return this.backIcon||"step"==this.type?(0,o.h)("rs-icon",{ref:s=>this.backButton=s,name:"arrow-left",color:"grey",class:"rs-flint-popup__back",onClick:this.runPreviousStep}):(0,o.h)("div",null)}validateStep(s){s>this.steps?(this.progress=1,this.close()):s<1&&(this.progress=1)}showContent(s){var t;1==s&&(null===(t=this.backButton)||void 0===t||t.style.setProperty("visibility","hidden")),this.validateStep(s);const e=this.stepContents[this.progress-1];this.stepContents.forEach((s=>{e!==s&&(s.style.opacity="0",setTimeout((()=>{s.style.display="none"}),150))})),null!=e&&(e.style.display="block",setTimeout((()=>{e.style.opacity="1"}))),null!==this.stepProgress&&void 0!==this.stepProgress&&this.stepProgress.setAttribute("progress",this.progress.toString())}componentDidLoad(){this.stepContents=Array.from(this.popupBody.querySelectorAll("rs-flint-popup-content")),"step"===this.type&&this.stepContents.forEach(((s,t)=>{s.setAttribute("order",t.toString()),s.setAttribute("parent-type",this.type)})),this.showContent(this.progress)}componentWillLoad(){this.validateStep(this.progress),this.canCloseFromBackdrop=!!this.closeIcon&&this.backdropClose}render(){return(0,o.h)(o.H,{key:"2e774afaeb0484d1419adace1fa7a8ba9d4c3b36"},(0,o.h)("div",{key:"8019f2e8d0a89a6f6ef6456aed35d4745be6f5c9",class:"rs-flint-popup__backdrop",onClick:this.closePopupFromBackdrop}),(0,o.h)("div",{key:"4714792567eb9b6d64f13241b2b712f1b466f9d4",class:"rs-flint-popup__inner rs-component-shadow--popup"},(0,o.h)("div",{key:"53f7d8d03c856ae8476ce29dcdc9934829ded9e2",class:"rs-flint-popup__header"},this.renderBackButton(),(0,o.h)("slot",{key:"a87a0ec60b6f0327fd87ff7c41384ee111bc7248",name:"title"}),"step"==this.type?(0,o.h)("rs-progress-step",{steps:this.steps,ref:s=>this.stepProgress=s,class:"rs-flint-popup__progress-step",progress:this.progress}):null,this.renderCloseButton()),(0,o.h)("div",{key:"00905dfaf2bd93c887b3e380337e25a2a6daf6b2",class:"rs-flint-popup__body",ref:s=>this.popupBody=s},(0,o.h)("slot",{key:"d2da8f47cce15409bd60a93eed2b00f0052afe99"}))))}get el(){return(0,o.g)(this)}};p.style=".sc-rs-flint-popup-h{display:none;opacity:0;transition:opacity 0.15s cubic-bezier(0, 0.55, 0.45, 1)}.sc-rs-flint-popup-h .rs-flint-popup__body.sc-rs-flint-popup{position:relative}.sc-rs-flint-popup-h .rs-flint-popup__backdrop.sc-rs-flint-popup{display:block;width:100%;height:100%;position:fixed;top:0;left:0;background:var(--rs-color-grey-light);opacity:0.8}.sc-rs-flint-popup-h .rs-flint-popup__inner.sc-rs-flint-popup{display:block;width:644px;height:400px;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);background-color:var(--rs-color-white);border-radius:10px;box-shadow:none;box-sizing:border-box}.sc-rs-flint-popup-h .rs-flint-popup__header.sc-rs-flint-popup{display:flex;align-items:center;justify-content:space-between;padding:30px;box-sizing:border-box}.sc-rs-flint-popup-h .rs-flint-popup__close.sc-rs-flint-popup,.sc-rs-flint-popup-h .rs-flint-popup__back.sc-rs-flint-popup{cursor:pointer;color:var(--rs-color-grey);font-size:16px}.sc-rs-flint-popup-h .rs-flint-popup__close.sc-rs-flint-popup{margin-left:auto}[type='step'].sc-rs-flint-popup-h .rs-flint-popup__close.sc-rs-flint-popup{margin-left:0}"}}]); //# sourceMappingURL=588.index.js.map