Add silent property to skip animation triggering through submit actions.
This commit is contained in:
parent
837b3abeb2
commit
c88aa759ba
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tp/tp-button",
|
"name": "@tp/tp-button",
|
||||||
"version": "1.0.2",
|
"version": "1.1.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "tp-button.js",
|
"main": "tp-button.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
15
tp-button.js
15
tp-button.js
@ -140,6 +140,7 @@ class TpButton extends EventHelpers(LitElement) {
|
|||||||
return {
|
return {
|
||||||
submit: { type: Boolean },
|
submit: { type: Boolean },
|
||||||
extended: { type: Boolean },
|
extended: { type: Boolean },
|
||||||
|
slient: { type: Boolean },
|
||||||
locked: { type: Boolean, reflect: true },
|
locked: { type: Boolean, reflect: true },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -338,12 +339,17 @@ class TpButton extends EventHelpers(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onFormSubmit() {
|
_onFormSubmit() {
|
||||||
this.showSpinner();
|
if (!this.slient) {
|
||||||
|
this.showSpinner();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onFormSuccess() {
|
_onFormSuccess() {
|
||||||
this.isSubmitting(false);
|
this.isSubmitting(false);
|
||||||
this.showSuccess();
|
|
||||||
|
if (!this.slient) {
|
||||||
|
this.showSuccess();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onFormFailed(e) {
|
_onFormFailed(e) {
|
||||||
@ -357,7 +363,10 @@ class TpButton extends EventHelpers(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.isSubmitting = false;
|
this.isSubmitting = false;
|
||||||
this.showError();
|
|
||||||
|
if (!this.slient) {
|
||||||
|
this.showError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user