sparnatural
Version:
Visual client-side SPARQL query builder and knowledge graph exploration tool
35 lines • 1.77 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 _OptionalComponent_instances, _OptionalComponent_addEventListeners;
import BaseOptionComponent from "./BaseOptionComponent";
import { OptionTypes } from "../OptionsGroup";
import { I18n } from "../../../../../../settings/I18n";
/*
Not Exists Component. Get's rendered by OptionsGroup if this is enabled.
When Clicked changes the SPARQL of the query to a NOTEXISTS form
*/
class OptionalComponent extends BaseOptionComponent {
// If you would like to change the shape of the Arrow. Do it here
constructor(ParentComponent) {
super("Optional", OptionTypes.OPTIONAL, ParentComponent, "optional");
_OptionalComponent_instances.add(this);
this.stateType = OptionTypes.OPTIONAL;
}
render() {
this.label = I18n.labels.labelOptionOptional;
super.render();
__classPrivateFieldGet(this, _OptionalComponent_instances, "m", _OptionalComponent_addEventListeners).call(this);
return this;
}
}
_OptionalComponent_instances = new WeakSet(), _OptionalComponent_addEventListeners = function _OptionalComponent_addEventListeners() {
this.html.on("click", (e) => {
e.stopPropagation();
this.onChange();
});
};
export default OptionalComponent;
//# sourceMappingURL=OptionalComponent.js.map