All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev-ui.qwc-roq-generator.js Maven / Gradle / Ivy

The newest version!
import { LitElement, html, css} from 'lit';
import { JsonRpc } from 'jsonrpc';
import '@vaadin/icon';
import '@vaadin/button';
import '@vaadin/text-field';
import '@vaadin/text-area';
import '@vaadin/form-layout';
import '@vaadin/progress-bar';
import '@vaadin/checkbox';
import '@vaadin/grid';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
import '@vaadin/grid/vaadin-grid-sort-column.js';
import '@qomponent/qui-alert';

export class QwcRoqGenerator extends LitElement {

    jsonRpc = new JsonRpc(this);

    // Component style
    static styles = css`
        .button {
            background-color: transparent;
            cursor: pointer;
        }
        .clearIcon {
            color: orange;
        }
        `;

    // Component properties
    static properties = {
        "_pages": {state: true},
    }

    constructor() {
        super();
    }

    // Components callbacks

    /**
     * Called when displayed
     */
    connectedCallback() {
        super.connectedCallback();
        this.jsonRpc.getStaticPages().then(jsonRpcResponse => {
            this._pages = [];
            jsonRpcResponse.result.forEach(c => {
                this._pages.push(c);
            });
        });
    }

    /**
     * Called when it needs to render the components
     * @returns {*}
     */
    render() {
        if (this._pages) {
            return this._renderTable();
        } else {
            return html`Loading pages...`;
        }
    }

    // View / Templates

    _renderTable() {
        return html`
          
          
            
            
            
            

            
            
            
          


        `;
    }

    _generate() {
        this.jsonRpc.generate().then(jsonRpcResponse => {
            alert("Roq generation succeeded in directory: " + jsonRpcResponse.result);
        });
    }

    _fileRenderer(page) {
        return html`${page.outputPath}`;
    }

    _pathRenderer(page) {
        return html`${page.path}`;
    }

    _linkRenderer(page) {
        return html``;
    }



}
customElements.define('qwc-roq-generator', QwcRoqGenerator);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy