UNPKG

@skhemata/skhemata-form

Version:

Skhemata Form Web Component. This web component can be used as base web component when working with forms and inputs.

59 lines 1.73 kB
import { __decorate } from "tslib"; import { html, css, SkhemataBase, property } from '@skhemata/skhemata-base'; export class SkhemataFormButton extends SkhemataBase { static get stlyes() { return [ ...super.styles, css ` .field { margin-bottom: 1rem; display: block; } `, ]; } title = ''; type = ''; isFullwidth = false; isLoading = false; valid = true; helpClass = ''; handleClick() { if (this.type === 'submit') { this.dispatchEvent(new CustomEvent('submit')); } else { this.dispatchEvent(new Event('click')); } } render() { return html ` <button class="button ${this.isFullwidth ? 'is-fullwidth' : ''} is-primary ${this.isLoading ? 'is-loading' : ''}" style="background-color: var(--skhemata-form-button-background-color, #00d1b2); color: var(--skhemata-form-button-text-color, #fff);" @click=${this.handleClick} > ${this.title} </button> `; } } __decorate([ property({ type: String }) ], SkhemataFormButton.prototype, "title", void 0); __decorate([ property({ type: String }) ], SkhemataFormButton.prototype, "type", void 0); __decorate([ property({ type: Boolean }) ], SkhemataFormButton.prototype, "isFullwidth", void 0); __decorate([ property({ type: Boolean }) ], SkhemataFormButton.prototype, "isLoading", void 0); __decorate([ property({ type: Boolean }) ], SkhemataFormButton.prototype, "valid", void 0); __decorate([ property({ type: String }) ], SkhemataFormButton.prototype, "helpClass", void 0); //# sourceMappingURL=SkhemataFormButton.js.map