sparnatural
Version:
Visual client-side SPARQL query builder and knowledge graph exploration tool
25 lines • 1.36 kB
JavaScript
import GroupWrapper from "../../GroupWrapper";
import LinkAndBottom from "../../LinkAndBottom";
//add GroupWrapper as a Sibling
export function addAndComponent(grpWrapper, startClassVal) {
grpWrapper.andSibling = new GroupWrapper(grpWrapper.parentComponent, grpWrapper.specProvider,
// same depth
grpWrapper.depth, startClassVal).render();
//set state to startClassValSelected and trigger change
let inputSelector = grpWrapper.andSibling.CriteriaGroup.StartClassGroup.inputSelector;
//inputSelector.oldWidget.val(startClassVal.type);
inputSelector.submitSelected();
// nice-select is 2nd place in childrenslist. move away from nice-select...
//inputSelector.html[0].children[1].classList.add("disabled");
// draw the AND link
grpWrapper.linkAndBottom = new LinkAndBottom(grpWrapper).render();
grpWrapper.html[0].dispatchEvent(new CustomEvent("redrawBackgroundAndLinks", { bubbles: true }));
removeActionAnd(grpWrapper);
}
function removeActionAnd(grpWarpper) {
// deactivate onHover function and remove it. Could also make it invisible?
let remCss = grpWarpper.CriteriaGroup.ActionsGroup.actions.ActionAnd.widgetHtml.remove();
if (remCss.length == 0)
throw Error(`Didn't find ActionAnd Component. ActionAnd.html:${this.actions.ActionAnd.html}`);
}
//# sourceMappingURL=AddAndComponent.js.map