UNPKG

sparnatural

Version:

Visual client-side SPARQL query builder and knowledge graph exploration tool

39 lines 2.05 kB
import { I18n } from "../../../../settings/I18n"; import { HTMLComponent } from "../../../HtmlComponent"; /* The parent component here is in the beginning the ActionsGroup component. That seems very useless. check if there are any things going on eith ActionWhere.ParenComponent except the rendering in render() There the Endclassgroup is foun */ class ActionWhere extends HTMLComponent { constructor(parentComponent, specProvider, callBack) { //TODO refactor the null init in html widget super("ActionWhere", parentComponent, null); this.render = () => { super.render(); var choiceNumber = 2; var endLabel = this.specProvider.getEntity(this.parentComponent.endClassVal.type).getLabel(); this.parentComponent.html[0].classList.add("nb-choice-2"); let editTrait = $(` <span class="edit-trait"> <span class="edit-num"> ${choiceNumber}</span> </span>`); let where = $(` <div> ${I18n.labels.Search} ${endLabel} ${I18n.labels.That} </div> `); this.btn = $(`<a>${"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d=\"M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z\"/></svg>" /* UiuxConfig.ICON_PLUS */}</a>`); where = where.add(this.btn[0]); editTrait = editTrait.add(where); this.btn[0].addEventListener("click", () => { this.callBack(); }); this.html.append(editTrait); return this; }; this.specProvider = specProvider; this.callBack = callBack; this.parentComponent = parentComponent; } } export default ActionWhere; //# sourceMappingURL=ActionWhere.js.map