@esfaenza/extensions 15.2.36 → 15.2.37
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.
- package/esm2020/lib/services/extensions.messages.service.mjs +33 -24
- package/fesm2015/esfaenza-extensions.mjs +32 -23
- package/fesm2015/esfaenza-extensions.mjs.map +1 -1
- package/fesm2020/esfaenza-extensions.mjs +32 -23
- package/fesm2020/esfaenza-extensions.mjs.map +1 -1
- package/lib/services/extensions.messages.service.d.ts +16 -4
- package/package.json +1 -1
|
@@ -859,29 +859,13 @@ class MessageService {
|
|
|
859
859
|
return providerOverride;
|
|
860
860
|
return "swal";
|
|
861
861
|
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
*
|
|
865
|
-
* @param {string} title Titolo del messaggio
|
|
866
|
-
* @param {string} text Contenuto del messaggio
|
|
867
|
-
* @param {Function} onsuccess Callback da chimare su conferma
|
|
868
|
-
* @param {Function} onerror Callback da chimare su errori
|
|
869
|
-
*/
|
|
870
|
-
_simpleWarningWithChoice(title, text, onsuccess = null, onerror = null) {
|
|
871
|
-
this.warningSwalWithCancel.fire(title, text).then((result) => {
|
|
872
|
-
if (result.value && onsuccess)
|
|
873
|
-
onsuccess();
|
|
874
|
-
else if (onerror)
|
|
875
|
-
onerror();
|
|
876
|
-
});
|
|
877
|
-
}
|
|
878
|
-
simpleWarningWithChoice(title, text, onsuccess, onerror) {
|
|
879
|
-
this.withChoiceBase("warning", title, text, onsuccess, onerror);
|
|
862
|
+
simpleWarningWithChoice(title, text, onsuccess, onerror, confirmtext = "", aborttext = '') {
|
|
863
|
+
this.withChoiceBase("warning", title, text, onsuccess, onerror, confirmtext, aborttext);
|
|
880
864
|
}
|
|
881
|
-
simpleSuccessWithChoice(title, text, onsuccess, onerror) {
|
|
882
|
-
this.withChoiceBase("success", title, text, onsuccess, onerror);
|
|
865
|
+
simpleSuccessWithChoice(title, text, onsuccess, onerror, confirmtext = "", aborttext = '') {
|
|
866
|
+
this.withChoiceBase("success", title, text, onsuccess, onerror, confirmtext, aborttext);
|
|
883
867
|
}
|
|
884
|
-
withChoiceBase(level, title, text, onsuccess, onerror) {
|
|
868
|
+
withChoiceBase(level, title, text, onsuccess, onerror, confirmtext = "", aborttext = '') {
|
|
885
869
|
if (this.Embedded) {
|
|
886
870
|
let guid = this.hash.getGUID();
|
|
887
871
|
this.GuidRepsonseFunctionsMap[guid] = { onsuccess, onerror };
|
|
@@ -897,7 +881,18 @@ class MessageService {
|
|
|
897
881
|
});
|
|
898
882
|
}
|
|
899
883
|
else
|
|
900
|
-
(level == "warning" ? this._simpleWarningWithChoice.bind(this) : this._simpleSuccessWithChoice.bind(this))(title, text, onsuccess, onerror);
|
|
884
|
+
(level == "warning" ? this._simpleWarningWithChoice.bind(this) : this._simpleSuccessWithChoice.bind(this))(title, text, onsuccess, onerror, confirmtext, aborttext);
|
|
885
|
+
}
|
|
886
|
+
/**
|
|
887
|
+
* Mostra un messaggio di avviso con richiesta di conferma e gestisce il risultato chiamato i callback **onsuccess** o **onerror**
|
|
888
|
+
*
|
|
889
|
+
* @param {string} title Titolo del messaggio
|
|
890
|
+
* @param {string} text Contenuto del messaggio
|
|
891
|
+
* @param {Function} onsuccess Callback da chimare su conferma
|
|
892
|
+
* @param {Function} onerror Callback da chimare su errori
|
|
893
|
+
*/
|
|
894
|
+
_simpleWarningWithChoice(title, text, onconfirm = null, onabort = null, confirmtext = "", aborttext = '') {
|
|
895
|
+
this._simpleWithChoice(this.warningSwalWithCancel, title, text, onconfirm, onabort, confirmtext, aborttext);
|
|
901
896
|
}
|
|
902
897
|
/**
|
|
903
898
|
* Mostra un messaggio di success con richiesta di conferma e gestisce il risultato chiamato i callback **onconfirm** o **onabort**
|
|
@@ -910,6 +905,20 @@ class MessageService {
|
|
|
910
905
|
* @param {string} aborttext Testo del pulsante di annullamento
|
|
911
906
|
*/
|
|
912
907
|
_simpleSuccessWithChoice(title, text, onconfirm = null, onabort = null, confirmtext = "", aborttext = '') {
|
|
908
|
+
this._simpleWithChoice(this.successSwalWithCancel, title, text, onconfirm, onabort, confirmtext, aborttext);
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Metodo base per richiedere una scelta all'utente
|
|
912
|
+
*
|
|
913
|
+
* @param {any} swal Swal mixin da utilizzare per visualizzare il messaggio di choice
|
|
914
|
+
* @param {string} title Titolo del messaggio
|
|
915
|
+
* @param {string} text Contenuto del messaggio
|
|
916
|
+
* @param {Function} onconfirm Callback da chimare su conferma
|
|
917
|
+
* @param {Function} onabort Callback da chimare su annullamento
|
|
918
|
+
* @param {string} confirmtext Testo del pulsante di azione
|
|
919
|
+
* @param {string} aborttext Testo del pulsante di annullamento
|
|
920
|
+
*/
|
|
921
|
+
_simpleWithChoice(swal, title, text, onconfirm = null, onabort = null, confirmtext = "", aborttext = '') {
|
|
913
922
|
var configuration = {
|
|
914
923
|
title: title,
|
|
915
924
|
html: text
|
|
@@ -918,7 +927,7 @@ class MessageService {
|
|
|
918
927
|
configuration["confirmButtonText"] = confirmtext;
|
|
919
928
|
if (aborttext)
|
|
920
929
|
configuration["cancelButtonText"] = aborttext;
|
|
921
|
-
|
|
930
|
+
swal.fire(configuration).then((result) => {
|
|
922
931
|
if (result.value && onconfirm)
|
|
923
932
|
onconfirm();
|
|
924
933
|
else if (onabort)
|