import BsModal from "../../Bootstrap/Modal.js"; import WidgetIcon from "./WidgetIcon.js"; export default { components: { BsModal, WidgetIcon, }, props: [ "widgets" ], data: () => ({ callbacks: {} }), methods: { getWidget() { return new Promise((resolve,reject) => { this.callbacks = {resolve,reject}; this.$refs.modal.show(); }); }, close() { if (this.callbacks.reject) this.callbacks.reject(); this.callbacks = {}; }, pick(widget_id) { if (this.callbacks.resolve) this.callbacks.resolve(widget_id); this.callbacks = {}; this.$refs.modal.hide(); }, }, template: /* html */`
` }