@kalel1500/kalion-js 0.9.1-beta.0 → 0.9.2-beta.0

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.
@@ -36,7 +36,7 @@ const _Constants = class _Constants {
36
36
  routeName_queues_checkService: "kalion.ajax.queues.checkService",
37
37
  // Vite
38
38
  VITE_BROADCASTING_ENABLED: false,
39
- VITE_REVERB_APP_KEY: null,
39
+ VITE_REVERB_APP_KEY: void 0,
40
40
  VITE_REVERB_HOST: "localhost",
41
41
  VITE_REVERB_PORT: 8080,
42
42
  VITE_REVERB_SCHEME: "http",
@@ -98,7 +98,6 @@ const launch$1 = "Lanzar";
98
98
  const correct$1 = "Correcto";
99
99
  const ok$1 = "De acuerdo";
100
100
  const reload_page$1 = "Recargar página";
101
- const contact_pi_team$1 = "Contacta con el equipo de Herramientas PI";
102
101
  const unforeseen_error$1 = "Error imprevisto";
103
102
  const loading$1 = "Cargando";
104
103
  const loading_dots$1 = "Cargando...";
@@ -144,7 +143,6 @@ const es = {
144
143
  correct: correct$1,
145
144
  ok: ok$1,
146
145
  reload_page: reload_page$1,
147
- contact_pi_team: contact_pi_team$1,
148
146
  unforeseen_error: unforeseen_error$1,
149
147
  loading: loading$1,
150
148
  loading_dots: loading_dots$1,
@@ -189,7 +187,6 @@ const launch = "Launch";
189
187
  const correct = "It's right";
190
188
  const ok = "Ok";
191
189
  const reload_page = "Reload Page";
192
- const contact_pi_team = "Contact the PI Tools team";
193
190
  const unforeseen_error = "Unforeseen error";
194
191
  const loading = "Loading";
195
192
  const loading_dots = "Loading...";
@@ -235,7 +232,6 @@ const en = {
235
232
  correct,
236
233
  ok,
237
234
  reload_page,
238
- contact_pi_team,
239
235
  unforeseen_error,
240
236
  loading,
241
237
  loading_dots,
@@ -304,7 +300,7 @@ function getDefaultExportFromCjs(x) {
304
300
  }
305
301
  var sweetalert2$1 = { exports: {} };
306
302
  /*!
307
- * sweetalert2 v11.17.2
303
+ * sweetalert2 v11.22.0
308
304
  * Released under the MIT License.
309
305
  */
310
306
  var sweetalert2 = sweetalert2$1.exports;
@@ -357,7 +353,7 @@ function requireSweetalert2() {
357
353
  });
358
354
  };
359
355
  const swalPrefix = "swal2-";
360
- const classNames = ["container", "shown", "height-auto", "iosfix", "popup", "modal", "no-backdrop", "no-transition", "toast", "toast-shown", "show", "hide", "close", "title", "html-container", "actions", "confirm", "deny", "cancel", "default-outline", "footer", "icon", "icon-content", "image", "input", "file", "range", "select", "radio", "checkbox", "label", "textarea", "inputerror", "input-label", "validation-message", "progress-steps", "active-progress-step", "progress-step", "progress-step-line", "loader", "loading", "styled", "top", "top-start", "top-end", "top-left", "top-right", "center", "center-start", "center-end", "center-left", "center-right", "bottom", "bottom-start", "bottom-end", "bottom-left", "bottom-right", "grow-row", "grow-column", "grow-fullscreen", "rtl", "timer-progress-bar", "timer-progress-bar-container", "scrollbar-measure", "icon-success", "icon-warning", "icon-info", "icon-question", "icon-error", "draggable", "dragging"];
356
+ const classNames = ["container", "shown", "height-auto", "iosfix", "popup", "modal", "no-backdrop", "no-transition", "toast", "toast-shown", "show", "hide", "close", "title", "html-container", "actions", "confirm", "deny", "cancel", "footer", "icon", "icon-content", "image", "input", "file", "range", "select", "radio", "checkbox", "label", "textarea", "inputerror", "input-label", "validation-message", "progress-steps", "active-progress-step", "progress-step", "progress-step-line", "loader", "loading", "styled", "top", "top-start", "top-end", "top-left", "top-right", "center", "center-start", "center-end", "center-left", "center-right", "bottom", "bottom-start", "bottom-end", "bottom-left", "bottom-right", "grow-row", "grow-column", "grow-fullscreen", "rtl", "timer-progress-bar", "timer-progress-bar-container", "scrollbar-measure", "icon-success", "icon-warning", "icon-info", "icon-question", "icon-error", "draggable", "dragging"];
361
357
  const swalClasses = classNames.reduce(
362
358
  (acc, className) => {
363
359
  acc[className] = swalPrefix + className;
@@ -390,8 +386,7 @@ function requireSweetalert2() {
390
386
  warn(message);
391
387
  }
392
388
  };
393
- const warnAboutDeprecation = function(deprecatedParam) {
394
- let useInstead = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
389
+ const warnAboutDeprecation = (deprecatedParam, useInstead = null) => {
395
390
  warnOnce(`"${deprecatedParam}" is deprecated and will be removed in the next major release.${useInstead ? ` Use "${useInstead}" instead.` : ""}`);
396
391
  };
397
392
  const callIfFunction = (arg) => typeof arg === "function" ? arg() : arg;
@@ -622,8 +617,7 @@ function requireSweetalert2() {
622
617
  elem.style.removeProperty(property);
623
618
  }
624
619
  };
625
- const show = function(elem) {
626
- let display = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "flex";
620
+ const show = (elem, display = "flex") => {
627
621
  if (!elem) {
628
622
  return;
629
623
  }
@@ -635,8 +629,7 @@ function requireSweetalert2() {
635
629
  }
636
630
  elem.style.display = "none";
637
631
  };
638
- const showWhenInnerHtmlPresent = function(elem) {
639
- let display = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "block";
632
+ const showWhenInnerHtmlPresent = (elem, display = "block") => {
640
633
  if (!elem) {
641
634
  return;
642
635
  }
@@ -653,8 +646,7 @@ function requireSweetalert2() {
653
646
  el.style.setProperty(property, value);
654
647
  }
655
648
  };
656
- const toggle = function(elem, condition) {
657
- let display = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "flex";
649
+ const toggle = (elem, condition, display = "flex") => {
658
650
  if (condition) {
659
651
  show(elem, display);
660
652
  } else {
@@ -664,14 +656,23 @@ function requireSweetalert2() {
664
656
  const isVisible$1 = (elem) => !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length));
665
657
  const allButtonsAreHidden = () => !isVisible$1(getConfirmButton()) && !isVisible$1(getDenyButton()) && !isVisible$1(getCancelButton());
666
658
  const isScrollable = (elem) => !!(elem.scrollHeight > elem.clientHeight);
659
+ const selfOrParentIsScrollable = (element, stopElement) => {
660
+ let parent = element;
661
+ while (parent && parent !== stopElement) {
662
+ if (isScrollable(parent)) {
663
+ return true;
664
+ }
665
+ parent = parent.parentElement;
666
+ }
667
+ return false;
668
+ };
667
669
  const hasCssAnimation = (elem) => {
668
670
  const style = window.getComputedStyle(elem);
669
671
  const animDuration = parseFloat(style.getPropertyValue("animation-duration") || "0");
670
672
  const transDuration = parseFloat(style.getPropertyValue("transition-duration") || "0");
671
673
  return animDuration > 0 || transDuration > 0;
672
674
  };
673
- const animateTimerProgressBar = function(timer) {
674
- let reset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
675
+ const animateTimerProgressBar = (timer, reset = false) => {
675
676
  const timerProgressBar = getTimerProgressBar();
676
677
  if (!timerProgressBar) {
677
678
  return;
@@ -798,6 +799,10 @@ function requireSweetalert2() {
798
799
  container.dataset["swal2Theme"] = params.theme;
799
800
  const targetElement = getTarget(params.target);
800
801
  targetElement.appendChild(container);
802
+ if (params.topLayer) {
803
+ container.setAttribute("popover", "");
804
+ container.showPopover();
805
+ }
801
806
  setupAccessibility(params);
802
807
  setupRTL(targetElement);
803
808
  addInputChangeListeners();
@@ -873,17 +878,25 @@ function requireSweetalert2() {
873
878
  }
874
879
  addClass([confirmButton, denyButton, cancelButton], swalClasses.styled);
875
880
  if (params.confirmButtonColor) {
876
- confirmButton.style.backgroundColor = params.confirmButtonColor;
877
- addClass(confirmButton, swalClasses["default-outline"]);
881
+ confirmButton.style.setProperty("--swal2-confirm-button-background-color", params.confirmButtonColor);
878
882
  }
879
883
  if (params.denyButtonColor) {
880
- denyButton.style.backgroundColor = params.denyButtonColor;
881
- addClass(denyButton, swalClasses["default-outline"]);
884
+ denyButton.style.setProperty("--swal2-deny-button-background-color", params.denyButtonColor);
882
885
  }
883
886
  if (params.cancelButtonColor) {
884
- cancelButton.style.backgroundColor = params.cancelButtonColor;
885
- addClass(cancelButton, swalClasses["default-outline"]);
887
+ cancelButton.style.setProperty("--swal2-cancel-button-background-color", params.cancelButtonColor);
886
888
  }
889
+ applyOutlineColor(confirmButton);
890
+ applyOutlineColor(denyButton);
891
+ applyOutlineColor(cancelButton);
892
+ }
893
+ function applyOutlineColor(button) {
894
+ const buttonStyle = window.getComputedStyle(button);
895
+ if (buttonStyle.getPropertyValue("--swal2-action-button-focus-box-shadow")) {
896
+ return;
897
+ }
898
+ const outlineColor = buttonStyle.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/, "rgba($1, $2, $3, 0.5)");
899
+ button.style.setProperty("--swal2-action-button-focus-box-shadow", buttonStyle.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/, ` ${outlineColor}`));
887
900
  }
888
901
  function renderButton(button, buttonType, params) {
889
902
  const buttonName = (
@@ -1519,6 +1532,9 @@ function requireSweetalert2() {
1519
1532
  const focusableElements = getFocusableElements();
1520
1533
  if (focusableElements.length) {
1521
1534
  index = index + increment;
1535
+ if (index === -2) {
1536
+ index = focusableElements.length - 1;
1537
+ }
1522
1538
  if (index === focusableElements.length) {
1523
1539
  index = 0;
1524
1540
  } else if (index === -1) {
@@ -1684,7 +1700,8 @@ function requireSweetalert2() {
1684
1700
  if (target === container) {
1685
1701
  return true;
1686
1702
  }
1687
- if (!isScrollable(container) && target instanceof HTMLElement && target.tagName !== "INPUT" && // #1603
1703
+ if (!isScrollable(container) && target instanceof HTMLElement && !selfOrParentIsScrollable(target, htmlContainer) && // #2823
1704
+ target.tagName !== "INPUT" && // #1603
1688
1705
  target.tagName !== "TEXTAREA" && // #2266
1689
1706
  !(isScrollable(htmlContainer) && // #1944
1690
1707
  htmlContainer.contains(target))) {
@@ -2341,7 +2358,8 @@ function requireSweetalert2() {
2341
2358
  willClose: void 0,
2342
2359
  didClose: void 0,
2343
2360
  didDestroy: void 0,
2344
- scrollbarPadding: true
2361
+ scrollbarPadding: true,
2362
+ topLayer: false
2345
2363
  };
2346
2364
  const updatableParams = ["allowEscapeKey", "allowOutsideClick", "background", "buttonsStyling", "cancelButtonAriaLabel", "cancelButtonColor", "cancelButtonText", "closeButtonAriaLabel", "closeButtonHtml", "color", "confirmButtonAriaLabel", "confirmButtonColor", "confirmButtonText", "currentProgressStep", "customClass", "denyButtonAriaLabel", "denyButtonColor", "denyButtonText", "didClose", "didDestroy", "draggable", "footer", "hideClass", "html", "icon", "iconColor", "iconHtml", "imageAlt", "imageHeight", "imageUrl", "imageWidth", "preConfirm", "preDeny", "progressSteps", "returnFocus", "reverseButtons", "showCancelButton", "showCloseButton", "showConfirmButton", "showDenyButton", "text", "title", "titleText", "theme", "willClose"];
2347
2365
  const deprecatedParams = {
@@ -2377,8 +2395,8 @@ function requireSweetalert2() {
2377
2395
  if (params.backdrop === false && params.allowOutsideClick) {
2378
2396
  warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');
2379
2397
  }
2380
- if (params.theme && !["light", "dark", "auto", "borderless"].includes(params.theme)) {
2381
- warn(`Invalid theme "${params.theme}". Expected "light", "dark", "auto", or "borderless"`);
2398
+ if (params.theme && !["light", "dark", "auto", "minimal", "borderless", "embed-iframe", "bulma", "bulma-light", "bulma-dark"].includes(params.theme)) {
2399
+ warn(`Invalid theme "${params.theme}"`);
2382
2400
  }
2383
2401
  for (const param in params) {
2384
2402
  checkIfParamIsValid(param);
@@ -2571,10 +2589,7 @@ function requireSweetalert2() {
2571
2589
  }
2572
2590
  return params;
2573
2591
  };
2574
- function fire() {
2575
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2576
- args[_key] = arguments[_key];
2577
- }
2592
+ function fire(...args) {
2578
2593
  return new this(...args);
2579
2594
  }
2580
2595
  function mixin(mixinParams) {
@@ -2617,8 +2632,7 @@ function requireSweetalert2() {
2617
2632
  };
2618
2633
  let bodyClickListenerAdded = false;
2619
2634
  const clickHandlers = {};
2620
- function bindClickHandler() {
2621
- let attr = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "data-swal-template";
2635
+ function bindClickHandler(attr = "data-swal-template") {
2622
2636
  clickHandlers[attr] = this;
2623
2637
  if (!bodyClickListenerAdded) {
2624
2638
  document.body.addEventListener("click", bodyClickListener);
@@ -2667,13 +2681,9 @@ function requireSweetalert2() {
2667
2681
  * @param {EventHandler} eventHandler
2668
2682
  */
2669
2683
  once(eventName, eventHandler) {
2670
- var _this = this;
2671
- const onceFn = function() {
2672
- _this.removeListener(eventName, onceFn);
2673
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2674
- args[_key] = arguments[_key];
2675
- }
2676
- eventHandler.apply(_this, args);
2684
+ const onceFn = (...args) => {
2685
+ this.removeListener(eventName, onceFn);
2686
+ eventHandler.apply(this, args);
2677
2687
  };
2678
2688
  this.on(eventName, onceFn);
2679
2689
  }
@@ -2681,10 +2691,7 @@ function requireSweetalert2() {
2681
2691
  * @param {string} eventName
2682
2692
  * @param {Array} args
2683
2693
  */
2684
- emit(eventName) {
2685
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2686
- args[_key2 - 1] = arguments[_key2];
2687
- }
2694
+ emit(eventName, ...args) {
2688
2695
  this._getHandlersByEventName(eventName).forEach(
2689
2696
  /**
2690
2697
  * @param {EventHandler} eventHandler
@@ -3141,22 +3148,18 @@ function requireSweetalert2() {
3141
3148
  * @param {...any} args
3142
3149
  * @this {SweetAlert}
3143
3150
  */
3144
- constructor() {
3151
+ constructor(...args) {
3145
3152
  _classPrivateFieldInitSpec(this, _promise, void 0);
3146
3153
  if (typeof window === "undefined") {
3147
3154
  return;
3148
3155
  }
3149
3156
  currentInstance = this;
3150
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3151
- args[_key] = arguments[_key];
3152
- }
3153
3157
  const outerParams = Object.freeze(this.constructor.argsToParams(args));
3154
3158
  this.params = outerParams;
3155
3159
  this.isAwaitingPromise = false;
3156
3160
  _classPrivateFieldSet2(_promise, this, this._main(currentInstance.params));
3157
3161
  }
3158
- _main(userParams) {
3159
- let mixinParams = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3162
+ _main(userParams, mixinParams = {}) {
3160
3163
  showWarningsForParams(Object.assign({}, mixinParams, userParams));
3161
3164
  if (globalState.currentInstance) {
3162
3165
  const swalPromiseResolve = privateMethods.swalPromiseResolve.get(globalState.currentInstance);
@@ -3360,15 +3363,15 @@ function requireSweetalert2() {
3360
3363
  SweetAlert.prototype._destroy = _destroy;
3361
3364
  Object.assign(SweetAlert, staticMethods);
3362
3365
  Object.keys(instanceMethods).forEach((key) => {
3363
- SweetAlert[key] = function() {
3366
+ SweetAlert[key] = function(...args) {
3364
3367
  if (currentInstance && currentInstance[key]) {
3365
- return currentInstance[key](...arguments);
3368
+ return currentInstance[key](...args);
3366
3369
  }
3367
3370
  return null;
3368
3371
  };
3369
3372
  });
3370
3373
  SweetAlert.DismissReason = DismissReason;
3371
- SweetAlert.version = "11.17.2";
3374
+ SweetAlert.version = "11.22.0";
3372
3375
  const Swal2 = SweetAlert;
3373
3376
  Swal2.default = Swal2;
3374
3377
  return Swal2;
@@ -3487,7 +3490,7 @@ ensureIsValidValue_fn3 = function() {
3487
3490
  throw new InvalidValueException(message);
3488
3491
  }
3489
3492
  if (!this._permittedValues.includes(this._value)) {
3490
- const message = `<ActionVo> ha recibido un valor no permitido. Valores permitidos [${this._permittedValues.join(",")}]`;
3493
+ const message = `<EnumVo> ha recibido un valor no permitido. Valores permitidos [${this._permittedValues.join(",")}]`;
3491
3494
  throw new InvalidValueException(message);
3492
3495
  }
3493
3496
  };
@@ -3497,7 +3500,7 @@ class Test {
3497
3500
  console.log(__const("VITE_BROADCASTING_ENABLED"));
3498
3501
  }
3499
3502
  static printTranslation() {
3500
- console.log(___("contact_pi_team"));
3503
+ console.log(___("no_results"));
3501
3504
  }
3502
3505
  }
3503
3506
  class Instantiable {
@@ -3631,8 +3634,12 @@ class DomService extends Instantiable {
3631
3634
  const InputsNeedsChangeListener = ["range", "select", "radio", "checkbox", "date", "datetime-local", "time", "week", "month"];
3632
3635
  const _SModal = class _SModal {
3633
3636
  static mustAbortIfIsAlreadyOpen({ isUpdate = false, ignorePendingLoading = false }) {
3634
- if (g.errorModalIsShowed) throw new CannotOpenModalException("Se ha intentado abrir un modal cuando hay un modal de error abierto");
3635
- if (!ignorePendingLoading && !isUpdate && _SModal.isPendigLoading) throw new CannotOpenModalWarning("Se ha intentado abrir un modal cuando hay un modal de loading pendiente de actualizarse");
3637
+ if (g.errorModalIsShowed) {
3638
+ throw new CannotOpenModalException("Se ha intentado abrir un modal cuando hay un modal de error abierto");
3639
+ }
3640
+ if (!ignorePendingLoading && !isUpdate && _SModal.isPendigLoading) {
3641
+ throw new CannotOpenModalWarning("Se ha intentado abrir un modal cuando hay un modal de loading pendiente de actualizarse");
3642
+ }
3636
3643
  }
3637
3644
  static toastInfo({
3638
3645
  icon = "info",
@@ -3995,19 +4002,19 @@ checkAndExecuteShow_fn = function(callback) {
3995
4002
  try {
3996
4003
  return callback();
3997
4004
  } catch (e) {
3998
- if (e instanceof CannotOpenModalWarning) {
4005
+ if (e instanceof CannotOpenModalException || e instanceof CannotOpenModalWarning) {
3999
4006
  g.consoleInfo(e.message);
4000
4007
  } else {
4001
4008
  throw e;
4002
4009
  }
4003
- return Promise.resolve();
4010
+ return Promise.reject();
4004
4011
  }
4005
4012
  };
4006
4013
  checkAndExecuteUpdate_fn = function(callback) {
4007
4014
  try {
4008
4015
  callback();
4009
4016
  } catch (e) {
4010
- if (e instanceof CannotOpenModalWarning) {
4017
+ if (e instanceof CannotOpenModalException || e instanceof CannotOpenModalWarning) {
4011
4018
  g.consoleInfo(e.message);
4012
4019
  } else {
4013
4020
  throw e;
@@ -4165,18 +4172,22 @@ const _g = class _g {
4165
4172
  static escapeHtml(html) {
4166
4173
  return html.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#039;");
4167
4174
  }
4168
- static handleGlobalError(error) {
4169
- if ((error == null ? void 0 : error.name) === "CannotOpenModalException") {
4170
- _g.consoleInfo(error);
4171
- return true;
4175
+ static handleGlobalError(event, source, lineno, colno, error) {
4176
+ let message = error == null ? void 0 : error.message;
4177
+ if (message === void 0 && typeof event === "string") {
4178
+ message = event;
4172
4179
  }
4180
+ if (message === void 0) {
4181
+ message = "No se ha podido obtener ningun mensaje del error";
4182
+ }
4183
+ console.warn(message);
4173
4184
  SModal.errorModal({
4174
4185
  title: "Error imprevisto",
4175
- html: `<span class="restriction-message">${_g.escapeHtml((error == null ? void 0 : error.message) ?? "Formato error imprevisto")}</span>`,
4176
- cancelButtonText: "Ok",
4177
- footer: ___("contact_pi_team")
4186
+ html: `<span class="restriction-message">${_g.escapeHtml(message)}</span>`,
4187
+ cancelButtonText: "Ok"
4178
4188
  }).then((result) => {
4179
4189
  _g.errorModalIsShowed = false;
4190
+ }).catch((e) => {
4180
4191
  });
4181
4192
  _g.errorModalIsShowed = true;
4182
4193
  return false;
@@ -4224,7 +4235,7 @@ const _g = class _g {
4224
4235
  text = void 0,
4225
4236
  html = void 0,
4226
4237
  reloadOnClose = false,
4227
- footer = ___("contact_pi_team"),
4238
+ footer = void 0,
4228
4239
  from = void 0
4229
4240
  }) {
4230
4241
  if (_g.errorModalIsShowed) return;
@@ -5808,7 +5819,7 @@ __publicField(UtilitiesServiceProvider, "actions", {
5808
5819
  },
5809
5820
  registerGlobalError: () => {
5810
5821
  window.onerror = (message, source, lineno, colno, error) => {
5811
- return g.handleGlobalError(error);
5822
+ return g.handleGlobalError(message, source, lineno, colno, error);
5812
5823
  };
5813
5824
  },
5814
5825
  enableNotifications: () => {