@signal24/vue-foundation 4.17.0 → 4.17.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,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
2
  export default _default;
@@ -1,22 +1,20 @@
1
1
  import type { OverlayAnchorOptions } from './overlay-types';
2
- declare var __VLS_0: {};
3
- declare var __VLS_inheritedAttrs: {};
4
- declare const __VLS_templateResult: {
2
+ declare function __VLS_template(): {
5
3
  slots: {
6
- default?(_: typeof __VLS_0): any;
4
+ default?(_: {}): any;
7
5
  };
8
6
  refs: {};
9
- attrs: Partial<typeof __VLS_inheritedAttrs>;
7
+ attrs: Partial<{}>;
10
8
  };
11
- type __VLS_Slots = typeof __VLS_templateResult['slots'];
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
10
  declare const __VLS_component: import("vue").DefineComponent<{
13
11
  overlayId: string;
14
12
  anchor: OverlayAnchorOptions;
15
13
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
16
14
  overlayId: string;
17
15
  anchor: OverlayAnchorOptions;
18
- }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
19
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_Slots>;
16
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
20
18
  export default _default;
21
19
  type __VLS_WithTemplateSlots<T, S> = T & {
22
20
  new (): {
@@ -15,7 +15,7 @@ export interface OverlayInjection<C extends OverlayComponent, R extends Componen
15
15
  }
16
16
  export declare const OverlayContainer: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
17
17
  [key: string]: any;
18
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}>;
18
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
19
19
  export type Vue__ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
20
20
  __isFragment?: never;
21
21
  __isTeleport?: never;
@@ -14,5 +14,5 @@ declare const _default: import("vue").DefineComponent<{
14
14
  message: string | Error;
15
15
  shouldConfirm?: boolean;
16
16
  callback: (ok: boolean) => void;
17
- }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
17
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
18
  export default _default;
@@ -10,7 +10,7 @@ declare const _default: import("vue").DefineComponent<{
10
10
  [K: string]: string;
11
11
  } | string[];
12
12
  formatter?: (item: IComputedOption) => string;
13
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
14
  "update:modelValue": (value: string | null) => any;
15
15
  }, string, import("vue").PublicProps, Readonly<{
16
16
  modelValue: string | null | undefined;
@@ -22,5 +22,5 @@ declare const _default: import("vue").DefineComponent<{
22
22
  formatter?: (item: IComputedOption) => string;
23
23
  }> & Readonly<{
24
24
  "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
25
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
26
  export default _default;
@@ -2,21 +2,19 @@ declare function mask(): () => void;
2
2
  declare function unmask(): void;
3
3
  declare function hide(): () => void;
4
4
  declare function unhide(): void;
5
- declare var __VLS_1: {};
6
- declare var __VLS_inheritedAttrs: {};
7
- declare const __VLS_templateResult: {
5
+ declare function __VLS_template(): {
8
6
  slots: {
9
7
  header?(_: {}): any;
10
- default?(_: typeof __VLS_1): any;
8
+ default?(_: {}): any;
11
9
  footer?(_: {}): any;
12
10
  };
13
11
  refs: {
14
- overlay: import("vue").HTMLAttributes & import("vue").ReservedProps;
15
- form: import("vue").FormHTMLAttributes & import("vue").ReservedProps;
12
+ overlay: HTMLDivElement;
13
+ form: HTMLFormElement;
16
14
  };
17
- attrs: Partial<typeof __VLS_inheritedAttrs>;
15
+ attrs: Partial<{}>;
18
16
  };
19
- type __VLS_Slots = typeof __VLS_templateResult['slots'];
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
20
18
  declare const __VLS_component: import("vue").DefineComponent<{
21
19
  id?: string;
22
20
  closeOnMaskClick?: boolean;
@@ -38,8 +36,8 @@ declare const __VLS_component: import("vue").DefineComponent<{
38
36
  class?: string | string[];
39
37
  }> & Readonly<{
40
38
  onFormSubmit?: ((...args: any[]) => any) | undefined;
41
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
42
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_Slots>;
39
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
43
41
  export default _default;
44
42
  type __VLS_WithTemplateSlots<T, S> = T & {
45
43
  new (): {
@@ -9,5 +9,5 @@ declare const _default: import("vue").DefineComponent<IToastOptions & {
9
9
  callback: () => void;
10
10
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IToastOptions & {
11
11
  callback: () => void;
12
- }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
12
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  export default _default;
@@ -25,8 +25,8 @@ const Wt = {
25
25
  },
26
26
  emits: ["update:modelValue"],
27
27
  setup(e, { emit: t }) {
28
- const n = e, o = t, i = T(null), l = M(() => i.value ? i.value.map((h) => {
29
- const k = h;
28
+ const n = e, o = t, i = T(null), l = M(() => i.value ? i.value.map((p) => {
29
+ const k = p;
30
30
  return n.preprocesor ? n.preprocesor(k) : n.displayKey ? k[n.displayKey] : "";
31
31
  }) : null), c = T(n.modelValue ?? null);
32
32
  F(() => n.loadFn, r), F(
@@ -36,16 +36,16 @@ const Wt = {
36
36
  async function r() {
37
37
  i.value = await n.loadFn();
38
38
  }
39
- return $(r), (d, h) => l.value ? J((w(), b("select", {
39
+ return $(r), (d, p) => l.value ? J((w(), b("select", {
40
40
  key: 1,
41
- "onUpdate:modelValue": h[0] || (h[0] = (k) => c.value = k)
41
+ "onUpdate:modelValue": p[0] || (p[0] = (k) => c.value = k)
42
42
  }, [
43
43
  n.nullText ? (w(), b("option", Ut, W(n.nullText), 1)) : D("", !0),
44
- (w(!0), b(ee, null, he(l.value, (k, p) => {
44
+ (w(!0), b(ee, null, he(l.value, (k, y) => {
45
45
  var E;
46
46
  return w(), b("option", {
47
- key: p,
48
- value: (E = i.value) == null ? void 0 : E[p]
47
+ key: y,
48
+ value: (E = i.value) == null ? void 0 : E[y]
49
49
  }, W(k), 9, jt);
50
50
  }), 128))
51
51
  ], 512)), [
@@ -65,32 +65,32 @@ const Wt = {
65
65
  $(c);
66
66
  function c() {
67
67
  if (!l) return;
68
- const h = l.vnode.el, { styles: k, classes: p } = r(h, n);
69
- o.value = k, i.value = p;
68
+ const p = l.vnode.el, { styles: k, classes: y } = r(p, n);
69
+ o.value = k, i.value = y;
70
70
  }
71
- function r(h, k) {
72
- const p = t.anchor instanceof HTMLElement ? {} : t.anchor, E = k.getBoundingClientRect(), f = h.getBoundingClientRect();
73
- p.matchWidth && (f.width = E.width), p.matchHeight && (f.height = E.height);
74
- const a = p.class ? Array.isArray(p.class) ? p.class : [p.class] : [];
71
+ function r(p, k) {
72
+ const y = t.anchor instanceof HTMLElement ? {} : t.anchor, E = k.getBoundingClientRect(), v = p.getBoundingClientRect();
73
+ y.matchWidth && (v.width = E.width), y.matchHeight && (v.height = E.height);
74
+ const a = y.class ? Array.isArray(y.class) ? y.class : [y.class] : [];
75
75
  let u, S;
76
- if (p.y === "center")
77
- u = E.top + E.height / 2 - f.height / 2, a.push("anchored-center-y");
76
+ if (y.y === "center")
77
+ u = E.top + E.height / 2 - v.height / 2, a.push("anchored-center-y");
78
78
  else {
79
- const L = (E.bottom + f.height < window.innerHeight || p.y === "below") && p.y !== "above";
80
- u = L ? E.bottom : E.top - f.height, a.push(L ? "anchored-top" : "anchored-bottom");
79
+ const L = (E.bottom + v.height < window.innerHeight || y.y === "below") && y.y !== "above";
80
+ u = L ? E.bottom : E.top - v.height, a.push(L ? "anchored-top" : "anchored-bottom");
81
81
  }
82
- if (p.x === "center")
83
- S = E.left + E.width / 2 - f.width / 2, a.push("anchored-center-x");
82
+ if (y.x === "center")
83
+ S = E.left + E.width / 2 - v.width / 2, a.push("anchored-center-x");
84
84
  else {
85
- const L = (E.left + f.width < window.innerWidth || p.x === "left") && p.x !== "right";
86
- S = L ? E.left : E.right - f.width, a.push(L ? "anchored-left" : "anchored-right");
85
+ const L = (E.left + v.width < window.innerWidth || y.x === "left") && y.x !== "right";
86
+ S = L ? E.left : E.right - v.width, a.push(L ? "anchored-left" : "anchored-right");
87
87
  }
88
88
  return {
89
89
  styles: {
90
90
  top: `${u}px`,
91
91
  left: `${S}px`,
92
- ...p.matchWidth ? { width: `${f.width}px` } : {},
93
- ...p.matchHeight ? { height: `${f.height}px` } : {}
92
+ ...y.matchWidth ? { width: `${v.width}px` } : {},
93
+ ...y.matchHeight ? { height: `${v.height}px` } : {}
94
94
  },
95
95
  classes: a
96
96
  };
@@ -102,12 +102,12 @@ const Wt = {
102
102
  setTimeout(() => {
103
103
  window.addEventListener("click", d);
104
104
  }, 10);
105
- }), (h, k) => (w(), b("div", {
105
+ }), (p, k) => (w(), b("div", {
106
106
  class: B(["vf-overlay-anchor", i.value]),
107
107
  style: St(o.value),
108
108
  onClick: ye(d, ["stop"])
109
109
  }, [
110
- Q(h.$slots, "default")
110
+ Q(p.$slots, "default")
111
111
  ], 6));
112
112
  }
113
113
  });
@@ -302,18 +302,18 @@ const Qt = ["id"], Jt = {
302
302
  emits: ["formSubmit"],
303
303
  setup(e, { expose: t }) {
304
304
  const n = pe(), o = e;
305
- t({ mask: p, unmask: E, hide: f, unhide: a });
305
+ t({ mask: y, unmask: E, hide: v, unhide: a });
306
306
  const i = T(), l = T(), c = T(!1), r = M(() => At([...Array.isArray(o.class) ? o.class : [o.class], c.value && "hidden"]));
307
307
  $(() => {
308
308
  var u;
309
- document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", h), (u = i.value) == null || u.addEventListener("click", d));
309
+ document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", p), (u = i.value) == null || u.addEventListener("click", d));
310
310
  }), ge(() => {
311
- window.removeEventListener("keydown", h), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
311
+ window.removeEventListener("keydown", p), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
312
312
  });
313
313
  function d(u) {
314
314
  u.target == i.value && k();
315
315
  }
316
- function h(u) {
316
+ function p(u) {
317
317
  if (u.key === "Esc" || u.key === "Escape") {
318
318
  const S = document.querySelectorAll(".vf-modal-wrap");
319
319
  S[S.length - 1] === i.value && k();
@@ -322,13 +322,13 @@ const Qt = ["id"], Jt = {
322
322
  function k() {
323
323
  Ye(n);
324
324
  }
325
- function p() {
325
+ function y() {
326
326
  return Gt(l.value), () => E();
327
327
  }
328
328
  function E() {
329
329
  Ge(l.value);
330
330
  }
331
- function f() {
331
+ function v() {
332
332
  return c.value = !0, () => a();
333
333
  }
334
334
  function a() {
@@ -511,33 +511,33 @@ const mn = ["disabled", "placeholder", "required"], hn = {
511
511
  t({
512
512
  addRemoteOption: wt
513
513
  });
514
- const r = T(), d = T(), h = T(), k = T(!1), p = T(!1), E = T([]), f = T(!1), a = T(""), u = T(null), S = T(null), I = T(!1), L = T(null), Se = T(!1), it = M(() => l.prependOptions ?? []), rt = M(() => l.appendOptions ?? []), Ce = M(() => !!l.disabled), at = M(() => !p.value && l.preload ? "Loading..." : l.nullTitle ? l.nullTitle : l.placeholder || ""), ut = M(() => l.noResultsText || "No options match your search."), R = M(() => l.valueExtractor ? l.valueExtractor : l.valueField ? (s) => s[l.valueField] : null), j = M(() => l.keyExtractor ? l.keyExtractor : l.keyField ? (s) => String(s[l.keyField]) : R.value ? (s) => String(R.value(s)) : null), ie = M(() => l.formatter ? l.formatter : l.labelField ? (s) => String(s[l.labelField]) : (s) => String(s)), Le = M(() => [...it.value, ...E.value, ...rt.value]), re = M(() => Le.value.map((s, v) => {
514
+ const r = T(), d = T(), p = T(), k = T(!1), y = T(!1), E = T([]), v = T(!1), a = T(""), u = T(null), S = T(null), I = T(!1), L = T(null), Se = T(!1), it = M(() => l.prependOptions ?? []), rt = M(() => l.appendOptions ?? []), Ce = M(() => !!l.disabled), at = M(() => !y.value && l.preload ? "Loading..." : l.nullTitle ? l.nullTitle : l.placeholder || ""), ut = M(() => l.noResultsText || "No options match your search."), R = M(() => l.valueExtractor ? l.valueExtractor : l.valueField ? (s) => s[l.valueField] : null), j = M(() => l.keyExtractor ? l.keyExtractor : l.keyField ? (s) => String(s[l.keyField]) : R.value ? (s) => String(R.value(s)) : null), ie = M(() => l.formatter ? l.formatter : l.labelField ? (s) => String(s[l.labelField]) : (s) => String(s)), Le = M(() => [...it.value, ...E.value, ...rt.value]), re = M(() => Le.value.map((s, f) => {
515
515
  var Ae, Fe;
516
- const m = ie.value(s), y = (Ae = l.subtitleFormatter) == null ? void 0 : Ae.call(l, s), g = m ? m.trim().toLowerCase() : "", C = y ? y.trim().toLowerCase() : "", Z = [];
516
+ const m = ie.value(s), h = (Ae = l.subtitleFormatter) == null ? void 0 : Ae.call(l, s), g = m ? m.trim().toLowerCase() : "", C = h ? h.trim().toLowerCase() : "", Z = [];
517
517
  return l.searchFields ? l.searchFields.forEach((Oe) => {
518
518
  s[Oe] && Z.push(String(s[Oe]).toLowerCase());
519
519
  }) : (Z.push(g), C && Z.push(C)), {
520
- key: ((Fe = j.value) == null ? void 0 : Fe.call(j, s)) ?? String(v),
520
+ key: ((Fe = j.value) == null ? void 0 : Fe.call(j, s)) ?? String(f),
521
521
  title: m,
522
- subtitle: y,
522
+ subtitle: h,
523
523
  searchContent: Z.join(""),
524
524
  ref: s
525
525
  };
526
526
  })), H = M(() => {
527
527
  let s = [...re.value];
528
- if (f.value) {
529
- const v = a.value.trim().toLowerCase();
530
- if (v.length) {
531
- s = s.filter((g) => g.searchContent.includes(v));
532
- const m = _t(a.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), y = new RegExp(`(${m})`, "ig");
528
+ if (v.value) {
529
+ const f = a.value.trim().toLowerCase();
530
+ if (f.length) {
531
+ s = s.filter((g) => g.searchContent.includes(f));
532
+ const m = _t(a.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), h = new RegExp(`(${m})`, "ig");
533
533
  s = s.map((g) => {
534
534
  var C;
535
535
  return {
536
536
  ...g,
537
- title: g.title.replace(y, "<mark>$1</mark>"),
538
- subtitle: (C = g.subtitle) == null ? void 0 : C.replace(y, "<mark>$1</mark>")
537
+ title: g.title.replace(h, "<mark>$1</mark>"),
538
+ subtitle: (C = g.subtitle) == null ? void 0 : C.replace(h, "<mark>$1</mark>")
539
539
  };
540
- }), Se.value && (s.find((C) => C.searchContent === v) !== void 0 || s.push({
540
+ }), Se.value && (s.find((C) => C.searchContent === f) !== void 0 || s.push({
541
541
  key: i,
542
542
  title: "Create <strong>" + a.value.trim() + "</strong>..."
543
543
  }));
@@ -551,19 +551,19 @@ const mn = ["disabled", "placeholder", "required"], hn = {
551
551
  F(() => l.modelValue, ue), F(
552
552
  () => l.options,
553
553
  () => {
554
- E.value = l.options ?? [], p.value = !0;
554
+ E.value = l.options ?? [], y.value = !0;
555
555
  }
556
556
  ), F(re, () => {
557
557
  I.value && setTimeout(Ie, 0);
558
558
  }), F(a, () => {
559
- f.value && !l.remoteSearch && !a.value.trim().length && (f.value = !1);
559
+ v.value && !l.remoteSearch && !a.value.trim().length && (v.value = !1);
560
560
  }), F(I, () => {
561
- I.value ? setTimeout(yt, 0) : (f.value = !1, a.value = S.value || "", h.value && (h.value.style.visibility = "hidden"));
561
+ I.value ? setTimeout(yt, 0) : (v.value = !1, a.value = S.value || "", p.value && (p.value.style.visibility = "hidden"));
562
562
  }), F(H, () => {
563
563
  var s;
564
- l.modelValue && !u.value && ue(), (L.value || f.value) && !H.value.find((v) => v.key == L.value) && (L.value = ((s = H.value[0]) == null ? void 0 : s.key) ?? o);
564
+ l.modelValue && !u.value && ue(), (L.value || v.value) && !H.value.find((f) => f.key == L.value) && (L.value = ((s = H.value[0]) == null ? void 0 : s.key) ?? o);
565
565
  }), $(async () => {
566
- Se.value = l.onCreateItem !== void 0, l.options ? (E.value = [...l.options], p.value = !0) : l.preload && await xe(), ue(), F(u, () => {
566
+ Se.value = l.onCreateItem !== void 0, l.options ? (E.value = [...l.options], y.value = !0) : l.preload && await xe(), ue(), F(u, () => {
567
567
  u.value !== l.modelValue && c(
568
568
  "update:modelValue",
569
569
  u.value && R.value ? R.value(u.value) : u.value
@@ -574,12 +574,12 @@ const mn = ["disabled", "placeholder", "required"], hn = {
574
574
  await Me(), E.value && c("optionsLoaded", E.value);
575
575
  }
576
576
  async function Me() {
577
- var v;
578
- const s = l.remoteSearch && f.value && a.value ? a.value : null;
579
- k.value = !0, E.value = await ((v = l.loadOptions) == null ? void 0 : v.call(l, s)) ?? [], k.value = !1, p.value = !0;
577
+ var f;
578
+ const s = l.remoteSearch && v.value && a.value ? a.value : null;
579
+ k.value = !0, E.value = await ((f = l.loadOptions) == null ? void 0 : f.call(l, s)) ?? [], k.value = !1, y.value = !0;
580
580
  }
581
581
  function ct() {
582
- f.value && (Me(), f.value = a.value.trim().length > 0);
582
+ v.value && (Me(), v.value = a.value.trim().length > 0);
583
583
  }
584
584
  function dt(s) {
585
585
  if (s.key == "Escape") {
@@ -587,8 +587,8 @@ const mn = ["disabled", "placeholder", "required"], hn = {
587
587
  return;
588
588
  }
589
589
  if (!(s.key == "ArrowLeft" || s.key == "ArrowRight") && s.key != "Tab") {
590
- if (!p.value) {
591
- f.value || s.preventDefault();
590
+ if (!y.value) {
591
+ v.value || s.preventDefault();
592
592
  return;
593
593
  }
594
594
  if (s.key == "ArrowUp" || s.key == "ArrowDown")
@@ -599,14 +599,14 @@ const mn = ["disabled", "placeholder", "required"], hn = {
599
599
  return s.preventDefault(), ae(s.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
600
600
  if (s.key == "Enter") {
601
601
  s.preventDefault();
602
- const v = H.value.find((m) => m.key == L.value);
603
- if (v) return He(v);
602
+ const f = H.value.find((m) => m.key == L.value);
603
+ if (f) return He(f);
604
604
  }
605
605
  if (s.key === "Delete" || s.key === "Backspace") {
606
- a.value.length > 1 && (f.value = !0);
606
+ a.value.length > 1 && (v.value = !0);
607
607
  return;
608
608
  }
609
- !s.metaKey && wn.includes(s.key) && (f.value = !0);
609
+ !s.metaKey && wn.includes(s.key) && (v.value = !0);
610
610
  }
611
611
  }
612
612
  function ft() {
@@ -619,56 +619,56 @@ const mn = ["disabled", "placeholder", "required"], hn = {
619
619
  u.value ? L.value = mt(u.value) : l.nullTitle && (L.value = o);
620
620
  }
621
621
  function mt(s) {
622
- var v;
623
- return j.value ? j.value(u.value) : ((v = ht(s)) == null ? void 0 : v.key) ?? "";
622
+ var f;
623
+ return j.value ? j.value(u.value) : ((f = ht(s)) == null ? void 0 : f.key) ?? "";
624
624
  }
625
625
  function ht(s) {
626
- const v = H.value.find((g) => g.ref === s);
627
- if (v)
628
- return v;
629
- const m = l.keyExtractor ? (g, C) => l.keyExtractor(g) === l.keyExtractor(C) : Xe, y = H.value.find((g) => m(g.ref, s));
630
- return y || null;
626
+ const f = H.value.find((g) => g.ref === s);
627
+ if (f)
628
+ return f;
629
+ const m = l.keyExtractor ? (g, C) => l.keyExtractor(g) === l.keyExtractor(C) : Xe, h = H.value.find((g) => m(g.ref, s));
630
+ return h || null;
631
631
  }
632
632
  function pt() {
633
633
  l.debug || (!a.value.length && l.nullTitle && (u.value = null, S.value = null), I.value = !1);
634
634
  }
635
635
  function yt() {
636
636
  var s;
637
- p.value || xe(), l.optionsListId && ((s = h.value) == null || s.setAttribute("id", l.optionsListId)), gt();
637
+ y.value || xe(), l.optionsListId && ((s = p.value) == null || s.setAttribute("id", l.optionsListId)), gt();
638
638
  }
639
639
  function gt() {
640
- const s = r.value.getBoundingClientRect(), v = s.y + s.height + 2, m = s.x, y = h.value, g = window.getComputedStyle(r.value);
640
+ const s = r.value.getBoundingClientRect(), f = s.y + s.height + 2, m = s.x, h = p.value, g = window.getComputedStyle(r.value);
641
641
  for (let C in g)
642
- /^(font|text)/.test(C) && (y.style[C] = g[C]);
643
- if (y.style.top = v + "px", y.style.left = m + "px", y.style.minWidth = s.width + "px", !g.maxHeight || g.maxHeight == "none") {
644
- const C = window.innerHeight - v - 12;
645
- y.style.maxHeight = C + "px";
642
+ /^(font|text)/.test(C) && (h.style[C] = g[C]);
643
+ if (h.style.top = f + "px", h.style.left = m + "px", h.style.minWidth = s.width + "px", !g.maxHeight || g.maxHeight == "none") {
644
+ const C = window.innerHeight - f - 12;
645
+ h.style.maxHeight = C + "px";
646
646
  }
647
- y.style.visibility = "visible", document.body.appendChild(y), setTimeout(Ie, 0);
647
+ h.style.visibility = "visible", document.body.appendChild(h), setTimeout(Ie, 0);
648
648
  }
649
649
  function Ie() {
650
- if (!p.value || !L.value) return;
651
- const s = H.value.findIndex((y) => y.key == L.value), v = h.value, m = v.querySelectorAll(".option")[s];
652
- v.scrollTop = m.offsetTop;
650
+ if (!y.value || !L.value) return;
651
+ const s = H.value.findIndex((h) => h.key == L.value), f = p.value, m = f == null ? void 0 : f.querySelectorAll(".option")[s];
652
+ m && (f.scrollTop = m.offsetTop);
653
653
  }
654
654
  function Et(s) {
655
655
  L.value = s ? s.key : null;
656
656
  }
657
657
  function ae(s) {
658
- const v = H.value.findIndex((C) => C.key == L.value);
659
- let m = v + s;
660
- if (m < 0 ? m = 0 : m >= H.value.length && (m = H.value.length - 1), v == m) return;
658
+ const f = H.value.findIndex((C) => C.key == L.value);
659
+ let m = f + s;
660
+ if (m < 0 ? m = 0 : m >= H.value.length && (m = H.value.length - 1), f == m) return;
661
661
  L.value = H.value[m].key;
662
- const y = h.value, g = y.querySelectorAll(".option")[m];
663
- g.offsetTop < y.scrollTop ? y.scrollTop = g.offsetTop : g.offsetTop + g.offsetHeight > y.scrollTop + y.clientHeight && (y.scrollTop = g.offsetTop + g.offsetHeight - y.clientHeight);
662
+ const h = p.value, g = h == null ? void 0 : h.querySelectorAll(".option")[m];
663
+ g && (g.offsetTop < h.scrollTop ? h.scrollTop = g.offsetTop : g.offsetTop + g.offsetHeight > h.scrollTop + h.clientHeight && (h.scrollTop = g.offsetTop + g.offsetHeight - h.clientHeight));
664
664
  }
665
665
  function He(s) {
666
- var v, m;
667
- if (f.value = !1, s.key == o)
666
+ var f, m;
667
+ if (v.value = !1, s.key == o)
668
668
  a.value = "", u.value = null, S.value = null;
669
669
  else if (s.key === i) {
670
- const y = a.value.trim();
671
- a.value = "", u.value = null, S.value = null, (v = l.onCreateItem) == null || v.call(l, y);
670
+ const h = a.value.trim();
671
+ a.value = "", u.value = null, S.value = null, (f = l.onCreateItem) == null || f.call(l, h);
672
672
  } else {
673
673
  const g = re.value.find((C) => C.key == s.key).ref;
674
674
  u.value = g, S.value = ie.value(g), a.value = S.value || "";
@@ -681,7 +681,7 @@ const mn = ["disabled", "placeholder", "required"], hn = {
681
681
  function wt(s) {
682
682
  E.value.unshift(s);
683
683
  }
684
- return (s, v) => (w(), b("div", {
684
+ return (s, f) => (w(), b("div", {
685
685
  ref_key: "el",
686
686
  ref: r,
687
687
  class: B(["vf-smart-select", { disabled: Ce.value, open: I.value }])
@@ -689,7 +689,7 @@ const mn = ["disabled", "placeholder", "required"], hn = {
689
689
  J(O("input", {
690
690
  ref_key: "searchField",
691
691
  ref: d,
692
- "onUpdate:modelValue": v[0] || (v[0] = (m) => a.value = m),
692
+ "onUpdate:modelValue": f[0] || (f[0] = (m) => a.value = m),
693
693
  type: "text",
694
694
  disabled: Ce.value,
695
695
  class: B({ nullable: !!s.nullTitle }),
@@ -705,17 +705,17 @@ const mn = ["disabled", "placeholder", "required"], hn = {
705
705
  I.value ? (w(), b("div", {
706
706
  key: 0,
707
707
  ref_key: "optionsContainer",
708
- ref: h,
708
+ ref: p,
709
709
  class: "vf-smart-select-options"
710
710
  }, [
711
- p.value ? (w(), b(ee, { key: 1 }, [
711
+ y.value ? (w(), b(ee, { key: 1 }, [
712
712
  (w(!0), b(ee, null, he(H.value, (m) => (w(), b("div", {
713
713
  key: String(m.key),
714
714
  class: B(["option", {
715
715
  highlighted: L.value === m.key
716
716
  }]),
717
- onMousemove: (y) => Et(m),
718
- onMousedown: (y) => He(m)
717
+ onMousemove: (h) => Et(m),
718
+ onMousedown: (h) => He(m)
719
719
  }, [
720
720
  O("div", {
721
721
  class: "title",
@@ -753,12 +753,12 @@ const mn = ["disabled", "placeholder", "required"], hn = {
753
753
  c.value = o.value.find((d) => d.value === r) ?? null;
754
754
  }
755
755
  ), F(c, (r) => {
756
- var h;
757
- const d = r ? (h = o.value.find((k) => Xe(k, r))) == null ? void 0 : h.value : null;
756
+ var p;
757
+ const d = r ? (p = o.value.find((k) => Xe(k, r))) == null ? void 0 : p.value : null;
758
758
  l("update:modelValue", d ?? null);
759
759
  }), (r, d) => (w(), qe(kn, {
760
760
  modelValue: c.value,
761
- "onUpdate:modelValue": d[0] || (d[0] = (h) => c.value = h),
761
+ "onUpdate:modelValue": d[0] || (d[0] = (p) => c.value = p),
762
762
  options: o.value,
763
763
  formatter: i.value,
764
764
  "null-title": r.nullTitle
@@ -870,27 +870,27 @@ function Io(e, t, n) {
870
870
  }
871
871
  function Ho(e, t) {
872
872
  const n = document.createElement("div");
873
- n.classList.add("vf-overlay"), n.addEventListener("click", p), document.body.appendChild(n);
873
+ n.classList.add("vf-overlay"), n.addEventListener("click", y), document.body.appendChild(n);
874
874
  const o = document.createElement("div");
875
875
  o.classList.add("vf-context-menu"), o.style.position = "absolute", n.appendChild(o);
876
876
  const i = e.currentTarget;
877
- i.style.userSelect = "none", i.classList.add("context-menu-active"), t.targetClass && i.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((f) => {
878
- if (f == "-") {
877
+ i.style.userSelect = "none", i.classList.add("context-menu-active"), t.targetClass && i.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((v) => {
878
+ if (v == "-") {
879
879
  const u = document.createElement("div");
880
880
  u.classList.add("separator"), o.appendChild(u);
881
881
  return;
882
882
  }
883
883
  const a = document.createElement("div");
884
- a.classList.add("item"), a.style.userSelect = "none", a.innerText = f.title, o.appendChild(a), f.class && a.classList.add(f.class), f.shouldConfirm ? a.addEventListener("click", (u) => E(u, a, f.handler)) : a.addEventListener("click", () => f.handler());
884
+ a.classList.add("item"), a.style.userSelect = "none", a.innerText = v.title, o.appendChild(a), v.class && a.classList.add(v.class), v.shouldConfirm ? a.addEventListener("click", (u) => E(u, a, v.handler)) : a.addEventListener("click", () => v.handler());
885
885
  });
886
- const l = window.innerWidth - e.clientX, c = window.innerHeight - e.clientY, r = o.offsetHeight, d = o.offsetWidth, h = l < d ? e.clientX - d - 1 : e.clientX + 1, k = c < r ? e.clientY - r - 1 : e.clientY + 1;
887
- o.style.left = h + "px", o.style.top = k + "px", setTimeout(() => {
886
+ const l = window.innerWidth - e.clientX, c = window.innerHeight - e.clientY, r = o.offsetHeight, d = o.offsetWidth, p = l < d ? e.clientX - d - 1 : e.clientX + 1, k = c < r ? e.clientY - r - 1 : e.clientY + 1;
887
+ o.style.left = p + "px", o.style.top = k + "px", setTimeout(() => {
888
888
  o.style.width = o.offsetWidth + "px";
889
889
  }, 50);
890
- function p() {
890
+ function y() {
891
891
  t.targetClass && i.classList.remove(t.targetClass), i.classList.remove("context-menu-active"), i.style.userSelect = "", n.remove();
892
892
  }
893
- function E(f, a, u) {
893
+ function E(v, a, u) {
894
894
  if (a.classList.contains("pending-confirm"))
895
895
  return u();
896
896
  const S = a.innerHTML;
@@ -898,7 +898,7 @@ function Ho(e, t) {
898
898
  const I = () => {
899
899
  a.classList.remove("pending-confirm"), a.innerHTML = S, a.removeEventListener("mouseleave", I);
900
900
  };
901
- a.addEventListener("mouseleave", I), f.stopPropagation();
901
+ a.addEventListener("mouseleave", I), v.stopPropagation();
902
902
  }
903
903
  }
904
904
  const Vn = (e) => new Promise((t) => setTimeout(t, e)), Ao = (e) => Vn(e * 1e3);
@@ -1028,13 +1028,13 @@ function Re(e, t) {
1028
1028
  t.value == t.oldValue && e.innerHTML.length || (e.innerText = Kn(e, t));
1029
1029
  }
1030
1030
  function Kn(e, t) {
1031
- var d, h;
1031
+ var d, p;
1032
1032
  if (!t.value)
1033
1033
  return ((d = e.attributes.getNamedItem("placeholder")) == null ? void 0 : d.value) ?? "";
1034
1034
  let n = "";
1035
1035
  const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), i = e.attributes.getNamedItem("local") !== null ? o.replace(/Z$/, "") : o.replace(/(Z|\+00:00)?$/, "Z"), l = new Date(i);
1036
1036
  e.attributes.getNamedItem("display-utc") !== null && l.setMinutes(l.getMinutes() - l.getTimezoneOffset());
1037
- let c = (h = e.attributes.getNamedItem("format")) == null ? void 0 : h.value;
1037
+ let c = (p = e.attributes.getNamedItem("format")) == null ? void 0 : p.value;
1038
1038
  if (!c && e.attributes.getNamedItem("relative-date") !== null) {
1039
1039
  const k = /* @__PURE__ */ new Date();
1040
1040
  k.getFullYear() == l.getFullYear() && k.getMonth() == l.getMonth() && k.getDate() == l.getDate() && (n = "at", c = "HH:mm");
package/eslint.config.mjs CHANGED
@@ -15,6 +15,7 @@ export default tseslint.config(
15
15
  eslint.configs.recommended,
16
16
  ...tseslint.configs.recommended,
17
17
  ...pluginVue.configs['flat/recommended'],
18
+ eslintPluginPrettierRecommended,
18
19
 
19
20
  // register parser options
20
21
  {
@@ -36,7 +37,6 @@ export default tseslint.config(
36
37
  },
37
38
 
38
39
  // plugins & configs
39
- eslintPluginPrettierRecommended,
40
40
  {
41
41
  plugins: {
42
42
  'unused-imports': unusedImports,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signal24/vue-foundation",
3
3
  "type": "module",
4
- "version": "4.17.0",
4
+ "version": "4.17.2",
5
5
  "description": "Common components, directives, and helpers for Vue 3 apps",
6
6
  "module": "./dist/vue-foundation.es.js",
7
7
  "exports": {
@@ -43,7 +43,7 @@
43
43
  "vue": "^3.4.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@eslint/js": "^9.9.1",
46
+ "@eslint/js": "^9.10.0",
47
47
  "@nabla/vite-plugin-eslint": "^2.0.4",
48
48
  "@signal24/openapi-client-codegen": "^1.1.0",
49
49
  "@tsconfig/node20": "^20.1.4",
@@ -57,25 +57,25 @@
57
57
  "@vue/eslint-config-typescript": "^13.0.0",
58
58
  "@vue/test-utils": "^2.4.6",
59
59
  "@vue/tsconfig": "^0.5.1",
60
- "cypress": "^13.14.1",
61
- "date-fns": "^3.6.0",
62
- "eslint": "^9.9.1",
60
+ "cypress": "^13.14.2",
61
+ "date-fns": "^4.1.0",
62
+ "eslint": "^9.10.0",
63
63
  "eslint-plugin-cypress": "^3.5.0",
64
64
  "eslint-plugin-simple-import-sort": "^12.1.1",
65
- "eslint-plugin-unused-imports": "^4.1.3",
65
+ "eslint-plugin-unused-imports": "^4.1.4",
66
66
  "eslint-plugin-vue": "^9.28.0",
67
67
  "jsdom": "^25.0.0",
68
68
  "lodash": "^4.17.21",
69
69
  "prettier": "^3.3.3",
70
70
  "sass": "^1.78.0",
71
- "start-server-and-test": "^2.0.5",
72
- "type-fest": "^4.26.0",
73
- "typescript": "^5.5.4",
74
- "typescript-eslint": "^8.4.0",
75
- "vite": "^5.4.3",
76
- "vitest": "^2.0.5",
77
- "vue": "^3.5.1",
78
- "vue-tsc": "^2.1.4"
71
+ "start-server-and-test": "^2.0.8",
72
+ "type-fest": "^4.26.1",
73
+ "typescript": "^5.6.2",
74
+ "typescript-eslint": "^8.6.0",
75
+ "vite": "^5.4.6",
76
+ "vitest": "^2.1.1",
77
+ "vue": "^3.5.6",
78
+ "vue-tsc": "^2.1.6"
79
79
  },
80
80
  "packageManager": "yarn@4.0.2"
81
81
  }
@@ -443,7 +443,8 @@ function highlightInitialOption() {
443
443
  if (!highlightedOptionKey.value) return;
444
444
  const highlightedOptionIdx = effectiveOptions.value.findIndex(option => option.key == highlightedOptionKey.value);
445
445
  const containerEl = optionsContainer.value!;
446
- const highlightedOptionEl = containerEl.querySelectorAll('.option')[highlightedOptionIdx] as HTMLElement;
446
+ const highlightedOptionEl = containerEl?.querySelectorAll('.option')[highlightedOptionIdx] as HTMLElement;
447
+ if (!highlightedOptionEl) return;
447
448
  containerEl.scrollTop = highlightedOptionEl.offsetTop;
448
449
  }
449
450
 
@@ -463,7 +464,8 @@ function incrementHighlightedOption(increment: number) {
463
464
  highlightedOptionKey.value = effectiveOptions.value[targetOptionIdx].key;
464
465
 
465
466
  const containerEl = optionsContainer.value!;
466
- const targetOptionEl = containerEl.querySelectorAll('.option')[targetOptionIdx] as HTMLElement;
467
+ const targetOptionEl = containerEl?.querySelectorAll('.option')[targetOptionIdx] as HTMLElement;
468
+ if (!targetOptionEl) return;
467
469
 
468
470
  if (targetOptionEl.offsetTop < containerEl.scrollTop) {
469
471
  containerEl.scrollTop = targetOptionEl.offsetTop;