@signal24/vue-foundation 4.14.0 → 4.14.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,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
|
-
var E = (e, t, n) =>
|
|
4
|
-
import { defineComponent as C, defineProps as _e, defineEmits as Re, ref as
|
|
3
|
+
var E = (e, t, n) => Fe(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { defineComponent as C, defineProps as _e, defineEmits as Re, ref as b, computed as _, openBlock as d, createElementBlock as h, createElementVNode as w, toDisplayString as x, withDirectives as j, createCommentVNode as O, Fragment as U, renderList as J, vModelSelect as Ne, getCurrentInstance as ee, onMounted as L, normalizeClass as k, normalizeStyle as Ke, withModifiers as te, renderSlot as K, reactive as je, h as W, Teleport as Ue, markRaw as We, onBeforeUnmount as ne, resolveDirective as be, createBlock as Oe, createSlots as Pe, withCtx as Y, createTextVNode as ae, vModelText as qe, watch as ce, onActivated as ke, onDeactivated as Se } from "vue";
|
|
5
5
|
import { compact as ze, 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 ni } from "@vue/shared";
|
|
@@ -11,7 +11,7 @@ const nt = C({
|
|
|
11
11
|
setup() {
|
|
12
12
|
const e = _e();
|
|
13
13
|
Re(["update:modelValue"]);
|
|
14
|
-
const t =
|
|
14
|
+
const t = b(null), n = _(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = b(e.modelValue ?? null);
|
|
15
15
|
return { props: e, options: t, renderOptions: n, selectedItem: i };
|
|
16
16
|
},
|
|
17
17
|
watch: {
|
|
@@ -50,7 +50,7 @@ function lt(e, t, n, i, s, o) {
|
|
|
50
50
|
key: 1,
|
|
51
51
|
"onUpdate:modelValue": t[0] || (t[0] = (r) => e.selectedItem = r)
|
|
52
52
|
}, [
|
|
53
|
-
e.props.nullText ? (d(), h("option", st, x(e.props.nullText), 1)) :
|
|
53
|
+
e.props.nullText ? (d(), h("option", st, x(e.props.nullText), 1)) : O("", !0),
|
|
54
54
|
(d(!0), h(U, null, J(e.renderOptions, (r, l) => {
|
|
55
55
|
var a;
|
|
56
56
|
return d(), h("option", {
|
|
@@ -71,11 +71,10 @@ const Mn = /* @__PURE__ */ xe(nt, [["render", lt]]), rt = /* @__PURE__ */ C({
|
|
|
71
71
|
anchor: {}
|
|
72
72
|
},
|
|
73
73
|
setup(e) {
|
|
74
|
-
const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, i =
|
|
74
|
+
const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, i = b({ visibility: "hidden", top: "0", left: "0" }), s = b([]), o = ee();
|
|
75
75
|
L(r);
|
|
76
76
|
function r() {
|
|
77
|
-
if (!o)
|
|
78
|
-
return;
|
|
77
|
+
if (!o) return;
|
|
79
78
|
const p = o.vnode.el, { styles: g, classes: m } = l(p, n);
|
|
80
79
|
i.value = g, s.value = m;
|
|
81
80
|
}
|
|
@@ -262,9 +261,8 @@ function Me(e) {
|
|
|
262
261
|
const Q = Symbol("FormMaskState");
|
|
263
262
|
function ft(e, t, n) {
|
|
264
263
|
const i = e instanceof Element ? e : He(e);
|
|
265
|
-
if (!i)
|
|
266
|
-
|
|
267
|
-
};
|
|
264
|
+
if (!i) return () => {
|
|
265
|
+
};
|
|
268
266
|
i.classList.add("vf-masked");
|
|
269
267
|
const s = t instanceof Element ? t : i.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
|
|
270
268
|
let o;
|
|
@@ -278,8 +276,7 @@ function ft(e, t, n) {
|
|
|
278
276
|
}
|
|
279
277
|
function Ie(e) {
|
|
280
278
|
const t = e instanceof Element ? e : He(e);
|
|
281
|
-
if (!t)
|
|
282
|
-
return;
|
|
279
|
+
if (!t) return;
|
|
283
280
|
const n = t[Q];
|
|
284
281
|
n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((i) => i.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[Q]);
|
|
285
282
|
}
|
|
@@ -307,7 +304,7 @@ const pt = ["id"], mt = {
|
|
|
307
304
|
setup(e, { expose: t }) {
|
|
308
305
|
const n = ee(), i = e;
|
|
309
306
|
t({ mask: m, unmask: v, hide: f, unhide: u });
|
|
310
|
-
const s =
|
|
307
|
+
const s = b(), o = b(), r = b(!1), l = _(() => ze([i.class, r.value && "hidden"]));
|
|
311
308
|
L(() => {
|
|
312
309
|
var c;
|
|
313
310
|
document.body.classList.add("vf-modal-open"), i.closeOnMaskClick && (window.addEventListener("keydown", p), (c = s.value) == null || c.addEventListener("click", a));
|
|
@@ -357,14 +354,14 @@ const pt = ["id"], mt = {
|
|
|
357
354
|
key: 0,
|
|
358
355
|
class: "close",
|
|
359
356
|
onClick: g
|
|
360
|
-
})) :
|
|
361
|
-
])) :
|
|
357
|
+
})) : O("", !0)
|
|
358
|
+
])) : O("", !0),
|
|
362
359
|
w("div", vt, [
|
|
363
360
|
K(c.$slots, "default")
|
|
364
361
|
]),
|
|
365
362
|
c.$slots.footer ? (d(), h("div", yt, [
|
|
366
363
|
K(c.$slots, "footer")
|
|
367
|
-
])) :
|
|
364
|
+
])) : O("", !0)
|
|
368
365
|
], 34)
|
|
369
366
|
], 10, pt));
|
|
370
367
|
}
|
|
@@ -382,8 +379,8 @@ const pt = ["id"], mt = {
|
|
|
382
379
|
setup(e) {
|
|
383
380
|
const t = e, n = _(() => t.message instanceof Error ? ut(t.message) : t.message);
|
|
384
381
|
return (i, s) => {
|
|
385
|
-
const o =
|
|
386
|
-
return d(),
|
|
382
|
+
const o = be("autofocus");
|
|
383
|
+
return d(), Oe(gt, {
|
|
387
384
|
class: k(["vf-alert", i.classes])
|
|
388
385
|
}, Pe({
|
|
389
386
|
default: Y(() => [
|
|
@@ -439,7 +436,7 @@ const pt = ["id"], mt = {
|
|
|
439
436
|
});
|
|
440
437
|
let N;
|
|
441
438
|
const wt = new Uint8Array(16);
|
|
442
|
-
function
|
|
439
|
+
function bt() {
|
|
443
440
|
if (!N && (N = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !N))
|
|
444
441
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
445
442
|
return N(wt);
|
|
@@ -447,7 +444,7 @@ function Ot() {
|
|
|
447
444
|
const y = [];
|
|
448
445
|
for (let e = 0; e < 256; ++e)
|
|
449
446
|
y.push((e + 256).toString(16).slice(1));
|
|
450
|
-
function
|
|
447
|
+
function Ot(e, t = 0) {
|
|
451
448
|
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]];
|
|
452
449
|
}
|
|
453
450
|
const kt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ue = {
|
|
@@ -457,14 +454,8 @@ function St(e, t, n) {
|
|
|
457
454
|
if (ue.randomUUID && !t && !e)
|
|
458
455
|
return ue.randomUUID();
|
|
459
456
|
e = e || {};
|
|
460
|
-
const i = e.random || (e.rng ||
|
|
461
|
-
|
|
462
|
-
n = n || 0;
|
|
463
|
-
for (let s = 0; s < 16; ++s)
|
|
464
|
-
t[n + s] = i[s];
|
|
465
|
-
return t;
|
|
466
|
-
}
|
|
467
|
-
return bt(i);
|
|
457
|
+
const i = e.random || (e.rng || bt)();
|
|
458
|
+
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Ot(i);
|
|
468
459
|
}
|
|
469
460
|
function Nn(e) {
|
|
470
461
|
return e.replace(/\n/g, "<br>");
|
|
@@ -592,11 +583,10 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
592
583
|
title: "Create <strong>" + this.searchText.trim() + "</strong>..."
|
|
593
584
|
}));
|
|
594
585
|
}
|
|
595
|
-
} else
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
});
|
|
586
|
+
} else this.nullTitle && e.unshift({
|
|
587
|
+
key: D,
|
|
588
|
+
title: this.nullTitle
|
|
589
|
+
});
|
|
600
590
|
return e;
|
|
601
591
|
}
|
|
602
592
|
},
|
|
@@ -662,8 +652,7 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
662
652
|
if (e.key == "Enter") {
|
|
663
653
|
e.preventDefault();
|
|
664
654
|
const t = this.effectiveOptions.find((n) => n.key == this.highlightedOptionKey);
|
|
665
|
-
if (t)
|
|
666
|
-
return this.selectOption(t);
|
|
655
|
+
if (t) return this.selectOption(t);
|
|
667
656
|
}
|
|
668
657
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
669
658
|
this.searchText.length > 1 && (this.isSearching = !0);
|
|
@@ -707,8 +696,7 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
707
696
|
i.style.visibility = "visible", document.body.appendChild(i), setTimeout(this.highlightInitialOption, 0);
|
|
708
697
|
},
|
|
709
698
|
highlightInitialOption() {
|
|
710
|
-
if (!this.isLoaded || !this.highlightedOptionKey)
|
|
711
|
-
return;
|
|
699
|
+
if (!this.isLoaded || !this.highlightedOptionKey) return;
|
|
712
700
|
const e = this.effectiveOptions.findIndex((i) => i.key == this.highlightedOptionKey), t = this.$refs.optionsContainer, n = t.querySelectorAll(".option")[e];
|
|
713
701
|
t.scrollTop = n.offsetTop;
|
|
714
702
|
},
|
|
@@ -718,8 +706,7 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
718
706
|
incrementHighlightedOption(e) {
|
|
719
707
|
const t = this.effectiveOptions.findIndex((o) => o.key == this.highlightedOptionKey);
|
|
720
708
|
let n = t + e;
|
|
721
|
-
if (n < 0 ? n = 0 : n >= this.effectiveOptions.length && (n = this.effectiveOptions.length - 1), t == n)
|
|
722
|
-
return;
|
|
709
|
+
if (n < 0 ? n = 0 : n >= this.effectiveOptions.length && (n = this.effectiveOptions.length - 1), t == n) return;
|
|
723
710
|
this.highlightedOptionKey = this.effectiveOptions[n].key;
|
|
724
711
|
const i = this.$refs.optionsContainer, s = i.querySelectorAll(".option")[n];
|
|
725
712
|
s.offsetTop < i.scrollTop ? i.scrollTop = s.offsetTop : s.offsetTop + s.offsetHeight > i.scrollTop + i.clientHeight && (i.scrollTop = s.offsetTop + s.offsetHeight - i.clientHeight);
|
|
@@ -756,7 +743,7 @@ const D = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
756
743
|
class: "no-results"
|
|
757
744
|
};
|
|
758
745
|
function _t(e, t, n, i, s, o) {
|
|
759
|
-
const r =
|
|
746
|
+
const r = be("disabled");
|
|
760
747
|
return d(), h("div", {
|
|
761
748
|
class: k(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
|
|
762
749
|
}, [
|
|
@@ -793,11 +780,11 @@ function _t(e, t, n, i, s, o) {
|
|
|
793
780
|
key: 0,
|
|
794
781
|
class: "subtitle",
|
|
795
782
|
innerHTML: l.subtitle
|
|
796
|
-
}, null, 8, Vt)) :
|
|
783
|
+
}, null, 8, Vt)) : O("", !0)
|
|
797
784
|
], 42, $t))), 128)),
|
|
798
|
-
!o.effectiveOptions.length && e.searchText ? (d(), h("div", Ft, x(o.effectiveNoResultsText), 1)) :
|
|
785
|
+
!o.effectiveOptions.length && e.searchText ? (d(), h("div", Ft, x(o.effectiveNoResultsText), 1)) : O("", !0)
|
|
799
786
|
], 64)) : (d(), h("div", At, "Loading..."))
|
|
800
|
-
], 512)) :
|
|
787
|
+
], 512)) : O("", !0)
|
|
801
788
|
], 2);
|
|
802
789
|
}
|
|
803
790
|
const Rt = /* @__PURE__ */ xe(It, [["render", _t]]), jn = /* @__PURE__ */ C({
|
|
@@ -817,7 +804,7 @@ const Rt = /* @__PURE__ */ xe(It, [["render", _t]]), jn = /* @__PURE__ */ C({
|
|
|
817
804
|
}))), s = _(() => n.formatter ? (l) => {
|
|
818
805
|
var a;
|
|
819
806
|
return (a = n.formatter) == null ? void 0 : a.call(n, l.label);
|
|
820
|
-
} : (l) => l.label), o = t, r =
|
|
807
|
+
} : (l) => l.label), o = t, r = b(i.value.find((l) => l.value === n.modelValue) ?? null);
|
|
821
808
|
return ce(
|
|
822
809
|
() => n.modelValue,
|
|
823
810
|
(l) => {
|
|
@@ -826,7 +813,7 @@ const Rt = /* @__PURE__ */ xe(It, [["render", _t]]), jn = /* @__PURE__ */ C({
|
|
|
826
813
|
), ce(r, (l) => {
|
|
827
814
|
var a;
|
|
828
815
|
o("update:modelValue", l ? ((a = i.value.find((p) => Ce(p, l))) == null ? void 0 : a.value) ?? null : null);
|
|
829
|
-
}), (l, a) => (d(),
|
|
816
|
+
}), (l, a) => (d(), Oe(Rt, {
|
|
830
817
|
modelValue: r.value,
|
|
831
818
|
"onUpdate:modelValue": a[0] || (a[0] = (p) => r.value = p),
|
|
832
819
|
options: i.value,
|
|
@@ -855,7 +842,7 @@ const Rt = /* @__PURE__ */ xe(It, [["render", _t]]), jn = /* @__PURE__ */ C({
|
|
|
855
842
|
function n() {
|
|
856
843
|
t.onClick ? t.onClick() : t.disableClose || t.callback();
|
|
857
844
|
}
|
|
858
|
-
const i =
|
|
845
|
+
const i = b();
|
|
859
846
|
return t.durationSecs !== null && L(() => {
|
|
860
847
|
var o;
|
|
861
848
|
const s = t.durationSecs ?? 5;
|
|
@@ -869,7 +856,7 @@ const Rt = /* @__PURE__ */ xe(It, [["render", _t]]), jn = /* @__PURE__ */ C({
|
|
|
869
856
|
}, [
|
|
870
857
|
w("div", Nt, [
|
|
871
858
|
w("div", Kt, x(s.message), 1),
|
|
872
|
-
s.disableClose ?
|
|
859
|
+
s.disableClose ? O("", !0) : (d(), h("div", jt, "x"))
|
|
873
860
|
]),
|
|
874
861
|
s.durationSecs !== null ? (d(), h("div", Ut, [
|
|
875
862
|
w("div", {
|
|
@@ -877,7 +864,7 @@ const Rt = /* @__PURE__ */ xe(It, [["render", _t]]), jn = /* @__PURE__ */ C({
|
|
|
877
864
|
ref: i,
|
|
878
865
|
class: "inner"
|
|
879
866
|
}, null, 512)
|
|
880
|
-
])) :
|
|
867
|
+
])) : O("", !0)
|
|
881
868
|
], 2));
|
|
882
869
|
}
|
|
883
870
|
});
|
|
@@ -1021,8 +1008,7 @@ function pe(e) {
|
|
|
1021
1008
|
const Z = ["auto", "scroll"];
|
|
1022
1009
|
function De(e) {
|
|
1023
1010
|
const t = e.parentElement;
|
|
1024
|
-
if (!t)
|
|
1025
|
-
return null;
|
|
1011
|
+
if (!t) return null;
|
|
1026
1012
|
const n = window.getComputedStyle(t);
|
|
1027
1013
|
return Z.includes(n.overflow) || Z.includes(n.overflowX) || Z.includes(n.overflowY) ? t : De(t);
|
|
1028
1014
|
}
|
|
@@ -1050,8 +1036,7 @@ const ln = {
|
|
|
1050
1036
|
updated: ve
|
|
1051
1037
|
}, me = Symbol("HasAutoFocused");
|
|
1052
1038
|
function ve(e, t) {
|
|
1053
|
-
if (t.value === void 0 && e[me] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue)
|
|
1054
|
-
return;
|
|
1039
|
+
if (t.value === void 0 && e[me] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
|
|
1055
1040
|
e[me] = !0;
|
|
1056
1041
|
const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
|
|
1057
1042
|
setTimeout(() => n.focus(), 10);
|
|
@@ -1137,10 +1122,8 @@ function vn() {
|
|
|
1137
1122
|
setInterval(vn, 1e3);
|
|
1138
1123
|
function Ee(e, t) {
|
|
1139
1124
|
var r;
|
|
1140
|
-
if (t.value == t.oldValue)
|
|
1141
|
-
|
|
1142
|
-
if (!t.value)
|
|
1143
|
-
return $e(e);
|
|
1125
|
+
if (t.value == t.oldValue) return;
|
|
1126
|
+
if (!t.value) return $e(e);
|
|
1144
1127
|
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;
|
|
1145
1128
|
e[R] || re.push(e), e[R] = {
|
|
1146
1129
|
startTs: s,
|
|
@@ -1250,11 +1233,11 @@ class wn {
|
|
|
1250
1233
|
this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext);
|
|
1251
1234
|
}
|
|
1252
1235
|
}
|
|
1253
|
-
function
|
|
1236
|
+
function bn(e) {
|
|
1254
1237
|
e.directive("autofocus", ln), e.directive("confirm-button", rn), e.directive("date-input", cn), e.directive("datetime", un), e.directive("disabled", fn), e.directive("duration", mn), e.directive("infinite-scroll", gn), e.directive("readonly", En), e.directive("tooltip", Tn);
|
|
1255
1238
|
}
|
|
1256
1239
|
function Jn(e) {
|
|
1257
|
-
|
|
1240
|
+
bn(e);
|
|
1258
1241
|
}
|
|
1259
1242
|
export {
|
|
1260
1243
|
In as OverlayContainer,
|
package/package.json
CHANGED
|
@@ -63,9 +63,8 @@ export type Vue__ComponentPublicInstanceConstructor<
|
|
|
63
63
|
new (...args: any[]): T;
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
export type ObjectComponentConfig<T extends Vue__ComponentPublicInstanceConstructor> =
|
|
67
|
-
? P
|
|
68
|
-
: never;
|
|
66
|
+
export type ObjectComponentConfig<T extends Vue__ComponentPublicInstanceConstructor> =
|
|
67
|
+
T extends Vue__ComponentPublicInstanceConstructor<infer P> ? P : never;
|
|
69
68
|
export type ObjectComponentProps<T extends Vue__ComponentPublicInstanceConstructor> = Writable<
|
|
70
69
|
Omit<ObjectComponentConfig<T>['$props'], keyof VNodeProps | keyof AllowedComponentProps>
|
|
71
70
|
>;
|