From c88aa759ba2f0f52d2742d1bc41f3e878e395b27 Mon Sep 17 00:00:00 2001 From: pk Date: Sun, 5 Mar 2023 22:50:20 +0100 Subject: [PATCH] Add silent property to skip animation triggering through submit actions. --- package.json | 2 +- tp-button.js | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 2ad512f..2b8563d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-button", - "version": "1.0.2", + "version": "1.1.0", "description": "", "main": "tp-button.js", "scripts": { diff --git a/tp-button.js b/tp-button.js index 67de248..2fe8a9c 100644 --- a/tp-button.js +++ b/tp-button.js @@ -140,6 +140,7 @@ class TpButton extends EventHelpers(LitElement) { return { submit: { type: Boolean }, extended: { type: Boolean }, + slient: { type: Boolean }, locked: { type: Boolean, reflect: true }, }; } @@ -338,12 +339,17 @@ class TpButton extends EventHelpers(LitElement) { } _onFormSubmit() { - this.showSpinner(); + if (!this.slient) { + this.showSpinner(); + } } _onFormSuccess() { this.isSubmitting(false); - this.showSuccess(); + + if (!this.slient) { + this.showSuccess(); + } } _onFormFailed(e) { @@ -357,7 +363,10 @@ class TpButton extends EventHelpers(LitElement) { } this.isSubmitting = false; - this.showError(); + + if (!this.slient) { + this.showError(); + } } }