@signal24/vue-foundation 4.3.0 → 4.3.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.
- package/dist/vue-foundation.es.js +119 -120
- package/package.json +2 -1
- package/src/components/modal.vue +6 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var De = Object.defineProperty;
|
|
2
2
|
var Ae = (e, t, n) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
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
|
|
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";
|
|
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";
|
|
@@ -45,21 +45,21 @@ const Ye = I({
|
|
|
45
45
|
value: null
|
|
46
46
|
}, Qe = ["value"];
|
|
47
47
|
function Je(e, t, n, i, s, o) {
|
|
48
|
-
return e.renderOptions ? B((
|
|
48
|
+
return e.renderOptions ? B((c(), d("select", {
|
|
49
49
|
key: 1,
|
|
50
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
50
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => e.selectedItem = r)
|
|
51
51
|
}, [
|
|
52
|
-
e.props.nullText ? (
|
|
53
|
-
(
|
|
54
|
-
var
|
|
55
|
-
return
|
|
56
|
-
key:
|
|
57
|
-
value: (
|
|
58
|
-
}, k(
|
|
52
|
+
e.props.nullText ? (c(), d("option", Ge, k(e.props.nullText), 1)) : y("", !0),
|
|
53
|
+
(c(!0), d(F, null, q(e.renderOptions, (r, l) => {
|
|
54
|
+
var a;
|
|
55
|
+
return c(), d("option", {
|
|
56
|
+
key: l,
|
|
57
|
+
value: (a = e.options) == null ? void 0 : a[l]
|
|
58
|
+
}, k(r), 9, Qe);
|
|
59
59
|
}), 128))
|
|
60
60
|
], 512)), [
|
|
61
61
|
[Be, e.selectedItem]
|
|
62
|
-
]) : (
|
|
62
|
+
]) : (c(), d("select", Ze, [
|
|
63
63
|
g("option", null, k(e.props.loadingText || "Loading..."), 1)
|
|
64
64
|
]));
|
|
65
65
|
}
|
|
@@ -103,8 +103,8 @@ function tt(e) {
|
|
|
103
103
|
async function Z(e, t) {
|
|
104
104
|
return new Promise((n) => {
|
|
105
105
|
let i = null;
|
|
106
|
-
const o = { ...t, callback: (
|
|
107
|
-
we(i), n(
|
|
106
|
+
const o = { ...t, callback: (r) => {
|
|
107
|
+
we(i), n(r);
|
|
108
108
|
} };
|
|
109
109
|
i = be(e, o);
|
|
110
110
|
});
|
|
@@ -184,50 +184,49 @@ const it = ["id"], st = {
|
|
|
184
184
|
},
|
|
185
185
|
emits: ["formSubmit"],
|
|
186
186
|
setup(e) {
|
|
187
|
-
const t = e, n = $();
|
|
187
|
+
const t = e, n = ve(), i = $();
|
|
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));
|
|
191
191
|
}), X(() => {
|
|
192
|
-
document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
|
|
192
|
+
window.removeEventListener("keydown", o), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
|
|
193
193
|
});
|
|
194
|
-
function i(l) {
|
|
195
|
-
l.target == n.value && o();
|
|
196
|
-
}
|
|
197
194
|
function s(l) {
|
|
195
|
+
l.target == i.value && r();
|
|
196
|
+
}
|
|
197
|
+
function o(l) {
|
|
198
198
|
if (l.key === "Esc" || l.key === "Escape") {
|
|
199
|
-
const
|
|
200
|
-
|
|
199
|
+
const a = document.querySelectorAll(".vf-modal-wrap");
|
|
200
|
+
a[a.length - 1] === i.value && r();
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
|
|
205
|
-
Se(l);
|
|
203
|
+
function r() {
|
|
204
|
+
Se(n);
|
|
206
205
|
}
|
|
207
|
-
return (l,
|
|
206
|
+
return (l, a) => (c(), Y(Ne, { to: "#vf-modal-target" }, [
|
|
208
207
|
g("div", {
|
|
209
208
|
id: l.id,
|
|
210
209
|
class: T(["vf-overlay vf-modal-wrap", t.class]),
|
|
211
210
|
ref_key: "overlay",
|
|
212
|
-
ref:
|
|
211
|
+
ref: i
|
|
213
212
|
}, [
|
|
214
213
|
g("form", {
|
|
215
214
|
action: ".",
|
|
216
215
|
class: T(["vf-modal", { scrolls: l.scrolls }]),
|
|
217
|
-
onSubmit:
|
|
216
|
+
onSubmit: a[0] || (a[0] = Ke((m) => l.$emit("formSubmit"), ["prevent"]))
|
|
218
217
|
}, [
|
|
219
|
-
l.$slots.header ? (
|
|
218
|
+
l.$slots.header ? (c(), d("div", st, [
|
|
220
219
|
R(l.$slots, "header"),
|
|
221
|
-
t.closeX ? (
|
|
220
|
+
t.closeX ? (c(), d("i", {
|
|
222
221
|
key: 0,
|
|
223
222
|
class: "close",
|
|
224
|
-
onClick:
|
|
223
|
+
onClick: r
|
|
225
224
|
})) : y("", !0)
|
|
226
225
|
])) : y("", !0),
|
|
227
226
|
g("div", ot, [
|
|
228
227
|
R(l.$slots, "default")
|
|
229
228
|
]),
|
|
230
|
-
l.$slots.footer ? (
|
|
229
|
+
l.$slots.footer ? (c(), d("div", lt, [
|
|
231
230
|
R(l.$slots, "footer")
|
|
232
231
|
])) : y("", !0)
|
|
233
232
|
], 34)
|
|
@@ -250,15 +249,15 @@ const at = ["innerHtml"], ct = ["innerText"], K = /* @__PURE__ */ I({
|
|
|
250
249
|
const t = e, n = V(() => t.message instanceof Error ? nt(t.message) : t.message);
|
|
251
250
|
return (i, s) => {
|
|
252
251
|
const o = ge("autofocus");
|
|
253
|
-
return
|
|
252
|
+
return c(), Y(rt, {
|
|
254
253
|
class: T(["vf-alert", i.classes])
|
|
255
254
|
}, Re({
|
|
256
255
|
default: U(() => [
|
|
257
|
-
i.isHtml ? (
|
|
256
|
+
i.isHtml ? (c(), d("div", {
|
|
258
257
|
key: 0,
|
|
259
258
|
innerHtml: i.message,
|
|
260
259
|
class: "user-message"
|
|
261
|
-
}, null, 8, at)) : (
|
|
260
|
+
}, null, 8, at)) : (c(), d("div", {
|
|
262
261
|
key: 1,
|
|
263
262
|
innerText: n.value
|
|
264
263
|
}, null, 8, ct))
|
|
@@ -275,8 +274,8 @@ const at = ["innerHtml"], ct = ["innerText"], K = /* @__PURE__ */ I({
|
|
|
275
274
|
i.isBare ? void 0 : {
|
|
276
275
|
name: "footer",
|
|
277
276
|
fn: U(() => [
|
|
278
|
-
i.shouldConfirm ? (
|
|
279
|
-
B((
|
|
277
|
+
i.shouldConfirm ? (c(), d(F, { key: 0 }, [
|
|
278
|
+
B((c(), d("button", {
|
|
280
279
|
class: "primary",
|
|
281
280
|
onClick: s[0] || (s[0] = () => i.callback(!0))
|
|
282
281
|
}, [
|
|
@@ -288,7 +287,7 @@ const at = ["innerHtml"], ct = ["innerText"], K = /* @__PURE__ */ I({
|
|
|
288
287
|
class: "default",
|
|
289
288
|
onClick: s[1] || (s[1] = () => i.callback(!1))
|
|
290
289
|
}, "Cancel")
|
|
291
|
-
], 64)) : B((
|
|
290
|
+
], 64)) : B((c(), d("button", {
|
|
292
291
|
key: 1,
|
|
293
292
|
class: "default",
|
|
294
293
|
onClick: s[2] || (s[2] = () => i.callback(!0))
|
|
@@ -426,16 +425,16 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
|
|
|
426
425
|
},
|
|
427
426
|
optionsDescriptors() {
|
|
428
427
|
return this.allOptions.map((e, t) => {
|
|
429
|
-
var
|
|
430
|
-
const n = this.formatter(e), i = (
|
|
428
|
+
var l, a;
|
|
429
|
+
const n = this.formatter(e), i = (l = this.subtitleFormatter) == null ? void 0 : l.call(this, e), s = n ? n.trim().toLowerCase() : "", o = i ? i.trim().toLowerCase() : "", r = [];
|
|
431
430
|
return this.searchFields ? this.searchFields.forEach((m) => {
|
|
432
|
-
e[m] &&
|
|
433
|
-
}) : (
|
|
431
|
+
e[m] && r.push(String(e[m]).toLowerCase());
|
|
432
|
+
}) : (r.push(s), o && r.push(o)), {
|
|
434
433
|
// eslint-disable-next-line vue/no-use-computed-property-like-method
|
|
435
|
-
key: ((
|
|
434
|
+
key: ((a = this.effectiveKeyExtractor) == null ? void 0 : a.call(this, e)) ?? String(t),
|
|
436
435
|
title: n,
|
|
437
436
|
subtitle: i,
|
|
438
|
-
searchContent:
|
|
437
|
+
searchContent: r.join(""),
|
|
439
438
|
ref: e
|
|
440
439
|
};
|
|
441
440
|
});
|
|
@@ -627,50 +626,50 @@ const Tt = ["placeholder"], Ot = {
|
|
|
627
626
|
key: 0,
|
|
628
627
|
class: "no-results"
|
|
629
628
|
};
|
|
630
|
-
function
|
|
631
|
-
const
|
|
632
|
-
return
|
|
629
|
+
function Lt(e, t, n, i, s, o) {
|
|
630
|
+
const r = ge("disabled");
|
|
631
|
+
return c(), d("div", {
|
|
633
632
|
class: T(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
|
|
634
633
|
}, [
|
|
635
634
|
B(g("input", {
|
|
636
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
635
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => e.searchText = l),
|
|
637
636
|
ref: "searchField",
|
|
638
637
|
type: "text",
|
|
639
638
|
class: T({ nullable: !!n.nullTitle }),
|
|
640
|
-
onKeydown: t[1] || (t[1] = (...
|
|
639
|
+
onKeydown: t[1] || (t[1] = (...l) => o.handleKeyDown && o.handleKeyDown(...l)),
|
|
641
640
|
placeholder: o.effectivePlaceholder,
|
|
642
|
-
onFocus: t[2] || (t[2] = (...
|
|
643
|
-
onBlur: t[3] || (t[3] = (...
|
|
641
|
+
onFocus: t[2] || (t[2] = (...l) => o.handleInputFocused && o.handleInputFocused(...l)),
|
|
642
|
+
onBlur: t[3] || (t[3] = (...l) => o.handleInputBlurred && o.handleInputBlurred(...l))
|
|
644
643
|
}, null, 42, Tt), [
|
|
645
644
|
[Ue, e.searchText],
|
|
646
|
-
[
|
|
645
|
+
[r, o.effectiveDisabled]
|
|
647
646
|
]),
|
|
648
|
-
e.shouldDisplayOptions ? (
|
|
649
|
-
e.isLoaded ? (
|
|
650
|
-
(
|
|
651
|
-
key: String(
|
|
647
|
+
e.shouldDisplayOptions ? (c(), d("div", Ot, [
|
|
648
|
+
e.isLoaded ? (c(), d(F, { key: 1 }, [
|
|
649
|
+
(c(!0), d(F, null, q(o.effectiveOptions, (l) => (c(), d("div", {
|
|
650
|
+
key: String(l.key),
|
|
652
651
|
class: T(["option", {
|
|
653
|
-
highlighted: e.highlightedOptionKey ===
|
|
652
|
+
highlighted: e.highlightedOptionKey === l.key
|
|
654
653
|
}]),
|
|
655
|
-
onMousemove: (
|
|
656
|
-
onMousedown: (
|
|
654
|
+
onMousemove: (a) => o.handleOptionHover(l),
|
|
655
|
+
onMousedown: (a) => o.selectOption(l)
|
|
657
656
|
}, [
|
|
658
657
|
g("div", {
|
|
659
658
|
class: "title",
|
|
660
|
-
innerHTML:
|
|
659
|
+
innerHTML: l.title
|
|
661
660
|
}, null, 8, St),
|
|
662
|
-
|
|
661
|
+
l.subtitle ? (c(), d("div", {
|
|
663
662
|
key: 0,
|
|
664
663
|
class: "subtitle",
|
|
665
|
-
innerHTML:
|
|
664
|
+
innerHTML: l.subtitle
|
|
666
665
|
}, null, 8, kt)) : y("", !0)
|
|
667
666
|
], 42, wt))), 128)),
|
|
668
|
-
!o.effectiveOptions.length && e.searchText ? (
|
|
669
|
-
], 64)) : (
|
|
667
|
+
!o.effectiveOptions.length && e.searchText ? (c(), d("div", Mt, k(o.effectiveNoResultsText), 1)) : y("", !0)
|
|
668
|
+
], 64)) : (c(), d("div", bt, "Loading..."))
|
|
670
669
|
], 512)) : y("", !0)
|
|
671
670
|
], 2);
|
|
672
671
|
}
|
|
673
|
-
const
|
|
672
|
+
const xt = /* @__PURE__ */ Oe(Et, [["render", Lt]]), Mn = /* @__PURE__ */ I({
|
|
674
673
|
__name: "ez-smart-select",
|
|
675
674
|
props: {
|
|
676
675
|
modelValue: {},
|
|
@@ -681,27 +680,27 @@ const Lt = /* @__PURE__ */ Oe(Et, [["render", xt]]), Mn = /* @__PURE__ */ I({
|
|
|
681
680
|
},
|
|
682
681
|
emits: ["update:modelValue"],
|
|
683
682
|
setup(e, { emit: t }) {
|
|
684
|
-
const n = e, i = V(() => Array.isArray(n.options) ? n.options.map((
|
|
685
|
-
value:
|
|
686
|
-
label:
|
|
687
|
-
}))), s = V(() => n.formatter ? (
|
|
688
|
-
var
|
|
689
|
-
return (
|
|
690
|
-
} : (
|
|
683
|
+
const n = e, i = V(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: r })) : Object.entries(n.options).map(([r, l]) => ({
|
|
684
|
+
value: r,
|
|
685
|
+
label: l
|
|
686
|
+
}))), s = V(() => n.formatter ? (r) => {
|
|
687
|
+
var l;
|
|
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);
|
|
691
690
|
return ne(
|
|
692
691
|
() => n.modelValue,
|
|
693
|
-
(
|
|
694
|
-
o.value = i.value.find((
|
|
692
|
+
(r) => {
|
|
693
|
+
o.value = i.value.find((l) => l.value === r) ?? null;
|
|
695
694
|
}
|
|
696
|
-
), ne(o, (
|
|
697
|
-
var
|
|
698
|
-
t("update:modelValue",
|
|
699
|
-
}), (
|
|
695
|
+
), ne(o, (r) => {
|
|
696
|
+
var l;
|
|
697
|
+
t("update:modelValue", r ? ((l = i.value.find((a) => Te(a, r))) == null ? void 0 : l.value) ?? null : null);
|
|
698
|
+
}), (r, l) => (c(), Y(xt, {
|
|
700
699
|
modelValue: o.value,
|
|
701
|
-
"onUpdate:modelValue":
|
|
700
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => o.value = a),
|
|
702
701
|
options: i.value,
|
|
703
702
|
formatter: s.value,
|
|
704
|
-
"null-title":
|
|
703
|
+
"null-title": r.nullTitle
|
|
705
704
|
}, null, 8, ["modelValue", "options", "formatter", "null-title"]));
|
|
706
705
|
}
|
|
707
706
|
});
|
|
@@ -747,11 +746,11 @@ const le = {
|
|
|
747
746
|
upperCase: Bt,
|
|
748
747
|
desnake: Ft,
|
|
749
748
|
usCurrency: _t
|
|
750
|
-
},
|
|
749
|
+
}, Ln = (e) => ({
|
|
751
750
|
...le,
|
|
752
751
|
...e(le)
|
|
753
752
|
});
|
|
754
|
-
function
|
|
753
|
+
function xn(e, t, n) {
|
|
755
754
|
const i = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
|
|
756
755
|
return i === -1 ? !1 : (e.splice(i, 1, n), !0);
|
|
757
756
|
}
|
|
@@ -770,7 +769,7 @@ function Cn(e, t) {
|
|
|
770
769
|
const v = document.createElement("div");
|
|
771
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));
|
|
772
771
|
});
|
|
773
|
-
const o = window.innerWidth - e.clientX,
|
|
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;
|
|
774
773
|
i.style.left = m + "px", i.style.top = f + "px", setTimeout(() => {
|
|
775
774
|
i.style.width = i.offsetWidth + "px";
|
|
776
775
|
}, 50);
|
|
@@ -813,9 +812,9 @@ function An(e, t, n) {
|
|
|
813
812
|
i.classList.add("vf-masked");
|
|
814
813
|
const s = t instanceof Element ? t : i.querySelectorAll(t ?? "button:not([disabled])")[0], o = s.tagName === "INPUT" ? s.value : s.innerHTML;
|
|
815
814
|
s.setAttribute("disabled", "disabled"), s.innerText = n ?? "Please wait...";
|
|
816
|
-
const
|
|
817
|
-
return
|
|
818
|
-
disabledElements:
|
|
815
|
+
const l = [...i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
|
|
816
|
+
return l.forEach((a) => a.setAttribute("disabled", "disabled")), i[W] = {
|
|
817
|
+
disabledElements: l,
|
|
819
818
|
waitButton: s,
|
|
820
819
|
buttonHtml: o
|
|
821
820
|
}, () => Rt(i);
|
|
@@ -845,19 +844,19 @@ function jt(e) {
|
|
|
845
844
|
}
|
|
846
845
|
function Bn({ apiClient: e, onRequest: t, onError: n, CancelablePromise: i }) {
|
|
847
846
|
const s = e.request.request.bind(e.request);
|
|
848
|
-
e.request.request = (o) => (t && (o = t(o)), new i((
|
|
847
|
+
e.request.request = (o) => (t && (o = t(o)), new i((r, l, a) => {
|
|
849
848
|
const m = s(o);
|
|
850
|
-
|
|
849
|
+
a(m.cancel), m.then(r).catch((f) => {
|
|
851
850
|
if (jt(f) && typeof f.body == "object" && "error" in f.body && f.status === 422)
|
|
852
|
-
return
|
|
851
|
+
return l(new N(f.body.error));
|
|
853
852
|
if (n) {
|
|
854
853
|
const O = n(f, o);
|
|
855
854
|
if (O === null)
|
|
856
855
|
return;
|
|
857
856
|
if (O instanceof Error)
|
|
858
|
-
return
|
|
857
|
+
return l(O);
|
|
859
858
|
}
|
|
860
|
-
|
|
859
|
+
l(f);
|
|
861
860
|
});
|
|
862
861
|
}));
|
|
863
862
|
}
|
|
@@ -868,11 +867,11 @@ function Fn(e, t) {
|
|
|
868
867
|
}
|
|
869
868
|
function Pt(e, t) {
|
|
870
869
|
const n = {};
|
|
871
|
-
if (t.elScrolledToBottom && (n.el = new
|
|
872
|
-
const i =
|
|
873
|
-
i ? n.ancestor = new
|
|
870
|
+
if (t.elScrolledToBottom && (n.el = new L(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
|
|
871
|
+
const i = Le(e.vnode.el);
|
|
872
|
+
i ? n.ancestor = new L(i, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
|
|
874
873
|
}
|
|
875
|
-
t.windowScrolledToBottom && (n.window = new
|
|
874
|
+
t.windowScrolledToBottom && (n.window = new L(window, t.windowScrolledToBottom)), e[Q] = n;
|
|
876
875
|
}
|
|
877
876
|
function Wt(e) {
|
|
878
877
|
var n, i, s;
|
|
@@ -885,14 +884,14 @@ function re(e) {
|
|
|
885
884
|
(n = t == null ? void 0 : t.el) == null || n.uninstall(), (i = t == null ? void 0 : t.ancestor) == null || i.uninstall(), (s = t == null ? void 0 : t.window) == null || s.uninstall();
|
|
886
885
|
}
|
|
887
886
|
const j = ["auto", "scroll"];
|
|
888
|
-
function
|
|
887
|
+
function Le(e) {
|
|
889
888
|
const t = e.parentElement;
|
|
890
889
|
if (!t)
|
|
891
890
|
return null;
|
|
892
891
|
const n = window.getComputedStyle(t);
|
|
893
|
-
return j.includes(n.overflow) || j.includes(n.overflowX) || j.includes(n.overflowY) ? t :
|
|
892
|
+
return j.includes(n.overflow) || j.includes(n.overflowX) || j.includes(n.overflowY) ? t : Le(t);
|
|
894
893
|
}
|
|
895
|
-
class
|
|
894
|
+
class L {
|
|
896
895
|
constructor(t, n) {
|
|
897
896
|
p(this, "isTripped", !1);
|
|
898
897
|
p(this, "onScrollWithContext", this.onScroll.bind(this));
|
|
@@ -964,20 +963,20 @@ function de(e, t) {
|
|
|
964
963
|
t.value == t.oldValue && e.innerHTML.length || (e.innerText = Qt(e, t));
|
|
965
964
|
}
|
|
966
965
|
function Qt(e, t) {
|
|
967
|
-
var
|
|
966
|
+
var a, m;
|
|
968
967
|
if (!t.value)
|
|
969
|
-
return ((
|
|
968
|
+
return ((a = e.attributes.getNamedItem("placeholder")) == null ? void 0 : a.value) ?? "";
|
|
970
969
|
let n = "";
|
|
971
970
|
const i = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), s = e.attributes.getNamedItem("local") !== null ? i.replace(/Z$/, "") : i.replace(/(Z|\+00:00)?$/, "Z"), o = new Date(s);
|
|
972
971
|
!e.attributes.getNamedItem("display-utc") !== null && o.setMinutes(o.getMinutes() - o.getTimezoneOffset());
|
|
973
|
-
let
|
|
974
|
-
if (!
|
|
972
|
+
let r = (m = e.attributes.getNamedItem("format")) == null ? void 0 : m.value;
|
|
973
|
+
if (!r && e.attributes.getNamedItem("relative-date") !== null) {
|
|
975
974
|
const f = /* @__PURE__ */ new Date();
|
|
976
|
-
f.getFullYear() == o.getFullYear() && f.getMonth() == o.getMonth() && f.getDate() == o.getDate() && (n = "at",
|
|
975
|
+
f.getFullYear() == o.getFullYear() && f.getMonth() == o.getMonth() && f.getDate() == o.getDate() && (n = "at", r = "HH:mm");
|
|
977
976
|
}
|
|
978
|
-
|
|
979
|
-
let
|
|
980
|
-
return n && (
|
|
977
|
+
r || (r = H.defaultDateTimeFormat);
|
|
978
|
+
let l = P(o, r);
|
|
979
|
+
return n && (l = n + " " + l), l;
|
|
981
980
|
}
|
|
982
981
|
const Jt = {
|
|
983
982
|
beforeMount: ue,
|
|
@@ -996,22 +995,22 @@ const tn = {
|
|
|
996
995
|
unmounted: Ce
|
|
997
996
|
}, C = Symbol("HasAutoFocused"), J = [];
|
|
998
997
|
function nn() {
|
|
999
|
-
J.forEach(
|
|
998
|
+
J.forEach(xe);
|
|
1000
999
|
}
|
|
1001
1000
|
setInterval(nn, 1e3);
|
|
1002
1001
|
function he(e, t) {
|
|
1003
|
-
var
|
|
1002
|
+
var r;
|
|
1004
1003
|
if (t.value == t.oldValue)
|
|
1005
1004
|
return;
|
|
1006
1005
|
if (!t.value)
|
|
1007
1006
|
return Ce(e);
|
|
1008
|
-
const n = new Date(t.value), i = (
|
|
1007
|
+
const n = new Date(t.value), i = (r = e.attributes.getNamedItem("base-time")) == null ? void 0 : r.value, s = n.getTime() - (i ? new Date(i).getTime() - t.value * 1e3 : 0), o = e.getAttribute("no-seconds") === null;
|
|
1009
1008
|
e[C] || J.push(e), e[C] = {
|
|
1010
1009
|
startTs: s,
|
|
1011
1010
|
includeSeconds: o
|
|
1012
|
-
},
|
|
1011
|
+
}, xe(e);
|
|
1013
1012
|
}
|
|
1014
|
-
function
|
|
1013
|
+
function xe(e) {
|
|
1015
1014
|
const t = e[C], n = Math.round((Date.now() - t.startTs) / 1e3);
|
|
1016
1015
|
e.innerText = sn(n, t.includeSeconds);
|
|
1017
1016
|
}
|
|
@@ -1028,11 +1027,11 @@ function sn(e, t) {
|
|
|
1028
1027
|
}
|
|
1029
1028
|
const S = Symbol("InfiniteScrollHandler"), on = {
|
|
1030
1029
|
mounted(e, t) {
|
|
1031
|
-
e[S] = new
|
|
1030
|
+
e[S] = new L(e, t.value);
|
|
1032
1031
|
},
|
|
1033
1032
|
updated(e, t) {
|
|
1034
1033
|
var n;
|
|
1035
|
-
(n = e[S]) == null || n.uninstall(), e[S] = new
|
|
1034
|
+
(n = e[S]) == null || n.uninstall(), e[S] = new L(e, t.value);
|
|
1036
1035
|
},
|
|
1037
1036
|
unmounted(e) {
|
|
1038
1037
|
var t;
|
|
@@ -1049,7 +1048,7 @@ const rn = {
|
|
|
1049
1048
|
mounted: pe,
|
|
1050
1049
|
updated: pe,
|
|
1051
1050
|
unmounted: Ie
|
|
1052
|
-
},
|
|
1051
|
+
}, x = Symbol("TooltipState");
|
|
1053
1052
|
function pe(e, t) {
|
|
1054
1053
|
var i;
|
|
1055
1054
|
let n = ((i = e.attributes.getNamedItem("tip")) == null ? void 0 : i.value) ?? t.value;
|
|
@@ -1058,13 +1057,13 @@ function pe(e, t) {
|
|
|
1058
1057
|
content: n,
|
|
1059
1058
|
html: e.getAttribute("html") !== null
|
|
1060
1059
|
};
|
|
1061
|
-
e[
|
|
1060
|
+
e[x] ? e[x].configure(s) : e[x] = new an(e, s);
|
|
1062
1061
|
} else
|
|
1063
1062
|
Ie(e);
|
|
1064
1063
|
}
|
|
1065
1064
|
function Ie(e) {
|
|
1066
1065
|
var t;
|
|
1067
|
-
(t = e[
|
|
1066
|
+
(t = e[x]) == null || t.destroy(), delete e[x];
|
|
1068
1067
|
}
|
|
1069
1068
|
class an {
|
|
1070
1069
|
constructor(t, n) {
|
|
@@ -1103,8 +1102,8 @@ class an {
|
|
|
1103
1102
|
}
|
|
1104
1103
|
handleMouseMove(t) {
|
|
1105
1104
|
const n = this.tipEl.offsetWidth, i = this.tipEl.offsetHeight, s = window.innerWidth, o = window.innerHeight;
|
|
1106
|
-
let
|
|
1107
|
-
|
|
1105
|
+
let r = t.pageX + 10, l = t.pageY + 20;
|
|
1106
|
+
r + n > s && (r = t.pageX - 5 - n), l + i > o && (l = t.pageY - 5 - i), this.tipEl.style.left = r + "px", this.tipEl.style.top = l + "px", this.lastMoveEvt = t;
|
|
1108
1107
|
}
|
|
1109
1108
|
checkMoveEvent() {
|
|
1110
1109
|
var t;
|
|
@@ -1127,10 +1126,10 @@ export {
|
|
|
1127
1126
|
K as VfAlertModal,
|
|
1128
1127
|
Mn as VfEzSmartSelect,
|
|
1129
1128
|
rt as VfModal,
|
|
1130
|
-
|
|
1129
|
+
xt as VfSmartSelect,
|
|
1131
1130
|
$n as cloneProp,
|
|
1132
1131
|
On as configureVf,
|
|
1133
|
-
|
|
1132
|
+
Ln as createFilters,
|
|
1134
1133
|
be as createModalInjection,
|
|
1135
1134
|
mt as desnakeCase,
|
|
1136
1135
|
Un as escapeHtml,
|
|
@@ -1153,7 +1152,7 @@ export {
|
|
|
1153
1152
|
gn as removeModalInjectionByInstance,
|
|
1154
1153
|
Se as removeModalInjectionByInternalInstance,
|
|
1155
1154
|
tt as removeModalInjectionByVnode,
|
|
1156
|
-
|
|
1155
|
+
xn as replaceElement,
|
|
1157
1156
|
ie as showAlert,
|
|
1158
1157
|
yn as showConfirm,
|
|
1159
1158
|
En as showConfirmDestroy,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signal24/vue-foundation",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.3.
|
|
4
|
+
"version": "4.3.1",
|
|
5
5
|
"description": "Common components, directives, and helpers for Vue 3 apps",
|
|
6
6
|
"module": "./dist/vue-foundation.es.js",
|
|
7
7
|
"bin": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"dev": "vite",
|
|
27
27
|
"build": "rm -rf dist && vite build && vue-tsc --declaration --emitDeclarationOnly -p tsconfig.app.json && tsc -p tsconfig.vite-plugins.json && find dist -name '*.tsbuildinfo' -delete && chmod +x dist/src/vite-plugins/vite-openapi-plugin.cli.js",
|
|
28
|
+
"build:watch": "fswatch -o src | xargs -n1 -I{} yarn build",
|
|
28
29
|
"preview": "vite preview",
|
|
29
30
|
"test:types": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
|
30
31
|
"test:unit": "vitest",
|
package/src/components/modal.vue
CHANGED
|
@@ -22,6 +22,8 @@ import { getCurrentInstance, onBeforeUnmount, onMounted, ref } from 'vue';
|
|
|
22
22
|
|
|
23
23
|
import { removeModalInjectionByInternalInstance } from './modal-container';
|
|
24
24
|
|
|
25
|
+
const instance = getCurrentInstance();
|
|
26
|
+
|
|
25
27
|
const props = defineProps<{
|
|
26
28
|
id?: string;
|
|
27
29
|
closeOnMaskClick?: boolean;
|
|
@@ -35,16 +37,18 @@ defineEmits(['formSubmit']);
|
|
|
35
37
|
const overlay = ref<HTMLElement>();
|
|
36
38
|
|
|
37
39
|
onMounted(() => {
|
|
38
|
-
window.addEventListener('keydown', handleEscapeKey);
|
|
39
40
|
document.body.classList.add('vf-modal-open');
|
|
40
41
|
|
|
41
42
|
if (props.closeOnMaskClick) {
|
|
43
|
+
window.addEventListener('keydown', handleEscapeKey);
|
|
42
44
|
overlay.value?.addEventListener('click', handleOverlayClick);
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
|
|
46
48
|
onBeforeUnmount(() => {
|
|
47
|
-
|
|
49
|
+
window.removeEventListener('keydown', handleEscapeKey);
|
|
50
|
+
|
|
51
|
+
const areOtherModalsOpen = document.body.querySelectorAll('.vf-modal').length > 0;
|
|
48
52
|
areOtherModalsOpen || document.body.classList.remove('vf-modal-open');
|
|
49
53
|
});
|
|
50
54
|
|
|
@@ -65,7 +69,6 @@ function handleEscapeKey(e: KeyboardEvent) {
|
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
function closeParent() {
|
|
68
|
-
const instance = getCurrentInstance();
|
|
69
72
|
removeModalInjectionByInternalInstance(instance!);
|
|
70
73
|
}
|
|
71
74
|
</script>
|