@esfaenza/extensions 11.2.44 → 11.2.45
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/bundles/esfaenza-extensions.umd.js +55 -11
- package/bundles/esfaenza-extensions.umd.js.map +1 -1
- package/bundles/esfaenza-extensions.umd.min.js +1 -1
- package/bundles/esfaenza-extensions.umd.min.js.map +1 -1
- package/esfaenza-extensions.metadata.json +1 -1
- package/esm2015/lib/services/extensions.messages.service.js +52 -12
- package/fesm2015/esfaenza-extensions.js +51 -11
- package/fesm2015/esfaenza-extensions.js.map +1 -1
- package/lib/services/extensions.messages.service.d.ts +15 -0
- package/package.json +1 -1
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
* @ignore
|
|
61
61
|
*/
|
|
62
62
|
function MessageService(toastr, FANCY_ALERTS, LOCALE) {
|
|
63
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
63
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
64
64
|
this.toastr = toastr;
|
|
65
65
|
this.FANCY_ALERTS = FANCY_ALERTS;
|
|
66
66
|
this.LOCALE = LOCALE;
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
allowOutsideClick: false,
|
|
89
89
|
icon: "warning"
|
|
90
90
|
});
|
|
91
|
-
this.
|
|
92
|
-
title: this.loc["
|
|
91
|
+
this.successSwalWithCancel = swal__default['default'].mixin({
|
|
92
|
+
title: this.loc["Success"][(_a = this.LOCALE) !== null && _a !== void 0 ? _a : 'it-IT'],
|
|
93
93
|
customClass: {
|
|
94
94
|
confirmButton: "btn btn-primary",
|
|
95
95
|
cancelButton: "btn btn-secondary app-margin-right-10",
|
|
@@ -100,10 +100,24 @@
|
|
|
100
100
|
showCancelButton: true,
|
|
101
101
|
confirmButtonText: this.loc["Confirm"][(_b = this.LOCALE) !== null && _b !== void 0 ? _b : 'it-IT'],
|
|
102
102
|
cancelButtonText: this.loc["Cancel"][(_c = this.LOCALE) !== null && _c !== void 0 ? _c : 'it-IT'],
|
|
103
|
+
icon: "success"
|
|
104
|
+
});
|
|
105
|
+
this.warningSwalWithCancel = swal__default['default'].mixin({
|
|
106
|
+
title: this.loc["Warning"][(_d = this.LOCALE) !== null && _d !== void 0 ? _d : 'it-IT'],
|
|
107
|
+
customClass: {
|
|
108
|
+
confirmButton: "btn btn-primary",
|
|
109
|
+
cancelButton: "btn btn-secondary app-margin-right-10",
|
|
110
|
+
container: "app-wrap",
|
|
111
|
+
},
|
|
112
|
+
buttonsStyling: false,
|
|
113
|
+
reverseButtons: true,
|
|
114
|
+
showCancelButton: true,
|
|
115
|
+
confirmButtonText: this.loc["Confirm"][(_e = this.LOCALE) !== null && _e !== void 0 ? _e : 'it-IT'],
|
|
116
|
+
cancelButtonText: this.loc["Cancel"][(_f = this.LOCALE) !== null && _f !== void 0 ? _f : 'it-IT'],
|
|
103
117
|
icon: "warning"
|
|
104
118
|
});
|
|
105
119
|
this.warningSwal = swal__default['default'].mixin({
|
|
106
|
-
title: this.loc["Warning"][(
|
|
120
|
+
title: this.loc["Warning"][(_g = this.LOCALE) !== null && _g !== void 0 ? _g : 'it-IT'],
|
|
107
121
|
customClass: {
|
|
108
122
|
confirmButton: "btn btn-primary",
|
|
109
123
|
container: "app-wrap",
|
|
@@ -111,11 +125,11 @@
|
|
|
111
125
|
buttonsStyling: false,
|
|
112
126
|
reverseButtons: true,
|
|
113
127
|
showCancelButton: false,
|
|
114
|
-
confirmButtonText: this.loc["Close"][(
|
|
128
|
+
confirmButtonText: this.loc["Close"][(_h = this.LOCALE) !== null && _h !== void 0 ? _h : 'it-IT'],
|
|
115
129
|
icon: "warning"
|
|
116
130
|
});
|
|
117
131
|
this.successSwal = swal__default['default'].mixin({
|
|
118
|
-
title: this.loc["Success"][(
|
|
132
|
+
title: this.loc["Success"][(_j = this.LOCALE) !== null && _j !== void 0 ? _j : 'it-IT'],
|
|
119
133
|
customClass: {
|
|
120
134
|
confirmButton: "btn btn-primary",
|
|
121
135
|
container: "app-wrap",
|
|
@@ -123,11 +137,11 @@
|
|
|
123
137
|
buttonsStyling: false,
|
|
124
138
|
reverseButtons: true,
|
|
125
139
|
showCancelButton: false,
|
|
126
|
-
confirmButtonText: this.loc["Close"][(
|
|
140
|
+
confirmButtonText: this.loc["Close"][(_k = this.LOCALE) !== null && _k !== void 0 ? _k : 'it-IT'],
|
|
127
141
|
icon: "success"
|
|
128
142
|
});
|
|
129
143
|
this.errorSwal = swal__default['default'].mixin({
|
|
130
|
-
title: this.loc["Error"][(
|
|
144
|
+
title: this.loc["Error"][(_l = this.LOCALE) !== null && _l !== void 0 ? _l : 'it-IT'],
|
|
131
145
|
customClass: {
|
|
132
146
|
confirmButton: "btn btn-primary",
|
|
133
147
|
container: "app-wrap",
|
|
@@ -135,11 +149,11 @@
|
|
|
135
149
|
buttonsStyling: false,
|
|
136
150
|
reverseButtons: true,
|
|
137
151
|
showCancelButton: false,
|
|
138
|
-
confirmButtonText: this.loc["Close"][(
|
|
152
|
+
confirmButtonText: this.loc["Close"][(_m = this.LOCALE) !== null && _m !== void 0 ? _m : 'it-IT'],
|
|
139
153
|
icon: "error"
|
|
140
154
|
});
|
|
141
155
|
this.infoSwal = swal__default['default'].mixin({
|
|
142
|
-
title: this.loc["Info"][(
|
|
156
|
+
title: this.loc["Info"][(_o = this.LOCALE) !== null && _o !== void 0 ? _o : 'it-IT'],
|
|
143
157
|
customClass: {
|
|
144
158
|
confirmButton: "btn btn-primary",
|
|
145
159
|
container: "app-wrap",
|
|
@@ -147,7 +161,7 @@
|
|
|
147
161
|
buttonsStyling: false,
|
|
148
162
|
reverseButtons: true,
|
|
149
163
|
showCancelButton: false,
|
|
150
|
-
confirmButtonText: this.loc["Close"][(
|
|
164
|
+
confirmButtonText: this.loc["Close"][(_p = this.LOCALE) !== null && _p !== void 0 ? _p : 'it-IT'],
|
|
151
165
|
icon: "info"
|
|
152
166
|
});
|
|
153
167
|
}
|
|
@@ -271,6 +285,36 @@
|
|
|
271
285
|
onerror();
|
|
272
286
|
});
|
|
273
287
|
};
|
|
288
|
+
/**
|
|
289
|
+
* Mostra un messaggio di success con richiesta di conferma e gestisce il risultato chiamato i callback **onconfirm** o **onabort**
|
|
290
|
+
*
|
|
291
|
+
* @param {string} title Titolo del messaggio
|
|
292
|
+
* @param {string} text Contenuto del messaggio
|
|
293
|
+
* @param {Function} onconfirm Callback da chimare su conferma
|
|
294
|
+
* @param {Function} onabort Callback da chimare su annullamento
|
|
295
|
+
* @param {string} confirmtext Testo del pulsante di azione
|
|
296
|
+
* @param {string} aborttext Testo del pulsante di annullamento
|
|
297
|
+
*/
|
|
298
|
+
MessageService.prototype.simpleSuccessWithChoice = function (title, text, onconfirm, onabort, confirmtext, aborttext) {
|
|
299
|
+
if (onconfirm === void 0) { onconfirm = null; }
|
|
300
|
+
if (onabort === void 0) { onabort = null; }
|
|
301
|
+
if (confirmtext === void 0) { confirmtext = ""; }
|
|
302
|
+
if (aborttext === void 0) { aborttext = ''; }
|
|
303
|
+
var configuration = {
|
|
304
|
+
title: title,
|
|
305
|
+
html: text
|
|
306
|
+
};
|
|
307
|
+
if (confirmtext)
|
|
308
|
+
configuration["confirmButtonText"] = confirmtext;
|
|
309
|
+
if (aborttext)
|
|
310
|
+
configuration["cancelButtonText"] = aborttext;
|
|
311
|
+
this.successSwalWithCancel.fire(configuration).then(function (result) {
|
|
312
|
+
if (result.value && onconfirm)
|
|
313
|
+
onconfirm();
|
|
314
|
+
else if (onabort)
|
|
315
|
+
onabort();
|
|
316
|
+
});
|
|
317
|
+
};
|
|
274
318
|
/**
|
|
275
319
|
* Mostra un messaggio di avviso con richiesta di conferma e gestisce il risultato chiamato i callback **onsuccess** o **onerror**
|
|
276
320
|
*
|