@signal24/vue-foundation 4.14.1 → 4.15.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.
@@ -1,8 +1,18 @@
1
+ interface IAlertOptions {
2
+ title?: string;
3
+ message: string | Error;
4
+ classes?: string[];
5
+ }
1
6
  export declare function showAlert(title: string, message: string | Error): Promise<void>;
2
7
  export declare function showAlert(message: string | Error): Promise<void>;
8
+ export declare function showAlert(options: IAlertOptions): Promise<void>;
3
9
  export declare function showConfirm(title: string, message: string): Promise<boolean>;
4
10
  export declare function showConfirm(message: string): Promise<boolean>;
11
+ export declare function showConfirm(options: IAlertOptions): Promise<boolean>;
5
12
  export declare function showConfirmDestroy(title: string, message: string): Promise<boolean>;
6
13
  export declare function showConfirmDestroy(message: string): Promise<boolean>;
14
+ export declare function showConfirmDestroy(options: IAlertOptions): Promise<boolean>;
7
15
  export declare function showWait(title: string, message: string): () => void;
8
16
  export declare function showWait(message: string): () => void;
17
+ export declare function showWait(options: IAlertOptions): () => void;
18
+ export {};
@@ -3,5 +3,10 @@ export declare class UserError extends Error {
3
3
  }
4
4
  export declare function formatError(err: any): string;
5
5
  export declare function toError(err: any): Error;
6
- export declare function handleErrorAndAlert(errIn: any, alertTitle?: string): Promise<void>;
6
+ interface IErrorAlertOptions {
7
+ title?: string;
8
+ classes?: string[];
9
+ }
10
+ export declare function handleErrorAndAlert(errIn: any, options?: IErrorAlertOptions): Promise<void>;
7
11
  export declare function handleError(errIn: any): Promise<void>;
12
+ export {};
@@ -1,18 +1,18 @@
1
- var Ve = Object.defineProperty;
2
- var Fe = (e, t, n) => t in e ? Ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var E = (e, t, n) => Fe(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { defineComponent as C, defineProps as _e, defineEmits as Re, ref as b, computed as _, openBlock as d, createElementBlock as h, createElementVNode as w, toDisplayString as x, withDirectives as j, createCommentVNode as O, Fragment as U, renderList as J, vModelSelect as Ne, getCurrentInstance as ee, onMounted as L, normalizeClass as k, normalizeStyle as Ke, withModifiers as te, renderSlot as K, reactive as je, h as W, Teleport as Ue, markRaw as We, onBeforeUnmount as ne, resolveDirective as be, createBlock as Oe, createSlots as Pe, withCtx as Y, createTextVNode as ae, vModelText as qe, watch as ce, onActivated as ke, onDeactivated as Se } from "vue";
5
- import { compact as ze, debounce as Xe, isEqual as Ce, upperFirst as Ye, startCase as Ze, cloneDeep as Ge, remove as Qe } from "lodash";
6
- import { escapeHtml as Je } from "@vue/shared";
7
- import { escapeHtml as ni } from "@vue/shared";
8
- import { installOpenApiClientInterceptors as et, isOpenApiError as tt } from "@signal24/openapi-client-codegen/browser";
1
+ var Be = Object.defineProperty;
2
+ var Ve = (e, t, n) => t in e ? Be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var E = (e, t, n) => Ve(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defineComponent as C, defineProps as Fe, defineEmits as _e, ref as b, computed as _, openBlock as d, createElementBlock as h, createElementVNode as w, toDisplayString as x, withDirectives as j, createCommentVNode as O, Fragment as U, renderList as J, vModelSelect as Re, getCurrentInstance as ee, onMounted as L, normalizeClass as k, normalizeStyle as Ne, withModifiers as te, renderSlot as K, reactive as Ke, h as W, Teleport as je, markRaw as Ue, onBeforeUnmount as ne, resolveDirective as we, createBlock as be, createSlots as We, withCtx as Y, createTextVNode as ae, vModelText as Pe, watch as ce, onActivated as Oe, onDeactivated as ke } from "vue";
5
+ import { compact as qe, debounce as ze, isEqual as Se, upperFirst as Xe, startCase as Ye, cloneDeep as Ze, remove as Ge } from "lodash";
6
+ import { escapeHtml as Qe } from "@vue/shared";
7
+ import { escapeHtml as ns } from "@vue/shared";
8
+ import { installOpenApiClientInterceptors as Je, isOpenApiError as et } from "@signal24/openapi-client-codegen/browser";
9
9
  import { format as G } from "date-fns";
10
- const nt = C({
10
+ const tt = C({
11
11
  setup() {
12
- const e = _e();
13
- Re(["update:modelValue"]);
14
- const t = b(null), n = _(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = b(e.modelValue ?? null);
15
- return { props: e, options: t, renderOptions: n, selectedItem: i };
12
+ const e = Fe();
13
+ _e(["update:modelValue"]);
14
+ const t = b(null), n = _(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), s = b(e.modelValue ?? null);
15
+ return { props: e, options: t, renderOptions: n, selectedItem: s };
16
16
  },
17
17
  watch: {
18
18
  loadFn() {
@@ -33,19 +33,19 @@ const nt = C({
33
33
  this.options = await this.props.loadFn();
34
34
  }
35
35
  }
36
- }), xe = (e, t) => {
36
+ }), Ce = (e, t) => {
37
37
  const n = e.__vccOpts || e;
38
- for (const [i, s] of t)
39
- n[i] = s;
38
+ for (const [s, i] of t)
39
+ n[s] = i;
40
40
  return n;
41
- }, it = {
41
+ }, nt = {
42
42
  key: 0,
43
43
  disabled: ""
44
44
  }, st = {
45
45
  key: 0,
46
46
  value: null
47
- }, ot = ["value"];
48
- function lt(e, t, n, i, s, o) {
47
+ }, it = ["value"];
48
+ function ot(e, t, n, s, i, o) {
49
49
  return e.renderOptions ? j((d(), h("select", {
50
50
  key: 1,
51
51
  "onUpdate:modelValue": t[0] || (t[0] = (r) => e.selectedItem = r)
@@ -56,27 +56,27 @@ function lt(e, t, n, i, s, o) {
56
56
  return d(), h("option", {
57
57
  key: l,
58
58
  value: (a = e.options) == null ? void 0 : a[l]
59
- }, x(r), 9, ot);
59
+ }, x(r), 9, it);
60
60
  }), 128))
61
61
  ], 512)), [
62
- [Ne, e.selectedItem]
63
- ]) : (d(), h("select", it, [
62
+ [Re, e.selectedItem]
63
+ ]) : (d(), h("select", nt, [
64
64
  w("option", null, x(e.props.loadingText || "Loading..."), 1)
65
65
  ]));
66
66
  }
67
- const Mn = /* @__PURE__ */ xe(nt, [["render", lt]]), rt = /* @__PURE__ */ C({
67
+ const Mn = /* @__PURE__ */ Ce(tt, [["render", ot]]), lt = /* @__PURE__ */ C({
68
68
  __name: "overlay-anchor",
69
69
  props: {
70
70
  overlayId: {},
71
71
  anchor: {}
72
72
  },
73
73
  setup(e) {
74
- const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, i = b({ visibility: "hidden", top: "0", left: "0" }), s = b([]), o = ee();
74
+ const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, s = b({ visibility: "hidden", top: "0", left: "0" }), i = b([]), o = ee();
75
75
  L(r);
76
76
  function r() {
77
77
  if (!o) return;
78
78
  const p = o.vnode.el, { styles: g, classes: m } = l(p, n);
79
- i.value = g, s.value = m;
79
+ s.value = g, i.value = m;
80
80
  }
81
81
  function l(p, g) {
82
82
  const m = t.anchor instanceof HTMLElement ? {} : t.anchor, v = g.getBoundingClientRect(), f = p.getBoundingClientRect();
@@ -106,34 +106,34 @@ const Mn = /* @__PURE__ */ xe(nt, [["render", lt]]), rt = /* @__PURE__ */ C({
106
106
  };
107
107
  }
108
108
  function a() {
109
- window.removeEventListener("click", a), dt(t.overlayId);
109
+ window.removeEventListener("click", a), ct(t.overlayId);
110
110
  }
111
111
  return L(() => {
112
112
  setTimeout(() => {
113
113
  window.addEventListener("click", a);
114
114
  }, 10);
115
115
  }), (p, g) => (d(), h("div", {
116
- class: k(["vf-overlay-anchor", s.value]),
117
- style: Ke(i.value),
116
+ class: k(["vf-overlay-anchor", i.value]),
117
+ style: Ne(s.value),
118
118
  onClick: te(a, ["stop"])
119
119
  }, [
120
120
  K(p.$slots, "default")
121
121
  ], 6));
122
122
  }
123
123
  });
124
- let at = 0;
125
- const S = je([]), In = C({
124
+ let rt = 0;
125
+ const S = Ke([]), In = C({
126
126
  setup() {
127
127
  return () => W("div", [
128
- J(S, (e) => W(Ue, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
128
+ J(S, (e) => W(je, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
129
129
  ]);
130
130
  }
131
131
  });
132
- function ie(e, t, n) {
133
- const i = document.getElementById("vf-overlay-target") ?? document.createElement("div");
134
- i.id = "vf-overlay-target", i.removeAttribute("inert"), document.body.appendChild(i);
135
- const s = String(++at), o = We(e), r = W(o, t), l = n != null && n.anchor ? W(rt, { overlayId: s, anchor: n.anchor }, () => [r]) : void 0, a = {
136
- id: s,
132
+ function se(e, t, n) {
133
+ const s = document.getElementById("vf-overlay-target") ?? document.createElement("div");
134
+ s.id = "vf-overlay-target", s.removeAttribute("inert"), document.body.appendChild(s);
135
+ const i = String(++rt), o = Ue(e), r = W(o, t), l = n != null && n.anchor ? W(lt, { overlayId: i, anchor: n.anchor }, () => [r]) : void 0, a = {
136
+ id: i,
137
137
  component: o,
138
138
  props: t,
139
139
  options: n ?? {},
@@ -143,18 +143,18 @@ function ie(e, t, n) {
143
143
  return S.push(a), a;
144
144
  }
145
145
  function Hn(e) {
146
- e.$ && Le(e.$);
146
+ e.$ && xe(e.$);
147
147
  }
148
- function Le(e) {
148
+ function xe(e) {
149
149
  let t = e;
150
- for (; t && !ct(t.vnode); )
150
+ for (; t && !at(t.vnode); )
151
151
  t = t.parent;
152
152
  }
153
- function ct(e) {
153
+ function at(e) {
154
154
  const t = S.findIndex((n) => n.vnode.component === e.component);
155
155
  return t >= 0 ? (S[t].props.callback(), !0) : !1;
156
156
  }
157
- function dt(e) {
157
+ function ct(e) {
158
158
  const t = S.findIndex((n) => n.id === e);
159
159
  return t >= 0 ? (S[t].props.callback(), !0) : !1;
160
160
  }
@@ -162,48 +162,53 @@ function P(e) {
162
162
  const t = S.indexOf(e);
163
163
  t >= 0 && S.splice(t, 1);
164
164
  }
165
- async function se(e, t, n) {
166
- return new Promise((i) => {
167
- let s = null;
165
+ async function ie(e, t, n) {
166
+ return new Promise((s) => {
167
+ let i = null;
168
168
  const r = { ...t, callback: async (l) => {
169
169
  if (n != null && n.onCallback) {
170
170
  const a = n.onCallback(l);
171
171
  if (typeof a == "object" && "then" in a && typeof a.then == "function" && await a === !1)
172
172
  return;
173
173
  }
174
- P(s), i(l);
174
+ P(i), s(l);
175
175
  } };
176
- s = ie(e, r, n);
176
+ i = se(e, r, n);
177
177
  });
178
178
  }
179
179
  function q(e, t) {
180
- return { title: t ? e : void 0, message: t ?? e };
180
+ return typeof e == "object" && !(e instanceof Error) ? {
181
+ ...e,
182
+ classes: e.classes ?? []
183
+ } : { title: t ? e : void 0, message: t ?? e, classes: [] };
181
184
  }
182
- async function de(e, t) {
183
- await se(X, q(e, t));
185
+ async function dt(e, t) {
186
+ await ie(X, q(e, t));
184
187
  }
185
188
  async function Dn(e, t) {
186
- return await se(X, {
187
- ...q(e, t),
189
+ const n = q(e, t);
190
+ return await ie(X, {
191
+ ...n,
188
192
  shouldConfirm: !0
189
193
  }) === !0;
190
194
  }
191
195
  async function An(e, t) {
192
- return await se(X, {
193
- ...q(e, t),
196
+ const n = q(e, t);
197
+ return await ie(X, {
198
+ ...n,
194
199
  shouldConfirm: !0,
195
- classes: ["destructive"]
200
+ classes: ["destructive", ...n.classes]
196
201
  }) === !0;
197
202
  }
198
203
  function $n(e, t) {
199
- const n = ie(X, {
200
- ...q(e, t),
204
+ const n = q(e, t), s = se(X, {
205
+ ...n,
201
206
  isBare: !0,
202
- classes: ["wait"],
207
+ classes: ["wait", ...n.classes],
203
208
  callback: () => {
204
209
  }
205
210
  });
206
- return () => P(n);
211
+ return () => P(s);
207
212
  }
208
213
  const M = {
209
214
  unhandledErrorSupportText: "please contact support",
@@ -231,7 +236,11 @@ function oe(e) {
231
236
  }
232
237
  async function Vn(e, t) {
233
238
  const n = oe(e);
234
- return n instanceof z || M.errorHandler(n), t ? de(t, n) : de(n);
239
+ return n instanceof z || M.errorHandler(n), dt({
240
+ title: t == null ? void 0 : t.title,
241
+ message: n,
242
+ classes: t == null ? void 0 : t.classes
243
+ });
235
244
  }
236
245
  async function Fn(e) {
237
246
  const t = oe(e);
@@ -239,48 +248,48 @@ async function Fn(e) {
239
248
  }
240
249
  const B = Symbol("MaskState");
241
250
  function _n(e, t) {
242
- var s;
243
- const n = (s = e.$) == null ? void 0 : s.vnode.el, i = n.closest(".vf-modal");
244
- return ht(i ?? n, t);
251
+ var i;
252
+ const n = (i = e.$) == null ? void 0 : i.vnode.el, s = n.closest(".vf-modal");
253
+ return ht(s ?? n, t);
245
254
  }
246
255
  function Rn(e) {
247
- var i;
248
- const t = (i = e.$) == null ? void 0 : i.vnode.el, n = t.closest(".vf-modal");
249
- return Me(n ?? t);
256
+ var s;
257
+ const t = (s = e.$) == null ? void 0 : s.vnode.el, n = t.closest(".vf-modal");
258
+ return Le(n ?? t);
250
259
  }
251
260
  function ht(e, t) {
252
261
  if (!e[B]) {
253
262
  const n = document.createElement("div");
254
263
  n.classList.add("vf-mask"), e.appendChild(n), e[B] = { maskEl: n };
255
264
  }
256
- return e[B].maskEl.innerText = t ?? "", () => Me(e);
265
+ return e[B].maskEl.innerText = t ?? "", () => Le(e);
257
266
  }
258
- function Me(e) {
267
+ function Le(e) {
259
268
  e[B] && e.removeChild(e[B].maskEl);
260
269
  }
261
270
  const Q = Symbol("FormMaskState");
262
271
  function ft(e, t, n) {
263
- const i = e instanceof Element ? e : He(e);
264
- if (!i) return () => {
272
+ const s = e instanceof Element ? e : Ie(e);
273
+ if (!s) return () => {
265
274
  };
266
- i.classList.add("vf-masked");
267
- const s = t instanceof Element ? t : i.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
275
+ s.classList.add("vf-masked");
276
+ const i = t instanceof Element ? t : s.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
268
277
  let o;
269
- s && (o = s.tagName === "INPUT" ? s.value : s.innerHTML, s.setAttribute("disabled", "disabled"), s.innerText = n ?? "Please wait...");
270
- const l = [...i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
271
- return l.forEach((a) => a.setAttribute("disabled", "disabled")), i[Q] = {
278
+ i && (o = i.tagName === "INPUT" ? i.value : i.innerHTML, i.setAttribute("disabled", "disabled"), i.innerText = n ?? "Please wait...");
279
+ const l = [...s.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
280
+ return l.forEach((a) => a.setAttribute("disabled", "disabled")), s[Q] = {
272
281
  disabledElements: l,
273
- waitButton: s,
282
+ waitButton: i,
274
283
  buttonHtml: o
275
- }, () => Ie(i);
284
+ }, () => Me(s);
276
285
  }
277
- function Ie(e) {
278
- const t = e instanceof Element ? e : He(e);
286
+ function Me(e) {
287
+ const t = e instanceof Element ? e : Ie(e);
279
288
  if (!t) return;
280
289
  const n = t[Q];
281
- n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((i) => i.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[Q]);
290
+ n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((s) => s.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[Q]);
282
291
  }
283
- function He(e) {
292
+ function Ie(e) {
284
293
  var n;
285
294
  const t = (n = e == null ? void 0 : e.$) == null ? void 0 : n.vnode.el;
286
295
  return t ? t.tagName === "FORM" ? t : t.querySelector("form") : null;
@@ -302,32 +311,32 @@ const pt = ["id"], mt = {
302
311
  },
303
312
  emits: ["formSubmit"],
304
313
  setup(e, { expose: t }) {
305
- const n = ee(), i = e;
314
+ const n = ee(), s = e;
306
315
  t({ mask: m, unmask: v, hide: f, unhide: u });
307
- const s = b(), o = b(), r = b(!1), l = _(() => ze([i.class, r.value && "hidden"]));
316
+ const i = b(), o = b(), r = b(!1), l = _(() => qe([s.class, r.value && "hidden"]));
308
317
  L(() => {
309
318
  var c;
310
- document.body.classList.add("vf-modal-open"), i.closeOnMaskClick && (window.addEventListener("keydown", p), (c = s.value) == null || c.addEventListener("click", a));
319
+ document.body.classList.add("vf-modal-open"), s.closeOnMaskClick && (window.addEventListener("keydown", p), (c = i.value) == null || c.addEventListener("click", a));
311
320
  }), ne(() => {
312
321
  window.removeEventListener("keydown", p), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
313
322
  });
314
323
  function a(c) {
315
- c.target == s.value && g();
324
+ c.target == i.value && g();
316
325
  }
317
326
  function p(c) {
318
327
  if (c.key === "Esc" || c.key === "Escape") {
319
328
  const T = document.querySelectorAll(".vf-modal-wrap");
320
- T[T.length - 1] === s.value && g();
329
+ T[T.length - 1] === i.value && g();
321
330
  }
322
331
  }
323
332
  function g() {
324
- Le(n);
333
+ xe(n);
325
334
  }
326
335
  function m() {
327
336
  return ft(o.value), () => v();
328
337
  }
329
338
  function v() {
330
- Ie(o.value);
339
+ Me(o.value);
331
340
  }
332
341
  function f() {
333
342
  return r.value = !0, () => u();
@@ -339,7 +348,7 @@ const pt = ["id"], mt = {
339
348
  id: c.id,
340
349
  class: k(["vf-overlay vf-modal-wrap", l.value]),
341
350
  ref_key: "overlay",
342
- ref: s
351
+ ref: i
343
352
  }, [
344
353
  w("form", {
345
354
  action: ".",
@@ -350,7 +359,7 @@ const pt = ["id"], mt = {
350
359
  }, [
351
360
  c.$slots.header ? (d(), h("div", mt, [
352
361
  K(c.$slots, "header"),
353
- i.closeX ? (d(), h("i", {
362
+ s.closeX ? (d(), h("i", {
354
363
  key: 0,
355
364
  class: "close",
356
365
  onClick: g
@@ -378,15 +387,15 @@ const pt = ["id"], mt = {
378
387
  },
379
388
  setup(e) {
380
389
  const t = e, n = _(() => t.message instanceof Error ? ut(t.message) : t.message);
381
- return (i, s) => {
382
- const o = be("autofocus");
383
- return d(), Oe(gt, {
384
- class: k(["vf-alert", i.classes])
385
- }, Pe({
390
+ return (s, i) => {
391
+ const o = we("autofocus");
392
+ return d(), be(gt, {
393
+ class: k(["vf-alert", s.classes])
394
+ }, We({
386
395
  default: Y(() => [
387
- i.isHtml ? (d(), h("div", {
396
+ s.isHtml ? (d(), h("div", {
388
397
  key: 0,
389
- innerHtml: i.message,
398
+ innerHtml: s.message,
390
399
  class: "user-message"
391
400
  }, null, 8, Et)) : (d(), h("div", {
392
401
  key: 1,
@@ -395,20 +404,20 @@ const pt = ["id"], mt = {
395
404
  ]),
396
405
  _: 2
397
406
  }, [
398
- i.title ? {
407
+ s.title ? {
399
408
  name: "header",
400
409
  fn: Y(() => [
401
- w("h1", null, x(i.title), 1)
410
+ w("h1", null, x(s.title), 1)
402
411
  ]),
403
412
  key: "0"
404
413
  } : void 0,
405
- i.isBare ? void 0 : {
414
+ s.isBare ? void 0 : {
406
415
  name: "footer",
407
416
  fn: Y(() => [
408
- i.shouldConfirm ? (d(), h(U, { key: 0 }, [
417
+ s.shouldConfirm ? (d(), h(U, { key: 0 }, [
409
418
  j((d(), h("button", {
410
419
  class: "primary",
411
- onClick: s[0] || (s[0] = () => i.callback(!0))
420
+ onClick: i[0] || (i[0] = () => s.callback(!0))
412
421
  }, [
413
422
  ae("Confirm")
414
423
  ])), [
@@ -416,12 +425,12 @@ const pt = ["id"], mt = {
416
425
  ]),
417
426
  w("button", {
418
427
  class: "default",
419
- onClick: s[1] || (s[1] = () => i.callback(!1))
428
+ onClick: i[1] || (i[1] = () => s.callback(!1))
420
429
  }, "Cancel")
421
430
  ], 64)) : j((d(), h("button", {
422
431
  key: 1,
423
432
  class: "default",
424
- onClick: s[2] || (s[2] = () => i.callback(!0))
433
+ onClick: i[2] || (i[2] = () => s.callback(!0))
425
434
  }, [
426
435
  ae("OK")
427
436
  ])), [
@@ -447,15 +456,15 @@ for (let e = 0; e < 256; ++e)
447
456
  function Ot(e, t = 0) {
448
457
  return y[e[t + 0]] + y[e[t + 1]] + y[e[t + 2]] + y[e[t + 3]] + "-" + y[e[t + 4]] + y[e[t + 5]] + "-" + y[e[t + 6]] + y[e[t + 7]] + "-" + y[e[t + 8]] + y[e[t + 9]] + "-" + y[e[t + 10]] + y[e[t + 11]] + y[e[t + 12]] + y[e[t + 13]] + y[e[t + 14]] + y[e[t + 15]];
449
458
  }
450
- const kt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ue = {
459
+ const kt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), de = {
451
460
  randomUUID: kt
452
461
  };
453
462
  function St(e, t, n) {
454
- if (ue.randomUUID && !t && !e)
455
- return ue.randomUUID();
463
+ if (de.randomUUID && !t && !e)
464
+ return de.randomUUID();
456
465
  e = e || {};
457
- const i = e.random || (e.rng || bt)();
458
- return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Ot(i);
466
+ const s = e.random || (e.rng || bt)();
467
+ return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, Ot(s);
459
468
  }
460
469
  function Nn(e) {
461
470
  return e.replace(/\n/g, "<br>");
@@ -473,7 +482,7 @@ function Lt(e, t = 1) {
473
482
  function Kn() {
474
483
  return St();
475
484
  }
476
- const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", It = {
485
+ const D = Symbol("null"), ue = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", It = {
477
486
  props: {
478
487
  modelValue: {
479
488
  type: null,
@@ -551,14 +560,14 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
551
560
  optionsDescriptors() {
552
561
  return this.allOptions.map((e, t) => {
553
562
  var l, a;
554
- const n = this.formatter(e), i = (l = this.subtitleFormatter) == null ? void 0 : l.call(this, e), s = n ? n.trim().toLowerCase() : "", o = i ? i.trim().toLowerCase() : "", r = [];
563
+ const n = this.formatter(e), s = (l = this.subtitleFormatter) == null ? void 0 : l.call(this, e), i = n ? n.trim().toLowerCase() : "", o = s ? s.trim().toLowerCase() : "", r = [];
555
564
  return this.searchFields ? this.searchFields.forEach((p) => {
556
565
  e[p] && r.push(String(e[p]).toLowerCase());
557
- }) : (r.push(s), o && r.push(o)), {
566
+ }) : (r.push(i), o && r.push(o)), {
558
567
  // eslint-disable-next-line vue/no-use-computed-property-like-method
559
568
  key: ((a = this.effectiveKeyExtractor) == null ? void 0 : a.call(this, e)) ?? String(t),
560
569
  title: n,
561
- subtitle: i,
570
+ subtitle: s,
562
571
  searchContent: r.join(""),
563
572
  ref: e
564
573
  };
@@ -569,17 +578,17 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
569
578
  if (this.isSearching) {
570
579
  const t = this.searchText.trim().toLowerCase();
571
580
  if (t.length) {
572
- e = e.filter((s) => s.searchContent.includes(t));
573
- const n = Je(this.searchText).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), i = new RegExp(`(${n})`, "ig");
574
- e = e.map((s) => {
581
+ e = e.filter((i) => i.searchContent.includes(t));
582
+ const n = Qe(this.searchText).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), s = new RegExp(`(${n})`, "ig");
583
+ e = e.map((i) => {
575
584
  var o;
576
585
  return {
577
- ...s,
578
- title: s.title.replace(i, "<mark>$1</mark>"),
579
- subtitle: (o = s.subtitle) == null ? void 0 : o.replace(i, "<mark>$1</mark>")
586
+ ...i,
587
+ title: i.title.replace(s, "<mark>$1</mark>"),
588
+ subtitle: (o = i.subtitle) == null ? void 0 : o.replace(s, "<mark>$1</mark>")
580
589
  };
581
590
  }), this.shouldShowCreateOption && (e.find((o) => o.searchContent === t) !== void 0 || e.push({
582
- key: he,
591
+ key: ue,
583
592
  title: "Create <strong>" + this.searchText.trim() + "</strong>..."
584
593
  }));
585
594
  }
@@ -619,7 +628,7 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
619
628
  "update:modelValue",
620
629
  this.selectedOption && this.valueExtractor ? this.valueExtractor(this.selectedOption) : this.selectedOption
621
630
  );
622
- }), this.remoteSearch && this.$watch("searchText", Xe(this.reloadOptionsIfSearching, 250));
631
+ }), this.remoteSearch && this.$watch("searchText", ze(this.reloadOptionsIfSearching, 250));
623
632
  },
624
633
  methods: {
625
634
  async loadRemoteOptions() {
@@ -673,11 +682,11 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
673
682
  return this.effectiveKeyExtractor ? this.effectiveKeyExtractor(this.selectedOption) : ((t = this.getOptionDescriptor(e)) == null ? void 0 : t.key) ?? "";
674
683
  },
675
684
  getOptionDescriptor(e) {
676
- const t = this.effectiveOptions.find((s) => s.ref === e);
685
+ const t = this.effectiveOptions.find((i) => i.ref === e);
677
686
  if (t)
678
687
  return t;
679
- const n = this.keyExtractor ? (s, o) => this.keyExtractor(s) === this.keyExtractor(o) : Ce, i = this.effectiveOptions.find((s) => n(s.ref, e));
680
- return i || null;
688
+ const n = this.keyExtractor ? (i, o) => this.keyExtractor(i) === this.keyExtractor(o) : Se, s = this.effectiveOptions.find((i) => n(i.ref, e));
689
+ return s || null;
681
690
  },
682
691
  handleInputBlurred() {
683
692
  this.debug || (!this.searchText.length && this.nullTitle && (this.selectedOption = null, this.selectedOptionTitle = null), this.shouldDisplayOptions = !1);
@@ -686,18 +695,18 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
686
695
  this.isLoaded || this.loadRemoteOptions(), this.optionsListId && this.$refs.optionsContainer.setAttribute("id", this.optionsListId), this.teleportOptionsContainer();
687
696
  },
688
697
  teleportOptionsContainer() {
689
- const e = this.$el.getBoundingClientRect(), t = e.y + e.height + 2, n = e.x, i = this.$refs.optionsContainer, s = window.getComputedStyle(this.$el);
690
- for (let o in s)
691
- /^(font|text)/.test(o) && (i.style[o] = s[o]);
692
- if (i.style.top = t + "px", i.style.left = n + "px", i.style.minWidth = e.width + "px", !s.maxHeight || s.maxHeight == "none") {
698
+ const e = this.$el.getBoundingClientRect(), t = e.y + e.height + 2, n = e.x, s = this.$refs.optionsContainer, i = window.getComputedStyle(this.$el);
699
+ for (let o in i)
700
+ /^(font|text)/.test(o) && (s.style[o] = i[o]);
701
+ if (s.style.top = t + "px", s.style.left = n + "px", s.style.minWidth = e.width + "px", !i.maxHeight || i.maxHeight == "none") {
693
702
  const o = window.innerHeight - t - 12;
694
- i.style.maxHeight = o + "px";
703
+ s.style.maxHeight = o + "px";
695
704
  }
696
- i.style.visibility = "visible", document.body.appendChild(i), setTimeout(this.highlightInitialOption, 0);
705
+ s.style.visibility = "visible", document.body.appendChild(s), setTimeout(this.highlightInitialOption, 0);
697
706
  },
698
707
  highlightInitialOption() {
699
708
  if (!this.isLoaded || !this.highlightedOptionKey) return;
700
- const e = this.effectiveOptions.findIndex((i) => i.key == this.highlightedOptionKey), t = this.$refs.optionsContainer, n = t.querySelectorAll(".option")[e];
709
+ const e = this.effectiveOptions.findIndex((s) => s.key == this.highlightedOptionKey), t = this.$refs.optionsContainer, n = t.querySelectorAll(".option")[e];
701
710
  t.scrollTop = n.offsetTop;
702
711
  },
703
712
  handleOptionHover(e) {
@@ -708,19 +717,19 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
708
717
  let n = t + e;
709
718
  if (n < 0 ? n = 0 : n >= this.effectiveOptions.length && (n = this.effectiveOptions.length - 1), t == n) return;
710
719
  this.highlightedOptionKey = this.effectiveOptions[n].key;
711
- const i = this.$refs.optionsContainer, s = i.querySelectorAll(".option")[n];
712
- s.offsetTop < i.scrollTop ? i.scrollTop = s.offsetTop : s.offsetTop + s.offsetHeight > i.scrollTop + i.clientHeight && (i.scrollTop = s.offsetTop + s.offsetHeight - i.clientHeight);
720
+ const s = this.$refs.optionsContainer, i = s.querySelectorAll(".option")[n];
721
+ i.offsetTop < s.scrollTop ? s.scrollTop = i.offsetTop : i.offsetTop + i.offsetHeight > s.scrollTop + s.clientHeight && (s.scrollTop = i.offsetTop + i.offsetHeight - s.clientHeight);
713
722
  },
714
723
  selectOption(e) {
715
724
  var t;
716
725
  if (this.isSearching = !1, e.key == D)
717
726
  this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null;
718
- else if (e.key === he) {
727
+ else if (e.key === ue) {
719
728
  const n = this.searchText.trim();
720
729
  this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null, (t = this.onCreateItem) == null || t.call(this, n);
721
730
  } else {
722
- const i = this.optionsDescriptors.find((s) => s.key == e.key).ref;
723
- this.selectedOption = i, this.selectedOptionTitle = this.formatter(i), this.searchText = this.selectedOptionTitle || "";
731
+ const s = this.optionsDescriptors.find((i) => i.key == e.key).ref;
732
+ this.selectedOption = s, this.selectedOptionTitle = this.formatter(s), this.searchText = this.selectedOptionTitle || "";
724
733
  }
725
734
  this.$refs.searchField.blur();
726
735
  },
@@ -742,8 +751,8 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
742
751
  key: 0,
743
752
  class: "no-results"
744
753
  };
745
- function _t(e, t, n, i, s, o) {
746
- const r = be("disabled");
754
+ function _t(e, t, n, s, i, o) {
755
+ const r = we("disabled");
747
756
  return d(), h("div", {
748
757
  class: k(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
749
758
  }, [
@@ -759,7 +768,7 @@ function _t(e, t, n, i, s, o) {
759
768
  required: n.required,
760
769
  "data-1p-ignore": ""
761
770
  }, null, 42, Ht), [
762
- [qe, e.searchText],
771
+ [Pe, e.searchText],
763
772
  [r, o.effectiveDisabled]
764
773
  ]),
765
774
  e.shouldDisplayOptions ? (d(), h("div", Dt, [
@@ -787,7 +796,7 @@ function _t(e, t, n, i, s, o) {
787
796
  ], 512)) : O("", !0)
788
797
  ], 2);
789
798
  }
790
- const Rt = /* @__PURE__ */ xe(It, [["render", _t]]), jn = /* @__PURE__ */ C({
799
+ const Rt = /* @__PURE__ */ Ce(It, [["render", _t]]), jn = /* @__PURE__ */ C({
791
800
  __name: "ez-smart-select",
792
801
  props: {
793
802
  modelValue: {},
@@ -798,26 +807,26 @@ const Rt = /* @__PURE__ */ xe(It, [["render", _t]]), jn = /* @__PURE__ */ C({
798
807
  },
799
808
  emits: ["update:modelValue"],
800
809
  setup(e, { emit: t }) {
801
- const n = e, i = _(() => Array.isArray(n.options) ? n.options.map((l) => ({ value: l, label: l })) : Object.entries(n.options).map(([l, a]) => ({
810
+ const n = e, s = _(() => Array.isArray(n.options) ? n.options.map((l) => ({ value: l, label: l })) : Object.entries(n.options).map(([l, a]) => ({
802
811
  value: l,
803
812
  label: a
804
- }))), s = _(() => n.formatter ? (l) => {
813
+ }))), i = _(() => n.formatter ? (l) => {
805
814
  var a;
806
815
  return (a = n.formatter) == null ? void 0 : a.call(n, l.label);
807
- } : (l) => l.label), o = t, r = b(i.value.find((l) => l.value === n.modelValue) ?? null);
816
+ } : (l) => l.label), o = t, r = b(s.value.find((l) => l.value === n.modelValue) ?? null);
808
817
  return ce(
809
818
  () => n.modelValue,
810
819
  (l) => {
811
- r.value = i.value.find((a) => a.value === l) ?? null;
820
+ r.value = s.value.find((a) => a.value === l) ?? null;
812
821
  }
813
822
  ), ce(r, (l) => {
814
823
  var a;
815
- o("update:modelValue", l ? ((a = i.value.find((p) => Ce(p, l))) == null ? void 0 : a.value) ?? null : null);
816
- }), (l, a) => (d(), Oe(Rt, {
824
+ o("update:modelValue", l ? ((a = s.value.find((p) => Se(p, l))) == null ? void 0 : a.value) ?? null : null);
825
+ }), (l, a) => (d(), be(Rt, {
817
826
  modelValue: r.value,
818
827
  "onUpdate:modelValue": a[0] || (a[0] = (p) => r.value = p),
819
- options: i.value,
820
- formatter: s.value,
828
+ options: s.value,
829
+ formatter: i.value,
821
830
  "null-title": l.nullTitle
822
831
  }, null, 8, ["modelValue", "options", "formatter", "null-title"]));
823
832
  }
@@ -842,26 +851,26 @@ const Rt = /* @__PURE__ */ xe(It, [["render", _t]]), jn = /* @__PURE__ */ C({
842
851
  function n() {
843
852
  t.onClick ? t.onClick() : t.disableClose || t.callback();
844
853
  }
845
- const i = b();
854
+ const s = b();
846
855
  return t.durationSecs !== null && L(() => {
847
856
  var o;
848
- const s = t.durationSecs ?? 5;
849
- (o = i.value) == null || o.animate([{ width: "0%" }, { width: "100%" }], {
850
- duration: s * 1e3,
857
+ const i = t.durationSecs ?? 5;
858
+ (o = s.value) == null || o.animate([{ width: "0%" }, { width: "100%" }], {
859
+ duration: i * 1e3,
851
860
  easing: "linear"
852
- }), setTimeout(() => t.callback(), s * 1e3);
853
- }), (s, o) => (d(), h("div", {
854
- class: k(["vf-toast", s.className]),
861
+ }), setTimeout(() => t.callback(), i * 1e3);
862
+ }), (i, o) => (d(), h("div", {
863
+ class: k(["vf-toast", i.className]),
855
864
  onClick: te(n, ["stop"])
856
865
  }, [
857
866
  w("div", Nt, [
858
- w("div", Kt, x(s.message), 1),
859
- s.disableClose ? O("", !0) : (d(), h("div", jt, "x"))
867
+ w("div", Kt, x(i.message), 1),
868
+ i.disableClose ? O("", !0) : (d(), h("div", jt, "x"))
860
869
  ]),
861
- s.durationSecs !== null ? (d(), h("div", Ut, [
870
+ i.durationSecs !== null ? (d(), h("div", Ut, [
862
871
  w("div", {
863
872
  ref_key: "progressInnerEl",
864
- ref: i,
873
+ ref: s,
865
874
  class: "inner"
866
875
  }, null, 512)
867
876
  ])) : O("", !0)
@@ -869,15 +878,15 @@ const Rt = /* @__PURE__ */ xe(It, [["render", _t]]), jn = /* @__PURE__ */ C({
869
878
  }
870
879
  });
871
880
  function Un(e) {
872
- const t = ie(Wt, {
881
+ const t = se(Wt, {
873
882
  ...e,
874
883
  callback: () => P(t)
875
884
  });
876
885
  return () => P(t);
877
886
  }
878
887
  function Pt(e) {
879
- const t = Math.floor(Math.log(e) / Math.log(1024)), i = (e / Math.pow(1024, t)).toFixed(2), s = ["B", "KB", "MB", "GB", "TB"][t];
880
- return `${i} ${s}`;
888
+ const t = Math.floor(Math.log(e) / Math.log(1024)), s = (e / Math.pow(1024, t)).toFixed(2), i = ["B", "KB", "MB", "GB", "TB"][t];
889
+ return `${s} ${i}`;
881
890
  }
882
891
  function qt(e) {
883
892
  return e != null && String(e).length ? e : "-";
@@ -892,10 +901,10 @@ function Yt(e) {
892
901
  return e && xt(e);
893
902
  }
894
903
  function Zt(e) {
895
- return e ? Ye(e) : null;
904
+ return e ? Xe(e) : null;
896
905
  }
897
906
  function Gt(e) {
898
- return e ? Ze(e) : null;
907
+ return e ? Ye(e) : null;
899
908
  }
900
909
  function Qt(e) {
901
910
  return e ? e.toUpperCase() : null;
@@ -906,7 +915,7 @@ function Jt(e) {
906
915
  function en(e, t = 1) {
907
916
  return Lt(e, t);
908
917
  }
909
- const fe = {
918
+ const he = {
910
919
  bytes: Pt,
911
920
  dash: qt,
912
921
  dashZeros: zt,
@@ -918,34 +927,34 @@ const fe = {
918
927
  desnake: Jt,
919
928
  usCurrency: en
920
929
  }, Wn = (e) => ({
921
- ...fe,
922
- ...e(fe)
930
+ ...he,
931
+ ...e(he)
923
932
  });
924
933
  function Pn(e, t, n) {
925
- const i = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
926
- return i === -1 ? !1 : (e.splice(i, 1, n), !0);
934
+ const s = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
935
+ return s === -1 ? !1 : (e.splice(s, 1, n), !0);
927
936
  }
928
937
  function qn(e, t) {
929
938
  const n = document.createElement("div");
930
939
  n.classList.add("vf-overlay"), n.addEventListener("click", m), document.body.appendChild(n);
931
- const i = document.createElement("div");
932
- i.classList.add("vf-context-menu"), i.style.position = "absolute", n.appendChild(i);
933
- const s = e.currentTarget;
934
- s.style.userSelect = "none", s.classList.add("context-menu-active"), t.targetClass && s.classList.add(t.targetClass), t.class && i.classList.add(t.class), t.items.forEach((f) => {
940
+ const s = document.createElement("div");
941
+ s.classList.add("vf-context-menu"), s.style.position = "absolute", n.appendChild(s);
942
+ const i = e.currentTarget;
943
+ i.style.userSelect = "none", i.classList.add("context-menu-active"), t.targetClass && i.classList.add(t.targetClass), t.class && s.classList.add(t.class), t.items.forEach((f) => {
935
944
  if (f == "-") {
936
945
  const c = document.createElement("div");
937
- c.classList.add("separator"), i.appendChild(c);
946
+ c.classList.add("separator"), s.appendChild(c);
938
947
  return;
939
948
  }
940
949
  const u = document.createElement("div");
941
- u.classList.add("item"), u.style.userSelect = "none", u.innerText = f.title, i.appendChild(u), f.class && u.classList.add(f.class), f.shouldConfirm ? u.addEventListener("click", (c) => v(c, u, f.handler)) : u.addEventListener("click", () => f.handler());
950
+ u.classList.add("item"), u.style.userSelect = "none", u.innerText = f.title, s.appendChild(u), f.class && u.classList.add(f.class), f.shouldConfirm ? u.addEventListener("click", (c) => v(c, u, f.handler)) : u.addEventListener("click", () => f.handler());
942
951
  });
943
- const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = i.offsetHeight, a = i.offsetWidth, p = o < a ? e.clientX - a - 1 : e.clientX + 1, g = r < l ? e.clientY - l - 1 : e.clientY + 1;
944
- i.style.left = p + "px", i.style.top = g + "px", setTimeout(() => {
945
- i.style.width = i.offsetWidth + "px";
952
+ const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = s.offsetHeight, a = s.offsetWidth, p = o < a ? e.clientX - a - 1 : e.clientX + 1, g = r < l ? e.clientY - l - 1 : e.clientY + 1;
953
+ s.style.left = p + "px", s.style.top = g + "px", setTimeout(() => {
954
+ s.style.width = s.offsetWidth + "px";
946
955
  }, 50);
947
956
  function m() {
948
- t.targetClass && s.classList.remove(t.targetClass), s.classList.remove("context-menu-active"), s.style.userSelect = "", n.remove();
957
+ t.targetClass && i.classList.remove(t.targetClass), i.classList.remove("context-menu-active"), i.style.userSelect = "", n.remove();
949
958
  }
950
959
  function v(f, u, c) {
951
960
  if (u.classList.contains("pending-confirm"))
@@ -963,54 +972,54 @@ function nn(e) {
963
972
  return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
964
973
  }
965
974
  function Xn(e, t) {
966
- return e != null ? Ge(e) : t;
975
+ return e != null ? Ze(e) : t;
967
976
  }
968
977
  function Yn(e, t) {
969
978
  const n = { ...e };
970
- for (const i of t)
971
- n[i] === "" && (n[i] = null);
979
+ for (const s of t)
980
+ n[s] === "" && (n[s] = null);
972
981
  return n;
973
982
  }
974
983
  function Zn(e) {
975
- et({
984
+ Je({
976
985
  ...e,
977
986
  onError(t, n) {
978
- var s;
979
- tt(t) && t.status === 422 && typeof t.body == "object" && "error" in t.body && (t = new z(t.body.error));
980
- const i = (s = e.onError) == null ? void 0 : s.call(e, t, n);
981
- return i !== void 0 ? i : t;
987
+ var i;
988
+ et(t) && t.status === 422 && typeof t.body == "object" && "error" in t.body && (t = new z(t.body.error));
989
+ const s = (i = e.onError) == null ? void 0 : i.call(e, t, n);
990
+ return s !== void 0 ? s : t;
982
991
  }
983
992
  });
984
993
  }
985
994
  const le = Symbol("HookState");
986
995
  function Gn(e, t) {
987
996
  const n = t ?? ee();
988
- L(() => sn(n, e), n), ke(() => on(n), n), Se(() => pe(n), n), ne(() => pe(n), n);
997
+ L(() => sn(n, e), n), Oe(() => on(n), n), ke(() => fe(n), n), ne(() => fe(n), n);
989
998
  }
990
999
  function sn(e, t) {
991
1000
  const n = {};
992
1001
  if (t.elScrolledToBottom && (n.el = new V(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
993
- const i = De(e.vnode.el);
994
- i ? n.ancestor = new V(i, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
1002
+ const s = He(e.vnode.el);
1003
+ s ? n.ancestor = new V(s, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
995
1004
  }
996
1005
  t.windowScrolledToBottom && (n.window = new V(window, t.windowScrolledToBottom)), e[le] = n;
997
1006
  }
998
1007
  function on(e) {
999
- var n, i, s;
1008
+ var n, s, i;
1000
1009
  const t = e[le];
1001
- (n = t == null ? void 0 : t.el) == null || n.install(), (i = t == null ? void 0 : t.ancestor) == null || i.install(), (s = t == null ? void 0 : t.window) == null || s.install();
1010
+ (n = t == null ? void 0 : t.el) == null || n.install(), (s = t == null ? void 0 : t.ancestor) == null || s.install(), (i = t == null ? void 0 : t.window) == null || i.install();
1002
1011
  }
1003
- function pe(e) {
1004
- var n, i, s;
1012
+ function fe(e) {
1013
+ var n, s, i;
1005
1014
  const t = e[le];
1006
- (n = t == null ? void 0 : t.el) == null || n.uninstall(), (i = t == null ? void 0 : t.ancestor) == null || i.uninstall(), (s = t == null ? void 0 : t.window) == null || s.uninstall();
1015
+ (n = t == null ? void 0 : t.el) == null || n.uninstall(), (s = t == null ? void 0 : t.ancestor) == null || s.uninstall(), (i = t == null ? void 0 : t.window) == null || i.uninstall();
1007
1016
  }
1008
1017
  const Z = ["auto", "scroll"];
1009
- function De(e) {
1018
+ function He(e) {
1010
1019
  const t = e.parentElement;
1011
1020
  if (!t) return null;
1012
1021
  const n = window.getComputedStyle(t);
1013
- return Z.includes(n.overflow) || Z.includes(n.overflowX) || Z.includes(n.overflowY) ? t : De(t);
1022
+ return Z.includes(n.overflow) || Z.includes(n.overflowX) || Z.includes(n.overflowY) ? t : He(t);
1014
1023
  }
1015
1024
  class V {
1016
1025
  constructor(t, n) {
@@ -1029,15 +1038,15 @@ class V {
1029
1038
  }
1030
1039
  }
1031
1040
  function Qn(e) {
1032
- L(() => window.addEventListener("resize", e)), ke(() => window.addEventListener("resize", e)), Se(() => window.removeEventListener("resize", e)), ne(() => window.removeEventListener("resize", e));
1041
+ L(() => window.addEventListener("resize", e)), Oe(() => window.addEventListener("resize", e)), ke(() => window.removeEventListener("resize", e)), ne(() => window.removeEventListener("resize", e));
1033
1042
  }
1034
1043
  const ln = {
1035
- mounted: ve,
1036
- updated: ve
1037
- }, me = Symbol("HasAutoFocused");
1038
- function ve(e, t) {
1039
- if (t.value === void 0 && e[me] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
1040
- e[me] = !0;
1044
+ mounted: me,
1045
+ updated: me
1046
+ }, pe = Symbol("HasAutoFocused");
1047
+ function me(e, t) {
1048
+ if (t.value === void 0 && e[pe] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
1049
+ e[pe] = !0;
1041
1050
  const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
1042
1051
  setTimeout(() => n.focus(), 10);
1043
1052
  }
@@ -1047,23 +1056,23 @@ const rn = {
1047
1056
  function an(e, t) {
1048
1057
  e.addEventListener("click", (n) => {
1049
1058
  var r, l;
1050
- const i = Date.now(), s = ((r = t.value) == null ? void 0 : r.text) !== void 0 ? t.value.text : "Confirm";
1059
+ const s = Date.now(), i = ((r = t.value) == null ? void 0 : r.text) !== void 0 ? t.value.text : "Confirm";
1051
1060
  if (e[A]) {
1052
- if (i - e[A].initTime < 300)
1061
+ if (s - e[A].initTime < 300)
1053
1062
  return;
1054
1063
  e[A].resetHandler(), e.dispatchEvent(new Event("confirm"));
1055
1064
  return;
1056
1065
  }
1057
1066
  n.preventDefault(), n.stopImmediatePropagation();
1058
1067
  const o = {
1059
- initTime: i,
1068
+ initTime: s,
1060
1069
  preconfirmHtml: e.innerHTML,
1061
1070
  resetHandler: () => {
1062
1071
  var a;
1063
- s && (e.innerHTML = o.preconfirmHtml), (a = t.value) != null && a.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", o.resetHandler), delete e[A];
1072
+ i && (e.innerHTML = o.preconfirmHtml), (a = t.value) != null && a.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", o.resetHandler), delete e[A];
1064
1073
  }
1065
1074
  };
1066
- e[A] = o, s && (e.innerHTML = s), (l = t.value) != null && l.class && e.classList.add(t.value.class), e.addEventListener("mouseout", o.resetHandler);
1075
+ e[A] = o, i && (e.innerHTML = i), (l = t.value) != null && l.class && e.classList.add(t.value.class), e.addEventListener("mouseout", o.resetHandler);
1067
1076
  });
1068
1077
  }
1069
1078
  const cn = {
@@ -1078,10 +1087,10 @@ function dn(e) {
1078
1087
  });
1079
1088
  }
1080
1089
  const un = {
1081
- beforeMount: ye,
1082
- updated: ye
1090
+ beforeMount: ve,
1091
+ updated: ve
1083
1092
  };
1084
- function ye(e, t) {
1093
+ function ve(e, t) {
1085
1094
  t.value == t.oldValue && e.innerHTML.length || (e.innerText = hn(e, t));
1086
1095
  }
1087
1096
  function hn(e, t) {
@@ -1089,7 +1098,7 @@ function hn(e, t) {
1089
1098
  if (!t.value)
1090
1099
  return ((a = e.attributes.getNamedItem("placeholder")) == null ? void 0 : a.value) ?? "";
1091
1100
  let n = "";
1092
- const i = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), s = e.attributes.getNamedItem("local") !== null ? i.replace(/Z$/, "") : i.replace(/(Z|\+00:00)?$/, "Z"), o = new Date(s);
1101
+ const s = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), i = e.attributes.getNamedItem("local") !== null ? s.replace(/Z$/, "") : s.replace(/(Z|\+00:00)?$/, "Z"), o = new Date(i);
1093
1102
  e.attributes.getNamedItem("display-utc") !== null && o.setMinutes(o.getMinutes() - o.getTimezoneOffset());
1094
1103
  let r = (p = e.attributes.getNamedItem("format")) == null ? void 0 : p.value;
1095
1104
  if (!r && e.attributes.getNamedItem("relative-date") !== null) {
@@ -1101,49 +1110,49 @@ function hn(e, t) {
1101
1110
  return n && (l = n + " " + l), l;
1102
1111
  }
1103
1112
  const fn = {
1104
- beforeMount: ge,
1105
- updated: ge,
1113
+ beforeMount: ye,
1114
+ updated: ye,
1106
1115
  unmounted: pn
1107
1116
  };
1108
- function ge(e, t) {
1117
+ function ye(e, t) {
1109
1118
  e.tagName === "LABEL" && (t.value ? e.classList.remove("disabled") : e.classList.add("disabled"), e = e.querySelector("input")), t.value ? e.setAttribute("disabled", "disabled") : e.removeAttribute("disabled");
1110
1119
  }
1111
1120
  function pn(e) {
1112
1121
  e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
1113
1122
  }
1114
1123
  const mn = {
1115
- beforeMount: Ee,
1116
- updated: Ee,
1117
- unmounted: $e
1124
+ beforeMount: ge,
1125
+ updated: ge,
1126
+ unmounted: Ae
1118
1127
  }, R = Symbol("HasAutoFocused"), re = [];
1119
1128
  function vn() {
1120
- re.forEach(Ae);
1129
+ re.forEach(De);
1121
1130
  }
1122
1131
  setInterval(vn, 1e3);
1123
- function Ee(e, t) {
1132
+ function ge(e, t) {
1124
1133
  var r;
1125
1134
  if (t.value == t.oldValue) return;
1126
- if (!t.value) return $e(e);
1127
- const n = new Date(t.value), i = (r = e.attributes.getNamedItem("base-time")) == null ? void 0 : r.value, s = n.getTime() - (i ? new Date(i).getTime() - t.value * 1e3 : 0), o = e.getAttribute("no-seconds") === null;
1135
+ if (!t.value) return Ae(e);
1136
+ const n = new Date(t.value), s = (r = e.attributes.getNamedItem("base-time")) == null ? void 0 : r.value, i = n.getTime() - (s ? new Date(s).getTime() - t.value * 1e3 : 0), o = e.getAttribute("no-seconds") === null;
1128
1137
  e[R] || re.push(e), e[R] = {
1129
- startTs: s,
1138
+ startTs: i,
1130
1139
  includeSeconds: o
1131
- }, Ae(e);
1140
+ }, De(e);
1132
1141
  }
1133
- function Ae(e) {
1142
+ function De(e) {
1134
1143
  const t = e[R], n = Math.round((Date.now() - t.startTs) / 1e3);
1135
1144
  e.innerText = yn(n, t.includeSeconds);
1136
1145
  }
1137
- function $e(e) {
1138
- e[R] && (Qe(re, e), delete e[R]), e.innerText = "-";
1146
+ function Ae(e) {
1147
+ e[R] && (Ge(re, e), delete e[R]), e.innerText = "-";
1139
1148
  }
1140
1149
  function yn(e, t) {
1141
- const n = [], i = Math.floor(e / 86400);
1142
- i && n.push(i + "d"), e -= i * 86400;
1143
- const s = Math.floor(e / 3600);
1144
- (i || s) && n.push(s + "h"), e -= s * 3600;
1150
+ const n = [], s = Math.floor(e / 86400);
1151
+ s && n.push(s + "d"), e -= s * 86400;
1152
+ const i = Math.floor(e / 3600);
1153
+ (s || i) && n.push(i + "h"), e -= i * 3600;
1145
1154
  const o = Math.floor(e / 60);
1146
- return (i || s || o) && n.push(o + "m"), t ? n.length || n.push("0m") : (e -= o * 60, n.push(e + "s")), n.join(" ");
1155
+ return (s || i || o) && n.push(o + "m"), t ? n.length || n.push("0m") : (e -= o * 60, n.push(e + "s")), n.join(" ");
1147
1156
  }
1148
1157
  const $ = Symbol("InfiniteScrollHandler"), gn = {
1149
1158
  mounted(e, t) {
@@ -1158,30 +1167,30 @@ const $ = Symbol("InfiniteScrollHandler"), gn = {
1158
1167
  (t = e[$]) == null || t.uninstall(), delete e[$];
1159
1168
  }
1160
1169
  }, En = {
1161
- beforeMount: Te,
1162
- updated: Te
1170
+ beforeMount: Ee,
1171
+ updated: Ee
1163
1172
  };
1164
- function Te(e, t) {
1173
+ function Ee(e, t) {
1165
1174
  e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
1166
1175
  }
1167
1176
  const Tn = {
1168
- mounted: we,
1169
- updated: we,
1170
- unmounted: Be
1177
+ mounted: Te,
1178
+ updated: Te,
1179
+ unmounted: $e
1171
1180
  }, F = Symbol("TooltipState");
1172
- function we(e, t) {
1173
- var i;
1174
- let n = ((i = e.attributes.getNamedItem("tip")) == null ? void 0 : i.value) ?? t.value;
1181
+ function Te(e, t) {
1182
+ var s;
1183
+ let n = ((s = e.attributes.getNamedItem("tip")) == null ? void 0 : s.value) ?? t.value;
1175
1184
  if (t.value || (n = null), n) {
1176
- const s = {
1185
+ const i = {
1177
1186
  content: n,
1178
1187
  html: e.getAttribute("html") !== null
1179
1188
  };
1180
- e[F] ? e[F].configure(s) : e[F] = new wn(e, s);
1189
+ e[F] ? e[F].configure(i) : e[F] = new wn(e, i);
1181
1190
  } else
1182
- Be(e);
1191
+ $e(e);
1183
1192
  }
1184
- function Be(e) {
1193
+ function $e(e) {
1185
1194
  var t;
1186
1195
  (t = e[F]) == null || t.destroy(), delete e[F];
1187
1196
  }
@@ -1221,9 +1230,9 @@ class wn {
1221
1230
  this.shouldShow || this.tipEl && (this.tipEl.remove(), this.tipEl = void 0, this.titleEl = void 0, this.contentEl = void 0, this.checkInterval && (clearInterval(this.checkInterval), this.checkInterval = void 0), window.removeEventListener("mousemove", this.handleMouseMoveWithContext), this.mouseMoveBound = !1);
1222
1231
  }
1223
1232
  handleMouseMove(t) {
1224
- const n = this.tipEl.offsetWidth, i = this.tipEl.offsetHeight, s = window.innerWidth, o = window.innerHeight;
1233
+ const n = this.tipEl.offsetWidth, s = this.tipEl.offsetHeight, i = window.innerWidth, o = window.innerHeight;
1225
1234
  let r = t.pageX + 10, l = t.pageY + 20;
1226
- r + n > s && (r = t.pageX - 5 - n), l + i > o && (l = t.pageY - 5 - i), this.tipEl.style.left = r + "px", this.tipEl.style.top = l + "px", this.lastMoveEvt = t;
1235
+ r + n > i && (r = t.pageX - 5 - n), l + s > o && (l = t.pageY - 5 - s), this.tipEl.style.left = r + "px", this.tipEl.style.top = l + "px", this.lastMoveEvt = t;
1227
1236
  }
1228
1237
  checkMoveEvent() {
1229
1238
  var t;
@@ -1250,13 +1259,13 @@ export {
1250
1259
  Xn as cloneProp,
1251
1260
  Bn as configureVf,
1252
1261
  Wn as createFilters,
1253
- ie as createOverlayInjection,
1262
+ se as createOverlayInjection,
1254
1263
  Ct as desnakeCase,
1255
- dt as dismissOverlayInjectionById,
1264
+ ct as dismissOverlayInjectionById,
1256
1265
  Hn as dismissOverlayInjectionByInstance,
1257
- Le as dismissOverlayInjectionByInternalInstance,
1258
- ct as dismissOverlayInjectionByVnode,
1259
- ni as escapeHtml,
1266
+ xe as dismissOverlayInjectionByInternalInstance,
1267
+ at as dismissOverlayInjectionByVnode,
1268
+ ns as escapeHtml,
1260
1269
  ut as formatError,
1261
1270
  nn as formatNumber,
1262
1271
  xt as formatPhone,
@@ -1270,10 +1279,10 @@ export {
1270
1279
  ft as maskForm,
1271
1280
  Nn as nl2br,
1272
1281
  Yn as nullifyEmptyInputs,
1273
- se as presentOverlay,
1282
+ ie as presentOverlay,
1274
1283
  P as removeOverlayInjection,
1275
1284
  Pn as replaceElement,
1276
- de as showAlert,
1285
+ dt as showAlert,
1277
1286
  Dn as showConfirm,
1278
1287
  An as showConfirmDestroy,
1279
1288
  qn as showContextMenu,
@@ -1283,8 +1292,8 @@ export {
1283
1292
  zn as sleepSecs,
1284
1293
  oe as toError,
1285
1294
  Rn as unmaskComponent,
1286
- Me as unmaskEl,
1287
- Ie as unmaskForm,
1295
+ Le as unmaskEl,
1296
+ Me as unmaskForm,
1288
1297
  Gn as useInfiniteScroll,
1289
1298
  Qn as useResizeWatcher,
1290
1299
  Kn as uuid
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signal24/vue-foundation",
3
3
  "type": "module",
4
- "version": "4.14.1",
4
+ "version": "4.15.0",
5
5
  "description": "Common components, directives, and helpers for Vue 3 apps",
6
6
  "module": "./dist/vue-foundation.es.js",
7
7
  "exports": {
@@ -1,23 +1,37 @@
1
1
  import AlertModal from './alert-modal.vue';
2
2
  import { createOverlayInjection, presentOverlay, removeOverlayInjection } from './overlay-container';
3
3
 
4
- function resolveAlertParams(titleOrMessage: string | Error, message?: string | Error) {
5
- const title = message ? (titleOrMessage as string) : undefined;
6
- const resolvedMessage = message ?? titleOrMessage;
7
- return { title, message: resolvedMessage };
4
+ interface IAlertOptions {
5
+ title?: string;
6
+ message: string | Error;
7
+ classes?: string[];
8
+ }
9
+
10
+ function resolveAlertParams(arg0: string | Error | IAlertOptions, arg1?: string | Error) {
11
+ if (typeof arg0 === 'object' && !(arg0 instanceof Error)) {
12
+ return {
13
+ ...arg0,
14
+ classes: arg0.classes ?? []
15
+ };
16
+ }
17
+ const title = arg1 ? (arg0 as string) : undefined;
18
+ return { title, message: arg1 ?? arg0, classes: [] };
8
19
  }
9
20
 
10
21
  export async function showAlert(title: string, message: string | Error): Promise<void>;
11
22
  export async function showAlert(message: string | Error): Promise<void>;
12
- export async function showAlert(titleOrMessage: string | Error, message?: string | Error): Promise<void> {
13
- await presentOverlay(AlertModal, resolveAlertParams(titleOrMessage, message));
23
+ export async function showAlert(options: IAlertOptions): Promise<void>;
24
+ export async function showAlert(arg0: string | Error | IAlertOptions, arg1?: string | Error): Promise<void> {
25
+ await presentOverlay(AlertModal, resolveAlertParams(arg0, arg1));
14
26
  }
15
27
 
16
28
  export async function showConfirm(title: string, message: string): Promise<boolean>;
17
29
  export async function showConfirm(message: string): Promise<boolean>;
18
- export async function showConfirm(titleOrMessage: string, message?: string): Promise<boolean> {
30
+ export async function showConfirm(options: IAlertOptions): Promise<boolean>;
31
+ export async function showConfirm(arg0: string | IAlertOptions, arg1?: string): Promise<boolean> {
32
+ const params = resolveAlertParams(arg0, arg1);
19
33
  const result = await presentOverlay(AlertModal, {
20
- ...resolveAlertParams(titleOrMessage, message),
34
+ ...params,
21
35
  shouldConfirm: true
22
36
  });
23
37
  return result === true;
@@ -25,22 +39,26 @@ export async function showConfirm(titleOrMessage: string, message?: string): Pro
25
39
 
26
40
  export async function showConfirmDestroy(title: string, message: string): Promise<boolean>;
27
41
  export async function showConfirmDestroy(message: string): Promise<boolean>;
28
- export async function showConfirmDestroy(titleOrMessage: string, message?: string): Promise<boolean> {
42
+ export async function showConfirmDestroy(options: IAlertOptions): Promise<boolean>;
43
+ export async function showConfirmDestroy(arg0: string | IAlertOptions, arg1?: string): Promise<boolean> {
44
+ const params = resolveAlertParams(arg0, arg1);
29
45
  const result = await presentOverlay(AlertModal, {
30
- ...resolveAlertParams(titleOrMessage, message),
46
+ ...params,
31
47
  shouldConfirm: true,
32
- classes: ['destructive']
48
+ classes: ['destructive', ...params.classes]
33
49
  });
34
50
  return result === true;
35
51
  }
36
52
 
37
53
  export function showWait(title: string, message: string): () => void;
38
54
  export function showWait(message: string): () => void;
39
- export function showWait(titleOrMessage: string, message?: string): () => void {
55
+ export function showWait(options: IAlertOptions): () => void;
56
+ export function showWait(arg0: string | IAlertOptions, arg1?: string): () => void {
57
+ const params = resolveAlertParams(arg0, arg1);
40
58
  const injection = createOverlayInjection(AlertModal, {
41
- ...resolveAlertParams(titleOrMessage, message),
59
+ ...params,
42
60
  isBare: true,
43
- classes: ['wait'],
61
+ classes: ['wait', ...params.classes],
44
62
  callback: () => {}
45
63
  });
46
64
  return () => removeOverlayInjection(injection);
@@ -21,14 +21,22 @@ export function toError(err: any) {
21
21
  return err instanceof Error ? err : new Error(String(err));
22
22
  }
23
23
 
24
- export async function handleErrorAndAlert(errIn: any, alertTitle?: string) {
24
+ interface IErrorAlertOptions {
25
+ title?: string;
26
+ classes?: string[];
27
+ }
28
+ export async function handleErrorAndAlert(errIn: any, options?: IErrorAlertOptions) {
25
29
  const err = toError(errIn);
26
30
 
27
31
  if (!(err instanceof UserError)) {
28
32
  VfOptions.errorHandler(err);
29
33
  }
30
34
 
31
- return alertTitle ? showAlert(alertTitle, err) : showAlert(err);
35
+ return showAlert({
36
+ title: options?.title,
37
+ message: err,
38
+ classes: options?.classes
39
+ });
32
40
  }
33
41
 
34
42
  export async function handleError(errIn: any) {