@claspo/components 1.9.4-ctx.5 → 1.10.1-ctx.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/SysButtonComponent/SysButtonComponent.js +1 -1
  2. package/SysCalendarComponent/SysCalendarComponent.js +1 -1
  3. package/SysCheckboxListComponent/SysCheckboxListComponent.js +1 -1
  4. package/SysChoiceButtonsComponent/SysChoiceButtonsComponent.js +1 -1
  5. package/SysColumnComponent/SysColumnComponent.js +1 -1
  6. package/SysColumnsComponent/SysColumnsComponent.js +1 -1
  7. package/SysConsentComponent/SysConsentComponent.js +1 -1
  8. package/SysContainerComponent/SysContainerComponent.js +1 -1
  9. package/SysCountdownTimerComponent/SysCountdownTimerComponent.js +1 -1
  10. package/SysDateComponent/SysDateComponent.js +1 -1
  11. package/SysDropdownInputComponent/SysDropdownInputComponent.js +1 -1
  12. package/SysImageComponent/SysImageComponent.js +1 -1
  13. package/SysInAppColumnsComponent/SysInAppColumnsComponent.js +1 -1
  14. package/SysInputComponent/SysInputComponent.js +1 -1
  15. package/SysPhoneInputComponent/SysPhoneInputComponent.js +1 -1
  16. package/SysPromoCodeComponent/SysPromoCodeComponent.js +1 -1
  17. package/SysRadioGroupComponent/SysRadioGroupComponent.js +1 -1
  18. package/SysSlideComponent/SysSlideComponent.js +1 -1
  19. package/SysSliderComponent/SysSliderComponent.js +1 -1
  20. package/SysSocialComponent/SysSocialComponent.js +1 -1
  21. package/SysTextAreaComponent/SysTextAreaComponent.js +1 -1
  22. package/SysTextComponent/SysTextComponent.js +1 -1
  23. package/SysVideoComponent/SysVideoComponent.js +1 -1
  24. package/package.json +3 -3
  25. package/script/SysButtonComponent/SysButton.manifest.js +62 -31
  26. package/script/SysButtonComponent/SysButton.styles.js +63 -0
  27. package/script/SysButtonComponent/SysButtonComponent.js +88 -1
@@ -26,97 +26,128 @@ var SysButtonManifest = {
26
26
  "i18nPropPaths": ["content,text", "handlers,[id],actions,[id],params,link", "handlers,[id],actions,[id],params,customData"],
27
27
  "i18n": {
28
28
  "en": {
29
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "At least one field is required: email or phone number"
29
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "At least one field is required: email or phone number",
30
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Something went wrong. Please try again later"
30
31
  },
31
32
  "ru": {
32
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Хотя бы одно из полей должно быть заполнено: Email или Номер телефона"
33
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Хотя бы одно из полей должно быть заполнено: Email или Номер телефона",
34
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Что-то пошло не так. Пожалуйста, попробуйте позже"
33
35
  },
34
36
  "uk": {
35
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Хоча б одне з полів має бути заповнене: Email або Номер телефону"
37
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Хоча б одне з полів має бути заповнене: Email або Номер телефону",
38
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Щось пішло не так. Будь ласка, спробуйте пізніше"
36
39
  },
37
40
  "es": {
38
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Necesita, como mínimo, un campo obligatorio: email o número de teléfono"
41
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Necesita, como mínimo, un campo obligatorio: email o número de teléfono",
42
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Algo salió mal. Por favor, inténtalo de nuevo más tarde"
39
43
  },
40
44
  "de": {
41
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Mindestens ein Feld ist erforderlich: E-Mail-Adresse oder Telefonnummer"
45
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Mindestens ein Feld ist erforderlich: E-Mail-Adresse oder Telefonnummer",
46
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Etwas ist schiefgelaufen. Bitte versuchen Sie es später erneut"
42
47
  },
43
48
  "fr": {
44
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Au moins un champ est obligatoire : courriel ou numéro de téléphone"
49
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Au moins un champ est obligatoire : courriel ou numéro de téléphone",
50
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Une erreur s'est produite. Veuillez réessayer plus tard"
45
51
  },
46
52
  "it": {
47
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Almeno un campo è obbligatorio: email o numero di telefono"
53
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Almeno un campo è obbligatorio: email o numero di telefono",
54
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Qualcosa è andato storto. Riprova più tardi"
48
55
  },
49
56
  "pt": {
50
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "É necessário pelo menos um campo: email ou número de telefone"
57
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "É necessário pelo menos um campo: email ou número de telefone",
58
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Algo deu errado. Por favor, tente novamente mais tarde"
51
59
  },
52
60
  "ro": {
53
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Cel puțin un câmp este obligatoriu: e-mail sau număr de telefon"
61
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Cel puțin un câmp este obligatoriu: e-mail sau număr de telefon",
62
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Ceva nu a funcționat. Vă rugăm să încercați din nou mai târziu"
54
63
  },
55
64
  "bg": {
56
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Изисква се поне едно поле: имейл или телефонен номер"
65
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Изисква се поне едно поле: имейл или телефонен номер",
66
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Нещо се обърка. Моля, опитайте отново по-късно"
57
67
  },
58
68
  "cs": {
59
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Je vyžadováno alespoň jedno pole: e-mail nebo telefonní číslo"
69
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Je vyžadováno alespoň jedno pole: e-mail nebo telefonní číslo",
70
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Něco se pokazilo. Zkuste to prosím znovu později"
60
71
  },
61
72
  "el": {
62
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Απαιτείται τουλάχιστον ένα πεδίο: ηλεκτρονική διεύθυνση ή τηλέφωνο"
73
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Απαιτείται τουλάχιστον ένα πεδίο: ηλεκτρονική διεύθυνση ή τηλέφωνο",
74
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Κάτι πήγε στραβά. Παρακαλώ δοκιμάστε ξανά αργότερα"
63
75
  },
64
76
  "nl": {
65
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Er is minimaal één veld vereist: e-mail of telefoonnummer"
77
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Er is minimaal één veld vereist: e-mail of telefoonnummer",
78
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Er is iets misgegaan. Probeer het later opnieuw"
66
79
  },
67
80
  "pl": {
68
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Wymagane jest co najmniej jedno pole: adres e-mail lub numer telefonu"
81
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Wymagane jest co najmniej jedno pole: adres e-mail lub numer telefonu",
82
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Coś poszło nie tak. Spróbuj ponownie później"
69
83
  },
70
84
  "sv": {
71
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Minst ett fält krävs: e-post eller telefonnummer"
85
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Minst ett fält krävs: e-post eller telefonnummer",
86
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Något gick fel. Försök igen senare"
72
87
  },
73
88
  "tr": {
74
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "En az bir alan gereklidir: e-posta veya telefon numarası"
89
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "En az bir alan gereklidir: e-posta veya telefon numarası",
90
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Bir şeyler ters gitti. Lütfen daha sonra tekrar deneyin"
75
91
  },
76
92
  "ar": {
77
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "مطلوب حقل واحد على الأقل: البريد الإلكتروني أو رقم الهاتف"
93
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "مطلوب حقل واحد على الأقل: البريد الإلكتروني أو رقم الهاتف",
94
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "حدث خطأ ما. يرجى المحاولة مرة أخرى لاحقًا"
78
95
  },
79
96
  "zh": {
80
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "至少一个字段为必填:电子邮箱或电话号码"
97
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "至少一个字段为必填:电子邮箱或电话号码",
98
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "出了点问题。请稍后再试"
81
99
  },
82
100
  "da": {
83
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Mindst ét ​​felt er påkrævet: e-mail eller telefonnummer"
101
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Mindst ét ​​felt er påkrævet: e-mail eller telefonnummer",
102
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Noget gik galt. Prøv venligst igen senere"
84
103
  },
85
104
  "he": {
86
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "נדרש לפחות שדה אחד: אימייל או מספר טלפון"
105
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "נדרש לפחות שדה אחד: אימייל או מספר טלפון",
106
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "משהו השתבש. אנא נסה שוב מאוחר יותר"
87
107
  },
88
108
  "fi": {
89
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Vähintään yksi kenttä vaaditaan: sähköposti tai puhelinnumero"
109
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Vähintään yksi kenttä vaaditaan: sähköposti tai puhelinnumero",
110
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Jotain meni pieleen. Yritä myöhemmin uudelleen"
90
111
  },
91
112
  "hi": {
92
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "कम से कम एक फ़ील्ड आवश्यक है: ईमेल या फ़ोन नंबर"
113
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "कम से कम एक फ़ील्ड आवश्यक है: ईमेल या फ़ोन नंबर",
114
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "कुछ गलत हो गया। कृपया बाद में पुनः प्रयास करें"
93
115
  },
94
116
  "hr": {
95
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Potrebno je ispuniti barem jedno polje: e-mail ili telefonski broj"
117
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Potrebno je ispuniti barem jedno polje: e-mail ili telefonski broj",
118
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Nešto je pošlo po zlu. Pokušajte ponovno kasnije"
96
119
  },
97
120
  "hu": {
98
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Legalább egy mező kitöltése kötelező: e-mail vagy telefonszám."
121
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Legalább egy mező kitöltése kötelező: e-mail vagy telefonszám.",
122
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Valami hiba történt. Kérjük, próbálja újra később"
99
123
  },
100
124
  "id": {
101
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Setidaknya satu bidang wajib diisi: email atau nomor telepon"
125
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Setidaknya satu bidang wajib diisi: email atau nomor telepon",
126
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Terjadi kesalahan. Silakan coba lagi nanti"
102
127
  },
103
128
  "ja": {
104
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "少なくとも1つのフィールドが必須です:メールアドレスまたは電話番号"
129
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "少なくとも1つのフィールドが必須です:メールアドレスまたは電話番号",
130
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "問題が発生しました。後でもう一度お試しください"
105
131
  },
106
132
  "ko": {
107
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "최소 한 칸 필수 입력: 이메일 또는 전화번호"
133
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "최소 한 칸 필수 입력: 이메일 또는 전화번호",
134
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "문제가 발생했습니다. 나중에 다시 시도해 주세요"
108
135
  },
109
136
  "no": {
110
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Minst ett felt er obligatorisk: e-post eller telefonnummer"
137
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Minst ett felt er obligatorisk: e-post eller telefonnummer",
138
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Noe gikk galt. Vennligst prøv igjen senere"
111
139
  },
112
140
  "sk": {
113
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Aspoň jedno pole je povinné: e-mail alebo telefónne číslo"
141
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Aspoň jedno pole je povinné: e-mail alebo telefónne číslo",
142
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Niečo sa pokazilo. Skúste to znova neskôr"
114
143
  },
115
144
  "sl": {
116
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Vsaj eno polje je obvezno: e-poštni naslov ali telefonska številka"
145
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Vsaj eno polje je obvezno: e-poštni naslov ali telefonska številka",
146
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Nekaj ​​je šlo narobe. Poskusite znova pozneje"
117
147
  },
118
148
  "sr": {
119
- "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Najmanje jedno polje je obavezno: e-pošta ili broj telefona"
149
+ "control,validation,validationErrors,EMAIL_OR_PHONE_IS_REQUIRED": "Najmanje jedno polje je obavezno: e-pošta ili broj telefona",
150
+ "control,validation,validationErrors,SUBMIT_REQUEST_FAILED": "Нешто је пошло наопако. Покушајте поново касније"
120
151
  }
121
152
  },
122
153
  "syncEnabled": true,
@@ -59,6 +59,69 @@ button {
59
59
  button.focus-outline-defined:focus {
60
60
  outline: var(--clFocusOutline);
61
61
  }
62
+
63
+ .button-asyncLoader {
64
+ display: none;
65
+ position: absolute;
66
+ top: 50%;
67
+ left: 50%;
68
+ width: 20px;
69
+ height: 20px;
70
+ margin: -10px 0 0 -10px;
71
+ z-index: 1;
72
+ pointer-events: none;
73
+ }
74
+
75
+ .main-container.cl-button-loading .button-asyncLoader {
76
+ display: block;
77
+ }
78
+
79
+ .button-success-icon {
80
+ display: none;
81
+ position: absolute;
82
+ top: 50%;
83
+ left: 50%;
84
+ width: 22px;
85
+ height: 22px;
86
+ margin: -11px 0 0 -11px;
87
+ z-index: 1;
88
+ pointer-events: none;
89
+ }
90
+
91
+ .button-success-icon svg {
92
+ width: 22px;
93
+ height: 22px;
94
+ }
95
+
96
+ .main-container.cl-button-success .button-success-icon {
97
+ display: block;
98
+ }
99
+
100
+ .main-container.cl-button-loading .editable-text,
101
+ .main-container.cl-button-loading .icon,
102
+ .main-container.cl-button-success .editable-text,
103
+ .main-container.cl-button-success .icon {
104
+ visibility: hidden;
105
+ }
106
+
107
+ .button-asyncLoader .spinner--icon {
108
+ width: 20px;
109
+ height: 20px;
110
+ transform-origin: center;
111
+ animation: cl-button-spinner-rotate 0.8s linear infinite;
112
+ }
113
+
114
+ .button-asyncLoader .spinner--icon .path {
115
+ stroke: currentColor;
116
+ stroke-linecap: round;
117
+ stroke-dasharray: 24 32;
118
+ }
119
+
120
+ @keyframes cl-button-spinner-rotate {
121
+ 100% {
122
+ transform: rotate(360deg);
123
+ }
124
+ }
62
125
  `;
63
126
 
64
127
  export { SysButtonStyles as default };
@@ -18,6 +18,9 @@ class SysButtonComponent extends WcElement {
18
18
 
19
19
  invalidListener;
20
20
  validListener;
21
+ submitStartedListener;
22
+ submitFinishedListener;
23
+ submitErrorWithoutViewListener;
21
24
  stylesUpdateObserver;
22
25
 
23
26
 
@@ -30,6 +33,19 @@ class SysButtonComponent extends WcElement {
30
33
  <div class="editable-text" cl-inline-edit="content, text"></div>
31
34
  </button>
32
35
 
36
+ <span class="button-asyncLoader" aria-hidden="true">
37
+ <svg class="spinner--icon" viewBox="0 0 18 18" aria-hidden="true">
38
+ <circle class="path" cx="9" cy="9" r="5" fill="none" stroke-width="2"></circle>
39
+ </svg>
40
+ </span>
41
+
42
+ <span class="button-success-icon" aria-hidden="true">
43
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
44
+ <circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="2"></circle>
45
+ <path d="M7 12.5L10.5 16L17 8.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
46
+ </svg>
47
+ </span>
48
+
33
49
  <div class="input-tooltip">
34
50
  <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
35
51
  <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>
@@ -70,8 +86,28 @@ class SysButtonComponent extends WcElement {
70
86
  }
71
87
 
72
88
  if (subscribeContactAction || requestAction) {
73
- this.services.eventEmitter.on('CONTACT_DATA_SUBMIT', () => {
89
+ this.submitStartedListener = this.services.eventEmitter.on('SUBMIT_REQUEST_STARTED', () => {
74
90
  buttonElement.disabled = true;
91
+ this.hideErrorTooltip();
92
+ this.hideSuccessIcon();
93
+ this.showPendingLoader();
94
+ });
95
+
96
+ this.submitFinishedListener = this.services.eventEmitter.on('SUBMIT_REQUEST_FINISHED', (payload) => {
97
+ this.hidePendingLoader();
98
+
99
+ if (payload?.success) {
100
+ // Show a success checkmark on the button. It stays disabled so the indicator
101
+ // remains until the widget navigates away or closes.
102
+ this.showSuccessIcon();
103
+ } else {
104
+ // Re-enable the button on failure so the user can retry.
105
+ buttonElement.disabled = false;
106
+ }
107
+ });
108
+
109
+ this.submitErrorWithoutViewListener = this.services.eventEmitter.on('SUBMIT_REQUEST_ERROR_WITHOUT_VIEW', () => {
110
+ this.showErrorTooltip('SUBMIT_REQUEST_FAILED');
75
111
  });
76
112
  }
77
113
  }
@@ -98,9 +134,60 @@ class SysButtonComponent extends WcElement {
98
134
  this.validListener.off();
99
135
  }
100
136
 
137
+ if (this.submitStartedListener) {
138
+ this.submitStartedListener.off();
139
+ }
140
+
141
+ if (this.submitFinishedListener) {
142
+ this.submitFinishedListener.off();
143
+ }
144
+
145
+ if (this.submitErrorWithoutViewListener) {
146
+ this.submitErrorWithoutViewListener.off();
147
+ }
148
+
101
149
  this.stylesUpdateObserver?.disconnect();
102
150
  }
103
151
 
152
+ showPendingLoader() {
153
+ const mainContainerElement = this.getRootElement().querySelector('.main-container');
154
+ const loaderElement = mainContainerElement?.querySelector('.button-asyncLoader');
155
+
156
+ if (!mainContainerElement || !loaderElement) {
157
+ return;
158
+ }
159
+
160
+ // Match the spinner color to the button text so it stays visible on the button background.
161
+ loaderElement.style.color = this.getRootElement().querySelector('button').style.color;
162
+ mainContainerElement.classList.remove('cl-button-success');
163
+ mainContainerElement.classList.add('cl-button-loading');
164
+ }
165
+
166
+ hidePendingLoader() {
167
+ this.getRootElement()
168
+ .querySelector('.main-container')
169
+ ?.classList.remove('cl-button-loading');
170
+ }
171
+
172
+ showSuccessIcon() {
173
+ const mainContainerElement = this.getRootElement().querySelector('.main-container');
174
+ const successIconElement = mainContainerElement?.querySelector('.button-success-icon');
175
+
176
+ if (!mainContainerElement || !successIconElement) {
177
+ return;
178
+ }
179
+
180
+ // Match the checkmark color to the button text so it stays visible on the button background.
181
+ successIconElement.style.color = this.getRootElement().querySelector('button').style.color;
182
+ mainContainerElement.classList.add('cl-button-success');
183
+ }
184
+
185
+ hideSuccessIcon() {
186
+ this.getRootElement()
187
+ .querySelector('.main-container')
188
+ ?.classList.remove('cl-button-success');
189
+ }
190
+
104
191
  hideErrorTooltip() {
105
192
  this.getRootElement()
106
193
  .querySelector('.input-tooltip')