UNPKG

graphdb-workbench

Version:
2 lines 2.83 kB
export const __webpack_id__=17830;export const __webpack_ids__=[17830];export const __webpack_modules__={17830:(t,o,e)=>{e.r(o),e.d(o,{keyboard_shortcuts_dialog:()=>s});var r=e(76128);const s=class{constructor(t){(0,r.r)(this,t),this.open=void 0,this.items=[],this.translationService=void 0}keydownListener(t){"Escape"===t.key&&(this.open=!1)}openDialog(){this.open=!0}closeDialog(t){const o=t.target;t.stopPropagation(),(o.classList.contains("close-button")||o.classList.contains("dialog-overlay"))&&(this.open=!1)}buildDialogConfig(){return{dialogTitle:this.translationService.translate("yasqe.keyboard_shortcuts.dialog.title"),onClose:this.closeDialog.bind(this)}}translateLabel(t){return this.translate(`yasqe.keyboard_shortcuts.dialog.item.${t}.label`)}translateDescription(t){return this.translate(`yasqe.keyboard_shortcuts.dialog.item.${t}.description`)}translate(t){return this.translationService?this.translationService.translate(t):t}render(){return(0,r.h)(r.H,{class:"keyboard-shortcuts-dialog-wrapper"},this.open&&(0,r.h)("ontotext-dialog-web-component",{config:this.buildDialogConfig()},(0,r.h)("div",{slot:"body"},this.items.map(t=>(0,r.h)("div",{class:"keyboard-shortcut-description-item"},(0,r.h)("kbd",{class:"keyboard-shortcut-description-item-label"},(0,r.h)("span",null,this.translateLabel(t))),(0,r.h)("div",{class:"keyboard-shortcut-description-item-description"},this.translateDescription(t)))))),!this.open&&(0,r.h)("button",{class:"keyboard-shortcuts-dialog-button",onClick:()=>this.openDialog()},this.translate("yasqe.keyboard_shortcuts.btn.label")))}};s.style=".keyboard-shortcuts-dialog-wrapper{display:flex;justify-content:flex-end;margin-top:-9px;margin-right:1px;z-index:1015}.keyboard-shortcuts-dialog-wrapper .keyboard-shortcuts-dialog-button{background-color:#f7f7f7;outline:none;border:0.5px solid #EBEBEB;cursor:pointer;position:relative;z-index:1015}.keyboard-shortcuts-dialog-wrapper .dialog{min-width:80vw}.keyboard-shortcuts-dialog-wrapper .dialog .dialog-footer{display:none}.keyboard-shortcuts-dialog-wrapper .keyboard-shortcut-description-item{display:flex;flex-direction:row;gap:10px;padding-bottom:10px}.keyboard-shortcuts-dialog-wrapper .keyboard-shortcut-description-item-label{width:50%;text-align:end;font-size:14px}.keyboard-shortcuts-dialog-wrapper .keyboard-shortcut-description-item-label span{color:#fff;background-color:#333;border-radius:0.2rem;padding:4px}.keyboard-shortcuts-dialog-wrapper .keyboard-shortcut-description-item-description{width:50%;font-size:20px}.keyboard-shortcuts-dialog-wrapper kbd{background-color:#FFF}.keyboard-shortcuts-dialog-wrapper.resizeable-on{margin-top:-29px}.yasqe-fullscreen .keyboard-shortcuts-dialog-wrapper .keyboard-shortcuts-dialog-button{position:fixed;bottom:0;right:0}"}}; //# sourceMappingURL=17830.cc43ada17d93f8597863.bundle.js.map