/** * Vvveb * * Copyright (C) 2021 Ziadin Givan * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * */ import {ServerComponent} from '../server-component.js'; let template = ` `; class MenuComponent extends ServerComponent{ constructor () { super(); this.name = "Menu"; this.attributes = ["data-v-component-menu"], this.image ="icons/menu.svg"; this.html = template; let options = []; for (let i in Vvveb.data.menu) { let menu = Vvveb.data.menu[i]; options.push({value:menu.slug, text:menu.name}); } this.properties = [{ name: "Menu to display", group:"automatic", key: "order", col:12, inline:false, htmlAttr:"data-v-slug", inputtype: SelectInput, data: { options } }]; } init(node) { } } let menuComponent = new MenuComponent; export { menuComponent };