@signal24/vue-foundation 4.29.1 → 4.29.2

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 +1 @@
1
- .vf-overlay-anchor{position:absolute;z-index:100}.vf-overlay{position:fixed;top:0;left:0;width:100%;height:100%;z-index:100}.vf-overlay.hidden{display:none}.vf-modal-wrap{background:#00000040;display:flex;justify-content:center;align-items:center}.vf-modal{background:#fff;box-shadow:0 3px 6px #00000026;min-width:200px;max-width:95%;max-height:95%;display:flex;flex-direction:column}.vf-modal-header,.vf-modal-footer{flex-shrink:0;position:relative}.vf-modal.scrolls>.vf-modal-content{overflow:auto;flex-grow:1;flex-shrink:1;flex-basis:0%}.vf-modal-wrap.vf-alert .vf-modal{max-width:800px}.vf-modal-wrap.vf-alert .vf-modal>.vf-modal-content{padding:12px}.vf-modal-wrap.vf-alert.wait .vf-modal-content{text-align:center}.vf-modal-wrap.vf-alert.wait .vf-alert-icon{margin-bottom:12px}.vf-modal-wrap.vf-alert.destructive button.primary{color:red}.vf-smart-select{position:relative}.vf-smart-select input{width:100%;padding-right:24px!important}.vf-smart-select input.nullable::placeholder{color:#000}.vf-smart-select:after{content:" ";display:block;position:absolute;top:50%;right:8px;margin-top:-3px;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#333333 transparent transparent transparent;pointer-events:none}.vf-smart-select.open:after{margin-top:-4px;border-width:0 5px 5px 5px;border-color:transparent transparent #333333 transparent}.vf-smart-select:not(.disabled) input{cursor:pointer}.vf-smart-select.disabled:after{opacity:.4}.vf-smart-select-options{visibility:hidden;position:absolute;min-height:20px;border:1px solid #e8e8e8;background:#fff;overflow:auto;z-index:101}.vf-smart-select-options .group-title{padding:5px 8px;color:#999}.vf-smart-select-options .option,.vf-smart-select-options .no-results{padding:5px 8px}.vf-smart-select-options .option{cursor:pointer}.vf-smart-select-options .option.highlighted{background-color:#f5f5f5}.vf-toast{position:absolute;bottom:50px;left:50%;transform:translate(-50%)}.vf-toast .content{display:flex;align-items:center}
1
+ .vf-overlay-anchor{position:absolute;z-index:100}.vf-overlay{position:fixed;top:0;left:0;width:100%;height:100%;z-index:100}.vf-overlay.hidden{display:none}.vf-modal-wrap{background:#00000040;display:flex;justify-content:center;align-items:center}.vf-modal{background:#fff;box-shadow:0 3px 6px #00000026;min-width:200px;max-width:95%;max-height:95%;display:flex;flex-direction:column}.vf-modal-header,.vf-modal-footer{flex-shrink:0;position:relative}.vf-modal.scrolls>.vf-modal-content{overflow:auto;flex-grow:1;flex-shrink:1;flex-basis:0%}.vf-modal-wrap.vf-alert .vf-modal{max-width:800px}.vf-modal-wrap.vf-alert .vf-modal>.vf-modal-content{padding:12px}.vf-modal-wrap.vf-alert.wait .vf-modal-content{text-align:center}.vf-modal-wrap.vf-alert.wait .vf-alert-icon{margin-bottom:12px}.vf-modal-wrap.vf-alert.destructive button.primary{color:red}.vf-smart-select{position:relative}.vf-smart-select input{width:100%;padding-right:24px!important}.vf-smart-select input.nullable::placeholder{color:#000}.vf-smart-select:after{content:" ";display:block;position:absolute;top:50%;right:8px;margin-top:-3px;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#333333 transparent transparent transparent;pointer-events:none}.vf-smart-select.open:after{margin-top:-4px;border-width:0 5px 5px 5px;border-color:transparent transparent #333333 transparent}.vf-smart-select:not(.disabled) input{cursor:pointer}.vf-smart-select.disabled:after{opacity:.4}.vf-smart-select-options{visibility:hidden;position:absolute;min-height:20px;border:1px solid #e8e8e8;background:#fff;overflow:auto;z-index:101}.vf-smart-select-options .group-title{padding:5px 8px;color:#999}.vf-smart-select-options .option,.vf-smart-select-options .no-results{padding:5px 8px}.vf-smart-select-options .option{cursor:pointer}.vf-smart-select-options .option.highlighted{background-color:#f5f5f5}.vf-toast{position:absolute;left:50%;transform:translate(-50%)}.vf-toast.bottom{bottom:50px}.vf-toast.top{top:50px}.vf-toast .content{display:flex;align-items:center}
@@ -2,7 +2,7 @@ import { defineComponent as N, ref as S, computed as T, watch as I, onMounted as
2
2
  import { compact as tt, cloneDeep as Wt, uniq as jt, groupBy as Ut, isEqual as we, debounce as Pt, startCase as qt, upperFirst as zt, remove as Kt, last as Yt } from "lodash";
3
3
  import { configureOpenApiClient as Xt, OpenApiError as Zt } from "@signal24/openapi-client-codegen";
4
4
  import { escapeHtml as Gt } from "@vue/shared";
5
- import { escapeHtml as vs } from "@vue/shared";
5
+ import { escapeHtml as ps } from "@vue/shared";
6
6
  import { format as U, addDays as Jt, parse as Qt } from "date-fns";
7
7
  const en = {
8
8
  key: 0,
@@ -23,8 +23,8 @@ const en = {
23
23
  emits: ["update:modelValue"],
24
24
  setup(e, { emit: t }) {
25
25
  const n = e, o = t, l = S(null), s = T(() => l.value ? l.value.map((d) => {
26
- const g = d;
27
- return n.preprocesor ? n.preprocesor(g) : n.displayKey ? g[n.displayKey] : "";
26
+ const E = d;
27
+ return n.preprocesor ? n.preprocesor(E) : n.displayKey ? E[n.displayKey] : "";
28
28
  }) : null), u = S(n.modelValue ?? null);
29
29
  I(() => n.loadFn, r), I(
30
30
  () => n.modelValue,
@@ -35,13 +35,13 @@ const en = {
35
35
  }
36
36
  return _(r), (c, d) => s.value ? ie((b(), k("select", {
37
37
  key: 1,
38
- "onUpdate:modelValue": d[0] || (d[0] = (g) => u.value = g)
38
+ "onUpdate:modelValue": d[0] || (d[0] = (E) => u.value = E)
39
39
  }, [
40
40
  n.nullText ? (b(), k("option", tn, R(n.nullText), 1)) : V("", !0),
41
- (b(!0), k(le, null, re(s.value, (g, h) => (b(), k("option", {
41
+ (b(!0), k(le, null, re(s.value, (E, h) => (b(), k("option", {
42
42
  key: h,
43
43
  value: l.value?.[h]
44
- }, R(g), 9, nn))), 128))
44
+ }, R(E), 9, nn))), 128))
45
45
  ], 512)), [
46
46
  [Vt, u.value]
47
47
  ]) : (b(), k("select", en, [
@@ -69,25 +69,25 @@ const on = /* @__PURE__ */ N({
69
69
  _(u);
70
70
  function u() {
71
71
  if (!s) return;
72
- const d = s.vnode.el, { styles: g, classes: h } = r(d, n);
73
- o.value = g, l.value = h;
72
+ const d = s.vnode.el, { styles: E, classes: h } = r(d, n);
73
+ o.value = E, l.value = h;
74
74
  }
75
- function r(d, g) {
76
- const h = t.anchor instanceof HTMLElement ? {} : t.anchor, w = g.getBoundingClientRect(), a = d.getBoundingClientRect();
77
- h.matchWidth && (a.width = w.width), h.matchHeight && (a.height = w.height);
75
+ function r(d, E) {
76
+ const h = t.anchor instanceof HTMLElement ? {} : t.anchor, g = E.getBoundingClientRect(), a = d.getBoundingClientRect();
77
+ h.matchWidth && (a.width = g.width), h.matchHeight && (a.height = g.height);
78
78
  const f = h.class ? Array.isArray(h.class) ? h.class : [h.class] : [];
79
79
  let m, C;
80
80
  if (h.y === "center")
81
- m = w.top + w.height / 2 - a.height / 2, f.push("anchored-center-y");
81
+ m = g.top + g.height / 2 - a.height / 2, f.push("anchored-center-y");
82
82
  else {
83
- const B = (w.bottom + a.height < window.innerHeight || h.y === "below") && h.y !== "above";
84
- m = B ? w.bottom : w.top - a.height, f.push(B ? "anchored-top" : "anchored-bottom");
83
+ const B = (g.bottom + a.height < window.innerHeight || h.y === "below") && h.y !== "above";
84
+ m = B ? g.bottom : g.top - a.height, f.push(B ? "anchored-top" : "anchored-bottom");
85
85
  }
86
86
  if (h.x === "center")
87
- C = w.left + w.width / 2 - a.width / 2, f.push("anchored-center-x");
87
+ C = g.left + g.width / 2 - a.width / 2, f.push("anchored-center-x");
88
88
  else {
89
- const B = (w.left + a.width < window.innerWidth || h.x === "left") && h.x !== "right";
90
- C = B ? w.left : w.right - a.width, f.push(B ? "anchored-left" : "anchored-right");
89
+ const B = (g.left + a.width < window.innerWidth || h.x === "left") && h.x !== "right";
90
+ C = B ? g.left : g.right - a.width, f.push(B ? "anchored-left" : "anchored-right");
91
91
  }
92
92
  return {
93
93
  styles: {
@@ -106,7 +106,7 @@ const on = /* @__PURE__ */ N({
106
106
  setTimeout(() => {
107
107
  window.addEventListener("click", c);
108
108
  }, 10);
109
- }), (d, g) => (b(), k("div", {
109
+ }), (d, E) => (b(), k("div", {
110
110
  class: H(["vf-overlay-anchor", l.value]),
111
111
  style: Ht(o.value),
112
112
  onClick: ke(c, ["stop"])
@@ -278,7 +278,7 @@ function ot(e) {
278
278
  e[Z] && e.removeChild(e[Z].maskEl);
279
279
  }
280
280
  const Ee = Symbol("FormMaskState");
281
- function vn(e, t, n) {
281
+ function pn(e, t, n) {
282
282
  const o = e instanceof Element ? e : it(e);
283
283
  if (!o) return () => {
284
284
  };
@@ -303,7 +303,7 @@ function it(e) {
303
303
  const t = e?.$?.vnode.el;
304
304
  return t ? t.tagName === "FORM" ? t : t.querySelector("form") : null;
305
305
  }
306
- const pn = ["id"], mn = {
306
+ const vn = ["id"], mn = {
307
307
  key: 0,
308
308
  class: "vf-modal-header"
309
309
  }, hn = { class: "vf-modal-content" }, yn = {
@@ -321,7 +321,7 @@ const pn = ["id"], mn = {
321
321
  emits: ["formSubmit"],
322
322
  setup(e, { expose: t }) {
323
323
  const n = be(), o = e;
324
- t({ mask: h, unmask: w, hide: a, unhide: f });
324
+ t({ mask: h, unmask: g, hide: a, unhide: f });
325
325
  const l = S(), s = S(), u = S(!1), r = T(() => tt([...Array.isArray(o.class) ? o.class : [o.class], u.value && "hidden"]));
326
326
  _(() => {
327
327
  document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", d), l.value?.addEventListener("click", c));
@@ -329,21 +329,21 @@ const pn = ["id"], mn = {
329
329
  window.removeEventListener("keydown", d), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
330
330
  });
331
331
  function c(m) {
332
- m.target == l.value && g();
332
+ m.target == l.value && E();
333
333
  }
334
334
  function d(m) {
335
335
  if (m.key === "Esc" || m.key === "Escape") {
336
336
  const C = document.querySelectorAll(".vf-modal-wrap");
337
- C[C.length - 1] === l.value && g();
337
+ C[C.length - 1] === l.value && E();
338
338
  }
339
339
  }
340
- function g() {
340
+ function E() {
341
341
  nt(n);
342
342
  }
343
343
  function h() {
344
- return vn(s.value), () => w();
344
+ return pn(s.value), () => g();
345
345
  }
346
- function w() {
346
+ function g() {
347
347
  st(s.value);
348
348
  }
349
349
  function a() {
@@ -370,7 +370,7 @@ const pn = ["id"], mn = {
370
370
  o.closeX ? (b(), k("i", {
371
371
  key: 0,
372
372
  class: "close",
373
- onClick: g
373
+ onClick: E
374
374
  })) : V("", !0)
375
375
  ])) : V("", !0),
376
376
  $("div", hn, [
@@ -380,7 +380,7 @@ const pn = ["id"], mn = {
380
380
  W(m.$slots, "footer")
381
381
  ])) : V("", !0)
382
382
  ], 34)
383
- ], 10, pn));
383
+ ], 10, vn));
384
384
  }
385
385
  }), wn = ["innerHtml"], En = ["innerText"], ne = /* @__PURE__ */ N({
386
386
  __name: "vf-alert-modal",
@@ -473,16 +473,16 @@ function Go(e, t) {
473
473
  return;
474
474
  }
475
475
  const f = document.createElement("div");
476
- f.classList.add("item"), f.style.userSelect = "none", f.innerText = a.title, o.appendChild(f), a.class && f.classList.add(a.class), a.shouldConfirm ? f.addEventListener("click", (m) => w(m, f, a.handler)) : f.addEventListener("click", () => a.handler());
476
+ f.classList.add("item"), f.style.userSelect = "none", f.innerText = a.title, o.appendChild(f), a.class && f.classList.add(a.class), a.shouldConfirm ? f.addEventListener("click", (m) => g(m, f, a.handler)) : f.addEventListener("click", () => a.handler());
477
477
  });
478
- const s = window.innerWidth - e.clientX, u = window.innerHeight - e.clientY, r = o.offsetHeight, c = o.offsetWidth, d = s < c ? e.clientX - c - 1 : e.clientX + 1, g = u < r ? e.clientY - r - 1 : e.clientY + 1;
479
- o.style.left = d + "px", o.style.top = g + "px", setTimeout(() => {
478
+ const s = window.innerWidth - e.clientX, u = window.innerHeight - e.clientY, r = o.offsetHeight, c = o.offsetWidth, d = s < c ? e.clientX - c - 1 : e.clientX + 1, E = u < r ? e.clientY - r - 1 : e.clientY + 1;
479
+ o.style.left = d + "px", o.style.top = E + "px", setTimeout(() => {
480
480
  o.style.width = o.offsetWidth + "px";
481
481
  }, 50);
482
482
  function h() {
483
483
  t.targetClass && l.classList.remove(t.targetClass), l.classList.remove("context-menu-active"), l.style.userSelect = "", n.remove();
484
484
  }
485
- function w(a, f, m) {
485
+ function g(a, f, m) {
486
486
  if (f.classList.contains("pending-confirm"))
487
487
  return m();
488
488
  const C = f.innerHTML;
@@ -551,14 +551,14 @@ function D(e, t) {
551
551
  n.intValue = s, n.value = s / l, o.increment = o.increment || 1 / l, o.useVedic ? o.groups = xn : o.groups = Cn, this.s = o, this.p = l;
552
552
  }
553
553
  function se(e, t) {
554
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0, l = t.decimal, s = t.errorOnInvalid, u = t.precision, r = t.fromCents, c = Ce(u), d = typeof e == "number", g = e instanceof D;
555
- if (g && r)
554
+ var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0, l = t.decimal, s = t.errorOnInvalid, u = t.precision, r = t.fromCents, c = Ce(u), d = typeof e == "number", E = e instanceof D;
555
+ if (E && r)
556
556
  return e.intValue;
557
- if (d || g)
558
- o = g ? e.value : e;
557
+ if (d || E)
558
+ o = E ? e.value : e;
559
559
  else if (typeof e == "string") {
560
- var h = new RegExp("[^-\\d" + l + "]", "g"), w = new RegExp("\\" + l, "g");
561
- o = e.replace(/\((.*)\)/, "-$1").replace(h, "").replace(w, "."), o = o || 0;
560
+ var h = new RegExp("[^-\\d" + l + "]", "g"), g = new RegExp("\\" + l, "g");
561
+ o = e.replace(/\((.*)\)/, "-$1").replace(h, "").replace(g, "."), o = o || 0;
562
562
  } else {
563
563
  if (s)
564
564
  throw Error("Invalid Input");
@@ -567,8 +567,8 @@ function se(e, t) {
567
567
  return r || (o *= c, o = o.toFixed(4)), n ? lt(o) : o;
568
568
  }
569
569
  function Mn(e, t) {
570
- var n = t.pattern, o = t.negativePattern, l = t.symbol, s = t.separator, u = t.decimal, r = t.groups, c = ("" + e).replace(/^-/, "").split("."), d = c[0], g = c[1];
571
- return (e.value >= 0 ? n : o).replace("!", l).replace("#", d.replace(r, "$1" + s) + (g ? u + g : ""));
570
+ var n = t.pattern, o = t.negativePattern, l = t.symbol, s = t.separator, u = t.decimal, r = t.groups, c = ("" + e).replace(/^-/, "").split("."), d = c[0], E = c[1];
571
+ return (e.value >= 0 ? n : o).replace("!", l).replace("#", d.replace(r, "$1" + s) + (E ? u + E : ""));
572
572
  }
573
573
  D.prototype = {
574
574
  /**
@@ -752,30 +752,30 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
752
752
  t({
753
753
  addRemoteOption: Dt
754
754
  });
755
- const r = S(), c = S(), d = S(), g = S(!1), h = S(), w = S(!1), a = S(""), f = S(null), m = S(null), C = S(!1), x = S(null), B = S(!1), mt = T(() => s.showCreateTextOnNewItem ?? !0), P = T(() => !!(s.options || h.value)), ht = T(() => s.options ?? h.value ?? []), yt = T(() => s.prependOptions ?? []), gt = T(() => s.appendOptions ?? []), Le = T(() => !!s.disabled || !P.value && (g.value || !s.loadOptions)), z = T(() => s.loadingText || "..."), wt = T(() => !P.value && (!s.loadOptions || s.preload || s.modelValue && (s.valueField || s.valueExtractor)) ? z.value : s.nullTitle ? s.nullTitle : s.placeholder || ""), Et = T(() => s.noResultsText || "No options match your search."), q = T(() => s.valueExtractor ? s.valueExtractor : s.valueField ? (i) => i[s.valueField] : null), fe = T(() => s.keyExtractor ? s.keyExtractor : s.keyField ? (i) => String(i[s.keyField]) : q.value ? (i) => String(q.value(i)) : null), bt = T(() => s.groupFormatter ? s.groupFormatter : s.groupField ? (i) => String(i[s.groupField]) : null), Fe = T(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Oe = T(() => s.selectionFormatter ? s.selectionFormatter : Fe.value), Ie = T(() => [...yt.value, ...ht.value, ...gt.value]), De = T(() => !!(s.groupField || s.groupFormatter)), ve = T(() => Ie.value.map((i, E) => {
756
- const p = bt.value?.(i), v = Fe.value(i), y = s.subtitleFormatter?.(i), O = v ? v.trim().toLowerCase() : "", Ne = y ? y.trim().toLowerCase() : "", oe = [];
755
+ const r = S(), c = S(), d = S(), E = S(!1), h = S(), g = S(!1), a = S(""), f = S(null), m = S(null), C = S(!1), x = S(null), B = S(!1), mt = T(() => s.showCreateTextOnNewItem ?? !0), P = T(() => !!(s.options || h.value)), ht = T(() => s.options ?? h.value ?? []), yt = T(() => s.prependOptions ?? []), gt = T(() => s.appendOptions ?? []), Le = T(() => !!s.disabled || !P.value && !s.loadOptions), z = T(() => s.loadingText || "..."), wt = T(() => !P.value && (!s.loadOptions || s.preload || s.modelValue && (s.valueField || s.valueExtractor)) ? z.value : s.nullTitle ? s.nullTitle : s.placeholder || ""), Et = T(() => s.noResultsText || "No options match your search."), q = T(() => s.valueExtractor ? s.valueExtractor : s.valueField ? (i) => i[s.valueField] : null), fe = T(() => s.keyExtractor ? s.keyExtractor : s.keyField ? (i) => String(i[s.keyField]) : q.value ? (i) => String(q.value(i)) : null), bt = T(() => s.groupFormatter ? s.groupFormatter : s.groupField ? (i) => String(i[s.groupField]) : null), Fe = T(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Oe = T(() => s.selectionFormatter ? s.selectionFormatter : Fe.value), Ie = T(() => [...yt.value, ...ht.value, ...gt.value]), De = T(() => !!(s.groupField || s.groupFormatter)), pe = T(() => Ie.value.map((i, w) => {
756
+ const v = bt.value?.(i), p = Fe.value(i), y = s.subtitleFormatter?.(i), O = p ? p.trim().toLowerCase() : "", Ne = y ? y.trim().toLowerCase() : "", oe = [];
757
757
  return s.searchFields ? s.searchFields.forEach((Re) => {
758
758
  i[Re] && oe.push(String(i[Re]).toLowerCase());
759
759
  }) : (oe.push(O), Ne && oe.push(Ne)), {
760
- key: fe.value?.(i) ?? String(E),
761
- group: p,
762
- title: v,
760
+ key: fe.value?.(i) ?? String(w),
761
+ group: v,
762
+ title: p,
763
763
  subtitle: y,
764
764
  searchContent: oe.join(""),
765
765
  ref: i
766
766
  };
767
767
  })), L = T(() => {
768
- let i = [...ve.value];
769
- if (w.value) {
770
- const E = a.value.trim().toLowerCase();
771
- if (E.length) {
772
- i = i.filter((y) => y.searchContent.includes(E));
773
- const p = Gt(a.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), v = new RegExp(`(${p})`, "ig");
768
+ let i = [...pe.value];
769
+ if (g.value) {
770
+ const w = a.value.trim().toLowerCase();
771
+ if (w.length) {
772
+ i = i.filter((y) => y.searchContent.includes(w));
773
+ const v = Gt(a.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(`(${v})`, "ig");
774
774
  i = i.map((y) => ({
775
775
  ...y,
776
- title: y.title.replace(v, "<mark>$1</mark>"),
777
- subtitle: y.subtitle?.replace(v, "<mark>$1</mark>")
778
- })), B.value && (i.find((O) => O.searchContent === E) !== void 0 || i.push({
776
+ title: y.title.replace(p, "<mark>$1</mark>"),
777
+ subtitle: y.subtitle?.replace(p, "<mark>$1</mark>")
778
+ })), B.value && (i.find((O) => O.searchContent === w) !== void 0 || i.push({
779
779
  key: l,
780
780
  title: mt.value ? "Create <strong>" + a.value.trim() + "</strong>..." : a.value.trim()
781
781
  }));
@@ -793,20 +793,20 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
793
793
  options: L.value
794
794
  }
795
795
  ];
796
- const i = jt(L.value.map((p) => p.group ?? "")), E = Ut(L.value, (p) => p.group ?? "");
797
- return i.map((p) => ({
798
- groupTitle: p,
799
- options: E[p]
796
+ const i = jt(L.value.map((v) => v.group ?? "")), w = Ut(L.value, (v) => v.group ?? "");
797
+ return i.map((v) => ({
798
+ groupTitle: v,
799
+ options: w[v]
800
800
  }));
801
801
  });
802
- I(() => s.modelValue, me), I(ve, () => {
802
+ I(() => s.modelValue, me), I(pe, () => {
803
803
  C.value && setTimeout($e, 0);
804
804
  }), I(a, () => {
805
- w.value && !s.remoteSearch && !a.value.trim().length && (w.value = !1);
805
+ g.value && !s.remoteSearch && !a.value.trim().length && (g.value = !1);
806
806
  }), I(C, () => {
807
- C.value ? setTimeout(Ft, 0) : (w.value = !1, a.value = m.value ?? "", d.value && (d.value.style.visibility = "hidden"));
807
+ C.value ? setTimeout(Ft, 0) : (g.value = !1, a.value = m.value ?? "", d.value && (d.value.style.visibility = "hidden"));
808
808
  }), I(L, () => {
809
- s.modelValue !== null && f.value === null && me(), (x.value !== null || w.value) && !L.value.find((i) => i.key == x.value) && (x.value = L.value[0]?.key ?? o);
809
+ s.modelValue !== null && f.value === null && me(), (x.value !== null || g.value) && !L.value.find((i) => i.key == x.value) && (x.value = L.value[0]?.key ?? o);
810
810
  }), _(async () => {
811
811
  B.value = s.onCreateItem !== void 0, s.loadOptions && s.preload && (a.value = z.value, await Ve(), a.value = ""), !s.options && !s.loadOptions && (s.valueField || s.valueExtractor) ? a.value = z.value : me(), I(f, () => {
812
812
  const i = We(f.value) && q.value !== null ? q.value(f.value) : f.value;
@@ -819,11 +819,11 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
819
819
  await He(), h.value && u("optionsLoaded", h.value);
820
820
  }
821
821
  async function He() {
822
- const i = s.remoteSearch && w.value && a.value.length ? a.value : null;
823
- g.value = !0, h.value = await s.loadOptions?.(i) ?? [], g.value = !1, Ae();
822
+ const i = s.remoteSearch && g.value && a.value.length ? a.value : null;
823
+ E.value = !0, h.value = await s.loadOptions?.(i) ?? [], E.value = !1, Ae();
824
824
  }
825
825
  function Tt() {
826
- w.value && (He(), w.value = a.value.trim().length > 0);
826
+ g.value && (He(), g.value = a.value.trim().length > 0);
827
827
  }
828
828
  function St(i) {
829
829
  if (i.key == "Escape") {
@@ -832,25 +832,25 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
832
832
  }
833
833
  if (!(i.key == "ArrowLeft" || i.key == "ArrowRight") && i.key != "Tab") {
834
834
  if (!P.value) {
835
- w.value || i.preventDefault();
835
+ g.value || i.preventDefault();
836
836
  return;
837
837
  }
838
838
  if (i.key == "ArrowUp" || i.key == "ArrowDown")
839
- return i.preventDefault(), pe(i.key == "ArrowUp" ? -1 : 1);
839
+ return i.preventDefault(), ve(i.key == "ArrowUp" ? -1 : 1);
840
840
  if (i.key == "PageUp" || i.key == "PageDown")
841
- return i.preventDefault(), pe(i.key == "PageUp" ? -10 : 10);
841
+ return i.preventDefault(), ve(i.key == "PageUp" ? -10 : 10);
842
842
  if (i.key == "Home" || i.key == "End")
843
- return i.preventDefault(), pe(i.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
843
+ return i.preventDefault(), ve(i.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
844
844
  if (i.key == "Enter") {
845
845
  i.preventDefault();
846
- const E = L.value.find((p) => p.key == x.value);
847
- if (E) return Be(E);
846
+ const w = L.value.find((v) => v.key == x.value);
847
+ if (w) return Be(w);
848
848
  }
849
849
  if (i.key === "Delete" || i.key === "Backspace") {
850
- a.value.length > 1 && (w.value = !0);
850
+ a.value.length > 1 && (g.value = !0);
851
851
  return;
852
852
  }
853
- !i.metaKey && Un.includes(i.key) && (w.value = !0);
853
+ !i.metaKey && Un.includes(i.key) && (g.value = !0);
854
854
  }
855
855
  }
856
856
  function Ct() {
@@ -863,11 +863,11 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
863
863
  return fe.value ? fe.value(f.value) : Mt(i)?.key ?? "";
864
864
  }
865
865
  function Mt(i) {
866
- const E = L.value.find((y) => y.ref === i);
867
- if (E)
868
- return E;
869
- const p = s.keyExtractor ? (y, O) => s.keyExtractor(y) === s.keyExtractor(O) : we, v = L.value.find((y) => p(y.ref, i));
870
- return v || null;
866
+ const w = L.value.find((y) => y.ref === i);
867
+ if (w)
868
+ return w;
869
+ const v = s.keyExtractor ? (y, O) => s.keyExtractor(y) === s.keyExtractor(O) : we, p = L.value.find((y) => v(y.ref, i));
870
+ return p || null;
871
871
  }
872
872
  function Lt() {
873
873
  s.debug || (!a.value.length && s.nullTitle && (f.value = null, m.value = null), C.value = !1);
@@ -876,40 +876,40 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
876
876
  P.value || Ve(), s.optionsListId && d.value?.setAttribute("id", s.optionsListId), Ot();
877
877
  }
878
878
  function Ot() {
879
- const i = r.value.getBoundingClientRect(), E = i.y + i.height + 2, p = i.x, v = d.value, y = window.getComputedStyle(r.value);
879
+ const i = r.value.getBoundingClientRect(), w = i.y + i.height + 2, v = i.x, p = d.value, y = window.getComputedStyle(r.value);
880
880
  for (let O in y)
881
- /^(font|text)/.test(O) && (v.style[O] = y[O]);
882
- if (v.style.top = E + "px", v.style.left = p + "px", v.style.minWidth = i.width + "px", !y.maxHeight || y.maxHeight == "none") {
883
- const O = window.innerHeight - E - 12;
884
- v.style.maxHeight = O + "px";
881
+ /^(font|text)/.test(O) && (p.style[O] = y[O]);
882
+ if (p.style.top = w + "px", p.style.left = v + "px", p.style.minWidth = i.width + "px", !y.maxHeight || y.maxHeight == "none") {
883
+ const O = window.innerHeight - w - 12;
884
+ p.style.maxHeight = O + "px";
885
885
  }
886
- v.style.visibility = "visible", document.body.appendChild(v), setTimeout($e, 0);
886
+ p.style.visibility = "visible", document.body.appendChild(p), setTimeout($e, 0);
887
887
  }
888
888
  function $e() {
889
889
  if (!P.value || !x.value) return;
890
- const i = L.value.findIndex((v) => v.key == x.value), E = d.value, p = E?.querySelectorAll(".option")[i];
891
- p && (E.scrollTop = p.offsetTop);
890
+ const i = L.value.findIndex((p) => p.key == x.value), w = d.value, v = w?.querySelectorAll(".option")[i];
891
+ v && (w.scrollTop = v.offsetTop);
892
892
  }
893
893
  function It(i) {
894
894
  x.value = i ? i.key : null;
895
895
  }
896
- function pe(i) {
897
- const E = L.value.findIndex((O) => O.key == x.value);
898
- let p = E + i;
899
- if (p < 0 ? p = 0 : p >= L.value.length && (p = L.value.length - 1), E == p) return;
900
- x.value = L.value[p].key;
901
- const v = d.value, y = v?.querySelectorAll(".option")[p];
902
- y && (y.offsetTop < v.scrollTop ? v.scrollTop = y.offsetTop : y.offsetTop + y.offsetHeight > v.scrollTop + v.clientHeight && (v.scrollTop = y.offsetTop + y.offsetHeight - v.clientHeight));
896
+ function ve(i) {
897
+ const w = L.value.findIndex((O) => O.key == x.value);
898
+ let v = w + i;
899
+ if (v < 0 ? v = 0 : v >= L.value.length && (v = L.value.length - 1), w == v) return;
900
+ x.value = L.value[v].key;
901
+ const p = d.value, y = p?.querySelectorAll(".option")[v];
902
+ y && (y.offsetTop < p.scrollTop ? p.scrollTop = y.offsetTop : y.offsetTop + y.offsetHeight > p.scrollTop + p.clientHeight && (p.scrollTop = y.offsetTop + y.offsetHeight - p.clientHeight));
903
903
  }
904
904
  function Be(i) {
905
- if (w.value = !1, i.key === o)
905
+ if (g.value = !1, i.key === o)
906
906
  a.value = "", f.value = null, m.value = null;
907
907
  else if (i.key === l) {
908
- const E = a.value.trim();
909
- a.value = "", f.value = null, m.value = null, s.onCreateItem?.(E);
908
+ const w = a.value.trim();
909
+ a.value = "", f.value = null, m.value = null, s.onCreateItem?.(w);
910
910
  } else {
911
- const p = ve.value.find((v) => v.key == i.key).ref;
912
- f.value = p, m.value = Oe.value(p), a.value = m.value ?? "";
911
+ const v = pe.value.find((p) => p.key == i.key).ref;
912
+ f.value = v, m.value = Oe.value(v), a.value = m.value ?? "";
913
913
  }
914
914
  c.value?.blur(), _e();
915
915
  }
@@ -925,12 +925,12 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
925
925
  for (; i && i.tagName !== "FORM" && i.tagName !== "BODY"; )
926
926
  i = i.parentElement;
927
927
  if (!i) return;
928
- const E = i.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
929
- if (!E) return;
930
- const p = Array.from(E).findIndex((y) => y === c.value), v = E[p + 1];
931
- v && setTimeout(() => v.focus(), 0);
928
+ const w = i.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
929
+ if (!w) return;
930
+ const v = Array.from(w).findIndex((y) => y === c.value), p = w[v + 1];
931
+ p && setTimeout(() => p.focus(), 0);
932
932
  }
933
- return (i, E) => (b(), k("div", {
933
+ return (i, w) => (b(), k("div", {
934
934
  ref_key: "el",
935
935
  ref: r,
936
936
  class: H(["vf-smart-select", { disabled: Le.value, open: C.value }])
@@ -938,7 +938,7 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
938
938
  ie($("input", {
939
939
  ref_key: "searchField",
940
940
  ref: c,
941
- "onUpdate:modelValue": E[0] || (E[0] = (p) => a.value = p),
941
+ "onUpdate:modelValue": w[0] || (w[0] = (v) => a.value = v),
942
942
  type: "text",
943
943
  disabled: Le.value,
944
944
  class: H({ nullable: !!i.nullTitle }),
@@ -958,32 +958,32 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
958
958
  ref: d,
959
959
  class: H(["vf-smart-select-options", { grouped: De.value }])
960
960
  }, [
961
- P.value ? (b(!0), k(le, { key: 1 }, re(kt.value, (p) => (b(), k("div", {
962
- key: p.groupTitle,
961
+ P.value ? (b(!0), k(le, { key: 1 }, re(kt.value, (v) => (b(), k("div", {
962
+ key: v.groupTitle,
963
963
  class: "group"
964
964
  }, [
965
- p.groupTitle ? (b(), k("div", _n, [
965
+ v.groupTitle ? (b(), k("div", _n, [
966
966
  W(i.$slots, "group", {
967
- group: p.groupTitle
967
+ group: v.groupTitle
968
968
  }, () => [
969
- X(R(p.groupTitle), 1)
969
+ X(R(v.groupTitle), 1)
970
970
  ])
971
971
  ])) : V("", !0),
972
- (b(!0), k(le, null, re(p.options, (v) => (b(), k("div", {
973
- key: v.key,
974
- class: H(["option", [x.value === v.key && "highlighted", v.ref && i.classForOption?.(v.ref)]]),
975
- onMousemove: (y) => It(v),
976
- onMousedown: (y) => Be(v)
972
+ (b(!0), k(le, null, re(v.options, (p) => (b(), k("div", {
973
+ key: p.key,
974
+ class: H(["option", [x.value === p.key && "highlighted", p.ref && i.classForOption?.(p.ref)]]),
975
+ onMousemove: (y) => It(p),
976
+ onMousedown: (y) => Be(p)
977
977
  }, [
978
- W(i.$slots, "option", { option: v }, () => [
978
+ W(i.$slots, "option", { option: p }, () => [
979
979
  $("div", {
980
980
  class: "title",
981
- innerHTML: v.title
981
+ innerHTML: p.title
982
982
  }, null, 8, Rn),
983
- v.subtitle ? (b(), k("div", {
983
+ p.subtitle ? (b(), k("div", {
984
984
  key: 0,
985
985
  class: "subtitle",
986
- innerHTML: v.subtitle
986
+ innerHTML: p.subtitle
987
987
  }, null, 8, Wn)) : V("", !0)
988
988
  ])
989
989
  ], 42, Nn))), 128)),
@@ -1043,6 +1043,7 @@ const qn = { class: "content" }, zn = { class: "message" }, Kn = {
1043
1043
  }, Xn = /* @__PURE__ */ N({
1044
1044
  __name: "vf-toast",
1045
1045
  props: {
1046
+ position: {},
1046
1047
  message: {},
1047
1048
  className: {},
1048
1049
  durationSecs: {},
@@ -1063,7 +1064,7 @@ const qn = { class: "content" }, zn = { class: "message" }, Kn = {
1063
1064
  easing: "linear"
1064
1065
  }), setTimeout(() => t.callback(), l * 1e3);
1065
1066
  }), (l, s) => (b(), k("div", {
1066
- class: H(["vf-toast", l.className]),
1067
+ class: H(["vf-toast", [l.className, { top: l.position === "top", bottom: l.position !== "top" }]]),
1067
1068
  onClick: ke(n, ["stop"])
1068
1069
  }, [
1069
1070
  $("div", qn, [
@@ -1159,7 +1160,7 @@ const Ue = {
1159
1160
  }), xe = Symbol("HookState");
1160
1161
  function as(e, t) {
1161
1162
  const n = t ?? be();
1162
- _(() => fo(n, e), n), Qe(() => vo(n), n), et(() => Pe(n), n), ue(() => Pe(n), n);
1163
+ _(() => fo(n, e), n), Qe(() => po(n), n), et(() => Pe(n), n), ue(() => Pe(n), n);
1163
1164
  }
1164
1165
  function fo(e, t) {
1165
1166
  const n = {};
@@ -1169,7 +1170,7 @@ function fo(e, t) {
1169
1170
  }
1170
1171
  t.windowScrolledToBottom && (n.window = new G(window, t.windowScrolledToBottom)), e[xe] = n;
1171
1172
  }
1172
- function vo(e) {
1173
+ function po(e) {
1173
1174
  const t = e[xe];
1174
1175
  t?.el?.install(), t?.ancestor?.install(), t?.window?.install();
1175
1176
  }
@@ -1203,7 +1204,7 @@ class G {
1203
1204
  function us(e) {
1204
1205
  _(() => window.addEventListener("resize", e)), Qe(() => window.addEventListener("resize", e)), et(() => window.removeEventListener("resize", e)), ue(() => window.removeEventListener("resize", e));
1205
1206
  }
1206
- const po = {
1207
+ const vo = {
1207
1208
  mounted: ze,
1208
1209
  updated: ze
1209
1210
  }, qe = Symbol("HasAutoFocused");
@@ -1268,8 +1269,8 @@ function Eo(e, t) {
1268
1269
  }
1269
1270
  if (!u && e.attributes.getNamedItem("simplified-date") !== null) {
1270
1271
  let d = null;
1271
- const g = /* @__PURE__ */ new Date();
1272
- g.getFullYear() === s.getFullYear() ? (g.getMonth() !== s.getMonth() || g.getDate() !== s.getDate()) && (d = "M/d") : d = "M/d/yy";
1272
+ const E = /* @__PURE__ */ new Date();
1273
+ E.getFullYear() === s.getFullYear() ? (E.getMonth() !== s.getMonth() || E.getDate() !== s.getDate()) && (d = "M/d") : d = "M/d/yy";
1273
1274
  const h = r ? null : F.defaultTimeFormat;
1274
1275
  u = tt([d, h]).join(" ");
1275
1276
  }
@@ -1327,7 +1328,7 @@ const xo = {
1327
1328
  unmounted: ft
1328
1329
  }, j = /* @__PURE__ */ new Map();
1329
1330
  function dt(e, t) {
1330
- j.size === 0 && window.addEventListener("keydown", vt), j.set(t.value.toLowerCase(), [...j.get(t.value.toLowerCase()) ?? [], e]);
1331
+ j.size === 0 && window.addEventListener("keydown", pt), j.set(t.value.toLowerCase(), [...j.get(t.value.toLowerCase()) ?? [], e]);
1331
1332
  }
1332
1333
  function ft(e, t) {
1333
1334
  const n = j.get(t.value.toLowerCase());
@@ -1335,12 +1336,12 @@ function ft(e, t) {
1335
1336
  const o = n.indexOf(e);
1336
1337
  o !== -1 && n.splice(o, 1), n.length === 0 && j.delete(t.value.toLowerCase());
1337
1338
  }
1338
- j.size === 0 && window.removeEventListener("keydown", vt);
1339
+ j.size === 0 && window.removeEventListener("keydown", pt);
1339
1340
  }
1340
1341
  function Mo(e, t) {
1341
1342
  ft(e, t), dt(e, t);
1342
1343
  }
1343
- function vt(e) {
1344
+ function pt(e) {
1344
1345
  if (typeof e.key != "string") return;
1345
1346
  const t = e.key.toLowerCase(), n = j.get(t);
1346
1347
  n && (Yt(n)?.click(), e.preventDefault());
@@ -1365,7 +1366,7 @@ function Ze(e, t) {
1365
1366
  const Oo = {
1366
1367
  mounted: Ge,
1367
1368
  updated: Ge,
1368
- unmounted: pt
1369
+ unmounted: vt
1369
1370
  }, J = Symbol("TooltipState");
1370
1371
  function Ge(e, t) {
1371
1372
  let n = e.attributes.getNamedItem("tip")?.value ?? t.value;
@@ -1376,9 +1377,9 @@ function Ge(e, t) {
1376
1377
  };
1377
1378
  e[J] ? e[J].configure(o) : e[J] = new Io(e, o);
1378
1379
  } else
1379
- pt(e);
1380
+ vt(e);
1380
1381
  }
1381
- function pt(e) {
1382
+ function vt(e) {
1382
1383
  e[J]?.destroy(), delete e[J];
1383
1384
  }
1384
1385
  class Io {
@@ -1429,7 +1430,7 @@ class Io {
1429
1430
  }
1430
1431
  }
1431
1432
  function Do(e) {
1432
- e.directive("autofocus", po), e.directive("confirm-button", mo), e.directive("date-input", yo), e.directive("datetime", wo), e.directive("disabled", bo), e.directive("duration", To), e.directive("hotkey", xo), e.directive("infinite-scroll", Lo), e.directive("readonly", Fo), e.directive("tooltip", Oo);
1433
+ e.directive("autofocus", vo), e.directive("confirm-button", mo), e.directive("date-input", yo), e.directive("datetime", wo), e.directive("disabled", bo), e.directive("duration", To), e.directive("hotkey", xo), e.directive("infinite-scroll", Lo), e.directive("readonly", Fo), e.directive("tooltip", Oo);
1433
1434
  }
1434
1435
  function cs(e) {
1435
1436
  Do(e);
@@ -1452,7 +1453,7 @@ export {
1452
1453
  Wo as dismissOverlayInjectionByInstance,
1453
1454
  nt as dismissOverlayInjectionByInternalInstance,
1454
1455
  ln as dismissOverlayInjectionByVnode,
1455
- vs as escapeHtml,
1456
+ ps as escapeHtml,
1456
1457
  cn as formatError,
1457
1458
  kn as formatNumber,
1458
1459
  Hn as formatPhone,
@@ -1464,7 +1465,7 @@ export {
1464
1465
  We as isNotNullOrUndefined,
1465
1466
  Yo as maskComponent,
1466
1467
  fn as maskEl,
1467
- vn as maskForm,
1468
+ pn as maskForm,
1468
1469
  ns as nl2br,
1469
1470
  es as nullifyEmptyInputs,
1470
1471
  Te as presentOverlay,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signal24/vue-foundation",
3
3
  "type": "module",
4
- "version": "4.29.1",
4
+ "version": "4.29.2",
5
5
  "description": "Common components, directives, and helpers for Vue 3 apps",
6
6
  "module": "./dist/vue-foundation.es.js",
7
7
  "exports": {
@@ -126,7 +126,7 @@ const loadedOptions = computed(() => props.options ?? remoteOptions.value ?? [])
126
126
 
127
127
  const effectivePrependOptions = computed(() => props.prependOptions ?? []);
128
128
  const effectiveAppendOptions = computed(() => props.appendOptions ?? []);
129
- const effectiveDisabled = computed(() => !!props.disabled || (!isLoaded.value && (isLoading.value || !props.loadOptions))); // need to check this. what about with typeahead?
129
+ const effectiveDisabled = computed(() => !!props.disabled || (!isLoaded.value && !props.loadOptions));
130
130
  const effectiveLoadingText = computed(() => props.loadingText || '...');
131
131
  const effectivePlaceholder = computed(() => {
132
132
  if (!isLoaded.value) {