@signal24/vue-foundation 4.18.0 → 4.19.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.
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/modal-helpers.d.ts +159 -0
- package/dist/src/helpers/openapi.d.ts +2 -2
- package/dist/vue-foundation.es.js +39 -34
- package/package.json +3 -3
- package/src/components/index.ts +1 -0
- package/src/components/modal-helpers.ts +7 -0
- package/src/helpers/openapi.ts +12 -4
|
@@ -4,6 +4,7 @@ import VfEzSmartSelect from './vf-ez-smart-select.vue';
|
|
|
4
4
|
import VfModal from './vf-modal.vue';
|
|
5
5
|
import VfSmartSelect from './vf-smart-select.vue';
|
|
6
6
|
export * from './alert-helpers';
|
|
7
|
+
export * from './modal-helpers';
|
|
7
8
|
export * from './overlay-container';
|
|
8
9
|
export * from './toast-helpers';
|
|
9
10
|
export { VfAjaxSelect, VfAlertModal, VfEzSmartSelect, VfModal, VfSmartSelect };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export declare function vfModalRef(): import("vue").Ref<({
|
|
2
|
+
$: import("vue").ComponentInternalInstance;
|
|
3
|
+
$data: {};
|
|
4
|
+
$props: {
|
|
5
|
+
readonly id?: string | undefined;
|
|
6
|
+
readonly closeOnMaskClick?: boolean | undefined;
|
|
7
|
+
readonly scrolls?: boolean | undefined;
|
|
8
|
+
readonly closeX?: boolean | undefined;
|
|
9
|
+
readonly class?: (string | string[]) | undefined;
|
|
10
|
+
readonly onFormSubmit?: ((...args: any[]) => any) | undefined;
|
|
11
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
12
|
+
$attrs: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
$refs: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
$slots: Readonly<{
|
|
19
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
22
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
23
|
+
$host: Element | null;
|
|
24
|
+
$emit: (event: "formSubmit", ...args: any[]) => void;
|
|
25
|
+
$el: HTMLDivElement;
|
|
26
|
+
$options: import("vue").ComponentOptionsBase<Readonly<{
|
|
27
|
+
id?: string;
|
|
28
|
+
closeOnMaskClick?: boolean;
|
|
29
|
+
scrolls?: boolean;
|
|
30
|
+
closeX?: boolean;
|
|
31
|
+
class?: string | string[];
|
|
32
|
+
}> & Readonly<{
|
|
33
|
+
onFormSubmit?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
mask: () => () => void;
|
|
36
|
+
unmask: () => void;
|
|
37
|
+
hide: () => () => void;
|
|
38
|
+
unhide: () => void;
|
|
39
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
40
|
+
formSubmit: (...args: any[]) => void;
|
|
41
|
+
}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
42
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
43
|
+
created?: (() => void) | (() => void)[];
|
|
44
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
45
|
+
mounted?: (() => void) | (() => void)[];
|
|
46
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
47
|
+
updated?: (() => void) | (() => void)[];
|
|
48
|
+
activated?: (() => void) | (() => void)[];
|
|
49
|
+
deactivated?: (() => void) | (() => void)[];
|
|
50
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
51
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
52
|
+
destroyed?: (() => void) | (() => void)[];
|
|
53
|
+
unmounted?: (() => void) | (() => void)[];
|
|
54
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
55
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
56
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
57
|
+
};
|
|
58
|
+
$forceUpdate: () => void;
|
|
59
|
+
$nextTick: typeof import("vue").nextTick;
|
|
60
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
61
|
+
} & Readonly<{}> & Omit<Readonly<{
|
|
62
|
+
id?: string;
|
|
63
|
+
closeOnMaskClick?: boolean;
|
|
64
|
+
scrolls?: boolean;
|
|
65
|
+
closeX?: boolean;
|
|
66
|
+
class?: string | string[];
|
|
67
|
+
}> & Readonly<{
|
|
68
|
+
onFormSubmit?: ((...args: any[]) => any) | undefined;
|
|
69
|
+
}>, "mask" | "hide" | "unmask" | "unhide"> & import("vue").ShallowUnwrapRef<{
|
|
70
|
+
mask: () => () => void;
|
|
71
|
+
unmask: () => void;
|
|
72
|
+
hide: () => () => void;
|
|
73
|
+
unhide: () => void;
|
|
74
|
+
}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
75
|
+
$slots: {
|
|
76
|
+
header?(_: {}): any;
|
|
77
|
+
default?(_: {}): any;
|
|
78
|
+
footer?(_: {}): any;
|
|
79
|
+
};
|
|
80
|
+
}) | undefined, ({
|
|
81
|
+
$: import("vue").ComponentInternalInstance;
|
|
82
|
+
$data: {};
|
|
83
|
+
$props: {
|
|
84
|
+
readonly id?: string | undefined;
|
|
85
|
+
readonly closeOnMaskClick?: boolean | undefined;
|
|
86
|
+
readonly scrolls?: boolean | undefined;
|
|
87
|
+
readonly closeX?: boolean | undefined;
|
|
88
|
+
readonly class?: (string | string[]) | undefined;
|
|
89
|
+
readonly onFormSubmit?: ((...args: any[]) => any) | undefined;
|
|
90
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
91
|
+
$attrs: {
|
|
92
|
+
[x: string]: unknown;
|
|
93
|
+
};
|
|
94
|
+
$refs: {
|
|
95
|
+
[x: string]: unknown;
|
|
96
|
+
};
|
|
97
|
+
$slots: Readonly<{
|
|
98
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
101
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
102
|
+
$host: Element | null;
|
|
103
|
+
$emit: (event: "formSubmit", ...args: any[]) => void;
|
|
104
|
+
$el: HTMLDivElement;
|
|
105
|
+
$options: import("vue").ComponentOptionsBase<Readonly<{
|
|
106
|
+
id?: string;
|
|
107
|
+
closeOnMaskClick?: boolean;
|
|
108
|
+
scrolls?: boolean;
|
|
109
|
+
closeX?: boolean;
|
|
110
|
+
class?: string | string[];
|
|
111
|
+
}> & Readonly<{
|
|
112
|
+
onFormSubmit?: ((...args: any[]) => any) | undefined;
|
|
113
|
+
}>, {
|
|
114
|
+
mask: () => () => void;
|
|
115
|
+
unmask: () => void;
|
|
116
|
+
hide: () => () => void;
|
|
117
|
+
unhide: () => void;
|
|
118
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
119
|
+
formSubmit: (...args: any[]) => void;
|
|
120
|
+
}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
121
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
122
|
+
created?: (() => void) | (() => void)[];
|
|
123
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
124
|
+
mounted?: (() => void) | (() => void)[];
|
|
125
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
126
|
+
updated?: (() => void) | (() => void)[];
|
|
127
|
+
activated?: (() => void) | (() => void)[];
|
|
128
|
+
deactivated?: (() => void) | (() => void)[];
|
|
129
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
130
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
131
|
+
destroyed?: (() => void) | (() => void)[];
|
|
132
|
+
unmounted?: (() => void) | (() => void)[];
|
|
133
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
134
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
135
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
136
|
+
};
|
|
137
|
+
$forceUpdate: () => void;
|
|
138
|
+
$nextTick: typeof import("vue").nextTick;
|
|
139
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
140
|
+
} & Readonly<{}> & Omit<Readonly<{
|
|
141
|
+
id?: string;
|
|
142
|
+
closeOnMaskClick?: boolean;
|
|
143
|
+
scrolls?: boolean;
|
|
144
|
+
closeX?: boolean;
|
|
145
|
+
class?: string | string[];
|
|
146
|
+
}> & Readonly<{
|
|
147
|
+
onFormSubmit?: ((...args: any[]) => any) | undefined;
|
|
148
|
+
}>, "mask" | "hide" | "unmask" | "unhide"> & import("vue").ShallowUnwrapRef<{
|
|
149
|
+
mask: () => () => void;
|
|
150
|
+
unmask: () => void;
|
|
151
|
+
hide: () => () => void;
|
|
152
|
+
unhide: () => void;
|
|
153
|
+
}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
154
|
+
$slots: {
|
|
155
|
+
header?(_: {}): any;
|
|
156
|
+
default?(_: {}): any;
|
|
157
|
+
footer?(_: {}): any;
|
|
158
|
+
};
|
|
159
|
+
}) | undefined>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function
|
|
1
|
+
import { type OpenApiClient, type OpenApiClientOptions } from '@signal24/openapi-client-codegen/browser';
|
|
2
|
+
export declare function configureVfOpenApiClient(client: OpenApiClient, clientOptions: OpenApiClientOptions): void;
|
|
@@ -4,8 +4,8 @@ var A = (e, t, n) => bt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
|
4
4
|
import { defineComponent as N, ref as T, computed as x, watch as F, onMounted as V, openBlock as w, createElementBlock as k, createElementVNode as D, toDisplayString as U, withDirectives as Q, createCommentVNode as O, Fragment as J, renderList as me, vModelSelect as Tt, getCurrentInstance as he, withModifiers as pe, normalizeStyle as St, normalizeClass as B, renderSlot as G, reactive as Ct, h as ee, Teleport as Lt, markRaw as Mt, onBeforeUnmount as ye, resolveDirective as xt, createBlock as Pe, createSlots as It, withCtx as ue, createTextVNode as De, vModelText as Ht, onActivated as qe, onDeactivated as ze } from "vue";
|
|
5
5
|
import { compact as Ye, debounce as At, isEqual as Ke, startCase as Ft, upperFirst as Dt, cloneDeep as Ot, remove as $t, last as Bt } from "lodash";
|
|
6
6
|
import { escapeHtml as Vt } from "@vue/shared";
|
|
7
|
-
import { escapeHtml as
|
|
8
|
-
import {
|
|
7
|
+
import { escapeHtml as Ro } from "@vue/shared";
|
|
8
|
+
import { configureOpenApiClient as _t, OpenApiError as Nt } from "@signal24/openapi-client-codegen/browser";
|
|
9
9
|
import { format as fe } from "date-fns";
|
|
10
10
|
const Rt = {
|
|
11
11
|
key: 0,
|
|
@@ -764,7 +764,11 @@ const vn = ["disabled", "placeholder", "required"], mn = {
|
|
|
764
764
|
"null-title": r.nullTitle
|
|
765
765
|
}, null, 8, ["modelValue", "options", "formatter", "null-title"]));
|
|
766
766
|
}
|
|
767
|
-
})
|
|
767
|
+
});
|
|
768
|
+
function Lo() {
|
|
769
|
+
return T();
|
|
770
|
+
}
|
|
771
|
+
const kn = { class: "content" }, bn = { class: "message" }, Tn = {
|
|
768
772
|
key: 0,
|
|
769
773
|
class: "close"
|
|
770
774
|
}, Sn = {
|
|
@@ -811,7 +815,7 @@ const vn = ["disabled", "placeholder", "required"], mn = {
|
|
|
811
815
|
], 2));
|
|
812
816
|
}
|
|
813
817
|
});
|
|
814
|
-
function
|
|
818
|
+
function Mo(e) {
|
|
815
819
|
const t = ge(Cn, {
|
|
816
820
|
...e,
|
|
817
821
|
callback: () => te(t)
|
|
@@ -860,15 +864,15 @@ const $e = {
|
|
|
860
864
|
upperCase: Dn,
|
|
861
865
|
desnake: On,
|
|
862
866
|
usCurrency: $n
|
|
863
|
-
},
|
|
867
|
+
}, xo = (e) => ({
|
|
864
868
|
...$e,
|
|
865
869
|
...e($e)
|
|
866
870
|
});
|
|
867
|
-
function
|
|
871
|
+
function Io(e, t, n) {
|
|
868
872
|
const o = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
|
|
869
873
|
return o === -1 ? !1 : (e.splice(o, 1, n), !0);
|
|
870
874
|
}
|
|
871
|
-
function
|
|
875
|
+
function Ho(e, t) {
|
|
872
876
|
const n = document.createElement("div");
|
|
873
877
|
n.classList.add("vf-overlay"), n.addEventListener("click", f), document.body.appendChild(n);
|
|
874
878
|
const o = document.createElement("div");
|
|
@@ -901,32 +905,32 @@ function Io(e, t) {
|
|
|
901
905
|
a.addEventListener("mouseleave", I), v.stopPropagation();
|
|
902
906
|
}
|
|
903
907
|
}
|
|
904
|
-
const Bn = (e) => new Promise((t) => setTimeout(t, e)),
|
|
908
|
+
const Bn = (e) => new Promise((t) => setTimeout(t, e)), Ao = (e) => Bn(e * 1e3);
|
|
905
909
|
function Vn(e) {
|
|
906
910
|
return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
907
911
|
}
|
|
908
|
-
function
|
|
912
|
+
function Fo(e, t) {
|
|
909
913
|
return e != null ? Ot(e) : t;
|
|
910
914
|
}
|
|
911
|
-
function
|
|
915
|
+
function Do(e, t) {
|
|
912
916
|
const n = { ...e };
|
|
913
917
|
for (const o of t)
|
|
914
918
|
n[o] === "" && (n[o] = null);
|
|
915
919
|
return n;
|
|
916
920
|
}
|
|
917
|
-
function
|
|
918
|
-
_t({
|
|
919
|
-
...
|
|
920
|
-
onError(
|
|
921
|
-
var
|
|
922
|
-
Nt
|
|
923
|
-
const
|
|
924
|
-
return
|
|
921
|
+
function Oo(e, t) {
|
|
922
|
+
_t(e, {
|
|
923
|
+
...t,
|
|
924
|
+
onError(n, o) {
|
|
925
|
+
var l;
|
|
926
|
+
n instanceof Nt && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new oe(n.body.error));
|
|
927
|
+
const i = (l = t.onError) == null ? void 0 : l.call(t, n, o);
|
|
928
|
+
return i !== void 0 ? i : n;
|
|
925
929
|
}
|
|
926
930
|
});
|
|
927
931
|
}
|
|
928
932
|
const ke = Symbol("HookState");
|
|
929
|
-
function
|
|
933
|
+
function $o(e, t) {
|
|
930
934
|
const n = t ?? he();
|
|
931
935
|
V(() => _n(n, e), n), qe(() => Nn(n), n), ze(() => Be(n), n), ye(() => Be(n), n);
|
|
932
936
|
}
|
|
@@ -971,7 +975,7 @@ class Y {
|
|
|
971
975
|
Math.ceil(this.el.scrollTop + this.el.clientHeight + 5) >= this.el.scrollHeight ? this.isTripped || (this.handler(t), this.isTripped = !0) : this.isTripped && (this.isTripped = !1);
|
|
972
976
|
}
|
|
973
977
|
}
|
|
974
|
-
function
|
|
978
|
+
function Bo(e) {
|
|
975
979
|
V(() => window.addEventListener("resize", e)), qe(() => window.addEventListener("resize", e)), ze(() => window.removeEventListener("resize", e)), ye(() => window.removeEventListener("resize", e));
|
|
976
980
|
}
|
|
977
981
|
const Rn = {
|
|
@@ -1214,7 +1218,7 @@ class oo {
|
|
|
1214
1218
|
function lo(e) {
|
|
1215
1219
|
e.directive("autofocus", Rn), e.directive("confirm-button", Wn), e.directive("date-input", jn), e.directive("datetime", qn), e.directive("disabled", Yn), e.directive("duration", Xn), e.directive("hotkey", Qn), e.directive("infinite-scroll", eo), e.directive("readonly", to), e.directive("tooltip", no);
|
|
1216
1220
|
}
|
|
1217
|
-
function
|
|
1221
|
+
function Vo(e) {
|
|
1218
1222
|
lo(e);
|
|
1219
1223
|
}
|
|
1220
1224
|
export {
|
|
@@ -1225,45 +1229,46 @@ export {
|
|
|
1225
1229
|
Co as VfEzSmartSelect,
|
|
1226
1230
|
tn as VfModal,
|
|
1227
1231
|
wn as VfSmartSelect,
|
|
1228
|
-
|
|
1232
|
+
Fo as cloneProp,
|
|
1229
1233
|
go as configureVf,
|
|
1230
|
-
|
|
1234
|
+
Oo as configureVfOpenApiClient,
|
|
1235
|
+
xo as createFilters,
|
|
1231
1236
|
ge as createOverlayInjection,
|
|
1232
1237
|
cn as desnakeCase,
|
|
1233
1238
|
zt as dismissOverlayInjectionById,
|
|
1234
1239
|
mo as dismissOverlayInjectionByInstance,
|
|
1235
1240
|
Xe as dismissOverlayInjectionByInternalInstance,
|
|
1236
1241
|
qt as dismissOverlayInjectionByVnode,
|
|
1237
|
-
|
|
1242
|
+
Ro as escapeHtml,
|
|
1238
1243
|
Kt as formatError,
|
|
1239
1244
|
Vn as formatNumber,
|
|
1240
1245
|
dn as formatPhone,
|
|
1241
1246
|
fn as formatUSCurrency,
|
|
1242
1247
|
wo as handleError,
|
|
1243
1248
|
Eo as handleErrorAndAlert,
|
|
1244
|
-
|
|
1245
|
-
Bo as installVf,
|
|
1249
|
+
Vo as installVf,
|
|
1246
1250
|
ko as maskComponent,
|
|
1247
1251
|
Xt as maskEl,
|
|
1248
1252
|
Zt as maskForm,
|
|
1249
1253
|
To as nl2br,
|
|
1250
|
-
|
|
1254
|
+
Do as nullifyEmptyInputs,
|
|
1251
1255
|
Ee as presentOverlay,
|
|
1252
1256
|
te as removeOverlayInjection,
|
|
1253
|
-
|
|
1257
|
+
Io as replaceElement,
|
|
1254
1258
|
Yt as showAlert,
|
|
1255
1259
|
ho as showConfirm,
|
|
1256
1260
|
po as showConfirmDestroy,
|
|
1257
|
-
|
|
1258
|
-
|
|
1261
|
+
Ho as showContextMenu,
|
|
1262
|
+
Mo as showToast,
|
|
1259
1263
|
yo as showWait,
|
|
1260
1264
|
Bn as sleep,
|
|
1261
|
-
|
|
1265
|
+
Ao as sleepSecs,
|
|
1262
1266
|
we as toError,
|
|
1263
1267
|
bo as unmaskComponent,
|
|
1264
1268
|
Ze as unmaskEl,
|
|
1265
1269
|
Ge as unmaskForm,
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
So as uuid
|
|
1270
|
+
$o as useInfiniteScroll,
|
|
1271
|
+
Bo as useResizeWatcher,
|
|
1272
|
+
So as uuid,
|
|
1273
|
+
Lo as vfModalRef
|
|
1269
1274
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signal24/vue-foundation",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.19.0",
|
|
5
5
|
"description": "Common components, directives, and helpers for Vue 3 apps",
|
|
6
6
|
"module": "./dist/vue-foundation.es.js",
|
|
7
7
|
"exports": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"uuid": "^11.0.3"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@signal24/openapi-client-codegen": "^
|
|
40
|
+
"@signal24/openapi-client-codegen": "^2.1.0",
|
|
41
41
|
"date-fns": "^3.0.6",
|
|
42
42
|
"lodash": "^4.17.21",
|
|
43
43
|
"vue": "^3.4.0"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@eslint/js": "9.14.0",
|
|
47
47
|
"@nabla/vite-plugin-eslint": "^2.0.4",
|
|
48
|
-
"@signal24/openapi-client-codegen": "^
|
|
48
|
+
"@signal24/openapi-client-codegen": "^2.1.0",
|
|
49
49
|
"@tsconfig/node22": "^22.0.0",
|
|
50
50
|
"@types/eslint__js": "^8.42.3",
|
|
51
51
|
"@types/jsdom": "^21.1.7",
|
package/src/components/index.ts
CHANGED
package/src/helpers/openapi.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { configureOpenApiClient, type OpenApiClient, type OpenApiClientOptions, OpenApiError } from '@signal24/openapi-client-codegen/browser';
|
|
2
2
|
|
|
3
3
|
import { UserError } from '.';
|
|
4
4
|
|
|
5
|
-
export function
|
|
6
|
-
|
|
5
|
+
export function configureVfOpenApiClient(client: OpenApiClient, clientOptions: OpenApiClientOptions) {
|
|
6
|
+
configureOpenApiClient(client, {
|
|
7
7
|
...clientOptions,
|
|
8
|
+
|
|
8
9
|
onError(err, options) {
|
|
9
|
-
if (
|
|
10
|
+
if (
|
|
11
|
+
err instanceof OpenApiError &&
|
|
12
|
+
err.response.status === 422 &&
|
|
13
|
+
typeof err.body === 'object' &&
|
|
14
|
+
err.body &&
|
|
15
|
+
'error' in err.body &&
|
|
16
|
+
typeof err.body.error === 'string'
|
|
17
|
+
) {
|
|
10
18
|
err = new UserError(err.body.error);
|
|
11
19
|
}
|
|
12
20
|
|