@signal24/vue-foundation 4.3.2 → 4.3.3

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,16 +1,36 @@
1
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
- id?: string | undefined;
3
- closeOnMaskClick?: boolean | undefined;
4
- scrolls?: boolean | undefined;
5
- closeX?: boolean | undefined;
6
- class?: string | undefined;
7
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "formSubmit"[], "formSubmit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
- id?: string | undefined;
9
- closeOnMaskClick?: boolean | undefined;
10
- scrolls?: boolean | undefined;
11
- closeX?: boolean | undefined;
12
- class?: string | undefined;
13
- }>>> & {
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
+ id: {
3
+ type: import("vue").PropType<string>;
4
+ };
5
+ closeOnMaskClick: {
6
+ type: import("vue").PropType<boolean>;
7
+ };
8
+ scrolls: {
9
+ type: import("vue").PropType<boolean>;
10
+ };
11
+ closeX: {
12
+ type: import("vue").PropType<boolean>;
13
+ };
14
+ class: {
15
+ type: import("vue").PropType<string>;
16
+ };
17
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "formSubmit"[], "formSubmit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
18
+ id: {
19
+ type: import("vue").PropType<string>;
20
+ };
21
+ closeOnMaskClick: {
22
+ type: import("vue").PropType<boolean>;
23
+ };
24
+ scrolls: {
25
+ type: import("vue").PropType<boolean>;
26
+ };
27
+ closeX: {
28
+ type: import("vue").PropType<boolean>;
29
+ };
30
+ class: {
31
+ type: import("vue").PropType<string>;
32
+ };
33
+ }>> & {
14
34
  onFormSubmit?: ((...args: any[]) => any) | undefined;
15
35
  }, {}, {}>, {
16
36
  header?(_: {}): any;
@@ -18,15 +38,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
18
38
  footer?(_: {}): any;
19
39
  }>;
20
40
  export default _default;
21
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
22
- type __VLS_TypePropsToRuntimeProps<T> = {
23
- [K in keyof T]-?: {} extends Pick<T, K> ? {
24
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
25
- } : {
26
- type: import('vue').PropType<T[K]>;
27
- required: true;
28
- };
29
- };
30
41
  type __VLS_WithTemplateSlots<T, S> = T & {
31
42
  new (): {
32
43
  $slots: S;
@@ -1,16 +1,16 @@
1
1
  var De = Object.defineProperty;
2
- var Ae = (e, t, n) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var p = (e, t, n) => (Ae(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { defineComponent as I, defineProps as $e, defineEmits as Ve, ref as $, computed as V, openBlock as c, createElementBlock as d, createElementVNode as g, toDisplayString as k, withDirectives as B, createCommentVNode as y, Fragment as F, renderList as q, vModelSelect as Be, reactive as Fe, h as me, markRaw as _e, getCurrentInstance as ve, onMounted as z, onBeforeUnmount as X, createBlock as Y, Teleport as Ne, normalizeClass as T, withModifiers as Ke, renderSlot as R, resolveDirective as ge, createSlots as Re, withCtx as U, createTextVNode as te, vModelText as Ue, watch as ne, onActivated as ye, onDeactivated as Ee } from "vue";
2
+ var $e = (e, t, n) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var p = (e, t, n) => ($e(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { defineComponent as I, defineProps as Ae, defineEmits as Ve, ref as A, computed as V, openBlock as c, createElementBlock as d, createElementVNode as g, toDisplayString as k, withDirectives as B, createCommentVNode as y, Fragment as F, renderList as q, vModelSelect as Be, reactive as Fe, h as me, markRaw as _e, getCurrentInstance as ve, onMounted as z, onBeforeUnmount as X, createBlock as Y, Teleport as Ne, normalizeClass as T, withModifiers as Ke, renderSlot as R, resolveDirective as ge, createSlots as Re, withCtx as U, createTextVNode as te, vModelText as Ue, watch as ne, onActivated as ye, onDeactivated as Ee } from "vue";
5
5
  import { debounce as je, isEqual as Te, upperFirst as Pe, startCase as We, cloneDeep as qe, remove as ze } from "lodash";
6
6
  import { escapeHtml as Xe } from "@vue/shared";
7
7
  import { escapeHtml as Un } from "@vue/shared";
8
8
  import { format as P } from "date-fns";
9
9
  const Ye = I({
10
10
  setup() {
11
- const e = $e();
11
+ const e = Ae();
12
12
  Ve(["update:modelValue"]);
13
- const t = $(null), n = V(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = $(e.modelValue ?? null);
13
+ const t = A(null), n = V(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = A(e.modelValue ?? null);
14
14
  return { props: e, options: t, renderOptions: n, selectedItem: i };
15
15
  },
16
16
  watch: {
@@ -184,7 +184,7 @@ const it = ["id"], st = {
184
184
  },
185
185
  emits: ["formSubmit"],
186
186
  setup(e) {
187
- const t = e, n = ve(), i = $();
187
+ const t = e, n = ve(), i = A();
188
188
  z(() => {
189
189
  var l;
190
190
  document.body.classList.add("vf-modal-open"), t.closeOnMaskClick && (window.addEventListener("keydown", o), (l = i.value) == null || l.addEventListener("click", s));
@@ -303,12 +303,12 @@ const at = ["innerHtml"], ct = ["innerText"], K = /* @__PURE__ */ I({
303
303
  };
304
304
  }
305
305
  });
306
- let A;
306
+ let $;
307
307
  const dt = new Uint8Array(16);
308
308
  function ut() {
309
- if (!A && (A = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !A))
309
+ if (!$ && ($ = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !$))
310
310
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
311
- return A(dt);
311
+ return $(dt);
312
312
  }
313
313
  const u = [];
314
314
  for (let e = 0; e < 256; ++e)
@@ -686,7 +686,7 @@ const xt = /* @__PURE__ */ Oe(Et, [["render", Lt]]), Mn = /* @__PURE__ */ I({
686
686
  }))), s = V(() => n.formatter ? (r) => {
687
687
  var l;
688
688
  return (l = n.formatter) == null ? void 0 : l.call(n, r.label);
689
- } : (r) => r.label), o = $(i.value.find((r) => r.value === n.modelValue) ?? null);
689
+ } : (r) => r.label), o = A(i.value.find((r) => r.value === n.modelValue) ?? null);
690
690
  return ne(
691
691
  () => n.modelValue,
692
692
  (r) => {
@@ -717,10 +717,10 @@ function Ht(e) {
717
717
  function Dt(e) {
718
718
  return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : Ut(Number(e));
719
719
  }
720
- function At(e) {
720
+ function $t(e) {
721
721
  return e && vt(e);
722
722
  }
723
- function $t(e) {
723
+ function At(e) {
724
724
  return e ? Pe(e) : null;
725
725
  }
726
726
  function Vt(e) {
@@ -740,8 +740,8 @@ const le = {
740
740
  dash: It,
741
741
  dashZeros: Ht,
742
742
  number: Dt,
743
- phone: At,
744
- upperFirst: $t,
743
+ phone: $t,
744
+ upperFirst: At,
745
745
  startCase: Vt,
746
746
  upperCase: Bt,
747
747
  desnake: Ft,
@@ -760,31 +760,31 @@ function Cn(e, t) {
760
760
  const i = document.createElement("div");
761
761
  i.classList.add("vf-context-menu"), i.style.position = "absolute", n.appendChild(i);
762
762
  const s = e.currentTarget;
763
- s.style.userSelect = "none", s.classList.add("context-menu-active"), t.targetClass && s.classList.add(t.targetClass), t.class && i.classList.add(t.class), t.items.forEach((h) => {
764
- if (h == "-") {
763
+ s.style.userSelect = "none", s.classList.add("context-menu-active"), t.targetClass && s.classList.add(t.targetClass), t.class && i.classList.add(t.class), t.items.forEach((f) => {
764
+ if (f == "-") {
765
765
  const D = document.createElement("div");
766
766
  D.classList.add("separator"), i.appendChild(D);
767
767
  return;
768
768
  }
769
769
  const v = document.createElement("div");
770
- v.classList.add("item"), v.style.userSelect = "none", v.innerText = h.title, i.appendChild(v), h.class && v.classList.add(h.class), h.shouldConfirm ? v.addEventListener("click", () => h.handler()) : v.addEventListener("click", () => He(v, h.handler));
770
+ v.classList.add("item"), v.style.userSelect = "none", v.innerText = f.title, i.appendChild(v), f.class && v.classList.add(f.class), f.shouldConfirm ? v.addEventListener("click", () => f.handler()) : v.addEventListener("click", () => He(v, f.handler));
771
771
  });
772
- const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = i.offsetHeight, a = i.offsetWidth, m = o < a ? e.clientX - a - 1 : e.clientX + 1, f = r < l ? e.clientY - l - 1 : e.clientY + 1;
773
- i.style.left = m + "px", i.style.top = f + "px", setTimeout(() => {
772
+ const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = i.offsetHeight, a = i.offsetWidth, m = o < a ? e.clientX - a - 1 : e.clientX + 1, h = r < l ? e.clientY - l - 1 : e.clientY + 1;
773
+ i.style.left = m + "px", i.style.top = h + "px", setTimeout(() => {
774
774
  i.style.width = i.offsetWidth + "px";
775
775
  }, 50);
776
776
  function O() {
777
777
  t.targetClass && s.classList.remove(t.targetClass), s.classList.remove("context-menu-active"), s.style.userSelect = "", n.remove();
778
778
  }
779
- function He(h, v) {
780
- if (h.classList.contains("pending-confirm"))
779
+ function He(f, v) {
780
+ if (f.classList.contains("pending-confirm"))
781
781
  return v();
782
- const D = h.innerHTML;
783
- h.classList.add("pending-confirm"), h.innerText = "Confirm";
782
+ const D = f.innerHTML;
783
+ f.classList.add("pending-confirm"), f.innerText = "Confirm";
784
784
  const ee = () => {
785
- h.classList.remove("pending-confirm"), h.innerHTML = D, h.removeEventListener("mouseleave", ee);
785
+ f.classList.remove("pending-confirm"), f.innerHTML = D, f.removeEventListener("mouseleave", ee);
786
786
  };
787
- h.addEventListener("mouseleave", ee), e.stopPropagation();
787
+ f.addEventListener("mouseleave", ee), e.stopPropagation();
788
788
  }
789
789
  }
790
790
  const Nt = (e) => new Promise((t) => setTimeout(t, e)), In = (e) => Nt(e * 1e3), M = Symbol("MaskState");
@@ -807,7 +807,7 @@ function ke(e) {
807
807
  e[M] && e.removeChild(e[M].maskEl);
808
808
  }
809
809
  const W = Symbol("FormMaskState");
810
- function An(e, t, n) {
810
+ function $n(e, t, n) {
811
811
  const i = e instanceof Element ? e : Me(e);
812
812
  i.classList.add("vf-masked");
813
813
  const s = t instanceof Element ? t : i.querySelectorAll(t ?? "button:not([disabled])")[0], o = s.tagName === "INPUT" ? s.value : s.innerHTML;
@@ -830,7 +830,7 @@ function Me(e) {
830
830
  function Ut(e) {
831
831
  return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
832
832
  }
833
- function $n(e, t) {
833
+ function An(e, t) {
834
834
  return e != null ? qe(e) : t;
835
835
  }
836
836
  function Vn(e, t) {
@@ -846,17 +846,20 @@ function Bn({ apiClient: e, onRequest: t, onError: n, CancelablePromise: i }) {
846
846
  const s = e.request.request.bind(e.request);
847
847
  e.request.request = (o) => (t && (o = t(o)), new i((r, l, a) => {
848
848
  const m = s(o);
849
- a(m.cancel), m.then(r).catch((f) => {
850
- if (jt(f) && typeof f.body == "object" && "error" in f.body && f.status === 422)
851
- return l(new N(f.body.error));
849
+ a(m.cancel), m.then(r).catch((h) => {
850
+ if (jt(h) && typeof h.body == "object" && "error" in h.body) {
851
+ if (h.status === 422)
852
+ return l(new N(h.body.error));
853
+ h.message = `${h.body.error} (${h.status})`;
854
+ }
852
855
  if (n) {
853
- const O = n(f, o);
856
+ const O = n(h, o);
854
857
  if (O === null)
855
858
  return;
856
859
  if (O instanceof Error)
857
860
  return l(O);
858
861
  }
859
- l(f);
862
+ l(h);
860
863
  });
861
864
  }));
862
865
  }
@@ -971,8 +974,8 @@ function Qt(e, t) {
971
974
  e.attributes.getNamedItem("display-utc") !== null && o.setMinutes(o.getMinutes() - o.getTimezoneOffset());
972
975
  let r = (m = e.attributes.getNamedItem("format")) == null ? void 0 : m.value;
973
976
  if (!r && e.attributes.getNamedItem("relative-date") !== null) {
974
- const f = /* @__PURE__ */ new Date();
975
- f.getFullYear() == o.getFullYear() && f.getMonth() == o.getMonth() && f.getDate() == o.getDate() && (n = "at", r = "HH:mm");
977
+ const h = /* @__PURE__ */ new Date();
978
+ h.getFullYear() == o.getFullYear() && h.getMonth() == o.getMonth() && h.getDate() == o.getDate() && (n = "at", r = "HH:mm");
976
979
  }
977
980
  r || (r = H.defaultDateTimeFormat);
978
981
  let l = P(o, r);
@@ -1127,7 +1130,7 @@ export {
1127
1130
  Mn as VfEzSmartSelect,
1128
1131
  rt as VfModal,
1129
1132
  xt as VfSmartSelect,
1130
- $n as cloneProp,
1133
+ An as cloneProp,
1131
1134
  On as configureVf,
1132
1135
  Ln as createFilters,
1133
1136
  be as createModalInjection,
@@ -1144,7 +1147,7 @@ export {
1144
1147
  jt as isApiError,
1145
1148
  Hn as maskComponent,
1146
1149
  Kt as maskEl,
1147
- An as maskForm,
1150
+ $n as maskForm,
1148
1151
  Sn as nl2br,
1149
1152
  Vn as nullifyEmptyInputs,
1150
1153
  Z as presentModal,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signal24/vue-foundation",
3
3
  "type": "module",
4
- "version": "4.3.2",
4
+ "version": "4.3.3",
5
5
  "description": "Common components, directives, and helpers for Vue 3 apps",
6
6
  "module": "./dist/vue-foundation.es.js",
7
7
  "bin": {
@@ -65,6 +65,8 @@ export function installApiClientInterceptors({ apiClient, onRequest, onError, Ca
65
65
  if (err.status === 422) {
66
66
  return reject(new UserError(err.body.error));
67
67
  }
68
+
69
+ err.message = `${err.body.error} (${err.status})`;
68
70
  }
69
71
  if (onError) {
70
72
  const handlerResult = onError(err, options);