@signal24/vue-foundation 4.7.1 → 4.7.2
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.
|
@@ -35,6 +35,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
35
35
|
disabled: PropType<boolean>;
|
|
36
36
|
optionsListId: PropType<string>;
|
|
37
37
|
debug: PropType<boolean>;
|
|
38
|
+
required: PropType<boolean>;
|
|
38
39
|
}, unknown, {
|
|
39
40
|
isLoading: boolean;
|
|
40
41
|
isLoaded: boolean;
|
|
@@ -64,7 +65,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
64
65
|
effectiveOptions(): OptionDescriptor[];
|
|
65
66
|
}, {
|
|
66
67
|
loadRemoteOptions(): Promise<void>;
|
|
67
|
-
handleSourceUpdate(): Promise<void> | undefined;
|
|
68
68
|
reloadOptions(): Promise<void>;
|
|
69
69
|
reloadOptionsIfSearching(): void;
|
|
70
70
|
handleKeyDown(e: KeyboardEvent): void;
|
|
@@ -83,7 +83,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
83
83
|
addRemoteOption(option: GenericObject): void;
|
|
84
84
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
85
85
|
optionsLoaded: (options: any[]) => void;
|
|
86
|
-
createItem: (searchText: string) => void;
|
|
87
86
|
'update:modelValue': (value: any) => void;
|
|
88
87
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
89
88
|
modelValue: {
|
|
@@ -111,10 +110,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
111
110
|
disabled: PropType<boolean>;
|
|
112
111
|
optionsListId: PropType<string>;
|
|
113
112
|
debug: PropType<boolean>;
|
|
113
|
+
required: PropType<boolean>;
|
|
114
114
|
}>> & {
|
|
115
115
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
116
116
|
onOptionsLoaded?: ((options: any[]) => any) | undefined;
|
|
117
|
-
onCreateItem?: ((searchText: string) => any) | undefined;
|
|
118
117
|
}, {
|
|
119
118
|
modelValue: any;
|
|
120
119
|
}, {}>;
|
|
@@ -1,17 +1,17 @@
|
|
|
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
3
|
var v = (e, t, n) => (Fe(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { compact as Xe, debounce as Ye, isEqual as
|
|
4
|
+
import { defineComponent as C, defineProps as Ne, defineEmits as Re, ref as w, computed as V, openBlock as u, createElementBlock as f, createElementVNode as O, toDisplayString as x, withDirectives as U, createCommentVNode as T, Fragment as j, renderList as J, vModelSelect as Ke, getCurrentInstance as ee, onMounted as L, normalizeClass as k, normalizeStyle as Ue, withModifiers as te, renderSlot as K, reactive as je, h as W, Teleport as We, markRaw as Pe, onBeforeUnmount as ne, resolveDirective as Te, createBlock as ke, createSlots as qe, withCtx as Y, createTextVNode as ae, vModelText as ze, watch as ce, onActivated as Se, onDeactivated as Ce } from "vue";
|
|
5
|
+
import { compact as Xe, debounce as Ye, isEqual as xe, upperFirst as Ze, startCase as Ge, cloneDeep as Qe, remove as Je } from "lodash";
|
|
6
6
|
import { escapeHtml as et } from "@vue/shared";
|
|
7
|
-
import { escapeHtml as
|
|
7
|
+
import { escapeHtml as si } from "@vue/shared";
|
|
8
8
|
import { format as G } from "date-fns";
|
|
9
|
-
const tt =
|
|
9
|
+
const tt = C({
|
|
10
10
|
setup() {
|
|
11
11
|
const e = Ne();
|
|
12
12
|
Re(["update:modelValue"]);
|
|
13
|
-
const t = w(null), n = V(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null),
|
|
14
|
-
return { props: e, options: t, renderOptions: n, selectedItem:
|
|
13
|
+
const t = w(null), n = V(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = w(e.modelValue ?? null);
|
|
14
|
+
return { props: e, options: t, renderOptions: n, selectedItem: i };
|
|
15
15
|
},
|
|
16
16
|
watch: {
|
|
17
17
|
loadFn() {
|
|
@@ -34,47 +34,47 @@ const tt = x({
|
|
|
34
34
|
}
|
|
35
35
|
}), Le = (e, t) => {
|
|
36
36
|
const n = e.__vccOpts || e;
|
|
37
|
-
for (const [
|
|
38
|
-
n[
|
|
37
|
+
for (const [i, s] of t)
|
|
38
|
+
n[i] = s;
|
|
39
39
|
return n;
|
|
40
40
|
}, nt = {
|
|
41
41
|
key: 0,
|
|
42
42
|
disabled: ""
|
|
43
|
-
},
|
|
43
|
+
}, it = {
|
|
44
44
|
key: 0,
|
|
45
45
|
value: null
|
|
46
|
-
},
|
|
47
|
-
function ot(e, t, n,
|
|
46
|
+
}, st = ["value"];
|
|
47
|
+
function ot(e, t, n, i, s, o) {
|
|
48
48
|
return e.renderOptions ? U((u(), f("select", {
|
|
49
49
|
key: 1,
|
|
50
50
|
"onUpdate:modelValue": t[0] || (t[0] = (r) => e.selectedItem = r)
|
|
51
51
|
}, [
|
|
52
|
-
e.props.nullText ? (u(), f("option",
|
|
52
|
+
e.props.nullText ? (u(), f("option", it, x(e.props.nullText), 1)) : T("", !0),
|
|
53
53
|
(u(!0), f(j, null, J(e.renderOptions, (r, l) => {
|
|
54
54
|
var c;
|
|
55
55
|
return u(), f("option", {
|
|
56
56
|
key: l,
|
|
57
57
|
value: (c = e.options) == null ? void 0 : c[l]
|
|
58
|
-
},
|
|
58
|
+
}, x(r), 9, st);
|
|
59
59
|
}), 128))
|
|
60
60
|
], 512)), [
|
|
61
61
|
[Ke, e.selectedItem]
|
|
62
62
|
]) : (u(), f("select", nt, [
|
|
63
|
-
O("option", null,
|
|
63
|
+
O("option", null, x(e.props.loadingText || "Loading..."), 1)
|
|
64
64
|
]));
|
|
65
65
|
}
|
|
66
|
-
const Hn = /* @__PURE__ */ Le(tt, [["render", ot]]), lt = ["onClick"], rt = /* @__PURE__ */
|
|
66
|
+
const Hn = /* @__PURE__ */ Le(tt, [["render", ot]]), lt = ["onClick"], rt = /* @__PURE__ */ C({
|
|
67
67
|
__name: "overlay-anchor",
|
|
68
68
|
props: {
|
|
69
69
|
overlayId: {},
|
|
70
70
|
anchor: {}
|
|
71
71
|
},
|
|
72
72
|
setup(e) {
|
|
73
|
-
const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el,
|
|
73
|
+
const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, i = w({ visibility: "hidden", top: "0", left: "0" }), s = w([]), o = ee();
|
|
74
74
|
L(r);
|
|
75
75
|
function r() {
|
|
76
76
|
const h = o.vnode.el, { styles: b, classes: m } = l(h, n);
|
|
77
|
-
|
|
77
|
+
i.value = b, s.value = m;
|
|
78
78
|
}
|
|
79
79
|
function l(h, b) {
|
|
80
80
|
const m = t.anchor instanceof HTMLElement ? {} : t.anchor, y = b.getBoundingClientRect(), p = h.getBoundingClientRect();
|
|
@@ -111,8 +111,8 @@ const Hn = /* @__PURE__ */ Le(tt, [["render", ot]]), lt = ["onClick"], rt = /* @
|
|
|
111
111
|
window.addEventListener("click", c);
|
|
112
112
|
}, 10);
|
|
113
113
|
}), (h, b) => (u(), f("div", {
|
|
114
|
-
class: k(["vf-overlay-anchor",
|
|
115
|
-
style: Ue(
|
|
114
|
+
class: k(["vf-overlay-anchor", s.value]),
|
|
115
|
+
style: Ue(i.value),
|
|
116
116
|
onClick: te(c, ["stop"])
|
|
117
117
|
}, [
|
|
118
118
|
K(h.$slots, "default")
|
|
@@ -120,18 +120,18 @@ const Hn = /* @__PURE__ */ Le(tt, [["render", ot]]), lt = ["onClick"], rt = /* @
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
let at = 0;
|
|
123
|
-
const S = je([]), _n =
|
|
123
|
+
const S = je([]), _n = C({
|
|
124
124
|
setup() {
|
|
125
125
|
return () => W("div", [
|
|
126
126
|
J(S, (e) => W(We, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
|
|
127
127
|
]);
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
|
-
function
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
id:
|
|
130
|
+
function ie(e, t, n) {
|
|
131
|
+
const i = document.getElementById("vf-overlay-target") ?? document.createElement("div");
|
|
132
|
+
i.id = "vf-overlay-target", i.removeAttribute("inert"), document.body.appendChild(i);
|
|
133
|
+
const s = String(++at), o = Pe(e), r = W(o, t), l = n != null && n.anchor ? W(rt, { overlayId: s, anchor: n.anchor }, () => [r]) : void 0, c = {
|
|
134
|
+
id: s,
|
|
135
135
|
component: o,
|
|
136
136
|
props: t,
|
|
137
137
|
options: n ?? {},
|
|
@@ -160,36 +160,36 @@ function P(e) {
|
|
|
160
160
|
const t = S.indexOf(e);
|
|
161
161
|
t >= 0 && S.splice(t, 1);
|
|
162
162
|
}
|
|
163
|
-
async function
|
|
164
|
-
return new Promise((
|
|
165
|
-
let
|
|
163
|
+
async function se(e, t, n) {
|
|
164
|
+
return new Promise((i) => {
|
|
165
|
+
let s = null;
|
|
166
166
|
const r = { ...t, callback: (l) => {
|
|
167
|
-
P(
|
|
167
|
+
P(s), i(l);
|
|
168
168
|
} };
|
|
169
|
-
|
|
169
|
+
s = ie(e, r, n);
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
function q(e, t) {
|
|
173
173
|
return { title: t ? e : void 0, message: t ?? e };
|
|
174
174
|
}
|
|
175
175
|
async function de(e, t) {
|
|
176
|
-
await
|
|
176
|
+
await se(X, q(e, t));
|
|
177
177
|
}
|
|
178
178
|
async function $n(e, t) {
|
|
179
|
-
return await
|
|
179
|
+
return await se(X, {
|
|
180
180
|
...q(e, t),
|
|
181
181
|
shouldConfirm: !0
|
|
182
182
|
}) === !0;
|
|
183
183
|
}
|
|
184
184
|
async function An(e, t) {
|
|
185
|
-
return await
|
|
185
|
+
return await se(X, {
|
|
186
186
|
...q(e, t),
|
|
187
187
|
shouldConfirm: !0,
|
|
188
188
|
classes: ["destructive"]
|
|
189
189
|
}) === !0;
|
|
190
190
|
}
|
|
191
191
|
function Bn(e, t) {
|
|
192
|
-
const n =
|
|
192
|
+
const n = ie(X, {
|
|
193
193
|
...q(e, t),
|
|
194
194
|
isBare: !0,
|
|
195
195
|
classes: ["wait"],
|
|
@@ -231,8 +231,8 @@ async function Nn(e) {
|
|
|
231
231
|
}
|
|
232
232
|
const $ = Symbol("MaskState");
|
|
233
233
|
function Rn(e, t) {
|
|
234
|
-
const n = e.$.vnode.el,
|
|
235
|
-
return ht(
|
|
234
|
+
const n = e.$.vnode.el, i = n.closest(".vf-modal");
|
|
235
|
+
return ht(i ?? n, t);
|
|
236
236
|
}
|
|
237
237
|
function Kn(e) {
|
|
238
238
|
const t = e.$.vnode.el, n = t.closest(".vf-modal");
|
|
@@ -250,20 +250,20 @@ function Ie(e) {
|
|
|
250
250
|
}
|
|
251
251
|
const Q = Symbol("FormMaskState");
|
|
252
252
|
function ft(e, t, n) {
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
const l = [...
|
|
258
|
-
return l.forEach((c) => c.setAttribute("disabled", "disabled")),
|
|
253
|
+
const i = e instanceof Element ? e : _e(e);
|
|
254
|
+
i.classList.add("vf-masked");
|
|
255
|
+
const s = t instanceof Element ? t : i.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0], o = s.tagName === "INPUT" ? s.value : s.innerHTML;
|
|
256
|
+
s.setAttribute("disabled", "disabled"), s.innerText = n ?? "Please wait...";
|
|
257
|
+
const l = [...i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
|
|
258
|
+
return l.forEach((c) => c.setAttribute("disabled", "disabled")), i[Q] = {
|
|
259
259
|
disabledElements: l,
|
|
260
|
-
waitButton:
|
|
260
|
+
waitButton: s,
|
|
261
261
|
buttonHtml: o
|
|
262
|
-
}, () => He(
|
|
262
|
+
}, () => He(i);
|
|
263
263
|
}
|
|
264
264
|
function He(e) {
|
|
265
265
|
const t = e instanceof Element ? e : _e(e), n = t[Q];
|
|
266
|
-
n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((
|
|
266
|
+
n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((i) => i.removeAttribute("disabled")), n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled"), delete t[Q]);
|
|
267
267
|
}
|
|
268
268
|
function _e(e) {
|
|
269
269
|
const t = e.$.vnode.el;
|
|
@@ -275,7 +275,7 @@ const pt = ["id"], mt = {
|
|
|
275
275
|
}, vt = { class: "vf-modal-content" }, yt = {
|
|
276
276
|
key: 1,
|
|
277
277
|
class: "vf-modal-footer"
|
|
278
|
-
}, gt = /* @__PURE__ */
|
|
278
|
+
}, gt = /* @__PURE__ */ C({
|
|
279
279
|
__name: "modal",
|
|
280
280
|
props: {
|
|
281
281
|
id: {},
|
|
@@ -286,26 +286,26 @@ const pt = ["id"], mt = {
|
|
|
286
286
|
},
|
|
287
287
|
emits: ["formSubmit"],
|
|
288
288
|
setup(e, { expose: t }) {
|
|
289
|
-
const n = e,
|
|
289
|
+
const n = e, i = ee();
|
|
290
290
|
t({ mask: m, unmask: y, hide: p, unhide: a });
|
|
291
|
-
const
|
|
291
|
+
const s = w(), o = w(), r = w(!1), l = V(() => Xe([n.class, r.value && "hidden"]));
|
|
292
292
|
L(() => {
|
|
293
293
|
var d;
|
|
294
|
-
document.body.classList.add("vf-modal-open"), n.closeOnMaskClick && (window.addEventListener("keydown", h), (d =
|
|
294
|
+
document.body.classList.add("vf-modal-open"), n.closeOnMaskClick && (window.addEventListener("keydown", h), (d = s.value) == null || d.addEventListener("click", c));
|
|
295
295
|
}), ne(() => {
|
|
296
296
|
window.removeEventListener("keydown", h), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
|
|
297
297
|
});
|
|
298
298
|
function c(d) {
|
|
299
|
-
d.target ==
|
|
299
|
+
d.target == s.value && b();
|
|
300
300
|
}
|
|
301
301
|
function h(d) {
|
|
302
302
|
if (d.key === "Esc" || d.key === "Escape") {
|
|
303
303
|
const E = document.querySelectorAll(".vf-modal-wrap");
|
|
304
|
-
E[E.length - 1] ===
|
|
304
|
+
E[E.length - 1] === s.value && b();
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
function b() {
|
|
308
|
-
Me(
|
|
308
|
+
Me(i);
|
|
309
309
|
}
|
|
310
310
|
function m() {
|
|
311
311
|
ft(o.value);
|
|
@@ -323,7 +323,7 @@ const pt = ["id"], mt = {
|
|
|
323
323
|
id: d.id,
|
|
324
324
|
class: k(["vf-overlay vf-modal-wrap", l.value]),
|
|
325
325
|
ref_key: "overlay",
|
|
326
|
-
ref:
|
|
326
|
+
ref: s
|
|
327
327
|
}, [
|
|
328
328
|
O("form", {
|
|
329
329
|
action: ".",
|
|
@@ -350,7 +350,7 @@ const pt = ["id"], mt = {
|
|
|
350
350
|
], 10, pt));
|
|
351
351
|
}
|
|
352
352
|
});
|
|
353
|
-
const bt = ["innerHtml"], Et = ["innerText"], X = /* @__PURE__ */
|
|
353
|
+
const bt = ["innerHtml"], Et = ["innerText"], X = /* @__PURE__ */ C({
|
|
354
354
|
__name: "alert-modal",
|
|
355
355
|
props: {
|
|
356
356
|
isBare: { type: Boolean },
|
|
@@ -363,15 +363,15 @@ const bt = ["innerHtml"], Et = ["innerText"], X = /* @__PURE__ */ x({
|
|
|
363
363
|
},
|
|
364
364
|
setup(e) {
|
|
365
365
|
const t = e, n = V(() => t.message instanceof Error ? ut(t.message) : t.message);
|
|
366
|
-
return (
|
|
366
|
+
return (i, s) => {
|
|
367
367
|
const o = Te("autofocus");
|
|
368
368
|
return u(), ke(gt, {
|
|
369
|
-
class: k(["vf-alert",
|
|
369
|
+
class: k(["vf-alert", i.classes])
|
|
370
370
|
}, qe({
|
|
371
371
|
default: Y(() => [
|
|
372
|
-
|
|
372
|
+
i.isHtml ? (u(), f("div", {
|
|
373
373
|
key: 0,
|
|
374
|
-
innerHtml:
|
|
374
|
+
innerHtml: i.message,
|
|
375
375
|
class: "user-message"
|
|
376
376
|
}, null, 8, bt)) : (u(), f("div", {
|
|
377
377
|
key: 1,
|
|
@@ -380,20 +380,20 @@ const bt = ["innerHtml"], Et = ["innerText"], X = /* @__PURE__ */ x({
|
|
|
380
380
|
]),
|
|
381
381
|
_: 2
|
|
382
382
|
}, [
|
|
383
|
-
|
|
383
|
+
i.title ? {
|
|
384
384
|
name: "header",
|
|
385
385
|
fn: Y(() => [
|
|
386
|
-
O("h1", null,
|
|
386
|
+
O("h1", null, x(i.title), 1)
|
|
387
387
|
]),
|
|
388
388
|
key: "0"
|
|
389
389
|
} : void 0,
|
|
390
|
-
|
|
390
|
+
i.isBare ? void 0 : {
|
|
391
391
|
name: "footer",
|
|
392
392
|
fn: Y(() => [
|
|
393
|
-
|
|
393
|
+
i.shouldConfirm ? (u(), f(j, { key: 0 }, [
|
|
394
394
|
U((u(), f("button", {
|
|
395
395
|
class: "primary",
|
|
396
|
-
onClick:
|
|
396
|
+
onClick: s[0] || (s[0] = () => i.callback(!0))
|
|
397
397
|
}, [
|
|
398
398
|
ae("Confirm")
|
|
399
399
|
])), [
|
|
@@ -401,12 +401,12 @@ const bt = ["innerHtml"], Et = ["innerText"], X = /* @__PURE__ */ x({
|
|
|
401
401
|
]),
|
|
402
402
|
O("button", {
|
|
403
403
|
class: "default",
|
|
404
|
-
onClick:
|
|
404
|
+
onClick: s[1] || (s[1] = () => i.callback(!1))
|
|
405
405
|
}, "Cancel")
|
|
406
406
|
], 64)) : U((u(), f("button", {
|
|
407
407
|
key: 1,
|
|
408
408
|
class: "default",
|
|
409
|
-
onClick:
|
|
409
|
+
onClick: s[2] || (s[2] = () => i.callback(!0))
|
|
410
410
|
}, [
|
|
411
411
|
ae("OK")
|
|
412
412
|
])), [
|
|
@@ -439,22 +439,22 @@ function St(e, t, n) {
|
|
|
439
439
|
if (ue.randomUUID && !t && !e)
|
|
440
440
|
return ue.randomUUID();
|
|
441
441
|
e = e || {};
|
|
442
|
-
const
|
|
443
|
-
if (
|
|
442
|
+
const i = e.random || (e.rng || wt)();
|
|
443
|
+
if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, t) {
|
|
444
444
|
n = n || 0;
|
|
445
|
-
for (let
|
|
446
|
-
t[n +
|
|
445
|
+
for (let s = 0; s < 16; ++s)
|
|
446
|
+
t[n + s] = i[s];
|
|
447
447
|
return t;
|
|
448
448
|
}
|
|
449
|
-
return Tt(
|
|
449
|
+
return Tt(i);
|
|
450
450
|
}
|
|
451
451
|
function Un(e) {
|
|
452
452
|
return e.replace(/\n/g, "<br>");
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Ct(e) {
|
|
455
455
|
return e.replace(/_/g, " ");
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function xt(e) {
|
|
458
458
|
const t = e.replace(/\D/g, "").replace(/^1/, "");
|
|
459
459
|
return t.length != 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
|
|
460
460
|
}
|
|
@@ -490,11 +490,11 @@ const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
490
490
|
noResultsText: String,
|
|
491
491
|
disabled: Boolean,
|
|
492
492
|
optionsListId: String,
|
|
493
|
-
debug: Boolean
|
|
493
|
+
debug: Boolean,
|
|
494
|
+
required: Boolean
|
|
494
495
|
},
|
|
495
496
|
emits: {
|
|
496
497
|
optionsLoaded: Object,
|
|
497
|
-
createItem: Object,
|
|
498
498
|
"update:modelValue": Object
|
|
499
499
|
},
|
|
500
500
|
data() {
|
|
@@ -542,14 +542,14 @@ const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
542
542
|
optionsDescriptors() {
|
|
543
543
|
return this.allOptions.map((e, t) => {
|
|
544
544
|
var l, c;
|
|
545
|
-
const n = this.formatter(e),
|
|
545
|
+
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 = [];
|
|
546
546
|
return this.searchFields ? this.searchFields.forEach((h) => {
|
|
547
547
|
e[h] && r.push(String(e[h]).toLowerCase());
|
|
548
|
-
}) : (r.push(
|
|
548
|
+
}) : (r.push(s), o && r.push(o)), {
|
|
549
549
|
// eslint-disable-next-line vue/no-use-computed-property-like-method
|
|
550
550
|
key: ((c = this.effectiveKeyExtractor) == null ? void 0 : c.call(this, e)) ?? String(t),
|
|
551
551
|
title: n,
|
|
552
|
-
subtitle:
|
|
552
|
+
subtitle: i,
|
|
553
553
|
searchContent: r.join(""),
|
|
554
554
|
ref: e
|
|
555
555
|
};
|
|
@@ -560,14 +560,14 @@ const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
560
560
|
if (this.isSearching) {
|
|
561
561
|
const t = this.searchText.trim().toLowerCase();
|
|
562
562
|
if (t.length) {
|
|
563
|
-
e = e.filter((
|
|
564
|
-
const n = et(this.searchText).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"),
|
|
565
|
-
e = e.map((
|
|
563
|
+
e = e.filter((s) => s.searchContent.includes(t));
|
|
564
|
+
const n = et(this.searchText).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), i = new RegExp(`(${n})`, "ig");
|
|
565
|
+
e = e.map((s) => {
|
|
566
566
|
var o;
|
|
567
567
|
return {
|
|
568
|
-
...
|
|
569
|
-
title:
|
|
570
|
-
subtitle: (o =
|
|
568
|
+
...s,
|
|
569
|
+
title: s.title.replace(i, "<mark>$1</mark>"),
|
|
570
|
+
subtitle: (o = s.subtitle) == null ? void 0 : o.replace(i, "<mark>$1</mark>")
|
|
571
571
|
};
|
|
572
572
|
}), this.shouldShowCreateOption && (e.find((o) => o.searchContent === t) !== void 0 || e.push({
|
|
573
573
|
key: he,
|
|
@@ -588,7 +588,7 @@ const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
588
588
|
this.handleValueChanged();
|
|
589
589
|
},
|
|
590
590
|
options() {
|
|
591
|
-
this.loadedOptions = this.options ?? [];
|
|
591
|
+
this.loadedOptions = this.options ?? [], this.isLoaded = !0;
|
|
592
592
|
},
|
|
593
593
|
// data
|
|
594
594
|
optionsDescriptors() {
|
|
@@ -606,7 +606,7 @@ const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
606
606
|
}
|
|
607
607
|
},
|
|
608
608
|
async mounted() {
|
|
609
|
-
this.shouldShowCreateOption = this
|
|
609
|
+
this.shouldShowCreateOption = this.onCreateItem !== void 0, this.options ? (this.loadedOptions = this.options, this.isLoaded = !0) : this.preload && await this.loadRemoteOptions(), this.handleValueChanged(), this.$watch("selectedOption", () => {
|
|
610
610
|
this.selectedOption !== this.modelValue && this.$emit(
|
|
611
611
|
"update:modelValue",
|
|
612
612
|
this.selectedOption && this.valueExtractor ? this.valueExtractor(this.selectedOption) : this.selectedOption
|
|
@@ -617,11 +617,6 @@ const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
617
617
|
async loadRemoteOptions() {
|
|
618
618
|
await this.reloadOptions(), this.loadedOptions && this.$emit("optionsLoaded", this.loadedOptions);
|
|
619
619
|
},
|
|
620
|
-
handleSourceUpdate() {
|
|
621
|
-
if (this.preload)
|
|
622
|
-
return this.reloadOptions();
|
|
623
|
-
this.isLoaded && (this.isLoaded = !1, this.loadedOptions = []);
|
|
624
|
-
},
|
|
625
620
|
async reloadOptions() {
|
|
626
621
|
var t;
|
|
627
622
|
const e = this.remoteSearch && this.isSearching && this.searchText ? this.searchText : null;
|
|
@@ -671,10 +666,10 @@ const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
671
666
|
return this.effectiveKeyExtractor ? this.effectiveKeyExtractor(this.selectedOption) : ((t = this.getOptionDescriptor(e)) == null ? void 0 : t.key) ?? "";
|
|
672
667
|
},
|
|
673
668
|
getOptionDescriptor(e) {
|
|
674
|
-
const t = this.effectiveOptions.find((
|
|
669
|
+
const t = this.effectiveOptions.find((i) => i.ref === e);
|
|
675
670
|
if (t)
|
|
676
671
|
return t;
|
|
677
|
-
const n = this.effectiveOptions.find((
|
|
672
|
+
const n = this.effectiveOptions.find((i) => xe(i.ref, e));
|
|
678
673
|
return n || null;
|
|
679
674
|
},
|
|
680
675
|
handleInputBlurred() {
|
|
@@ -684,19 +679,19 @@ const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
684
679
|
this.isLoaded || this.loadRemoteOptions(), this.optionsListId && this.$refs.optionsContainer.setAttribute("id", this.optionsListId), this.teleportOptionsContainer();
|
|
685
680
|
},
|
|
686
681
|
teleportOptionsContainer() {
|
|
687
|
-
const e = this.$el.getBoundingClientRect(), t = e.y + e.height + 2, n = e.x,
|
|
688
|
-
for (let o in
|
|
689
|
-
/^(font|text)/.test(o) && (
|
|
690
|
-
if (
|
|
682
|
+
const e = this.$el.getBoundingClientRect(), t = e.y + e.height + 2, n = e.x, i = this.$refs.optionsContainer, s = window.getComputedStyle(this.$el);
|
|
683
|
+
for (let o in s)
|
|
684
|
+
/^(font|text)/.test(o) && (i.style[o] = s[o]);
|
|
685
|
+
if (i.style.top = t + "px", i.style.left = n + "px", i.style.minWidth = e.width + "px", !s.maxHeight || s.maxHeight == "none") {
|
|
691
686
|
const o = window.innerHeight - t - 12;
|
|
692
|
-
|
|
687
|
+
i.style.maxHeight = o + "px";
|
|
693
688
|
}
|
|
694
|
-
|
|
689
|
+
i.style.visibility = "visible", document.body.appendChild(i), setTimeout(this.highlightInitialOption, 0);
|
|
695
690
|
},
|
|
696
691
|
highlightInitialOption() {
|
|
697
692
|
if (!this.isLoaded || !this.highlightedOptionKey)
|
|
698
693
|
return;
|
|
699
|
-
const e = this.effectiveOptions.findIndex((
|
|
694
|
+
const e = this.effectiveOptions.findIndex((i) => i.key == this.highlightedOptionKey), t = this.$refs.optionsContainer, n = t.querySelectorAll(".option")[e];
|
|
700
695
|
t.scrollTop = n.offsetTop;
|
|
701
696
|
},
|
|
702
697
|
handleOptionHover(e) {
|
|
@@ -708,18 +703,19 @@ const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
708
703
|
if (n < 0 ? n = 0 : n >= this.effectiveOptions.length && (n = this.effectiveOptions.length - 1), t == n)
|
|
709
704
|
return;
|
|
710
705
|
this.highlightedOptionKey = this.effectiveOptions[n].key;
|
|
711
|
-
const
|
|
712
|
-
|
|
706
|
+
const i = this.$refs.optionsContainer, s = i.querySelectorAll(".option")[n];
|
|
707
|
+
s.offsetTop < i.scrollTop ? i.scrollTop = s.offsetTop : s.offsetTop + s.offsetHeight > i.scrollTop + i.clientHeight && (i.scrollTop = s.offsetTop + s.offsetHeight - i.clientHeight);
|
|
713
708
|
},
|
|
714
709
|
selectOption(e) {
|
|
710
|
+
var t;
|
|
715
711
|
if (this.isSearching = !1, e.key == H)
|
|
716
712
|
this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null;
|
|
717
713
|
else if (e.key === he) {
|
|
718
|
-
const
|
|
719
|
-
this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null, this
|
|
714
|
+
const n = this.searchText.trim();
|
|
715
|
+
this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null, (t = this.onCreateItem) == null || t.call(this, n);
|
|
720
716
|
} else {
|
|
721
|
-
const
|
|
722
|
-
this.selectedOption =
|
|
717
|
+
const i = this.optionsDescriptors.find((s) => s.key == e.key).ref;
|
|
718
|
+
this.selectedOption = i, this.selectedOptionTitle = this.formatter(i), this.searchText = this.selectedOptionTitle || "";
|
|
723
719
|
}
|
|
724
720
|
this.$refs.searchField.blur();
|
|
725
721
|
},
|
|
@@ -727,11 +723,11 @@ const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@
|
|
|
727
723
|
this.modelValue ? (this.selectedOption = this.valueExtractor ? this.allOptions.find((e) => this.modelValue === this.valueExtractor(e)) : this.modelValue, this.selectedOptionTitle = this.selectedOption ? this.formatter(this.selectedOption) : null, this.searchText = this.selectedOptionTitle || "") : (this.selectedOption = null, this.selectedOptionTitle = null, this.searchText = "");
|
|
728
724
|
},
|
|
729
725
|
addRemoteOption(e) {
|
|
730
|
-
this.loadedOptions.
|
|
726
|
+
this.loadedOptions.unshift(e);
|
|
731
727
|
}
|
|
732
728
|
}
|
|
733
729
|
};
|
|
734
|
-
const Ht = ["placeholder"], _t = {
|
|
730
|
+
const Ht = ["placeholder", "required"], _t = {
|
|
735
731
|
key: 0,
|
|
736
732
|
ref: "optionsContainer",
|
|
737
733
|
class: "vf-smart-select-options"
|
|
@@ -742,7 +738,7 @@ const Ht = ["placeholder"], _t = {
|
|
|
742
738
|
key: 0,
|
|
743
739
|
class: "no-results"
|
|
744
740
|
};
|
|
745
|
-
function Ft(e, t, n,
|
|
741
|
+
function Ft(e, t, n, i, s, o) {
|
|
746
742
|
const r = Te("disabled");
|
|
747
743
|
return u(), f("div", {
|
|
748
744
|
class: k(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
|
|
@@ -755,7 +751,8 @@ function Ft(e, t, n, s, i, o) {
|
|
|
755
751
|
onKeydown: t[1] || (t[1] = (...l) => o.handleKeyDown && o.handleKeyDown(...l)),
|
|
756
752
|
placeholder: o.effectivePlaceholder,
|
|
757
753
|
onFocus: t[2] || (t[2] = (...l) => o.handleInputFocused && o.handleInputFocused(...l)),
|
|
758
|
-
onBlur: t[3] || (t[3] = (...l) => o.handleInputBlurred && o.handleInputBlurred(...l))
|
|
754
|
+
onBlur: t[3] || (t[3] = (...l) => o.handleInputBlurred && o.handleInputBlurred(...l)),
|
|
755
|
+
required: n.required
|
|
759
756
|
}, null, 42, Ht), [
|
|
760
757
|
[ze, e.searchText],
|
|
761
758
|
[r, o.effectiveDisabled]
|
|
@@ -780,12 +777,12 @@ function Ft(e, t, n, s, i, o) {
|
|
|
780
777
|
innerHTML: l.subtitle
|
|
781
778
|
}, null, 8, Bt)) : T("", !0)
|
|
782
779
|
], 42, $t))), 128)),
|
|
783
|
-
!o.effectiveOptions.length && e.searchText ? (u(), f("div", Vt,
|
|
780
|
+
!o.effectiveOptions.length && e.searchText ? (u(), f("div", Vt, x(o.effectiveNoResultsText), 1)) : T("", !0)
|
|
784
781
|
], 64)) : (u(), f("div", Dt, "Loading..."))
|
|
785
782
|
], 512)) : T("", !0)
|
|
786
783
|
], 2);
|
|
787
784
|
}
|
|
788
|
-
const Nt = /* @__PURE__ */ Le(It, [["render", Ft]]), Wn = /* @__PURE__ */
|
|
785
|
+
const Nt = /* @__PURE__ */ Le(It, [["render", Ft]]), Wn = /* @__PURE__ */ C({
|
|
789
786
|
__name: "ez-smart-select",
|
|
790
787
|
props: {
|
|
791
788
|
modelValue: {},
|
|
@@ -796,26 +793,26 @@ const Nt = /* @__PURE__ */ Le(It, [["render", Ft]]), Wn = /* @__PURE__ */ x({
|
|
|
796
793
|
},
|
|
797
794
|
emits: ["update:modelValue"],
|
|
798
795
|
setup(e, { emit: t }) {
|
|
799
|
-
const n = e,
|
|
796
|
+
const n = e, i = V(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: r })) : Object.entries(n.options).map(([r, l]) => ({
|
|
800
797
|
value: r,
|
|
801
798
|
label: l
|
|
802
|
-
}))),
|
|
799
|
+
}))), s = V(() => n.formatter ? (r) => {
|
|
803
800
|
var l;
|
|
804
801
|
return (l = n.formatter) == null ? void 0 : l.call(n, r.label);
|
|
805
|
-
} : (r) => r.label), o = w(
|
|
802
|
+
} : (r) => r.label), o = w(i.value.find((r) => r.value === n.modelValue) ?? null);
|
|
806
803
|
return ce(
|
|
807
804
|
() => n.modelValue,
|
|
808
805
|
(r) => {
|
|
809
|
-
o.value =
|
|
806
|
+
o.value = i.value.find((l) => l.value === r) ?? null;
|
|
810
807
|
}
|
|
811
808
|
), ce(o, (r) => {
|
|
812
809
|
var l;
|
|
813
|
-
t("update:modelValue", r ? ((l =
|
|
810
|
+
t("update:modelValue", r ? ((l = i.value.find((c) => xe(c, r))) == null ? void 0 : l.value) ?? null : null);
|
|
814
811
|
}), (r, l) => (u(), ke(Nt, {
|
|
815
812
|
modelValue: o.value,
|
|
816
813
|
"onUpdate:modelValue": l[0] || (l[0] = (c) => o.value = c),
|
|
817
|
-
options:
|
|
818
|
-
formatter:
|
|
814
|
+
options: i.value,
|
|
815
|
+
formatter: s.value,
|
|
819
816
|
"null-title": r.nullTitle
|
|
820
817
|
}, null, 8, ["modelValue", "options", "formatter", "null-title"]));
|
|
821
818
|
}
|
|
@@ -825,7 +822,7 @@ const Nt = /* @__PURE__ */ Le(It, [["render", Ft]]), Wn = /* @__PURE__ */ x({
|
|
|
825
822
|
}, Wt = {
|
|
826
823
|
key: 0,
|
|
827
824
|
class: "progress-bar"
|
|
828
|
-
}, Pt = /* @__PURE__ */
|
|
825
|
+
}, Pt = /* @__PURE__ */ C({
|
|
829
826
|
__name: "toast",
|
|
830
827
|
props: {
|
|
831
828
|
message: {},
|
|
@@ -840,26 +837,26 @@ const Nt = /* @__PURE__ */ Le(It, [["render", Ft]]), Wn = /* @__PURE__ */ x({
|
|
|
840
837
|
function n() {
|
|
841
838
|
t.onClick ? t.onClick() : t.disableClose || t.callback();
|
|
842
839
|
}
|
|
843
|
-
const
|
|
840
|
+
const i = w();
|
|
844
841
|
return t.durationSecs !== null && L(() => {
|
|
845
842
|
var o;
|
|
846
|
-
const
|
|
847
|
-
(o =
|
|
848
|
-
duration:
|
|
843
|
+
const s = t.durationSecs ?? 5;
|
|
844
|
+
(o = i.value) == null || o.animate([{ width: "0%" }, { width: "100%" }], {
|
|
845
|
+
duration: s * 1e3,
|
|
849
846
|
easing: "linear"
|
|
850
|
-
}), setTimeout(() => t.callback(),
|
|
851
|
-
}), (
|
|
852
|
-
class: k(["vf-toast",
|
|
847
|
+
}), setTimeout(() => t.callback(), s * 1e3);
|
|
848
|
+
}), (s, o) => (u(), f("div", {
|
|
849
|
+
class: k(["vf-toast", s.className]),
|
|
853
850
|
onClick: te(n, ["stop"])
|
|
854
851
|
}, [
|
|
855
852
|
O("div", Kt, [
|
|
856
|
-
O("div", Ut,
|
|
857
|
-
|
|
853
|
+
O("div", Ut, x(s.message), 1),
|
|
854
|
+
s.disableClose ? T("", !0) : (u(), f("div", jt, "x"))
|
|
858
855
|
]),
|
|
859
|
-
|
|
856
|
+
s.durationSecs !== null ? (u(), f("div", Wt, [
|
|
860
857
|
O("div", {
|
|
861
858
|
ref_key: "progressInnerEl",
|
|
862
|
-
ref:
|
|
859
|
+
ref: i,
|
|
863
860
|
class: "inner"
|
|
864
861
|
}, null, 512)
|
|
865
862
|
])) : T("", !0)
|
|
@@ -867,15 +864,15 @@ const Nt = /* @__PURE__ */ Le(It, [["render", Ft]]), Wn = /* @__PURE__ */ x({
|
|
|
867
864
|
}
|
|
868
865
|
});
|
|
869
866
|
function Pn(e) {
|
|
870
|
-
const t =
|
|
867
|
+
const t = ie(Pt, {
|
|
871
868
|
...e,
|
|
872
869
|
callback: () => P(t)
|
|
873
870
|
});
|
|
874
871
|
return () => P(t);
|
|
875
872
|
}
|
|
876
873
|
function qt(e) {
|
|
877
|
-
const t = Math.floor(Math.log(e) / Math.log(1024)),
|
|
878
|
-
return `${
|
|
874
|
+
const t = Math.floor(Math.log(e) / Math.log(1024)), i = (e / Math.pow(1024, t)).toFixed(2), s = ["B", "KB", "MB", "GB", "TB"][t];
|
|
875
|
+
return `${i} ${s}`;
|
|
879
876
|
}
|
|
880
877
|
function zt(e) {
|
|
881
878
|
return e != null && String(e).length ? e : "-";
|
|
@@ -887,7 +884,7 @@ function Yt(e) {
|
|
|
887
884
|
return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : sn(Number(e));
|
|
888
885
|
}
|
|
889
886
|
function Zt(e) {
|
|
890
|
-
return e &&
|
|
887
|
+
return e && xt(e);
|
|
891
888
|
}
|
|
892
889
|
function Gt(e) {
|
|
893
890
|
return e ? Ze(e) : null;
|
|
@@ -899,7 +896,7 @@ function Jt(e) {
|
|
|
899
896
|
return e ? e.toUpperCase() : null;
|
|
900
897
|
}
|
|
901
898
|
function en(e) {
|
|
902
|
-
return e ?
|
|
899
|
+
return e ? Ct(e) : null;
|
|
903
900
|
}
|
|
904
901
|
function tn(e) {
|
|
905
902
|
return Lt(e);
|
|
@@ -920,30 +917,30 @@ const fe = {
|
|
|
920
917
|
...e(fe)
|
|
921
918
|
});
|
|
922
919
|
function zn(e, t, n) {
|
|
923
|
-
const
|
|
924
|
-
return
|
|
920
|
+
const i = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
|
|
921
|
+
return i === -1 ? !1 : (e.splice(i, 1, n), !0);
|
|
925
922
|
}
|
|
926
923
|
function Xn(e, t) {
|
|
927
924
|
const n = document.createElement("div");
|
|
928
925
|
n.classList.add("vf-overlay"), n.addEventListener("click", m), document.body.appendChild(n);
|
|
929
|
-
const
|
|
930
|
-
|
|
931
|
-
const
|
|
932
|
-
|
|
926
|
+
const i = document.createElement("div");
|
|
927
|
+
i.classList.add("vf-context-menu"), i.style.position = "absolute", n.appendChild(i);
|
|
928
|
+
const s = e.currentTarget;
|
|
929
|
+
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((p) => {
|
|
933
930
|
if (p == "-") {
|
|
934
931
|
const d = document.createElement("div");
|
|
935
|
-
d.classList.add("separator"),
|
|
932
|
+
d.classList.add("separator"), i.appendChild(d);
|
|
936
933
|
return;
|
|
937
934
|
}
|
|
938
935
|
const a = document.createElement("div");
|
|
939
|
-
a.classList.add("item"), a.style.userSelect = "none", a.innerText = p.title,
|
|
936
|
+
a.classList.add("item"), a.style.userSelect = "none", a.innerText = p.title, i.appendChild(a), p.class && a.classList.add(p.class), p.shouldConfirm ? a.addEventListener("click", (d) => y(d, a, p.handler)) : a.addEventListener("click", () => p.handler());
|
|
940
937
|
});
|
|
941
|
-
const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l =
|
|
942
|
-
|
|
943
|
-
|
|
938
|
+
const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = i.offsetHeight, c = i.offsetWidth, h = o < c ? e.clientX - c - 1 : e.clientX + 1, b = r < l ? e.clientY - l - 1 : e.clientY + 1;
|
|
939
|
+
i.style.left = h + "px", i.style.top = b + "px", setTimeout(() => {
|
|
940
|
+
i.style.width = i.offsetWidth + "px";
|
|
944
941
|
}, 50);
|
|
945
942
|
function m() {
|
|
946
|
-
t.targetClass &&
|
|
943
|
+
t.targetClass && s.classList.remove(t.targetClass), s.classList.remove("context-menu-active"), s.style.userSelect = "", n.remove();
|
|
947
944
|
}
|
|
948
945
|
function y(p, a, d) {
|
|
949
946
|
if (a.classList.contains("pending-confirm"))
|
|
@@ -965,14 +962,14 @@ function Zn(e, t) {
|
|
|
965
962
|
}
|
|
966
963
|
function Gn(e, t) {
|
|
967
964
|
const n = { ...e };
|
|
968
|
-
for (const
|
|
969
|
-
n[
|
|
965
|
+
for (const i of t)
|
|
966
|
+
n[i] === "" && (n[i] = null);
|
|
970
967
|
return n;
|
|
971
968
|
}
|
|
972
969
|
function on(e) {
|
|
973
970
|
return e instanceof Error && "status" in e && "body" in e;
|
|
974
971
|
}
|
|
975
|
-
function Qn({ apiClient: e, wrapper: t, onRequest: n, onError:
|
|
972
|
+
function Qn({ apiClient: e, wrapper: t, onRequest: n, onError: i, afterRequest: s, CancelablePromise: o }) {
|
|
976
973
|
const r = e.request.request.bind(e.request), l = t ?? ((c, h) => h(c));
|
|
977
974
|
e.request.request = (c) => l(c, (h) => (h = ln(h), n && (h = n(h)), new o((b, m, y) => {
|
|
978
975
|
const p = r(h);
|
|
@@ -982,15 +979,15 @@ function Qn({ apiClient: e, wrapper: t, onRequest: n, onError: s, afterRequest:
|
|
|
982
979
|
return m(new z(a.body.error));
|
|
983
980
|
a.message = `${a.body.error} (${a.status})`;
|
|
984
981
|
}
|
|
985
|
-
if (
|
|
986
|
-
const d =
|
|
982
|
+
if (i) {
|
|
983
|
+
const d = i(a, h);
|
|
987
984
|
if (d === null)
|
|
988
985
|
return;
|
|
989
986
|
if (d instanceof Error)
|
|
990
987
|
return m(d);
|
|
991
988
|
}
|
|
992
989
|
m(a);
|
|
993
|
-
}).finally(() =>
|
|
990
|
+
}).finally(() => s == null ? void 0 : s(h));
|
|
994
991
|
})));
|
|
995
992
|
}
|
|
996
993
|
class pe {
|
|
@@ -1006,12 +1003,12 @@ class pe {
|
|
|
1006
1003
|
}
|
|
1007
1004
|
}
|
|
1008
1005
|
function ln(e) {
|
|
1009
|
-
if (!(typeof e.body == "object" && Object.values(e.body).some((
|
|
1006
|
+
if (!(typeof e.body == "object" && Object.values(e.body).some((s) => s instanceof pe)))
|
|
1010
1007
|
return e;
|
|
1011
|
-
const n = {},
|
|
1012
|
-
for (const [
|
|
1013
|
-
o instanceof pe ? n[
|
|
1014
|
-
return n._payload = new Blob([JSON.stringify(
|
|
1008
|
+
const n = {}, i = {};
|
|
1009
|
+
for (const [s, o] of Object.entries(e.body))
|
|
1010
|
+
o instanceof pe ? n[s] = o.blob : i[s] = o;
|
|
1011
|
+
return n._payload = new Blob([JSON.stringify(i)], { type: "application/json" }), {
|
|
1015
1012
|
...e,
|
|
1016
1013
|
body: void 0,
|
|
1017
1014
|
formData: n
|
|
@@ -1020,25 +1017,25 @@ function ln(e) {
|
|
|
1020
1017
|
const le = Symbol("HookState");
|
|
1021
1018
|
function Jn(e, t) {
|
|
1022
1019
|
const n = t ?? ee();
|
|
1023
|
-
L(() => rn(n, e), n), Se(() => an(n), n),
|
|
1020
|
+
L(() => rn(n, e), n), Se(() => an(n), n), Ce(() => me(n), n), ne(() => me(n), n);
|
|
1024
1021
|
}
|
|
1025
1022
|
function rn(e, t) {
|
|
1026
1023
|
const n = {};
|
|
1027
1024
|
if (t.elScrolledToBottom && (n.el = new A(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1025
|
+
const i = De(e.vnode.el);
|
|
1026
|
+
i ? n.ancestor = new A(i, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
|
|
1030
1027
|
}
|
|
1031
1028
|
t.windowScrolledToBottom && (n.window = new A(window, t.windowScrolledToBottom)), e[le] = n;
|
|
1032
1029
|
}
|
|
1033
1030
|
function an(e) {
|
|
1034
|
-
var n,
|
|
1031
|
+
var n, i, s;
|
|
1035
1032
|
const t = e[le];
|
|
1036
|
-
(n = t == null ? void 0 : t.el) == null || n.install(), (
|
|
1033
|
+
(n = t == null ? void 0 : t.el) == null || n.install(), (i = t == null ? void 0 : t.ancestor) == null || i.install(), (s = t == null ? void 0 : t.window) == null || s.install();
|
|
1037
1034
|
}
|
|
1038
1035
|
function me(e) {
|
|
1039
|
-
var n,
|
|
1036
|
+
var n, i, s;
|
|
1040
1037
|
const t = e[le];
|
|
1041
|
-
(n = t == null ? void 0 : t.el) == null || n.uninstall(), (
|
|
1038
|
+
(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();
|
|
1042
1039
|
}
|
|
1043
1040
|
const Z = ["auto", "scroll"];
|
|
1044
1041
|
function De(e) {
|
|
@@ -1064,8 +1061,8 @@ class A {
|
|
|
1064
1061
|
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);
|
|
1065
1062
|
}
|
|
1066
1063
|
}
|
|
1067
|
-
function
|
|
1068
|
-
L(() => window.addEventListener("resize", e)), Se(() => window.addEventListener("resize", e)),
|
|
1064
|
+
function ei(e) {
|
|
1065
|
+
L(() => window.addEventListener("resize", e)), Se(() => window.addEventListener("resize", e)), Ce(() => window.removeEventListener("resize", e)), ne(() => window.removeEventListener("resize", e));
|
|
1069
1066
|
}
|
|
1070
1067
|
const cn = {
|
|
1071
1068
|
mounted: ye,
|
|
@@ -1091,14 +1088,14 @@ function un(e) {
|
|
|
1091
1088
|
return;
|
|
1092
1089
|
}
|
|
1093
1090
|
t.preventDefault(), t.stopImmediatePropagation();
|
|
1094
|
-
const
|
|
1091
|
+
const i = {
|
|
1095
1092
|
initTime: n,
|
|
1096
1093
|
preconfirmHtml: e.innerHTML,
|
|
1097
1094
|
resetHandler: () => {
|
|
1098
|
-
e.innerHTML =
|
|
1095
|
+
e.innerHTML = i.preconfirmHtml, e.blur(), e.removeEventListener("mouseout", i.resetHandler), delete e[_];
|
|
1099
1096
|
}
|
|
1100
1097
|
};
|
|
1101
|
-
e[_] =
|
|
1098
|
+
e[_] = i, e.innerHTML = "Confirm", e.addEventListener("mouseout", i.resetHandler);
|
|
1102
1099
|
});
|
|
1103
1100
|
}
|
|
1104
1101
|
const hn = {
|
|
@@ -1124,7 +1121,7 @@ function mn(e, t) {
|
|
|
1124
1121
|
if (!t.value)
|
|
1125
1122
|
return ((c = e.attributes.getNamedItem("placeholder")) == null ? void 0 : c.value) ?? "";
|
|
1126
1123
|
let n = "";
|
|
1127
|
-
const
|
|
1124
|
+
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);
|
|
1128
1125
|
e.attributes.getNamedItem("display-utc") !== null && o.setMinutes(o.getMinutes() - o.getTimezoneOffset());
|
|
1129
1126
|
let r = (h = e.attributes.getNamedItem("format")) == null ? void 0 : h.value;
|
|
1130
1127
|
if (!r && e.attributes.getNamedItem("relative-date") !== null) {
|
|
@@ -1161,9 +1158,9 @@ function Ee(e, t) {
|
|
|
1161
1158
|
return;
|
|
1162
1159
|
if (!t.value)
|
|
1163
1160
|
return Ae(e);
|
|
1164
|
-
const n = new Date(t.value),
|
|
1161
|
+
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;
|
|
1165
1162
|
e[F] || re.push(e), e[F] = {
|
|
1166
|
-
startTs:
|
|
1163
|
+
startTs: s,
|
|
1167
1164
|
includeSeconds: o
|
|
1168
1165
|
}, $e(e);
|
|
1169
1166
|
}
|
|
@@ -1175,12 +1172,12 @@ function Ae(e) {
|
|
|
1175
1172
|
e[F] && (Je(re, e), delete e[F]), e.innerText = "-";
|
|
1176
1173
|
}
|
|
1177
1174
|
function En(e, t) {
|
|
1178
|
-
const n = [],
|
|
1179
|
-
|
|
1180
|
-
const
|
|
1181
|
-
(
|
|
1175
|
+
const n = [], i = Math.floor(e / 86400);
|
|
1176
|
+
i && n.push(i + "d"), e -= i * 86400;
|
|
1177
|
+
const s = Math.floor(e / 3600);
|
|
1178
|
+
(i || s) && n.push(s + "h"), e -= s * 3600;
|
|
1182
1179
|
const o = Math.floor(e / 60);
|
|
1183
|
-
return (
|
|
1180
|
+
return (i || s || o) && n.push(o + "m"), t ? n.length || n.push("0m") : (e -= o * 60, n.push(e + "s")), n.join(" ");
|
|
1184
1181
|
}
|
|
1185
1182
|
const D = Symbol("InfiniteScrollHandler"), On = {
|
|
1186
1183
|
mounted(e, t) {
|
|
@@ -1207,14 +1204,14 @@ const Tn = {
|
|
|
1207
1204
|
unmounted: Be
|
|
1208
1205
|
}, B = Symbol("TooltipState");
|
|
1209
1206
|
function we(e, t) {
|
|
1210
|
-
var
|
|
1211
|
-
let n = ((
|
|
1207
|
+
var i;
|
|
1208
|
+
let n = ((i = e.attributes.getNamedItem("tip")) == null ? void 0 : i.value) ?? t.value;
|
|
1212
1209
|
if (t.value || (n = null), n) {
|
|
1213
|
-
const
|
|
1210
|
+
const s = {
|
|
1214
1211
|
content: n,
|
|
1215
1212
|
html: e.getAttribute("html") !== null
|
|
1216
1213
|
};
|
|
1217
|
-
e[B] ? e[B].configure(
|
|
1214
|
+
e[B] ? e[B].configure(s) : e[B] = new kn(e, s);
|
|
1218
1215
|
} else
|
|
1219
1216
|
Be(e);
|
|
1220
1217
|
}
|
|
@@ -1258,9 +1255,9 @@ class kn {
|
|
|
1258
1255
|
this.shouldShow || this.tipEl && (this.tipEl.remove(), this.tipEl = void 0, this.titleEl = void 0, this.contentEl = void 0, this.checkInterval && (clearInterval(this.checkInterval), this.checkInterval = void 0), window.removeEventListener("mousemove", this.handleMouseMoveWithContext), this.mouseMoveBound = !1);
|
|
1259
1256
|
}
|
|
1260
1257
|
handleMouseMove(t) {
|
|
1261
|
-
const n = this.tipEl.offsetWidth,
|
|
1258
|
+
const n = this.tipEl.offsetWidth, i = this.tipEl.offsetHeight, s = window.innerWidth, o = window.innerHeight;
|
|
1262
1259
|
let r = t.pageX + 10, l = t.pageY + 20;
|
|
1263
|
-
r + n >
|
|
1260
|
+
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;
|
|
1264
1261
|
}
|
|
1265
1262
|
checkMoveEvent() {
|
|
1266
1263
|
var t;
|
|
@@ -1273,7 +1270,7 @@ class kn {
|
|
|
1273
1270
|
function Sn(e) {
|
|
1274
1271
|
e.directive("autofocus", cn), e.directive("confirm-button", dn), e.directive("date-input", hn), e.directive("datetime", pn), e.directive("disabled", vn), e.directive("duration", gn), e.directive("infinite-scroll", On), e.directive("readonly", wn), e.directive("tooltip", Tn);
|
|
1275
1272
|
}
|
|
1276
|
-
function
|
|
1273
|
+
function ti(e) {
|
|
1277
1274
|
Sn(e);
|
|
1278
1275
|
}
|
|
1279
1276
|
export {
|
|
@@ -1288,28 +1285,28 @@ export {
|
|
|
1288
1285
|
Zn as cloneProp,
|
|
1289
1286
|
Vn as configureVf,
|
|
1290
1287
|
qn as createFilters,
|
|
1291
|
-
|
|
1292
|
-
|
|
1288
|
+
ie as createOverlayInjection,
|
|
1289
|
+
Ct as desnakeCase,
|
|
1293
1290
|
dt as dismissOverlayInjectionById,
|
|
1294
1291
|
Dn as dismissOverlayInjectionByInstance,
|
|
1295
1292
|
Me as dismissOverlayInjectionByInternalInstance,
|
|
1296
1293
|
ct as dismissOverlayInjectionByVnode,
|
|
1297
|
-
|
|
1294
|
+
si as escapeHtml,
|
|
1298
1295
|
ut as formatError,
|
|
1299
1296
|
sn as formatNumber,
|
|
1300
|
-
|
|
1297
|
+
xt as formatPhone,
|
|
1301
1298
|
Lt as formatUSCurrency,
|
|
1302
1299
|
Nn as handleError,
|
|
1303
1300
|
Fn as handleErrorAndAlert,
|
|
1304
1301
|
Qn as installApiClientInterceptors,
|
|
1305
|
-
|
|
1302
|
+
ti as installVf,
|
|
1306
1303
|
on as isApiError,
|
|
1307
1304
|
Rn as maskComponent,
|
|
1308
1305
|
ht as maskEl,
|
|
1309
1306
|
ft as maskForm,
|
|
1310
1307
|
Un as nl2br,
|
|
1311
1308
|
Gn as nullifyEmptyInputs,
|
|
1312
|
-
|
|
1309
|
+
se as presentOverlay,
|
|
1313
1310
|
P as removeOverlayInjection,
|
|
1314
1311
|
zn as replaceElement,
|
|
1315
1312
|
de as showAlert,
|
|
@@ -1325,6 +1322,6 @@ export {
|
|
|
1325
1322
|
Ie as unmaskEl,
|
|
1326
1323
|
He as unmaskForm,
|
|
1327
1324
|
Jn as useInfiniteScroll,
|
|
1328
|
-
|
|
1325
|
+
ei as useResizeWatcher,
|
|
1329
1326
|
jn as uuid
|
|
1330
1327
|
};
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
v-disabled="effectiveDisabled"
|
|
11
11
|
@focus="handleInputFocused"
|
|
12
12
|
@blur="handleInputBlurred"
|
|
13
|
+
:required="required"
|
|
13
14
|
/>
|
|
14
15
|
<div v-if="shouldDisplayOptions" ref="optionsContainer" class="vf-smart-select-options">
|
|
15
16
|
<div v-if="!isLoaded" class="no-results">Loading...</div>
|
|
@@ -83,12 +84,12 @@ export default {
|
|
|
83
84
|
noResultsText: String as PropType<string>,
|
|
84
85
|
disabled: Boolean as PropType<boolean>,
|
|
85
86
|
optionsListId: String as PropType<string>,
|
|
86
|
-
debug: Boolean as PropType<boolean
|
|
87
|
+
debug: Boolean as PropType<boolean>,
|
|
88
|
+
required: Boolean as PropType<boolean>
|
|
87
89
|
},
|
|
88
90
|
|
|
89
91
|
emits: {
|
|
90
92
|
optionsLoaded: Object as (options: any[]) => void,
|
|
91
|
-
createItem: Object as (searchText: string) => void,
|
|
92
93
|
'update:modelValue': Object as (value: any) => void
|
|
93
94
|
},
|
|
94
95
|
|
|
@@ -232,6 +233,7 @@ export default {
|
|
|
232
233
|
|
|
233
234
|
options() {
|
|
234
235
|
this.loadedOptions = this.options ?? [];
|
|
236
|
+
this.isLoaded = true;
|
|
235
237
|
},
|
|
236
238
|
|
|
237
239
|
// data
|
|
@@ -274,7 +276,7 @@ export default {
|
|
|
274
276
|
},
|
|
275
277
|
|
|
276
278
|
async mounted() {
|
|
277
|
-
this.shouldShowCreateOption = this
|
|
279
|
+
this.shouldShowCreateOption = this.onCreateItem !== undefined;
|
|
278
280
|
|
|
279
281
|
if (this.options) {
|
|
280
282
|
this.loadedOptions = this.options;
|
|
@@ -305,13 +307,6 @@ export default {
|
|
|
305
307
|
this.loadedOptions && this.$emit('optionsLoaded', this.loadedOptions);
|
|
306
308
|
},
|
|
307
309
|
|
|
308
|
-
handleSourceUpdate() {
|
|
309
|
-
if (this.preload) return this.reloadOptions();
|
|
310
|
-
if (!this.isLoaded) return;
|
|
311
|
-
this.isLoaded = false;
|
|
312
|
-
this.loadedOptions = [];
|
|
313
|
-
},
|
|
314
|
-
|
|
315
310
|
async reloadOptions() {
|
|
316
311
|
const searchText = this.remoteSearch && this.isSearching && this.searchText ? this.searchText : null;
|
|
317
312
|
this.isLoading = true;
|
|
@@ -509,7 +504,7 @@ export default {
|
|
|
509
504
|
this.searchText = '';
|
|
510
505
|
this.selectedOption = null;
|
|
511
506
|
this.selectedOptionTitle = null;
|
|
512
|
-
this
|
|
507
|
+
this.onCreateItem?.(createText);
|
|
513
508
|
} else {
|
|
514
509
|
const selectedDecoratedOption = this.optionsDescriptors.find(decoratedOption => decoratedOption.key == option.key);
|
|
515
510
|
const realOption = selectedDecoratedOption!.ref;
|
|
@@ -534,7 +529,7 @@ export default {
|
|
|
534
529
|
},
|
|
535
530
|
|
|
536
531
|
addRemoteOption(option: GenericObject) {
|
|
537
|
-
this.loadedOptions.
|
|
532
|
+
this.loadedOptions.unshift(option);
|
|
538
533
|
}
|
|
539
534
|
}
|
|
540
535
|
};
|