@esfaenza/extensions 11.2.23 → 11.2.26

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('ngx-toastr'), require('sweetalert2'), require('cerialize'), require('rxjs')) :
3
- typeof define === 'function' && define.amd ? define('@esfaenza/extensions', ['exports', '@angular/core', 'ngx-toastr', 'sweetalert2', 'cerialize', 'rxjs'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza.extensions = {}), global.ng.core, global.ngxToastr, global.swal, global.cerialize, global.rxjs));
5
- }(this, (function (exports, core, ngxToastr, swal, cerialize, rxjs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('ngx-toastr'), require('sweetalert2'), require('rxjs'), require('rxjs/operators'), require('cerialize')) :
3
+ typeof define === 'function' && define.amd ? define('@esfaenza/extensions', ['exports', '@angular/core', 'ngx-toastr', 'sweetalert2', 'rxjs', 'rxjs/operators', 'cerialize'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza.extensions = {}), global.ng.core, global.ngxToastr, global.swal, global.rxjs, global.rxjs.operators, global.cerialize));
5
+ }(this, (function (exports, core, ngxToastr, swal, rxjs, operators, cerialize) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -267,6 +267,15 @@
267
267
  onerror();
268
268
  });
269
269
  };
270
+ /**
271
+ * Mostra un messaggio di avviso con richiesta di conferma e gestisce il risultato chiamato i callback **onsuccess** o **onerror**
272
+ *
273
+ * @param {string} title Titolo del messaggio
274
+ * @param {string} text Contenuto del messaggio
275
+ */
276
+ MessageService.prototype.observableSimpleWarningWithChoice = function (title, text) {
277
+ return rxjs.of(this.warningSwalWithCancel.fire(title, text)).pipe(operators.map(function (t) { return !!t.value; }));
278
+ };
270
279
  /**
271
280
  * Mostra un messaggio di avviso che la sessione corrente è scaduta e propone all'utente di navigare al login. Qualora l'utente decidesse di farlo
272
281
  * verrà chiamata la funzione di callback **onnavigate
@@ -295,7 +304,9 @@
295
304
  if (postSuccess === void 0) { postSuccess = null; }
296
305
  if (postFailure === void 0) { postFailure = null; }
297
306
  if (response.success) {
298
- if (successMsg)
307
+ if (response.haswarning)
308
+ this.simpleWarning(response.warning);
309
+ else if (successMsg)
299
310
  this.simpleSuccess(successMsg);
300
311
  if (postSuccess)
301
312
  postSuccess();
@@ -305,9 +316,6 @@
305
316
  if (postFailure)
306
317
  postFailure();
307
318
  }
308
- else if (response.haswarning) {
309
- this.simpleWarning(response.warning);
310
- }
311
319
  };
312
320
  /**
313
321
  * Metodo helper per gestire in maniera standardizzata una risposta di tipo **string**, considerando che:
@@ -710,7 +718,7 @@
710
718
  tryThis = toCall(date, this.cfg.smallDate);
711
719
  else if (length == this.cfg.fulldateNoSS.length)
712
720
  tryThis = toCall(date, this.cfg.fulldateNoSS);
713
- if (tryThis.isValid())
721
+ if (tryThis && tryThis.isValid())
714
722
  return tryThis;
715
723
  // Se niente funziona, null.
716
724
  // Ricondurre l'Input ad una data non è possibile.