sparnatural
Version:
Visual client-side SPARQL query builder and knowledge graph exploration tool
32 lines • 3.04 kB
JavaScript
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _AddWidgetValueBtn_instances, _AddWidgetValueBtn_addEventListener;
import { ArrowComponent } from "./ArrowComponent";
import { HTMLComponent } from "../HtmlComponent";
export class AddWidgetValueBtn extends HTMLComponent {
constructor(ParentComponent, callBack) {
super("AddWidgetValueBtn", ParentComponent, null);
_AddWidgetValueBtn_instances.add(this);
this.frontArrow = new ArrowComponent(this, "<svg data-name=\"Calque 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 48\"><defs></defs><path class=\"cls-1\" d=\"M 3.5511345e-5,46.497994 1.4361963,46.498028 C 4.1152796,46.495828 6.5425435,45.960846 8.383125,43.886622 12.296677,39.36225 22.28399,27.872435 22.28399,27.872435 c 0,0 1.196835,-1.301906 1.168082,-3.372191 -0.02772,-1.995828 -1.327436,-3.531545 -1.327436,-3.531545 0,0 -2.138386,-2.468047 -5.246376,-6.031304 C 13.831845,11.444733 10.328483,7.4203762 8.3992834,5.177641 6.5556265,3.0981441 4.025266,1.5036569 1.2346701,1.5 H 1.7192135e-4\"/><rect width=\"25\" height=\"5\" x=\"0\" y=\"43\" /><rect width=\"25\" height=\"5\" x=\"0\" y=\"0\" /></svg>" /* UiuxConfig.COMPONENT_ARROW_FRONT */);
this.backArrow = new ArrowComponent(this, "<svg data-name=\"Calque 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 48.000001\"><defs></defs><path class=\"cls-1\" d=\"M 18.008733,1.5080381 6.6838121,1.5024032 c 0,0 -2.7510996,0.04416 -4.2115752,1.5946504 -2.02680282,2.1517235 -0.2098002,4.361739 -0.2098002,4.361739 0,0 8.2984163,9.9121154 11.7095953,13.1759434 1.225377,1.172444 1.678616,2.314014 1.658747,3.289995 l 0.0038,0.312891 c 0.01988,0.975981 -0.357679,2.113567 -1.583053,3.28601 C 10.640342,30.78746 2.2971761,40.70739 2.2971761,40.70739 c 0,0 -1.96022402,2.586197 0.363389,4.448506 1.7469044,1.400093 3.8753989,1.339578 3.8753989,1.339578 l 11.468674,0.0044\"/></svg>" /* UiuxConfig.COMPONENT_ARROW_BACK */);
this.callBack = callBack;
}
render() {
super.render();
this.backArrow.render();
const widgetHtml = $(`<p><span>+</span></p>`);
this.html.append(widgetHtml);
this.frontArrow.render();
__classPrivateFieldGet(this, _AddWidgetValueBtn_instances, "m", _AddWidgetValueBtn_addEventListener).call(this, this.html);
return this;
}
}
_AddWidgetValueBtn_instances = new WeakSet(), _AddWidgetValueBtn_addEventListener = function _AddWidgetValueBtn_addEventListener(el) {
el[0].addEventListener("click", () => {
this.callBack();
});
};
//# sourceMappingURL=AddWidgetValueBtn.js.map