UNPKG

sparnatural

Version:

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

22 lines 1.53 kB
/* This is the green arrow which gets rendered. Pressing the arrow renders the Optional and NotExist component */ import { HTMLComponent } from "../HtmlComponent"; export class OptionalArrow extends HTMLComponent { constructor(ParentComponent, callBack) { let widgetHtml = $("<svg data-name=\"Calque 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 41 48\"><defs></defs><path class=\"cls-1\" d=\"m 3.0917719,45 9.8014121,-0.0026 c 2.568402,-0.0021 4.895386,-0.501445 6.659927,-2.43767 3.751871,-4.223356 13.326575,-14.948695 13.326575,-14.948695 0,0 1.14739,-1.215113 1.119825,-3.147661 -0.02657,-1.863045 -1.272596,-3.297016 -1.272596,-3.297016 0,0 -2.050042,-2.303657 -5.02963,-5.629849 C 24.776727,12.276335 21.428693,8.4681514 19.579195,6.3746257 17.811705,4.4334779 15.865226,3.0034141 13.189919,3.0000005 10.383928,3.0115521 3.0000011,3.0030926 3.0000011,3.0030926 L 18.65782,21.16648 c 0,0 1.230775,1.56816 1.223285,3.297016 0.0018,1.761575 -1.319153,3.14766 -1.319153,3.14766 z\" style=\"stroke-width:0;\"/></svg>" /* UiuxConfig.COMPONENT_OPTION_ARROW_FRONT */); super("optionalArrow", ParentComponent, widgetHtml); this.selected = false; this.callBack = callBack; } render() { super.render(); this.widgetHtml.on("click", (e) => { e.stopImmediatePropagation(); this.selected = this.selected ? false : true; this.callBack(this.selected); }); return this; } } //# sourceMappingURL=OptionalArrow.js.map