@signal24/vue-foundation 4.6.1 → 4.7.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,27 +1,50 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
- isBare?: boolean | undefined;
3
- isHtml?: boolean | undefined;
4
- classes?: string[] | undefined;
5
- title?: string | undefined;
6
- message: string | Error;
7
- shouldConfirm?: boolean | undefined;
8
- callback: (ok: boolean) => void;
9
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
10
- isBare?: boolean | undefined;
11
- isHtml?: boolean | undefined;
12
- classes?: string[] | undefined;
13
- title?: string | undefined;
14
- message: string | Error;
15
- shouldConfirm?: boolean | undefined;
16
- callback: (ok: boolean) => void;
17
- }>>>, {}, {}>;
18
- export default _default;
19
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
- type __VLS_TypePropsToRuntimeProps<T> = {
21
- [K in keyof T]-?: {} extends Pick<T, K> ? {
22
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
- } : {
24
- type: import('vue').PropType<T[K]>;
1
+ declare const _default: import("vue").DefineComponent<{
2
+ isBare: {
3
+ type: import("vue").PropType<boolean>;
4
+ };
5
+ isHtml: {
6
+ type: import("vue").PropType<boolean>;
7
+ };
8
+ classes: {
9
+ type: import("vue").PropType<string[]>;
10
+ };
11
+ title: {
12
+ type: import("vue").PropType<string>;
13
+ };
14
+ message: {
15
+ type: import("vue").PropType<string | Error>;
16
+ required: true;
17
+ };
18
+ shouldConfirm: {
19
+ type: import("vue").PropType<boolean>;
20
+ };
21
+ callback: {
22
+ type: import("vue").PropType<(ok: boolean) => void>;
23
+ required: true;
24
+ };
25
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
+ isBare: {
27
+ type: import("vue").PropType<boolean>;
28
+ };
29
+ isHtml: {
30
+ type: import("vue").PropType<boolean>;
31
+ };
32
+ classes: {
33
+ type: import("vue").PropType<string[]>;
34
+ };
35
+ title: {
36
+ type: import("vue").PropType<string>;
37
+ };
38
+ message: {
39
+ type: import("vue").PropType<string | Error>;
25
40
  required: true;
26
41
  };
27
- };
42
+ shouldConfirm: {
43
+ type: import("vue").PropType<boolean>;
44
+ };
45
+ callback: {
46
+ type: import("vue").PropType<(ok: boolean) => void>;
47
+ required: true;
48
+ };
49
+ }>>, {}, {}>;
50
+ export default _default;
@@ -1,27 +1,42 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
- modelValue: string | null | undefined;
3
- nullTitle?: string | undefined;
4
- placeholder?: string | undefined;
5
- options: string[] | Record<string, string>;
6
- formatter?: ((value: any) => string) | undefined;
7
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
1
+ declare const _default: import("vue").DefineComponent<{
2
+ modelValue: {
3
+ type: import("vue").PropType<string | null | undefined>;
4
+ required: true;
5
+ };
6
+ nullTitle: {
7
+ type: import("vue").PropType<string>;
8
+ };
9
+ placeholder: {
10
+ type: import("vue").PropType<string>;
11
+ };
12
+ options: {
13
+ type: import("vue").PropType<string[] | Record<string, string>>;
14
+ required: true;
15
+ };
16
+ formatter: {
17
+ type: import("vue").PropType<(value: any) => string>;
18
+ };
19
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
20
  "update:modelValue": (value: string | null) => void;
9
- }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
10
- modelValue: string | null | undefined;
11
- nullTitle?: string | undefined;
12
- placeholder?: string | undefined;
13
- options: string[] | Record<string, string>;
14
- formatter?: ((value: any) => string) | undefined;
15
- }>>> & {
21
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
22
+ modelValue: {
23
+ type: import("vue").PropType<string | null | undefined>;
24
+ required: true;
25
+ };
26
+ nullTitle: {
27
+ type: import("vue").PropType<string>;
28
+ };
29
+ placeholder: {
30
+ type: import("vue").PropType<string>;
31
+ };
32
+ options: {
33
+ type: import("vue").PropType<string[] | Record<string, string>>;
34
+ required: true;
35
+ };
36
+ formatter: {
37
+ type: import("vue").PropType<(value: any) => string>;
38
+ };
39
+ }>> & {
16
40
  "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
17
41
  }, {}, {}>;
18
42
  export default _default;
19
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
- type __VLS_TypePropsToRuntimeProps<T> = {
21
- [K in keyof T]-?: {} extends Pick<T, K> ? {
22
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
- } : {
24
- type: import('vue').PropType<T[K]>;
25
- required: true;
26
- };
27
- };
@@ -1,21 +1,41 @@
1
1
  declare function mask(): void;
2
2
  declare function unmask(): void;
3
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
- id?: string | undefined;
5
- closeOnMaskClick?: boolean | undefined;
6
- scrolls?: boolean | undefined;
7
- closeX?: boolean | undefined;
8
- class?: string | undefined;
9
- }>, {
3
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
4
+ id: {
5
+ type: import("vue").PropType<string>;
6
+ };
7
+ closeOnMaskClick: {
8
+ type: import("vue").PropType<boolean>;
9
+ };
10
+ scrolls: {
11
+ type: import("vue").PropType<boolean>;
12
+ };
13
+ closeX: {
14
+ type: import("vue").PropType<boolean>;
15
+ };
16
+ class: {
17
+ type: import("vue").PropType<string>;
18
+ };
19
+ }, {
10
20
  mask: typeof mask;
11
21
  unmask: typeof unmask;
12
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "formSubmit"[], "formSubmit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
13
- id?: string | undefined;
14
- closeOnMaskClick?: boolean | undefined;
15
- scrolls?: boolean | undefined;
16
- closeX?: boolean | undefined;
17
- class?: string | undefined;
18
- }>>> & {
22
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "formSubmit"[], "formSubmit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
23
+ id: {
24
+ type: import("vue").PropType<string>;
25
+ };
26
+ closeOnMaskClick: {
27
+ type: import("vue").PropType<boolean>;
28
+ };
29
+ scrolls: {
30
+ type: import("vue").PropType<boolean>;
31
+ };
32
+ closeX: {
33
+ type: import("vue").PropType<boolean>;
34
+ };
35
+ class: {
36
+ type: import("vue").PropType<string>;
37
+ };
38
+ }>> & {
19
39
  onFormSubmit?: ((...args: any[]) => any) | undefined;
20
40
  }, {}, {}>, {
21
41
  header?(_: {}): any;
@@ -23,15 +43,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
23
43
  footer?(_: {}): any;
24
44
  }>;
25
45
  export default _default;
26
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
27
- type __VLS_TypePropsToRuntimeProps<T> = {
28
- [K in keyof T]-?: {} extends Pick<T, K> ? {
29
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
30
- } : {
31
- type: import('vue').PropType<T[K]>;
32
- required: true;
33
- };
34
- };
35
46
  type __VLS_WithTemplateSlots<T, S> = T & {
36
47
  new (): {
37
48
  $slots: S;
@@ -1,23 +1,26 @@
1
1
  import type { OverlayAnchorOptions } from './overlay-types';
2
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
3
- overlayId: string;
4
- anchor: OverlayAnchorOptions;
5
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
- overlayId: string;
7
- anchor: OverlayAnchorOptions;
8
- }>>>, {}, {}>, {
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
+ overlayId: {
4
+ type: import("vue").PropType<string>;
5
+ required: true;
6
+ };
7
+ anchor: {
8
+ type: import("vue").PropType<OverlayAnchorOptions>;
9
+ required: true;
10
+ };
11
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
12
+ overlayId: {
13
+ type: import("vue").PropType<string>;
14
+ required: true;
15
+ };
16
+ anchor: {
17
+ type: import("vue").PropType<OverlayAnchorOptions>;
18
+ required: true;
19
+ };
20
+ }>>, {}, {}>, {
9
21
  default?(_: {}): any;
10
22
  }>;
11
23
  export default _default;
12
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
13
- type __VLS_TypePropsToRuntimeProps<T> = {
14
- [K in keyof T]-?: {} extends Pick<T, K> ? {
15
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
16
- } : {
17
- type: import('vue').PropType<T[K]>;
18
- required: true;
19
- };
20
- };
21
24
  type __VLS_WithTemplateSlots<T, S> = T & {
22
25
  new (): {
23
26
  $slots: S;
@@ -5,18 +5,47 @@ export interface IToastOptions {
5
5
  disableClose?: boolean;
6
6
  onClick?: () => void;
7
7
  }
8
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<IToastOptions & {
9
- callback: () => void;
10
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IToastOptions & {
11
- callback: () => void;
12
- }>>>, {}, {}>;
13
- export default _default;
14
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
- type __VLS_TypePropsToRuntimeProps<T> = {
16
- [K in keyof T]-?: {} extends Pick<T, K> ? {
17
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
18
- } : {
19
- type: import('vue').PropType<T[K]>;
8
+ declare const _default: import("vue").DefineComponent<{
9
+ message: {
10
+ type: import("vue").PropType<string>;
11
+ required: true;
12
+ };
13
+ className: {
14
+ type: import("vue").PropType<string>;
15
+ };
16
+ durationSecs: {
17
+ type: import("vue").PropType<number | null>;
18
+ };
19
+ disableClose: {
20
+ type: import("vue").PropType<boolean>;
21
+ };
22
+ onClick: {
23
+ type: import("vue").PropType<() => void>;
24
+ };
25
+ callback: {
26
+ type: import("vue").PropType<() => void>;
27
+ required: true;
28
+ };
29
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
30
+ message: {
31
+ type: import("vue").PropType<string>;
32
+ required: true;
33
+ };
34
+ className: {
35
+ type: import("vue").PropType<string>;
36
+ };
37
+ durationSecs: {
38
+ type: import("vue").PropType<number | null>;
39
+ };
40
+ disableClose: {
41
+ type: import("vue").PropType<boolean>;
42
+ };
43
+ onClick: {
44
+ type: import("vue").PropType<() => void>;
45
+ };
46
+ callback: {
47
+ type: import("vue").PropType<() => void>;
20
48
  required: true;
21
49
  };
22
- };
50
+ }>>, {}, {}>;
51
+ export default _default;
@@ -31,12 +31,14 @@ export declare class ICancelablePromise<T = any> {
31
31
  }
32
32
  interface IWrappedApiClientOptions<P extends ICancelablePromise = ICancelablePromise, Arguments extends unknown[] = any[]> {
33
33
  apiClient: IApiClient;
34
+ wrapper?: (options: IRequestOptions, fn: (options: IRequestOptions) => P) => P;
34
35
  onRequest?: (options: IRequestOptions) => IRequestOptions;
35
36
  onError?: (err: Error, options: IRequestOptions) => Error | null | void;
37
+ afterRequest?: (options: IRequestOptions) => void;
36
38
  CancelablePromise: new (...arguments_: Arguments) => P;
37
39
  }
38
40
  export declare function isApiError(err: any): err is IApiError;
39
- export declare function installApiClientInterceptors({ apiClient, onRequest, onError, CancelablePromise }: IWrappedApiClientOptions): void;
41
+ export declare function installApiClientInterceptors({ apiClient, wrapper, onRequest, onError, afterRequest, CancelablePromise }: IWrappedApiClientOptions): void;
40
42
  export declare class FileUploadRequest {
41
43
  constructor(blob: Blob);
42
44
  validator: null;
@@ -1,7 +1,7 @@
1
1
  var Ve = Object.defineProperty;
2
2
  var Fe = (e, t, n) => t in e ? Ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var v = (e, t, n) => (Fe(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { defineComponent as S, defineProps as Ne, defineEmits as Re, ref as T, computed as K, openBlock as d, createElementBlock as u, createElementVNode as E, toDisplayString as x, withDirectives as U, createCommentVNode as O, Fragment as j, renderList as J, vModelSelect as Ke, getCurrentInstance as ee, onMounted as C, normalizeClass as w, normalizeStyle as Ue, withModifiers as te, renderSlot as R, reactive as je, h as W, Teleport as We, markRaw as Pe, onBeforeUnmount as ne, resolveDirective as Te, createBlock as ke, createSlots as qe, withCtx as Y, createTextVNode as ae, vModelText as ze, watch as ce, onActivated as Se, onDeactivated as xe } from "vue";
4
+ import { defineComponent as S, defineProps as Ne, defineEmits as Re, ref as T, computed as K, openBlock as u, createElementBlock as h, createElementVNode as E, toDisplayString as x, withDirectives as U, createCommentVNode as O, Fragment as j, renderList as J, vModelSelect as Ke, getCurrentInstance as ee, onMounted as C, normalizeClass as w, normalizeStyle as Ue, withModifiers as te, renderSlot as R, reactive as je, h as W, Teleport as We, markRaw as Pe, onBeforeUnmount as ne, resolveDirective as Te, createBlock as ke, createSlots as qe, withCtx as Y, createTextVNode as ae, vModelText as ze, watch as ce, onActivated as Se, onDeactivated as xe } from "vue";
5
5
  import { debounce as Xe, isEqual as Ce, upperFirst as Ye, startCase as Ze, cloneDeep as Ge, remove as Qe } from "lodash";
6
6
  import { escapeHtml as Je } from "@vue/shared";
7
7
  import { escapeHtml as ss } from "@vue/shared";
@@ -45,21 +45,21 @@ const et = S({
45
45
  value: null
46
46
  }, st = ["value"];
47
47
  function it(e, t, n, s, i, o) {
48
- return e.renderOptions ? U((d(), u("select", {
48
+ return e.renderOptions ? U((u(), h("select", {
49
49
  key: 1,
50
50
  "onUpdate:modelValue": t[0] || (t[0] = (r) => e.selectedItem = r)
51
51
  }, [
52
- e.props.nullText ? (d(), u("option", nt, x(e.props.nullText), 1)) : O("", !0),
53
- (d(!0), u(j, null, J(e.renderOptions, (r, l) => {
52
+ e.props.nullText ? (u(), h("option", nt, x(e.props.nullText), 1)) : O("", !0),
53
+ (u(!0), h(j, null, J(e.renderOptions, (r, l) => {
54
54
  var c;
55
- return d(), u("option", {
55
+ return u(), h("option", {
56
56
  key: l,
57
57
  value: (c = e.options) == null ? void 0 : c[l]
58
58
  }, x(r), 9, st);
59
59
  }), 128))
60
60
  ], 512)), [
61
61
  [Ke, e.selectedItem]
62
- ]) : (d(), u("select", tt, [
62
+ ]) : (u(), h("select", tt, [
63
63
  E("option", null, x(e.props.loadingText || "Loading..."), 1)
64
64
  ]));
65
65
  }
@@ -73,25 +73,25 @@ const In = /* @__PURE__ */ Le(et, [["render", it]]), ot = ["onClick"], lt = /* @
73
73
  const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, s = T({ visibility: "hidden", top: "0", left: "0" }), i = T([]), o = ee();
74
74
  C(r);
75
75
  function r() {
76
- const y = o.vnode.el, { styles: h, classes: a } = l(y, n);
77
- s.value = h, i.value = a;
76
+ const f = o.vnode.el, { styles: g, classes: a } = l(f, n);
77
+ s.value = g, i.value = a;
78
78
  }
79
- function l(y, h) {
80
- const a = t.anchor instanceof HTMLElement ? {} : t.anchor, m = h.getBoundingClientRect(), p = y.getBoundingClientRect();
79
+ function l(f, g) {
80
+ const a = t.anchor instanceof HTMLElement ? {} : t.anchor, m = g.getBoundingClientRect(), p = f.getBoundingClientRect();
81
81
  a.matchWidth && (p.width = m.width), a.matchHeight && (p.height = m.height);
82
- const f = a.class ? Array.isArray(a.class) ? a.class : [a.class] : [];
82
+ const d = a.class ? Array.isArray(a.class) ? a.class : [a.class] : [];
83
83
  let b, L;
84
84
  if (a.y === "center")
85
- b = m.top + m.height / 2 - p.height / 2, f.push("anchored-center-y");
85
+ b = m.top + m.height / 2 - p.height / 2, d.push("anchored-center-y");
86
86
  else {
87
87
  const M = (m.bottom + p.height < window.innerHeight || a.y === "below") && a.y !== "above";
88
- b = M ? m.bottom : m.top - p.height, f.push(M ? "anchored-top" : "anchored-bottom");
88
+ b = M ? m.bottom : m.top - p.height, d.push(M ? "anchored-top" : "anchored-bottom");
89
89
  }
90
90
  if (a.x === "center")
91
- L = m.left + m.width / 2 - p.width / 2, f.push("anchored-center-x");
91
+ L = m.left + m.width / 2 - p.width / 2, d.push("anchored-center-x");
92
92
  else {
93
93
  const M = (m.left + p.width < window.innerWidth || a.x === "left") && a.x !== "right";
94
- L = M ? m.left : m.right - p.width, f.push(M ? "anchored-left" : "anchored-right");
94
+ L = M ? m.left : m.right - p.width, d.push(M ? "anchored-left" : "anchored-right");
95
95
  }
96
96
  return {
97
97
  styles: {
@@ -100,7 +100,7 @@ const In = /* @__PURE__ */ Le(et, [["render", it]]), ot = ["onClick"], lt = /* @
100
100
  ...a.matchWidth ? { width: `${p.width}px` } : {},
101
101
  ...a.matchHeight ? { height: `${p.height}px` } : {}
102
102
  },
103
- classes: f
103
+ classes: d
104
104
  };
105
105
  }
106
106
  function c() {
@@ -110,12 +110,12 @@ const In = /* @__PURE__ */ Le(et, [["render", it]]), ot = ["onClick"], lt = /* @
110
110
  setTimeout(() => {
111
111
  window.addEventListener("click", c);
112
112
  }, 10);
113
- }), (y, h) => (d(), u("div", {
113
+ }), (f, g) => (u(), h("div", {
114
114
  class: w(["vf-overlay-anchor", i.value]),
115
115
  style: Ue(s.value),
116
116
  onClick: te(c, ["stop"])
117
117
  }, [
118
- R(y.$slots, "default")
118
+ R(f.$slots, "default")
119
119
  ], 14, ot));
120
120
  }
121
121
  });
@@ -287,7 +287,7 @@ const ft = ["id"], pt = {
287
287
  emits: ["formSubmit"],
288
288
  setup(e, { expose: t }) {
289
289
  const n = e, s = ee();
290
- t({ mask: y, unmask: h });
290
+ t({ mask: f, unmask: g });
291
291
  const i = T(), o = T();
292
292
  C(() => {
293
293
  var a;
@@ -307,13 +307,13 @@ const ft = ["id"], pt = {
307
307
  function c() {
308
308
  Me(s);
309
309
  }
310
- function y() {
310
+ function f() {
311
311
  ht(o.value);
312
312
  }
313
- function h() {
313
+ function g() {
314
314
  _e(o.value);
315
315
  }
316
- return (a, m) => (d(), u("div", {
316
+ return (a, m) => (u(), h("div", {
317
317
  id: a.id,
318
318
  class: w(["vf-overlay vf-modal-wrap", n.class]),
319
319
  ref_key: "overlay",
@@ -326,9 +326,9 @@ const ft = ["id"], pt = {
326
326
  ref_key: "form",
327
327
  ref: o
328
328
  }, [
329
- a.$slots.header ? (d(), u("div", pt, [
329
+ a.$slots.header ? (u(), h("div", pt, [
330
330
  R(a.$slots, "header"),
331
- n.closeX ? (d(), u("i", {
331
+ n.closeX ? (u(), h("i", {
332
332
  key: 0,
333
333
  class: "close",
334
334
  onClick: c
@@ -337,7 +337,7 @@ const ft = ["id"], pt = {
337
337
  E("div", mt, [
338
338
  R(a.$slots, "default")
339
339
  ]),
340
- a.$slots.footer ? (d(), u("div", vt, [
340
+ a.$slots.footer ? (u(), h("div", vt, [
341
341
  R(a.$slots, "footer")
342
342
  ])) : O("", !0)
343
343
  ], 34)
@@ -359,15 +359,15 @@ const gt = ["innerHtml"], bt = ["innerText"], X = /* @__PURE__ */ S({
359
359
  const t = e, n = K(() => t.message instanceof Error ? dt(t.message) : t.message);
360
360
  return (s, i) => {
361
361
  const o = Te("autofocus");
362
- return d(), ke(yt, {
362
+ return u(), ke(yt, {
363
363
  class: w(["vf-alert", s.classes])
364
364
  }, qe({
365
365
  default: Y(() => [
366
- s.isHtml ? (d(), u("div", {
366
+ s.isHtml ? (u(), h("div", {
367
367
  key: 0,
368
368
  innerHtml: s.message,
369
369
  class: "user-message"
370
- }, null, 8, gt)) : (d(), u("div", {
370
+ }, null, 8, gt)) : (u(), h("div", {
371
371
  key: 1,
372
372
  innerText: n.value
373
373
  }, null, 8, bt))
@@ -384,8 +384,8 @@ const gt = ["innerHtml"], bt = ["innerText"], X = /* @__PURE__ */ S({
384
384
  s.isBare ? void 0 : {
385
385
  name: "footer",
386
386
  fn: Y(() => [
387
- s.shouldConfirm ? (d(), u(j, { key: 0 }, [
388
- U((d(), u("button", {
387
+ s.shouldConfirm ? (u(), h(j, { key: 0 }, [
388
+ U((u(), h("button", {
389
389
  class: "primary",
390
390
  onClick: i[0] || (i[0] = () => s.callback(!0))
391
391
  }, [
@@ -397,7 +397,7 @@ const gt = ["innerHtml"], bt = ["innerText"], X = /* @__PURE__ */ S({
397
397
  class: "default",
398
398
  onClick: i[1] || (i[1] = () => s.callback(!1))
399
399
  }, "Cancel")
400
- ], 64)) : U((d(), u("button", {
400
+ ], 64)) : U((u(), h("button", {
401
401
  key: 1,
402
402
  class: "default",
403
403
  onClick: i[2] || (i[2] = () => s.callback(!0))
@@ -420,11 +420,11 @@ function Ot() {
420
420
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
421
421
  return N(Et);
422
422
  }
423
- const g = [];
423
+ const y = [];
424
424
  for (let e = 0; e < 256; ++e)
425
- g.push((e + 256).toString(16).slice(1));
425
+ y.push((e + 256).toString(16).slice(1));
426
426
  function wt(e, t = 0) {
427
- return (g[e[t + 0]] + g[e[t + 1]] + g[e[t + 2]] + g[e[t + 3]] + "-" + g[e[t + 4]] + g[e[t + 5]] + "-" + g[e[t + 6]] + g[e[t + 7]] + "-" + g[e[t + 8]] + g[e[t + 9]] + "-" + g[e[t + 10]] + g[e[t + 11]] + g[e[t + 12]] + g[e[t + 13]] + g[e[t + 14]] + g[e[t + 15]]).toLowerCase();
427
+ 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]]).toLowerCase();
428
428
  }
429
429
  const Tt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ue = {
430
430
  randomUUID: Tt
@@ -537,8 +537,8 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
537
537
  return this.allOptions.map((e, t) => {
538
538
  var l, c;
539
539
  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 = [];
540
- return this.searchFields ? this.searchFields.forEach((y) => {
541
- e[y] && r.push(String(e[y]).toLowerCase());
540
+ return this.searchFields ? this.searchFields.forEach((f) => {
541
+ e[f] && r.push(String(e[f]).toLowerCase());
542
542
  }) : (r.push(i), o && r.push(o)), {
543
543
  // eslint-disable-next-line vue/no-use-computed-property-like-method
544
544
  key: ((c = this.effectiveKeyExtractor) == null ? void 0 : c.call(this, e)) ?? String(t),
@@ -738,7 +738,7 @@ const It = ["placeholder"], _t = {
738
738
  };
739
739
  function Vt(e, t, n, s, i, o) {
740
740
  const r = Te("disabled");
741
- return d(), u("div", {
741
+ return u(), h("div", {
742
742
  class: w(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
743
743
  }, [
744
744
  U(E("input", {
@@ -754,9 +754,9 @@ function Vt(e, t, n, s, i, o) {
754
754
  [ze, e.searchText],
755
755
  [r, o.effectiveDisabled]
756
756
  ]),
757
- e.shouldDisplayOptions ? (d(), u("div", _t, [
758
- e.isLoaded ? (d(), u(j, { key: 1 }, [
759
- (d(!0), u(j, null, J(o.effectiveOptions, (l) => (d(), u("div", {
757
+ e.shouldDisplayOptions ? (u(), h("div", _t, [
758
+ e.isLoaded ? (u(), h(j, { key: 1 }, [
759
+ (u(!0), h(j, null, J(o.effectiveOptions, (l) => (u(), h("div", {
760
760
  key: String(l.key),
761
761
  class: w(["option", {
762
762
  highlighted: e.highlightedOptionKey === l.key
@@ -768,14 +768,14 @@ function Vt(e, t, n, s, i, o) {
768
768
  class: "title",
769
769
  innerHTML: l.title
770
770
  }, null, 8, $t),
771
- l.subtitle ? (d(), u("div", {
771
+ l.subtitle ? (u(), h("div", {
772
772
  key: 0,
773
773
  class: "subtitle",
774
774
  innerHTML: l.subtitle
775
775
  }, null, 8, At)) : O("", !0)
776
776
  ], 42, Dt))), 128)),
777
- !o.effectiveOptions.length && e.searchText ? (d(), u("div", Bt, x(o.effectiveNoResultsText), 1)) : O("", !0)
778
- ], 64)) : (d(), u("div", Ht, "Loading..."))
777
+ !o.effectiveOptions.length && e.searchText ? (u(), h("div", Bt, x(o.effectiveNoResultsText), 1)) : O("", !0)
778
+ ], 64)) : (u(), h("div", Ht, "Loading..."))
779
779
  ], 512)) : O("", !0)
780
780
  ], 2);
781
781
  }
@@ -805,7 +805,7 @@ const Ft = /* @__PURE__ */ Le(Mt, [["render", Vt]]), jn = /* @__PURE__ */ S({
805
805
  ), ce(o, (r) => {
806
806
  var l;
807
807
  t("update:modelValue", r ? ((l = s.value.find((c) => Ce(c, r))) == null ? void 0 : l.value) ?? null : null);
808
- }), (r, l) => (d(), ke(Ft, {
808
+ }), (r, l) => (u(), ke(Ft, {
809
809
  modelValue: o.value,
810
810
  "onUpdate:modelValue": l[0] || (l[0] = (c) => o.value = c),
811
811
  options: s.value,
@@ -842,15 +842,15 @@ const Ft = /* @__PURE__ */ Le(Mt, [["render", Vt]]), jn = /* @__PURE__ */ S({
842
842
  duration: i * 1e3,
843
843
  easing: "linear"
844
844
  }), setTimeout(() => t.callback(), i * 1e3);
845
- }), (i, o) => (d(), u("div", {
845
+ }), (i, o) => (u(), h("div", {
846
846
  class: w(["vf-toast", i.className]),
847
847
  onClick: te(n, ["stop"])
848
848
  }, [
849
849
  E("div", Rt, [
850
850
  E("div", Kt, x(i.message), 1),
851
- i.disableClose ? O("", !0) : (d(), u("div", Ut, "x"))
851
+ i.disableClose ? O("", !0) : (u(), h("div", Ut, "x"))
852
852
  ]),
853
- i.durationSecs !== null ? (d(), u("div", jt, [
853
+ i.durationSecs !== null ? (u(), h("div", jt, [
854
854
  E("div", {
855
855
  ref_key: "progressInnerEl",
856
856
  ref: s,
@@ -929,25 +929,25 @@ function zn(e, t) {
929
929
  b.classList.add("separator"), s.appendChild(b);
930
930
  return;
931
931
  }
932
- const f = document.createElement("div");
933
- f.classList.add("item"), f.style.userSelect = "none", f.innerText = p.title, s.appendChild(f), p.class && f.classList.add(p.class), p.shouldConfirm ? f.addEventListener("click", (b) => m(b, f, p.handler)) : f.addEventListener("click", () => p.handler());
932
+ const d = document.createElement("div");
933
+ d.classList.add("item"), d.style.userSelect = "none", d.innerText = p.title, s.appendChild(d), p.class && d.classList.add(p.class), p.shouldConfirm ? d.addEventListener("click", (b) => m(b, d, p.handler)) : d.addEventListener("click", () => p.handler());
934
934
  });
935
- const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = s.offsetHeight, c = s.offsetWidth, y = o < c ? e.clientX - c - 1 : e.clientX + 1, h = r < l ? e.clientY - l - 1 : e.clientY + 1;
936
- s.style.left = y + "px", s.style.top = h + "px", setTimeout(() => {
935
+ const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = s.offsetHeight, c = s.offsetWidth, f = o < c ? e.clientX - c - 1 : e.clientX + 1, g = r < l ? e.clientY - l - 1 : e.clientY + 1;
936
+ s.style.left = f + "px", s.style.top = g + "px", setTimeout(() => {
937
937
  s.style.width = s.offsetWidth + "px";
938
938
  }, 50);
939
939
  function a() {
940
940
  t.targetClass && i.classList.remove(t.targetClass), i.classList.remove("context-menu-active"), i.style.userSelect = "", n.remove();
941
941
  }
942
- function m(p, f, b) {
943
- if (f.classList.contains("pending-confirm"))
942
+ function m(p, d, b) {
943
+ if (d.classList.contains("pending-confirm"))
944
944
  return b();
945
- const L = f.innerHTML;
946
- f.classList.add("pending-confirm"), f.innerText = "Confirm";
945
+ const L = d.innerHTML;
946
+ d.classList.add("pending-confirm"), d.innerText = "Confirm";
947
947
  const F = () => {
948
- f.classList.remove("pending-confirm"), f.innerHTML = L, f.removeEventListener("mouseleave", F);
948
+ d.classList.remove("pending-confirm"), d.innerHTML = L, d.removeEventListener("mouseleave", F);
949
949
  };
950
- f.addEventListener("mouseleave", F), p.stopPropagation();
950
+ d.addEventListener("mouseleave", F), p.stopPropagation();
951
951
  }
952
952
  }
953
953
  const tn = (e) => new Promise((t) => setTimeout(t, e)), Xn = (e) => tn(e * 1e3);
@@ -966,26 +966,26 @@ function Zn(e, t) {
966
966
  function sn(e) {
967
967
  return e instanceof Error && "status" in e && "body" in e;
968
968
  }
969
- function Gn({ apiClient: e, onRequest: t, onError: n, CancelablePromise: s }) {
970
- const i = e.request.request.bind(e.request);
971
- e.request.request = (o) => (o = on(o), t && (o = t(o)), new s((r, l, c) => {
972
- const y = i(o);
973
- c(y.cancel), y.then(r).catch((h) => {
974
- if (sn(h) && typeof h.body == "object" && "error" in h.body) {
975
- if (h.status === 422)
976
- return l(new z(h.body.error));
977
- h.message = `${h.body.error} (${h.status})`;
969
+ function Gn({ apiClient: e, wrapper: t, onRequest: n, onError: s, afterRequest: i, CancelablePromise: o }) {
970
+ const r = e.request.request.bind(e.request), l = t ?? ((c, f) => f(c));
971
+ e.request.request = (c) => l(c, (f) => (f = on(f), n && (f = n(f)), new o((g, a, m) => {
972
+ const p = r(f);
973
+ m(p.cancel), p.then(g).catch((d) => {
974
+ if (sn(d) && typeof d.body == "object" && "error" in d.body) {
975
+ if (d.status === 422)
976
+ return a(new z(d.body.error));
977
+ d.message = `${d.body.error} (${d.status})`;
978
978
  }
979
- if (n) {
980
- const a = n(h, o);
981
- if (a === null)
979
+ if (s) {
980
+ const b = s(d, f);
981
+ if (b === null)
982
982
  return;
983
- if (a instanceof Error)
984
- return l(a);
983
+ if (b instanceof Error)
984
+ return a(b);
985
985
  }
986
- l(h);
987
- });
988
- }));
986
+ a(d);
987
+ }).finally(() => i == null ? void 0 : i(f));
988
+ })));
989
989
  }
990
990
  class pe {
991
991
  constructor(t) {
@@ -1114,16 +1114,16 @@ function ge(e, t) {
1114
1114
  t.value == t.oldValue && e.innerHTML.length || (e.innerText = pn(e, t));
1115
1115
  }
1116
1116
  function pn(e, t) {
1117
- var c, y;
1117
+ var c, f;
1118
1118
  if (!t.value)
1119
1119
  return ((c = e.attributes.getNamedItem("placeholder")) == null ? void 0 : c.value) ?? "";
1120
1120
  let n = "";
1121
1121
  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);
1122
1122
  e.attributes.getNamedItem("display-utc") !== null && o.setMinutes(o.getMinutes() - o.getTimezoneOffset());
1123
- let r = (y = e.attributes.getNamedItem("format")) == null ? void 0 : y.value;
1123
+ let r = (f = e.attributes.getNamedItem("format")) == null ? void 0 : f.value;
1124
1124
  if (!r && e.attributes.getNamedItem("relative-date") !== null) {
1125
- const h = /* @__PURE__ */ new Date();
1126
- h.getFullYear() == o.getFullYear() && h.getMonth() == o.getMonth() && h.getDate() == o.getDate() && (n = "at", r = "HH:mm");
1125
+ const g = /* @__PURE__ */ new Date();
1126
+ g.getFullYear() == o.getFullYear() && g.getMonth() == o.getMonth() && g.getDate() == o.getDate() && (n = "at", r = "HH:mm");
1127
1127
  }
1128
1128
  r || (r = V.defaultDateTimeFormat);
1129
1129
  let l = G(o, r);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signal24/vue-foundation",
3
3
  "type": "module",
4
- "version": "4.6.1",
4
+ "version": "4.7.0",
5
5
  "description": "Common components, directives, and helpers for Vue 3 apps",
6
6
  "module": "./dist/vue-foundation.es.js",
7
7
  "bin": {
@@ -39,37 +39,37 @@
39
39
  "dependencies": {
40
40
  "date-fns": "^2.30.0",
41
41
  "lodash": "^4.17.21",
42
- "type-fest": "^3.11.0",
42
+ "type-fest": "^4.1.0",
43
43
  "uuid": "^9.0.0",
44
44
  "vue": "^3.3.4"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@nabla/vite-plugin-eslint": "^1.5.0",
48
- "@rushstack/eslint-patch": "^1.3.0",
49
- "@tsconfig/node18": "^2.0.1",
48
+ "@rushstack/eslint-patch": "^1.3.2",
49
+ "@tsconfig/node18": "^18.2.0",
50
50
  "@types/jsdom": "^21.1.1",
51
- "@types/lodash": "^4.14.194",
52
- "@types/node": "^18.15.11",
53
- "@types/uuid": "^9.0.1",
51
+ "@types/lodash": "^4.14.196",
52
+ "@types/node": "^18.17.1",
53
+ "@types/uuid": "^9.0.2",
54
54
  "@vitejs/plugin-vue": "^4.2.3",
55
- "@vue/eslint-config-prettier": "^7.1.0",
55
+ "@vue/eslint-config-prettier": "^8.0.0",
56
56
  "@vue/eslint-config-typescript": "^11.0.3",
57
- "@vue/test-utils": "^2.3.2",
57
+ "@vue/test-utils": "^2.4.1",
58
58
  "@vue/tsconfig": "^0.4.0",
59
- "cypress": "^12.12.0",
60
- "eslint": "^8.41.0",
59
+ "cypress": "^12.17.2",
60
+ "eslint": "^8.46.0",
61
61
  "eslint-plugin-cypress": "^2.13.3",
62
62
  "eslint-plugin-simple-import-sort": "^10.0.0",
63
- "eslint-plugin-unused-imports": "^2.0.0",
64
- "eslint-plugin-vue": "^9.14.0",
65
- "jsdom": "^22.0.0",
66
- "openapi-typescript-codegen": "^0.24.0",
67
- "prettier": "^2.8.8",
68
- "sass": "^1.62.1",
63
+ "eslint-plugin-unused-imports": "^3.0.0",
64
+ "eslint-plugin-vue": "^9.16.1",
65
+ "jsdom": "^22.1.0",
66
+ "openapi-typescript-codegen": "^0.25.0",
67
+ "prettier": "^3.0.0",
68
+ "sass": "^1.64.2",
69
69
  "start-server-and-test": "^2.0.0",
70
- "typescript": "~5.0.4",
71
- "vite": "^4.3.8",
72
- "vitest": "^0.31.1",
73
- "vue-tsc": "^1.6.5"
70
+ "typescript": "~5.1.6",
71
+ "vite": "^4.4.7",
72
+ "vitest": "^0.33.0",
73
+ "vue-tsc": "^1.8.8"
74
74
  }
75
75
  }
@@ -60,7 +60,10 @@ class VfTooltip {
60
60
  private handleTargetMouseEnterWithContext = this.handleTargetMouseEnter.bind(this);
61
61
  private handleTargetMouseLeaveWithContext = this.handleTargetMouseLeave.bind(this);
62
62
 
63
- constructor(private el: HTMLElement, private config: ITooltipOptions) {
63
+ constructor(
64
+ private el: HTMLElement,
65
+ private config: ITooltipOptions
66
+ ) {
64
67
  el.addEventListener('mouseenter', this.handleTargetMouseEnterWithContext);
65
68
  el.addEventListener('mouseleave', this.handleTargetMouseLeaveWithContext);
66
69
  }
@@ -41,8 +41,10 @@ export declare class ICancelablePromise<T = any> {
41
41
 
42
42
  interface IWrappedApiClientOptions<P extends ICancelablePromise = ICancelablePromise, Arguments extends unknown[] = any[]> {
43
43
  apiClient: IApiClient;
44
+ wrapper?: (options: IRequestOptions, fn: (options: IRequestOptions) => P) => P;
44
45
  onRequest?: (options: IRequestOptions) => IRequestOptions;
45
46
  onError?: (err: Error, options: IRequestOptions) => Error | null | void;
47
+ afterRequest?: (options: IRequestOptions) => void;
46
48
  CancelablePromise: new (...arguments_: Arguments) => P;
47
49
  }
48
50
 
@@ -50,36 +52,42 @@ export function isApiError(err: any): err is IApiError {
50
52
  return err instanceof Error && 'status' in err && 'body' in err;
51
53
  }
52
54
 
53
- export function installApiClientInterceptors({ apiClient, onRequest, onError, CancelablePromise }: IWrappedApiClientOptions) {
55
+ export function installApiClientInterceptors({ apiClient, wrapper, onRequest, onError, afterRequest, CancelablePromise }: IWrappedApiClientOptions) {
54
56
  const originalRequest = apiClient.request.request.bind(apiClient.request);
57
+ const resolvedWrapper = wrapper ?? ((options, fn) => fn(options));
55
58
  apiClient.request.request = (options: IRequestOptions) => {
56
- options = rewriteOptionsForFileUpload(options);
57
-
58
- if (onRequest) {
59
- options = onRequest(options);
60
- }
61
-
62
- return new CancelablePromise((resolve: (value: any) => void, reject: (err: any) => void, onCancel: (handler: () => void) => void) => {
63
- const promise = originalRequest(options);
64
- onCancel(promise.cancel);
65
- promise.then(resolve).catch(err => {
66
- if (isApiError(err) && typeof err.body === 'object' && 'error' in err.body) {
67
- if (err.status === 422) {
68
- return reject(new UserError(err.body.error));
69
- }
70
-
71
- err.message = `${err.body.error} (${err.status})`;
72
- }
73
- if (onError) {
74
- const handlerResult = onError(err, options);
75
- if (handlerResult === null) {
76
- return;
77
- }
78
- if (handlerResult instanceof Error) {
79
- return reject(handlerResult);
80
- }
81
- }
82
- reject(err);
59
+ return resolvedWrapper(options, options => {
60
+ options = rewriteOptionsForFileUpload(options);
61
+
62
+ if (onRequest) {
63
+ options = onRequest(options);
64
+ }
65
+
66
+ return new CancelablePromise((resolve: (value: any) => void, reject: (err: any) => void, onCancel: (handler: () => void) => void) => {
67
+ const promise = originalRequest(options);
68
+ onCancel(promise.cancel);
69
+ promise
70
+ .then(resolve)
71
+ .catch(err => {
72
+ if (isApiError(err) && typeof err.body === 'object' && 'error' in err.body) {
73
+ if (err.status === 422) {
74
+ return reject(new UserError(err.body.error));
75
+ }
76
+
77
+ err.message = `${err.body.error} (${err.status})`;
78
+ }
79
+ if (onError) {
80
+ const handlerResult = onError(err, options);
81
+ if (handlerResult === null) {
82
+ return;
83
+ }
84
+ if (handlerResult instanceof Error) {
85
+ return reject(handlerResult);
86
+ }
87
+ }
88
+ reject(err);
89
+ })
90
+ .finally(() => afterRequest?.(options));
83
91
  });
84
92
  });
85
93
  };
@@ -80,7 +80,10 @@ function discoverScrollableAncestorEl(el: Element): Element | null {
80
80
  export class InfiniteScrollHandler {
81
81
  isTripped = false;
82
82
 
83
- constructor(private el: Element, private handler: (e: Event) => void) {
83
+ constructor(
84
+ private el: Element,
85
+ private handler: (e: Event) => void
86
+ ) {
84
87
  this.install();
85
88
  }
86
89