@signal24/vue-foundation 4.2.0 → 4.2.1
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,16 +1,16 @@
|
|
|
1
1
|
var Ce = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var f = (e, t, n) => (
|
|
4
|
-
import { defineComponent as
|
|
2
|
+
var xe = (e, t, n) => t in e ? Ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var f = (e, t, n) => (xe(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import { defineComponent as L, defineProps as Ie, defineEmits as He, ref as I, computed as H, openBlock as a, createElementBlock as d, createElementVNode as v, toDisplayString as w, withDirectives as D, createCommentVNode as g, Fragment as $, renderList as P, vModelSelect as De, reactive as $e, h as ue, markRaw as Ae, onMounted as W, onBeforeUnmount as q, getCurrentInstance as he, createBlock as U, Teleport as Be, normalizeClass as E, withModifiers as Ve, renderSlot as F, resolveDirective as fe, createSlots as Fe, withCtx as _, createTextVNode as Q, vModelText as _e, watch as J, onActivated as pe, onDeactivated as me } from "vue";
|
|
5
5
|
import { debounce as Ne, isEqual as ve, upperFirst as Ke, startCase as Re, cloneDeep as je, remove as Pe } from "lodash";
|
|
6
6
|
import { escapeHtml as We } from "@vue/shared";
|
|
7
|
-
import { escapeHtml as
|
|
7
|
+
import { escapeHtml as Dn } from "@vue/shared";
|
|
8
8
|
import { format as R } from "date-fns";
|
|
9
|
-
const qe =
|
|
9
|
+
const qe = L({
|
|
10
10
|
setup() {
|
|
11
11
|
const e = Ie();
|
|
12
|
-
|
|
13
|
-
const t = I(null), n =
|
|
12
|
+
He(["update:modelValue"]);
|
|
13
|
+
const t = I(null), n = H(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = I(e.modelValue ?? null);
|
|
14
14
|
return { props: e, options: t, renderOptions: n, selectedItem: i };
|
|
15
15
|
},
|
|
16
16
|
watch: {
|
|
@@ -45,7 +45,7 @@ const qe = x({
|
|
|
45
45
|
value: null
|
|
46
46
|
}, Xe = ["value"];
|
|
47
47
|
function Ye(e, t, n, i, s, o) {
|
|
48
|
-
return e.renderOptions ?
|
|
48
|
+
return e.renderOptions ? D((a(), d("select", {
|
|
49
49
|
key: 1,
|
|
50
50
|
"onUpdate:modelValue": t[0] || (t[0] = (l) => e.selectedItem = l)
|
|
51
51
|
}, [
|
|
@@ -58,14 +58,14 @@ function Ye(e, t, n, i, s, o) {
|
|
|
58
58
|
}, w(l), 9, Xe);
|
|
59
59
|
}), 128))
|
|
60
60
|
], 512)), [
|
|
61
|
-
[
|
|
61
|
+
[De, e.selectedItem]
|
|
62
62
|
]) : (a(), d("select", Ue, [
|
|
63
63
|
v("option", null, w(e.props.loadingText || "Loading..."), 1)
|
|
64
64
|
]));
|
|
65
65
|
}
|
|
66
66
|
const rn = /* @__PURE__ */ ge(qe, [["render", Ye]]);
|
|
67
67
|
let Ze = 0;
|
|
68
|
-
const y = $e([]), an =
|
|
68
|
+
const y = $e([]), an = L({
|
|
69
69
|
setup() {
|
|
70
70
|
return () => ue("div", { id: "modal-container" }, [
|
|
71
71
|
P(y, (e) => e.vnode)
|
|
@@ -173,7 +173,7 @@ const Je = ["id"], et = {
|
|
|
173
173
|
}, tt = { class: "vf-modal-content" }, nt = {
|
|
174
174
|
key: 1,
|
|
175
175
|
class: "vf-modal-footer"
|
|
176
|
-
}, it = /* @__PURE__ */
|
|
176
|
+
}, it = /* @__PURE__ */ L({
|
|
177
177
|
__name: "modal",
|
|
178
178
|
props: {
|
|
179
179
|
id: {},
|
|
@@ -235,7 +235,7 @@ const Je = ["id"], et = {
|
|
|
235
235
|
]));
|
|
236
236
|
}
|
|
237
237
|
});
|
|
238
|
-
const st = ["innerHtml"], ot = ["innerText"], V = /* @__PURE__ */
|
|
238
|
+
const st = ["innerHtml"], ot = ["innerText"], V = /* @__PURE__ */ L({
|
|
239
239
|
__name: "alert-modal",
|
|
240
240
|
props: {
|
|
241
241
|
isBare: { type: Boolean },
|
|
@@ -247,7 +247,7 @@ const st = ["innerHtml"], ot = ["innerText"], V = /* @__PURE__ */ x({
|
|
|
247
247
|
callback: { type: Function }
|
|
248
248
|
},
|
|
249
249
|
setup(e) {
|
|
250
|
-
const t = e, n =
|
|
250
|
+
const t = e, n = H(() => t.message instanceof Error ? Qe(t.message) : t.message);
|
|
251
251
|
return (i, s) => {
|
|
252
252
|
const o = fe("autofocus");
|
|
253
253
|
return a(), U(it, {
|
|
@@ -276,7 +276,7 @@ const st = ["innerHtml"], ot = ["innerText"], V = /* @__PURE__ */ x({
|
|
|
276
276
|
name: "footer",
|
|
277
277
|
fn: _(() => [
|
|
278
278
|
i.shouldConfirm ? (a(), d($, { key: 0 }, [
|
|
279
|
-
|
|
279
|
+
D((a(), d("button", {
|
|
280
280
|
class: "primary",
|
|
281
281
|
onClick: s[0] || (s[0] = () => i.callback(!0))
|
|
282
282
|
}, [
|
|
@@ -288,7 +288,7 @@ const st = ["innerHtml"], ot = ["innerText"], V = /* @__PURE__ */ x({
|
|
|
288
288
|
class: "default",
|
|
289
289
|
onClick: s[1] || (s[1] = () => i.callback(!1))
|
|
290
290
|
}, "Cancel")
|
|
291
|
-
], 64)) :
|
|
291
|
+
], 64)) : D((a(), d("button", {
|
|
292
292
|
key: 1,
|
|
293
293
|
class: "default",
|
|
294
294
|
onClick: s[2] || (s[2] = () => i.callback(!0))
|
|
@@ -600,7 +600,7 @@ function yt(e, t, n, i, s, o) {
|
|
|
600
600
|
return a(), d("div", {
|
|
601
601
|
class: E(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
|
|
602
602
|
}, [
|
|
603
|
-
|
|
603
|
+
D(v("input", {
|
|
604
604
|
"onUpdate:modelValue": t[0] || (t[0] = (r) => e.searchText = r),
|
|
605
605
|
ref: "searchField",
|
|
606
606
|
type: "text",
|
|
@@ -638,7 +638,7 @@ function yt(e, t, n, i, s, o) {
|
|
|
638
638
|
], 512)) : g("", !0)
|
|
639
639
|
], 2);
|
|
640
640
|
}
|
|
641
|
-
const Et = /* @__PURE__ */ ge(dt, [["render", yt]]), gn = /* @__PURE__ */
|
|
641
|
+
const Et = /* @__PURE__ */ ge(dt, [["render", yt]]), gn = /* @__PURE__ */ L({
|
|
642
642
|
__name: "ez-smart-select",
|
|
643
643
|
props: {
|
|
644
644
|
modelValue: {},
|
|
@@ -649,10 +649,10 @@ const Et = /* @__PURE__ */ ge(dt, [["render", yt]]), gn = /* @__PURE__ */ x({
|
|
|
649
649
|
},
|
|
650
650
|
emits: ["update:modelValue"],
|
|
651
651
|
setup(e, { emit: t }) {
|
|
652
|
-
const n = e, i =
|
|
652
|
+
const n = e, i = H(() => Array.isArray(n.options) ? n.options.map((l) => ({ value: l, label: l })) : Object.entries(n.options).map(([l, r]) => ({
|
|
653
653
|
value: l,
|
|
654
654
|
label: r
|
|
655
|
-
}))), s =
|
|
655
|
+
}))), s = H(() => n.formatter ? (l) => {
|
|
656
656
|
var r;
|
|
657
657
|
return (r = n.formatter) == null ? void 0 : r.call(n, l.label);
|
|
658
658
|
} : (l) => l.label), o = I(i.value.find((l) => l.value === n.modelValue) ?? null);
|
|
@@ -695,13 +695,13 @@ function kt(e) {
|
|
|
695
695
|
function Mt(e) {
|
|
696
696
|
return e ? Re(e) : null;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Lt(e) {
|
|
699
699
|
return e ? e.toUpperCase() : null;
|
|
700
700
|
}
|
|
701
701
|
function Ct(e) {
|
|
702
702
|
return e ? lt(e) : null;
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function xt(e) {
|
|
705
705
|
return at(e);
|
|
706
706
|
}
|
|
707
707
|
const ne = {
|
|
@@ -712,9 +712,9 @@ const ne = {
|
|
|
712
712
|
phone: St,
|
|
713
713
|
upperFirst: kt,
|
|
714
714
|
startCase: Mt,
|
|
715
|
-
upperCase:
|
|
715
|
+
upperCase: Lt,
|
|
716
716
|
desnake: Ct,
|
|
717
|
-
usCurrency:
|
|
717
|
+
usCurrency: xt
|
|
718
718
|
}, yn = (e) => ({
|
|
719
719
|
...ne,
|
|
720
720
|
...e(ne)
|
|
@@ -731,12 +731,12 @@ function Tn(e, t) {
|
|
|
731
731
|
const s = e.currentTarget;
|
|
732
732
|
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((u) => {
|
|
733
733
|
if (u == "-") {
|
|
734
|
-
const
|
|
735
|
-
|
|
734
|
+
const x = document.createElement("div");
|
|
735
|
+
x.classList.add("separator"), i.appendChild(x);
|
|
736
736
|
return;
|
|
737
737
|
}
|
|
738
738
|
const m = document.createElement("div");
|
|
739
|
-
m.classList.add("item"), m.style.userSelect = "none", m.innerText = u.title, i.appendChild(m), u.class && m.classList.add(u.class), u.shouldConfirm ? m.addEventListener("click", () => u.handler()) : m.addEventListener("click", () =>
|
|
739
|
+
m.classList.add("item"), m.style.userSelect = "none", m.innerText = u.title, i.appendChild(m), u.class && m.classList.add(u.class), u.shouldConfirm ? m.addEventListener("click", () => u.handler()) : m.addEventListener("click", () => Le(m, u.handler));
|
|
740
740
|
});
|
|
741
741
|
const o = window.innerWidth - e.clientX, l = window.innerHeight - e.clientY, r = i.offsetHeight, c = i.offsetWidth, p = o < c ? e.clientX - c - 1 : e.clientX + 1, h = l < r ? e.clientY - r - 1 : e.clientY + 1;
|
|
742
742
|
i.style.left = p + "px", i.style.top = h + "px", setTimeout(() => {
|
|
@@ -745,13 +745,13 @@ function Tn(e, t) {
|
|
|
745
745
|
function T() {
|
|
746
746
|
t.targetClass && s.classList.remove(t.targetClass), s.classList.remove("context-menu-active"), s.style.userSelect = "", n.remove();
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function Le(u, m) {
|
|
749
749
|
if (u.classList.contains("pending-confirm"))
|
|
750
750
|
return m();
|
|
751
|
-
const
|
|
751
|
+
const x = u.innerHTML;
|
|
752
752
|
u.classList.add("pending-confirm"), u.innerText = "Confirm";
|
|
753
753
|
const G = () => {
|
|
754
|
-
u.classList.remove("pending-confirm"), u.innerHTML =
|
|
754
|
+
u.classList.remove("pending-confirm"), u.innerHTML = x, u.removeEventListener("mouseleave", G);
|
|
755
755
|
};
|
|
756
756
|
u.addEventListener("mouseleave", G), e.stopPropagation();
|
|
757
757
|
}
|
|
@@ -759,13 +759,13 @@ function Tn(e, t) {
|
|
|
759
759
|
const It = (e) => new Promise((t) => setTimeout(t, e)), On = (e) => It(e * 1e3), S = Symbol("MaskState");
|
|
760
760
|
function bn(e, t) {
|
|
761
761
|
const n = e.$.vnode.el, i = n.closest(".vf-modal");
|
|
762
|
-
return
|
|
762
|
+
return Ht(i ?? n, t);
|
|
763
763
|
}
|
|
764
764
|
function wn(e) {
|
|
765
765
|
const t = e.$.vnode.el, n = t.closest(".vf-modal");
|
|
766
766
|
return Oe(n ?? t);
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function Ht(e, t) {
|
|
769
769
|
if (!e[S]) {
|
|
770
770
|
const n = document.createElement("div");
|
|
771
771
|
n.classList.add("vf-mask"), e.appendChild(n), e[S] = { maskEl: n };
|
|
@@ -779,18 +779,18 @@ const j = Symbol("FormMaskState");
|
|
|
779
779
|
function Sn(e, t, n) {
|
|
780
780
|
const i = e instanceof Element ? e : be(e);
|
|
781
781
|
i.classList.add("vf-masked");
|
|
782
|
-
const s = t instanceof Element ? t : i.querySelectorAll(t ?? "button:not([disabled])")[0], o = s.tagName === "INPUT" ? s.value : s.
|
|
782
|
+
const s = t instanceof Element ? t : i.querySelectorAll(t ?? "button:not([disabled])")[0], o = s.tagName === "INPUT" ? s.value : s.innerHTML;
|
|
783
783
|
s.setAttribute("disabled", "disabled"), s.innerText = n ?? "Please wait...";
|
|
784
784
|
const r = [...i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
|
|
785
785
|
return r.forEach((c) => c.setAttribute("disabled", "disabled")), i[j] = {
|
|
786
786
|
disabledElements: r,
|
|
787
787
|
waitButton: s,
|
|
788
|
-
|
|
789
|
-
}, () =>
|
|
788
|
+
buttonHtml: o
|
|
789
|
+
}, () => Dt(i);
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Dt(e) {
|
|
792
792
|
const t = e instanceof Element ? e : be(e), n = t[j];
|
|
793
|
-
n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((i) => i.removeAttribute("disabled")), n.waitButton.
|
|
793
|
+
n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((i) => i.removeAttribute("disabled")), n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled"), delete t[j]);
|
|
794
794
|
}
|
|
795
795
|
function be(e) {
|
|
796
796
|
const t = e.$.vnode.el;
|
|
@@ -811,7 +811,7 @@ function Mn(e, t) {
|
|
|
811
811
|
function At(e) {
|
|
812
812
|
return e instanceof Error && "status" in e && "body" in e;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function Ln({ apiClient: e, onRequest: t, onError: n, CancelablePromise: i }) {
|
|
815
815
|
const s = e.request.request.bind(e.request);
|
|
816
816
|
e.request.request = (o) => (t && (o = t(o)), new i((l, r, c) => {
|
|
817
817
|
const p = s(o);
|
|
@@ -1077,7 +1077,7 @@ class Jt {
|
|
|
1077
1077
|
function en(e) {
|
|
1078
1078
|
e.directive("autofocus", _t), e.directive("confirm-button", Nt), e.directive("date-input", Rt), e.directive("datetime", Pt), e.directive("disabled", qt), e.directive("duration", zt), e.directive("infinite-scroll", Zt), e.directive("readonly", Gt), e.directive("tooltip", Qt);
|
|
1079
1079
|
}
|
|
1080
|
-
function
|
|
1080
|
+
function xn(e) {
|
|
1081
1081
|
en(e);
|
|
1082
1082
|
}
|
|
1083
1083
|
export {
|
|
@@ -1093,17 +1093,17 @@ export {
|
|
|
1093
1093
|
yn as createFilters,
|
|
1094
1094
|
ye as createModalInjection,
|
|
1095
1095
|
lt as desnakeCase,
|
|
1096
|
-
|
|
1096
|
+
Dn as escapeHtml,
|
|
1097
1097
|
Qe as formatError,
|
|
1098
1098
|
$t as formatNumber,
|
|
1099
1099
|
rt as formatPhone,
|
|
1100
1100
|
at as formatUSCurrency,
|
|
1101
1101
|
mn as handleError,
|
|
1102
1102
|
pn as handleErrorAndAlert,
|
|
1103
|
-
|
|
1104
|
-
|
|
1103
|
+
Ln as installApiClientInterceptors,
|
|
1104
|
+
xn as installVf,
|
|
1105
1105
|
bn as maskComponent,
|
|
1106
|
-
|
|
1106
|
+
Ht as maskEl,
|
|
1107
1107
|
Sn as maskForm,
|
|
1108
1108
|
vn as nl2br,
|
|
1109
1109
|
Mn as nullifyEmptyInputs,
|
|
@@ -1123,7 +1123,7 @@ export {
|
|
|
1123
1123
|
X as toError,
|
|
1124
1124
|
wn as unmaskComponent,
|
|
1125
1125
|
Oe as unmaskEl,
|
|
1126
|
-
|
|
1126
|
+
Dt as unmaskForm,
|
|
1127
1127
|
Bt as useInfiniteScroll,
|
|
1128
1128
|
Cn as useResizeWatcher
|
|
1129
1129
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { format } from 'date-fns';
|
|
2
2
|
import type { DirectiveBinding, ObjectDirective } from 'vue';
|
|
3
3
|
|
|
4
|
-
import { VfOptions } from '
|
|
4
|
+
import { VfOptions } from '../config';
|
|
5
5
|
|
|
6
6
|
export const vDatetime: ObjectDirective<HTMLElement, string> = {
|
|
7
7
|
beforeMount: applyDateTime,
|
package/src/helpers/error.ts
CHANGED
package/src/helpers/mask.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyComponentPublicInstance } from '
|
|
1
|
+
import type { AnyComponentPublicInstance } from '../components/modal-container';
|
|
2
2
|
|
|
3
3
|
/*///////////////////////////////////////////////
|
|
4
4
|
Component Overlay Masking
|
|
@@ -51,7 +51,7 @@ interface IFormMaskState {
|
|
|
51
51
|
[FormMaskState]?: {
|
|
52
52
|
disabledElements: HTMLElement[];
|
|
53
53
|
waitButton: HTMLElement;
|
|
54
|
-
|
|
54
|
+
buttonHtml: string;
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
type FormMaskElement = Element & IFormMaskState;
|
|
@@ -63,7 +63,7 @@ export function maskForm(formOrCmp: Element | AnyComponentPublicInstance, button
|
|
|
63
63
|
const buttonEl = (
|
|
64
64
|
buttonSelector instanceof Element ? buttonSelector : form.querySelectorAll(buttonSelector ?? 'button:not([disabled])')[0]
|
|
65
65
|
) as HTMLElement;
|
|
66
|
-
const
|
|
66
|
+
const originalButtonHtml = buttonEl.tagName === 'INPUT' ? (buttonEl as HTMLInputElement).value : buttonEl.innerHTML;
|
|
67
67
|
buttonEl.setAttribute('disabled', 'disabled');
|
|
68
68
|
buttonEl.innerText = buttonText ?? 'Please wait...';
|
|
69
69
|
|
|
@@ -74,7 +74,7 @@ export function maskForm(formOrCmp: Element | AnyComponentPublicInstance, button
|
|
|
74
74
|
(form as FormMaskElement)[FormMaskState] = {
|
|
75
75
|
disabledElements: inputs,
|
|
76
76
|
waitButton: buttonEl,
|
|
77
|
-
|
|
77
|
+
buttonHtml: originalButtonHtml
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
return () => unmaskForm(form);
|
|
@@ -89,7 +89,7 @@ export function unmaskForm(formOrCmp: Element | AnyComponentPublicInstance) {
|
|
|
89
89
|
form.classList.remove('vf-masked');
|
|
90
90
|
|
|
91
91
|
state.disabledElements.forEach(el => el.removeAttribute('disabled'));
|
|
92
|
-
state.waitButton.
|
|
92
|
+
state.waitButton.innerHTML = state.buttonHtml;
|
|
93
93
|
state.waitButton.removeAttribute('disabled');
|
|
94
94
|
|
|
95
95
|
delete (form as FormMaskElement)[FormMaskState];
|