import type { VNode } from 'vue'; import type { _ButtonArgsBase, ButtonLayout, ButtonSize } from './button-layout'; import { Prop, toNative, Watch } from 'vue-facing-decorator'; import TsxComponent, { Component } from '../../app/vuetsx'; import { LaddaLite } from '../../common/ladda-lite'; import Button from './button'; interface LaddaButtonArgs extends _ButtonArgsBase { clicked: (e: any) => Promise; loading?: boolean; } @Component class LaddaButtonComponent extends TsxComponent implements LaddaButtonArgs { @Prop() cssClass!: string; @Prop() layout!: ButtonLayout; @Prop() text!: string | VNode; @Prop() tooltip!: string; @Prop() size!: ButtonSize; @Prop() round!: boolean; @Prop() outlined!: boolean; @Prop() icon!: string; @Prop() iconOnRight!: boolean; @Prop() disabled!: boolean; @Prop() pulsate!: boolean; @Prop() loading!: boolean; @Prop() clicked: (e: any) => Promise; // Whether the spinner should currently be showing. Tracked so `updated()` can // restore the ladda DOM after a Vue re-render strips it (Ladda mutates this // Vue-owned