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

dev-ui.qwc-automatiko-functions.js Maven / Gradle / Ivy

There is a newer version: 0.38.0
Show newest version
import { LitElement, html, css} from 'lit';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
import { functions } from 'build-time-data';
import '@vaadin/grid';
import '@vaadin/vertical-layout';
import 'qui-badge';

export class QwcAutomatikoFunctions extends LitElement {

    static styles = css`
        .arctable {
          height: 100%;
          padding-bottom: 10px;
        }

        code {
          font-size: 85%;
        }

        .annotation {
          color: var(--lumo-contrast-50pct);
        }

        .producer {
          color: var(--lumo-primary-text-color);
        }
        `;

    static properties = {
        _functions: {state: true},
    };

    constructor() {
        super();
        this._functions = functions;
    }
    
     textToClipboard (text) {
	    var dummy = document.createElement("textarea");
	    document.body.appendChild(dummy);
	    dummy.value = text;
	    dummy.select();
	    document.execCommand("copy");
	    document.body.removeChild(dummy);
	}

    render() {
        if (this._functions) {

            return html`
                
                    
                    

                    
                    
                    
                    
                      
                     
                      
                    
                    
                    
                    
                    
                  
                `;
            
        } else {
            return html`No functions found`;
        }
    }


    _nameRenderer(func) {
      return html`
        
          ${func.name}
        
    `;
    }
    
    _endpointRenderer(func) {
      return html`
        
          ${func.endpoint}
        
    `;
    }
    _getRenderer(func) {
      return html`
        
          
${func.getInstructions}
`; } _getCopyRenderer(func) { return html` this.textToClipboard(func.curlGet)} class="button"> `; } _postRenderer(func) { return html`
${func.postInstructions}
`; } _postCopyRenderer(func) { return html` this.textToClipboard(func.curlPost)} class="button"> `; } } customElements.define('qwc-automatiko-functions', QwcAutomatikoFunctions);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy