@signal24/vue-foundation 4.7.0 → 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.
- package/dist/src/components/modal.vue.d.ts +4 -0
- package/dist/src/components/smart-select.vue.d.ts +2 -3
- package/dist/vue-foundation.css +1 -1
- package/dist/vue-foundation.es.js +482 -479
- package/package.json +1 -1
- package/src/components/modal.vue +22 -3
- package/src/components/smart-select.vue +7 -12
|
@@ -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 {
|
|
6
|
-
import { escapeHtml as
|
|
7
|
-
import { escapeHtml 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
|
+
import { escapeHtml as et } from "@vue/shared";
|
|
7
|
+
import { escapeHtml as si } from "@vue/shared";
|
|
8
8
|
import { format as G } from "date-fns";
|
|
9
|
-
const
|
|
9
|
+
const tt = C({
|
|
10
10
|
setup() {
|
|
11
11
|
const e = Ne();
|
|
12
12
|
Re(["update:modelValue"]);
|
|
13
|
-
const t =
|
|
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,162 +34,162 @@ const et = S({
|
|
|
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
46
|
}, st = ["value"];
|
|
47
|
-
function
|
|
48
|
-
return e.renderOptions ? U((u(),
|
|
47
|
+
function ot(e, t, n, i, s, o) {
|
|
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(),
|
|
53
|
-
(u(!0),
|
|
52
|
+
e.props.nullText ? (u(), f("option", it, x(e.props.nullText), 1)) : T("", !0),
|
|
53
|
+
(u(!0), f(j, null, J(e.renderOptions, (r, l) => {
|
|
54
54
|
var c;
|
|
55
|
-
return u(),
|
|
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
|
-
]) : (u(),
|
|
63
|
-
|
|
62
|
+
]) : (u(), f("select", nt, [
|
|
63
|
+
O("option", null, x(e.props.loadingText || "Loading..."), 1)
|
|
64
64
|
]));
|
|
65
65
|
}
|
|
66
|
-
const
|
|
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,
|
|
74
|
-
|
|
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
|
+
L(r);
|
|
75
75
|
function r() {
|
|
76
|
-
const
|
|
77
|
-
|
|
76
|
+
const h = o.vnode.el, { styles: b, classes: m } = l(h, n);
|
|
77
|
+
i.value = b, s.value = m;
|
|
78
78
|
}
|
|
79
|
-
function l(
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
let
|
|
84
|
-
if (
|
|
85
|
-
|
|
79
|
+
function l(h, b) {
|
|
80
|
+
const m = t.anchor instanceof HTMLElement ? {} : t.anchor, y = b.getBoundingClientRect(), p = h.getBoundingClientRect();
|
|
81
|
+
m.matchWidth && (p.width = y.width), m.matchHeight && (p.height = y.height);
|
|
82
|
+
const a = m.class ? Array.isArray(m.class) ? m.class : [m.class] : [];
|
|
83
|
+
let d, E;
|
|
84
|
+
if (m.y === "center")
|
|
85
|
+
d = y.top + y.height / 2 - p.height / 2, a.push("anchored-center-y");
|
|
86
86
|
else {
|
|
87
|
-
const
|
|
88
|
-
|
|
87
|
+
const I = (y.bottom + p.height < window.innerHeight || m.y === "below") && m.y !== "above";
|
|
88
|
+
d = I ? y.bottom : y.top - p.height, a.push(I ? "anchored-top" : "anchored-bottom");
|
|
89
89
|
}
|
|
90
|
-
if (
|
|
91
|
-
|
|
90
|
+
if (m.x === "center")
|
|
91
|
+
E = y.left + y.width / 2 - p.width / 2, a.push("anchored-center-x");
|
|
92
92
|
else {
|
|
93
|
-
const
|
|
94
|
-
|
|
93
|
+
const I = (y.left + p.width < window.innerWidth || m.x === "left") && m.x !== "right";
|
|
94
|
+
E = I ? y.left : y.right - p.width, a.push(I ? "anchored-left" : "anchored-right");
|
|
95
95
|
}
|
|
96
96
|
return {
|
|
97
97
|
styles: {
|
|
98
|
-
top: `${
|
|
99
|
-
left: `${
|
|
100
|
-
...
|
|
101
|
-
...
|
|
98
|
+
top: `${d}px`,
|
|
99
|
+
left: `${E}px`,
|
|
100
|
+
...m.matchWidth ? { width: `${p.width}px` } : {},
|
|
101
|
+
...m.matchHeight ? { height: `${p.height}px` } : {}
|
|
102
102
|
},
|
|
103
|
-
classes:
|
|
103
|
+
classes: a
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
function c() {
|
|
107
|
-
window.removeEventListener("click", c),
|
|
107
|
+
window.removeEventListener("click", c), dt(t.overlayId);
|
|
108
108
|
}
|
|
109
|
-
return
|
|
109
|
+
return L(() => {
|
|
110
110
|
setTimeout(() => {
|
|
111
111
|
window.addEventListener("click", c);
|
|
112
112
|
}, 10);
|
|
113
|
-
}), (
|
|
114
|
-
class:
|
|
115
|
-
style: Ue(
|
|
113
|
+
}), (h, b) => (u(), f("div", {
|
|
114
|
+
class: k(["vf-overlay-anchor", s.value]),
|
|
115
|
+
style: Ue(i.value),
|
|
116
116
|
onClick: te(c, ["stop"])
|
|
117
117
|
}, [
|
|
118
|
-
|
|
119
|
-
], 14,
|
|
118
|
+
K(h.$slots, "default")
|
|
119
|
+
], 14, lt));
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
|
-
let
|
|
123
|
-
const
|
|
122
|
+
let at = 0;
|
|
123
|
+
const S = je([]), _n = C({
|
|
124
124
|
setup() {
|
|
125
125
|
return () => W("div", [
|
|
126
|
-
J(
|
|
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 ?? {},
|
|
138
138
|
vnode: r,
|
|
139
139
|
wrapperVnode: l
|
|
140
140
|
};
|
|
141
|
-
return
|
|
141
|
+
return S.push(c), c;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function Dn(e) {
|
|
144
144
|
Me(e.$);
|
|
145
145
|
}
|
|
146
146
|
function Me(e) {
|
|
147
147
|
let t = e;
|
|
148
|
-
for (; t && !
|
|
148
|
+
for (; t && !ct(t.vnode); )
|
|
149
149
|
t = t.parent;
|
|
150
150
|
}
|
|
151
|
-
function at(e) {
|
|
152
|
-
const t = k.findIndex((n) => n.vnode.component === e.component);
|
|
153
|
-
return t >= 0 ? (k[t].props.callback(), !0) : !1;
|
|
154
|
-
}
|
|
155
151
|
function ct(e) {
|
|
156
|
-
const t =
|
|
157
|
-
return t >= 0 ? (
|
|
152
|
+
const t = S.findIndex((n) => n.vnode.component === e.component);
|
|
153
|
+
return t >= 0 ? (S[t].props.callback(), !0) : !1;
|
|
154
|
+
}
|
|
155
|
+
function dt(e) {
|
|
156
|
+
const t = S.findIndex((n) => n.id === e);
|
|
157
|
+
return t >= 0 ? (S[t].props.callback(), !0) : !1;
|
|
158
158
|
}
|
|
159
159
|
function P(e) {
|
|
160
|
-
const t =
|
|
161
|
-
t >= 0 &&
|
|
160
|
+
const t = S.indexOf(e);
|
|
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
|
-
async function
|
|
179
|
-
return await
|
|
178
|
+
async function $n(e, t) {
|
|
179
|
+
return await se(X, {
|
|
180
180
|
...q(e, t),
|
|
181
181
|
shouldConfirm: !0
|
|
182
182
|
}) === !0;
|
|
183
183
|
}
|
|
184
|
-
async function
|
|
185
|
-
return await
|
|
184
|
+
async function An(e, t) {
|
|
185
|
+
return await se(X, {
|
|
186
186
|
...q(e, t),
|
|
187
187
|
shouldConfirm: !0,
|
|
188
188
|
classes: ["destructive"]
|
|
189
189
|
}) === !0;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
const n =
|
|
191
|
+
function Bn(e, t) {
|
|
192
|
+
const n = ie(X, {
|
|
193
193
|
...q(e, t),
|
|
194
194
|
isBare: !0,
|
|
195
195
|
classes: ["wait"],
|
|
@@ -198,84 +198,84 @@ function An(e, t) {
|
|
|
198
198
|
});
|
|
199
199
|
return () => P(n);
|
|
200
200
|
}
|
|
201
|
-
const
|
|
201
|
+
const N = {
|
|
202
202
|
unhandledErrorSupportText: "please contact support",
|
|
203
203
|
errorHandler: (e) => console.error("Unhandled error:", e),
|
|
204
204
|
defaultDateTimeFormat: "MM/dd/yy HH:mm"
|
|
205
205
|
};
|
|
206
|
-
function
|
|
207
|
-
Object.assign(
|
|
206
|
+
function Vn(e) {
|
|
207
|
+
Object.assign(N, e);
|
|
208
208
|
}
|
|
209
209
|
class z extends Error {
|
|
210
210
|
constructor(t) {
|
|
211
211
|
super(t), this.name = "UserError";
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function ut(e) {
|
|
215
215
|
return e instanceof z ? e.message : `An application error has occurred:
|
|
216
216
|
|
|
217
217
|
${oe(e).message}
|
|
218
218
|
|
|
219
|
-
Please refresh the page and try again. If this error persists, ${
|
|
219
|
+
Please refresh the page and try again. If this error persists, ${N.unhandledErrorSupportText}.`;
|
|
220
220
|
}
|
|
221
221
|
function oe(e) {
|
|
222
222
|
return e instanceof Error ? e : new Error(String(e));
|
|
223
223
|
}
|
|
224
|
-
async function
|
|
224
|
+
async function Fn(e, t) {
|
|
225
225
|
const n = oe(e);
|
|
226
|
-
return n instanceof z ||
|
|
226
|
+
return n instanceof z || N.errorHandler(n), t ? de(t, n) : de(n);
|
|
227
227
|
}
|
|
228
|
-
async function
|
|
228
|
+
async function Nn(e) {
|
|
229
229
|
const t = oe(e);
|
|
230
|
-
t instanceof z ||
|
|
230
|
+
t instanceof z || N.errorHandler(t);
|
|
231
231
|
}
|
|
232
|
-
const
|
|
233
|
-
function
|
|
234
|
-
const n = e.$.vnode.el,
|
|
235
|
-
return
|
|
232
|
+
const $ = Symbol("MaskState");
|
|
233
|
+
function Rn(e, t) {
|
|
234
|
+
const n = e.$.vnode.el, i = n.closest(".vf-modal");
|
|
235
|
+
return ht(i ?? n, t);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Kn(e) {
|
|
238
238
|
const t = e.$.vnode.el, n = t.closest(".vf-modal");
|
|
239
239
|
return Ie(n ?? t);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
if (!e[
|
|
241
|
+
function ht(e, t) {
|
|
242
|
+
if (!e[$]) {
|
|
243
243
|
const n = document.createElement("div");
|
|
244
|
-
n.classList.add("vf-mask"), e.appendChild(n), e[
|
|
244
|
+
n.classList.add("vf-mask"), e.appendChild(n), e[$] = { maskEl: n };
|
|
245
245
|
}
|
|
246
|
-
return e[
|
|
246
|
+
return e[$].maskEl.innerText = t ?? "", () => Ie(e);
|
|
247
247
|
}
|
|
248
248
|
function Ie(e) {
|
|
249
|
-
e[
|
|
249
|
+
e[$] && e.removeChild(e[$].maskEl);
|
|
250
250
|
}
|
|
251
251
|
const Q = Symbol("FormMaskState");
|
|
252
|
-
function
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
const l = [...
|
|
258
|
-
return l.forEach((c) => c.setAttribute("disabled", "disabled")),
|
|
252
|
+
function ft(e, t, n) {
|
|
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
|
-
}, () =>
|
|
263
|
-
}
|
|
264
|
-
function _e(e) {
|
|
265
|
-
const t = e instanceof Element ? e : He(e), n = t[Q];
|
|
266
|
-
n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((s) => s.removeAttribute("disabled")), n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled"), delete t[Q]);
|
|
262
|
+
}, () => He(i);
|
|
267
263
|
}
|
|
268
264
|
function He(e) {
|
|
265
|
+
const t = e instanceof Element ? e : _e(e), n = t[Q];
|
|
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
|
+
}
|
|
268
|
+
function _e(e) {
|
|
269
269
|
const t = e.$.vnode.el;
|
|
270
270
|
return t.tagName === "FORM" ? t : t.querySelector("form");
|
|
271
271
|
}
|
|
272
|
-
const
|
|
272
|
+
const pt = ["id"], mt = {
|
|
273
273
|
key: 0,
|
|
274
274
|
class: "vf-modal-header"
|
|
275
|
-
},
|
|
275
|
+
}, vt = { class: "vf-modal-content" }, yt = {
|
|
276
276
|
key: 1,
|
|
277
277
|
class: "vf-modal-footer"
|
|
278
|
-
},
|
|
278
|
+
}, gt = /* @__PURE__ */ C({
|
|
279
279
|
__name: "modal",
|
|
280
280
|
props: {
|
|
281
281
|
id: {},
|
|
@@ -286,65 +286,71 @@ const ft = ["id"], pt = {
|
|
|
286
286
|
},
|
|
287
287
|
emits: ["formSubmit"],
|
|
288
288
|
setup(e, { expose: t }) {
|
|
289
|
-
const n = e,
|
|
290
|
-
t({ mask:
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
var
|
|
294
|
-
document.body.classList.add("vf-modal-open"), n.closeOnMaskClick && (window.addEventListener("keydown",
|
|
289
|
+
const n = e, i = ee();
|
|
290
|
+
t({ mask: m, unmask: y, hide: p, unhide: a });
|
|
291
|
+
const s = w(), o = w(), r = w(!1), l = V(() => Xe([n.class, r.value && "hidden"]));
|
|
292
|
+
L(() => {
|
|
293
|
+
var 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
|
-
window.removeEventListener("keydown",
|
|
296
|
+
window.removeEventListener("keydown", h), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
|
|
297
297
|
});
|
|
298
|
-
function
|
|
299
|
-
|
|
298
|
+
function c(d) {
|
|
299
|
+
d.target == s.value && b();
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
if (
|
|
303
|
-
const
|
|
304
|
-
|
|
301
|
+
function h(d) {
|
|
302
|
+
if (d.key === "Esc" || d.key === "Escape") {
|
|
303
|
+
const E = document.querySelectorAll(".vf-modal-wrap");
|
|
304
|
+
E[E.length - 1] === s.value && b();
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
Me(
|
|
307
|
+
function b() {
|
|
308
|
+
Me(i);
|
|
309
309
|
}
|
|
310
|
-
function
|
|
311
|
-
|
|
310
|
+
function m() {
|
|
311
|
+
ft(o.value);
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
|
|
313
|
+
function y() {
|
|
314
|
+
He(o.value);
|
|
315
315
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
316
|
+
function p() {
|
|
317
|
+
r.value = !0;
|
|
318
|
+
}
|
|
319
|
+
function a() {
|
|
320
|
+
r.value = !1;
|
|
321
|
+
}
|
|
322
|
+
return (d, E) => (u(), f("div", {
|
|
323
|
+
id: d.id,
|
|
324
|
+
class: k(["vf-overlay vf-modal-wrap", l.value]),
|
|
319
325
|
ref_key: "overlay",
|
|
320
|
-
ref:
|
|
326
|
+
ref: s
|
|
321
327
|
}, [
|
|
322
|
-
|
|
328
|
+
O("form", {
|
|
323
329
|
action: ".",
|
|
324
|
-
class:
|
|
325
|
-
onSubmit:
|
|
330
|
+
class: k(["vf-modal", { scrolls: d.scrolls }]),
|
|
331
|
+
onSubmit: E[0] || (E[0] = te((M) => d.$emit("formSubmit"), ["prevent"])),
|
|
326
332
|
ref_key: "form",
|
|
327
333
|
ref: o
|
|
328
334
|
}, [
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
n.closeX ? (u(),
|
|
335
|
+
d.$slots.header ? (u(), f("div", mt, [
|
|
336
|
+
K(d.$slots, "header"),
|
|
337
|
+
n.closeX ? (u(), f("i", {
|
|
332
338
|
key: 0,
|
|
333
339
|
class: "close",
|
|
334
|
-
onClick:
|
|
335
|
-
})) :
|
|
336
|
-
])) :
|
|
337
|
-
|
|
338
|
-
|
|
340
|
+
onClick: b
|
|
341
|
+
})) : T("", !0)
|
|
342
|
+
])) : T("", !0),
|
|
343
|
+
O("div", vt, [
|
|
344
|
+
K(d.$slots, "default")
|
|
339
345
|
]),
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
])) :
|
|
346
|
+
d.$slots.footer ? (u(), f("div", yt, [
|
|
347
|
+
K(d.$slots, "footer")
|
|
348
|
+
])) : T("", !0)
|
|
343
349
|
], 34)
|
|
344
|
-
], 10,
|
|
350
|
+
], 10, pt));
|
|
345
351
|
}
|
|
346
352
|
});
|
|
347
|
-
const
|
|
353
|
+
const bt = ["innerHtml"], Et = ["innerText"], X = /* @__PURE__ */ C({
|
|
348
354
|
__name: "alert-modal",
|
|
349
355
|
props: {
|
|
350
356
|
isBare: { type: Boolean },
|
|
@@ -356,51 +362,51 @@ const gt = ["innerHtml"], bt = ["innerText"], X = /* @__PURE__ */ S({
|
|
|
356
362
|
callback: { type: Function }
|
|
357
363
|
},
|
|
358
364
|
setup(e) {
|
|
359
|
-
const t = e, n =
|
|
360
|
-
return (
|
|
365
|
+
const t = e, n = V(() => t.message instanceof Error ? ut(t.message) : t.message);
|
|
366
|
+
return (i, s) => {
|
|
361
367
|
const o = Te("autofocus");
|
|
362
|
-
return u(), ke(
|
|
363
|
-
class:
|
|
368
|
+
return u(), ke(gt, {
|
|
369
|
+
class: k(["vf-alert", i.classes])
|
|
364
370
|
}, qe({
|
|
365
371
|
default: Y(() => [
|
|
366
|
-
|
|
372
|
+
i.isHtml ? (u(), f("div", {
|
|
367
373
|
key: 0,
|
|
368
|
-
innerHtml:
|
|
374
|
+
innerHtml: i.message,
|
|
369
375
|
class: "user-message"
|
|
370
|
-
}, null, 8,
|
|
376
|
+
}, null, 8, bt)) : (u(), f("div", {
|
|
371
377
|
key: 1,
|
|
372
378
|
innerText: n.value
|
|
373
|
-
}, null, 8,
|
|
379
|
+
}, null, 8, Et))
|
|
374
380
|
]),
|
|
375
381
|
_: 2
|
|
376
382
|
}, [
|
|
377
|
-
|
|
383
|
+
i.title ? {
|
|
378
384
|
name: "header",
|
|
379
385
|
fn: Y(() => [
|
|
380
|
-
|
|
386
|
+
O("h1", null, x(i.title), 1)
|
|
381
387
|
]),
|
|
382
388
|
key: "0"
|
|
383
389
|
} : void 0,
|
|
384
|
-
|
|
390
|
+
i.isBare ? void 0 : {
|
|
385
391
|
name: "footer",
|
|
386
392
|
fn: Y(() => [
|
|
387
|
-
|
|
388
|
-
U((u(),
|
|
393
|
+
i.shouldConfirm ? (u(), f(j, { key: 0 }, [
|
|
394
|
+
U((u(), f("button", {
|
|
389
395
|
class: "primary",
|
|
390
|
-
onClick:
|
|
396
|
+
onClick: s[0] || (s[0] = () => i.callback(!0))
|
|
391
397
|
}, [
|
|
392
398
|
ae("Confirm")
|
|
393
399
|
])), [
|
|
394
400
|
[o]
|
|
395
401
|
]),
|
|
396
|
-
|
|
402
|
+
O("button", {
|
|
397
403
|
class: "default",
|
|
398
|
-
onClick:
|
|
404
|
+
onClick: s[1] || (s[1] = () => i.callback(!1))
|
|
399
405
|
}, "Cancel")
|
|
400
|
-
], 64)) : U((u(),
|
|
406
|
+
], 64)) : U((u(), f("button", {
|
|
401
407
|
key: 1,
|
|
402
408
|
class: "default",
|
|
403
|
-
onClick:
|
|
409
|
+
onClick: s[2] || (s[2] = () => i.callback(!0))
|
|
404
410
|
}, [
|
|
405
411
|
ae("OK")
|
|
406
412
|
])), [
|
|
@@ -413,52 +419,52 @@ const gt = ["innerHtml"], bt = ["innerText"], X = /* @__PURE__ */ S({
|
|
|
413
419
|
};
|
|
414
420
|
}
|
|
415
421
|
});
|
|
416
|
-
let
|
|
417
|
-
const
|
|
418
|
-
function
|
|
419
|
-
if (!
|
|
422
|
+
let R;
|
|
423
|
+
const Ot = new Uint8Array(16);
|
|
424
|
+
function wt() {
|
|
425
|
+
if (!R && (R = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !R))
|
|
420
426
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
421
|
-
return
|
|
427
|
+
return R(Ot);
|
|
422
428
|
}
|
|
423
|
-
const
|
|
429
|
+
const g = [];
|
|
424
430
|
for (let e = 0; e < 256; ++e)
|
|
425
|
-
|
|
426
|
-
function
|
|
427
|
-
return (
|
|
431
|
+
g.push((e + 256).toString(16).slice(1));
|
|
432
|
+
function Tt(e, t = 0) {
|
|
433
|
+
return (g[e[t + 0]] + g[e[t + 1]] + g[e[t + 2]] + g[e[t + 3]] + "-" + g[e[t + 4]] + g[e[t + 5]] + "-" + g[e[t + 6]] + g[e[t + 7]] + "-" + g[e[t + 8]] + g[e[t + 9]] + "-" + g[e[t + 10]] + g[e[t + 11]] + g[e[t + 12]] + g[e[t + 13]] + g[e[t + 14]] + g[e[t + 15]]).toLowerCase();
|
|
428
434
|
}
|
|
429
|
-
const
|
|
430
|
-
randomUUID:
|
|
435
|
+
const kt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ue = {
|
|
436
|
+
randomUUID: kt
|
|
431
437
|
};
|
|
432
|
-
function
|
|
438
|
+
function St(e, t, n) {
|
|
433
439
|
if (ue.randomUUID && !t && !e)
|
|
434
440
|
return ue.randomUUID();
|
|
435
441
|
e = e || {};
|
|
436
|
-
const
|
|
437
|
-
if (
|
|
442
|
+
const i = e.random || (e.rng || wt)();
|
|
443
|
+
if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, t) {
|
|
438
444
|
n = n || 0;
|
|
439
|
-
for (let
|
|
440
|
-
t[n +
|
|
445
|
+
for (let s = 0; s < 16; ++s)
|
|
446
|
+
t[n + s] = i[s];
|
|
441
447
|
return t;
|
|
442
448
|
}
|
|
443
|
-
return
|
|
449
|
+
return Tt(i);
|
|
444
450
|
}
|
|
445
|
-
function
|
|
451
|
+
function Un(e) {
|
|
446
452
|
return e.replace(/\n/g, "<br>");
|
|
447
453
|
}
|
|
448
|
-
function
|
|
454
|
+
function Ct(e) {
|
|
449
455
|
return e.replace(/_/g, " ");
|
|
450
456
|
}
|
|
451
457
|
function xt(e) {
|
|
452
458
|
const t = e.replace(/\D/g, "").replace(/^1/, "");
|
|
453
459
|
return t.length != 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
|
|
454
460
|
}
|
|
455
|
-
function
|
|
461
|
+
function Lt(e) {
|
|
456
462
|
return "$" + Number(e).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
457
463
|
}
|
|
458
|
-
function
|
|
459
|
-
return
|
|
464
|
+
function jn() {
|
|
465
|
+
return St();
|
|
460
466
|
}
|
|
461
|
-
const
|
|
467
|
+
const H = Symbol("null"), he = Symbol("create"), Mt = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", It = {
|
|
462
468
|
props: {
|
|
463
469
|
modelValue: {
|
|
464
470
|
type: null,
|
|
@@ -484,11 +490,11 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
484
490
|
noResultsText: String,
|
|
485
491
|
disabled: Boolean,
|
|
486
492
|
optionsListId: String,
|
|
487
|
-
debug: Boolean
|
|
493
|
+
debug: Boolean,
|
|
494
|
+
required: Boolean
|
|
488
495
|
},
|
|
489
496
|
emits: {
|
|
490
497
|
optionsLoaded: Object,
|
|
491
|
-
createItem: Object,
|
|
492
498
|
"update:modelValue": Object
|
|
493
499
|
},
|
|
494
500
|
data() {
|
|
@@ -536,14 +542,14 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
536
542
|
optionsDescriptors() {
|
|
537
543
|
return this.allOptions.map((e, t) => {
|
|
538
544
|
var l, c;
|
|
539
|
-
const n = this.formatter(e),
|
|
540
|
-
return this.searchFields ? this.searchFields.forEach((
|
|
541
|
-
e[
|
|
542
|
-
}) : (r.push(
|
|
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
|
+
return this.searchFields ? this.searchFields.forEach((h) => {
|
|
547
|
+
e[h] && r.push(String(e[h]).toLowerCase());
|
|
548
|
+
}) : (r.push(s), o && r.push(o)), {
|
|
543
549
|
// eslint-disable-next-line vue/no-use-computed-property-like-method
|
|
544
550
|
key: ((c = this.effectiveKeyExtractor) == null ? void 0 : c.call(this, e)) ?? String(t),
|
|
545
551
|
title: n,
|
|
546
|
-
subtitle:
|
|
552
|
+
subtitle: i,
|
|
547
553
|
searchContent: r.join(""),
|
|
548
554
|
ref: e
|
|
549
555
|
};
|
|
@@ -554,14 +560,14 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
554
560
|
if (this.isSearching) {
|
|
555
561
|
const t = this.searchText.trim().toLowerCase();
|
|
556
562
|
if (t.length) {
|
|
557
|
-
e = e.filter((
|
|
558
|
-
const n =
|
|
559
|
-
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) => {
|
|
560
566
|
var o;
|
|
561
567
|
return {
|
|
562
|
-
...
|
|
563
|
-
title:
|
|
564
|
-
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>")
|
|
565
571
|
};
|
|
566
572
|
}), this.shouldShowCreateOption && (e.find((o) => o.searchContent === t) !== void 0 || e.push({
|
|
567
573
|
key: he,
|
|
@@ -570,7 +576,7 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
570
576
|
}
|
|
571
577
|
} else
|
|
572
578
|
this.nullTitle && e.unshift({
|
|
573
|
-
key:
|
|
579
|
+
key: H,
|
|
574
580
|
title: this.nullTitle
|
|
575
581
|
});
|
|
576
582
|
return e;
|
|
@@ -582,7 +588,7 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
582
588
|
this.handleValueChanged();
|
|
583
589
|
},
|
|
584
590
|
options() {
|
|
585
|
-
this.loadedOptions = this.options ?? [];
|
|
591
|
+
this.loadedOptions = this.options ?? [], this.isLoaded = !0;
|
|
586
592
|
},
|
|
587
593
|
// data
|
|
588
594
|
optionsDescriptors() {
|
|
@@ -596,26 +602,21 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
596
602
|
},
|
|
597
603
|
effectiveOptions() {
|
|
598
604
|
var e;
|
|
599
|
-
this.modelValue && !this.selectedOption && this.handleValueChanged(), this.highlightedOptionKey && !this.effectiveOptions.find((t) => t.key == this.highlightedOptionKey) && (this.highlightedOptionKey = ((e = this.effectiveOptions[0]) == null ? void 0 : e.key) ??
|
|
605
|
+
this.modelValue && !this.selectedOption && this.handleValueChanged(), this.highlightedOptionKey && !this.effectiveOptions.find((t) => t.key == this.highlightedOptionKey) && (this.highlightedOptionKey = ((e = this.effectiveOptions[0]) == null ? void 0 : e.key) ?? H);
|
|
600
606
|
}
|
|
601
607
|
},
|
|
602
608
|
async mounted() {
|
|
603
|
-
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", () => {
|
|
604
610
|
this.selectedOption !== this.modelValue && this.$emit(
|
|
605
611
|
"update:modelValue",
|
|
606
612
|
this.selectedOption && this.valueExtractor ? this.valueExtractor(this.selectedOption) : this.selectedOption
|
|
607
613
|
);
|
|
608
|
-
}), this.remoteSearch && this.$watch("searchText",
|
|
614
|
+
}), this.remoteSearch && this.$watch("searchText", Ye(this.reloadOptionsIfSearching, 250));
|
|
609
615
|
},
|
|
610
616
|
methods: {
|
|
611
617
|
async loadRemoteOptions() {
|
|
612
618
|
await this.reloadOptions(), this.loadedOptions && this.$emit("optionsLoaded", this.loadedOptions);
|
|
613
619
|
},
|
|
614
|
-
handleSourceUpdate() {
|
|
615
|
-
if (this.preload)
|
|
616
|
-
return this.reloadOptions();
|
|
617
|
-
this.isLoaded && (this.isLoaded = !1, this.loadedOptions = []);
|
|
618
|
-
},
|
|
619
620
|
async reloadOptions() {
|
|
620
621
|
var t;
|
|
621
622
|
const e = this.remoteSearch && this.isSearching && this.searchText ? this.searchText : null;
|
|
@@ -650,7 +651,7 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
650
651
|
this.searchText.length > 1 && (this.isSearching = !0);
|
|
651
652
|
return;
|
|
652
653
|
}
|
|
653
|
-
!e.metaKey &&
|
|
654
|
+
!e.metaKey && Mt.includes(e.key) && (this.isSearching = !0);
|
|
654
655
|
}
|
|
655
656
|
},
|
|
656
657
|
handleInputFocused() {
|
|
@@ -658,17 +659,17 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
658
659
|
},
|
|
659
660
|
setHighlightedOptionKey(e) {
|
|
660
661
|
var t;
|
|
661
|
-
this.selectedOption ? this.highlightedOptionKey = this.getOptionKey(this.selectedOption) : e ? this.highlightedOptionKey = ((t = this.effectiveOptions) == null ? void 0 : t[0].key) ??
|
|
662
|
+
this.selectedOption ? this.highlightedOptionKey = this.getOptionKey(this.selectedOption) : e ? this.highlightedOptionKey = ((t = this.effectiveOptions) == null ? void 0 : t[0].key) ?? H : this.nullTitle && (this.highlightedOptionKey = H);
|
|
662
663
|
},
|
|
663
664
|
getOptionKey(e) {
|
|
664
665
|
var t;
|
|
665
666
|
return this.effectiveKeyExtractor ? this.effectiveKeyExtractor(this.selectedOption) : ((t = this.getOptionDescriptor(e)) == null ? void 0 : t.key) ?? "";
|
|
666
667
|
},
|
|
667
668
|
getOptionDescriptor(e) {
|
|
668
|
-
const t = this.effectiveOptions.find((
|
|
669
|
+
const t = this.effectiveOptions.find((i) => i.ref === e);
|
|
669
670
|
if (t)
|
|
670
671
|
return t;
|
|
671
|
-
const n = this.effectiveOptions.find((
|
|
672
|
+
const n = this.effectiveOptions.find((i) => xe(i.ref, e));
|
|
672
673
|
return n || null;
|
|
673
674
|
},
|
|
674
675
|
handleInputBlurred() {
|
|
@@ -678,19 +679,19 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
678
679
|
this.isLoaded || this.loadRemoteOptions(), this.optionsListId && this.$refs.optionsContainer.setAttribute("id", this.optionsListId), this.teleportOptionsContainer();
|
|
679
680
|
},
|
|
680
681
|
teleportOptionsContainer() {
|
|
681
|
-
const e = this.$el.getBoundingClientRect(), t = e.y + e.height + 2, n = e.x,
|
|
682
|
-
for (let o in
|
|
683
|
-
/^(font|text)/.test(o) && (
|
|
684
|
-
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") {
|
|
685
686
|
const o = window.innerHeight - t - 12;
|
|
686
|
-
|
|
687
|
+
i.style.maxHeight = o + "px";
|
|
687
688
|
}
|
|
688
|
-
|
|
689
|
+
i.style.visibility = "visible", document.body.appendChild(i), setTimeout(this.highlightInitialOption, 0);
|
|
689
690
|
},
|
|
690
691
|
highlightInitialOption() {
|
|
691
692
|
if (!this.isLoaded || !this.highlightedOptionKey)
|
|
692
693
|
return;
|
|
693
|
-
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];
|
|
694
695
|
t.scrollTop = n.offsetTop;
|
|
695
696
|
},
|
|
696
697
|
handleOptionHover(e) {
|
|
@@ -702,18 +703,19 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
702
703
|
if (n < 0 ? n = 0 : n >= this.effectiveOptions.length && (n = this.effectiveOptions.length - 1), t == n)
|
|
703
704
|
return;
|
|
704
705
|
this.highlightedOptionKey = this.effectiveOptions[n].key;
|
|
705
|
-
const
|
|
706
|
-
|
|
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);
|
|
707
708
|
},
|
|
708
709
|
selectOption(e) {
|
|
709
|
-
|
|
710
|
+
var t;
|
|
711
|
+
if (this.isSearching = !1, e.key == H)
|
|
710
712
|
this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null;
|
|
711
713
|
else if (e.key === he) {
|
|
712
|
-
const
|
|
713
|
-
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);
|
|
714
716
|
} else {
|
|
715
|
-
const
|
|
716
|
-
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 || "";
|
|
717
719
|
}
|
|
718
720
|
this.$refs.searchField.blur();
|
|
719
721
|
},
|
|
@@ -721,65 +723,66 @@ const I = Symbol("null"), he = Symbol("create"), Lt = "`1234567890-=[]\\;',./~!@
|
|
|
721
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 = "");
|
|
722
724
|
},
|
|
723
725
|
addRemoteOption(e) {
|
|
724
|
-
this.loadedOptions.
|
|
726
|
+
this.loadedOptions.unshift(e);
|
|
725
727
|
}
|
|
726
728
|
}
|
|
727
729
|
};
|
|
728
|
-
const
|
|
730
|
+
const Ht = ["placeholder", "required"], _t = {
|
|
729
731
|
key: 0,
|
|
730
732
|
ref: "optionsContainer",
|
|
731
733
|
class: "vf-smart-select-options"
|
|
732
|
-
},
|
|
734
|
+
}, Dt = {
|
|
733
735
|
key: 0,
|
|
734
736
|
class: "no-results"
|
|
735
|
-
},
|
|
737
|
+
}, $t = ["onMousemove", "onMousedown"], At = ["innerHTML"], Bt = ["innerHTML"], Vt = {
|
|
736
738
|
key: 0,
|
|
737
739
|
class: "no-results"
|
|
738
740
|
};
|
|
739
|
-
function
|
|
741
|
+
function Ft(e, t, n, i, s, o) {
|
|
740
742
|
const r = Te("disabled");
|
|
741
|
-
return u(),
|
|
742
|
-
class:
|
|
743
|
+
return u(), f("div", {
|
|
744
|
+
class: k(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
|
|
743
745
|
}, [
|
|
744
|
-
U(
|
|
746
|
+
U(O("input", {
|
|
745
747
|
"onUpdate:modelValue": t[0] || (t[0] = (l) => e.searchText = l),
|
|
746
748
|
ref: "searchField",
|
|
747
749
|
type: "text",
|
|
748
|
-
class:
|
|
750
|
+
class: k({ nullable: !!n.nullTitle }),
|
|
749
751
|
onKeydown: t[1] || (t[1] = (...l) => o.handleKeyDown && o.handleKeyDown(...l)),
|
|
750
752
|
placeholder: o.effectivePlaceholder,
|
|
751
753
|
onFocus: t[2] || (t[2] = (...l) => o.handleInputFocused && o.handleInputFocused(...l)),
|
|
752
|
-
onBlur: t[3] || (t[3] = (...l) => o.handleInputBlurred && o.handleInputBlurred(...l))
|
|
753
|
-
|
|
754
|
+
onBlur: t[3] || (t[3] = (...l) => o.handleInputBlurred && o.handleInputBlurred(...l)),
|
|
755
|
+
required: n.required
|
|
756
|
+
}, null, 42, Ht), [
|
|
754
757
|
[ze, e.searchText],
|
|
755
758
|
[r, o.effectiveDisabled]
|
|
756
759
|
]),
|
|
757
|
-
e.shouldDisplayOptions ? (u(),
|
|
758
|
-
e.isLoaded ? (u(),
|
|
759
|
-
(u(!0),
|
|
760
|
+
e.shouldDisplayOptions ? (u(), f("div", _t, [
|
|
761
|
+
e.isLoaded ? (u(), f(j, { key: 1 }, [
|
|
762
|
+
(u(!0), f(j, null, J(o.effectiveOptions, (l) => (u(), f("div", {
|
|
760
763
|
key: String(l.key),
|
|
761
|
-
class:
|
|
764
|
+
class: k(["option", {
|
|
762
765
|
highlighted: e.highlightedOptionKey === l.key
|
|
763
766
|
}]),
|
|
764
767
|
onMousemove: (c) => o.handleOptionHover(l),
|
|
765
768
|
onMousedown: (c) => o.selectOption(l)
|
|
766
769
|
}, [
|
|
767
|
-
|
|
770
|
+
O("div", {
|
|
768
771
|
class: "title",
|
|
769
772
|
innerHTML: l.title
|
|
770
|
-
}, null, 8,
|
|
771
|
-
l.subtitle ? (u(),
|
|
773
|
+
}, null, 8, At),
|
|
774
|
+
l.subtitle ? (u(), f("div", {
|
|
772
775
|
key: 0,
|
|
773
776
|
class: "subtitle",
|
|
774
777
|
innerHTML: l.subtitle
|
|
775
|
-
}, null, 8,
|
|
776
|
-
], 42,
|
|
777
|
-
!o.effectiveOptions.length && e.searchText ? (u(),
|
|
778
|
-
], 64)) : (u(),
|
|
779
|
-
], 512)) :
|
|
778
|
+
}, null, 8, Bt)) : T("", !0)
|
|
779
|
+
], 42, $t))), 128)),
|
|
780
|
+
!o.effectiveOptions.length && e.searchText ? (u(), f("div", Vt, x(o.effectiveNoResultsText), 1)) : T("", !0)
|
|
781
|
+
], 64)) : (u(), f("div", Dt, "Loading..."))
|
|
782
|
+
], 512)) : T("", !0)
|
|
780
783
|
], 2);
|
|
781
784
|
}
|
|
782
|
-
const
|
|
785
|
+
const Nt = /* @__PURE__ */ Le(It, [["render", Ft]]), Wn = /* @__PURE__ */ C({
|
|
783
786
|
__name: "ez-smart-select",
|
|
784
787
|
props: {
|
|
785
788
|
modelValue: {},
|
|
@@ -790,36 +793,36 @@ const Ft = /* @__PURE__ */ Le(Mt, [["render", Vt]]), jn = /* @__PURE__ */ S({
|
|
|
790
793
|
},
|
|
791
794
|
emits: ["update:modelValue"],
|
|
792
795
|
setup(e, { emit: t }) {
|
|
793
|
-
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]) => ({
|
|
794
797
|
value: r,
|
|
795
798
|
label: l
|
|
796
|
-
}))),
|
|
799
|
+
}))), s = V(() => n.formatter ? (r) => {
|
|
797
800
|
var l;
|
|
798
801
|
return (l = n.formatter) == null ? void 0 : l.call(n, r.label);
|
|
799
|
-
} : (r) => r.label), o =
|
|
802
|
+
} : (r) => r.label), o = w(i.value.find((r) => r.value === n.modelValue) ?? null);
|
|
800
803
|
return ce(
|
|
801
804
|
() => n.modelValue,
|
|
802
805
|
(r) => {
|
|
803
|
-
o.value =
|
|
806
|
+
o.value = i.value.find((l) => l.value === r) ?? null;
|
|
804
807
|
}
|
|
805
808
|
), ce(o, (r) => {
|
|
806
809
|
var l;
|
|
807
|
-
t("update:modelValue", r ? ((l =
|
|
808
|
-
}), (r, l) => (u(), ke(
|
|
810
|
+
t("update:modelValue", r ? ((l = i.value.find((c) => xe(c, r))) == null ? void 0 : l.value) ?? null : null);
|
|
811
|
+
}), (r, l) => (u(), ke(Nt, {
|
|
809
812
|
modelValue: o.value,
|
|
810
813
|
"onUpdate:modelValue": l[0] || (l[0] = (c) => o.value = c),
|
|
811
|
-
options:
|
|
812
|
-
formatter:
|
|
814
|
+
options: i.value,
|
|
815
|
+
formatter: s.value,
|
|
813
816
|
"null-title": r.nullTitle
|
|
814
817
|
}, null, 8, ["modelValue", "options", "formatter", "null-title"]));
|
|
815
818
|
}
|
|
816
|
-
}),
|
|
819
|
+
}), Rt = ["onClick"], Kt = { class: "content" }, Ut = { class: "message" }, jt = {
|
|
817
820
|
key: 0,
|
|
818
821
|
class: "close"
|
|
819
|
-
},
|
|
822
|
+
}, Wt = {
|
|
820
823
|
key: 0,
|
|
821
824
|
class: "progress-bar"
|
|
822
|
-
},
|
|
825
|
+
}, Pt = /* @__PURE__ */ C({
|
|
823
826
|
__name: "toast",
|
|
824
827
|
props: {
|
|
825
828
|
message: {},
|
|
@@ -834,157 +837,157 @@ const Ft = /* @__PURE__ */ Le(Mt, [["render", Vt]]), jn = /* @__PURE__ */ S({
|
|
|
834
837
|
function n() {
|
|
835
838
|
t.onClick ? t.onClick() : t.disableClose || t.callback();
|
|
836
839
|
}
|
|
837
|
-
const
|
|
838
|
-
return t.durationSecs !== null &&
|
|
840
|
+
const i = w();
|
|
841
|
+
return t.durationSecs !== null && L(() => {
|
|
839
842
|
var o;
|
|
840
|
-
const
|
|
841
|
-
(o =
|
|
842
|
-
duration:
|
|
843
|
+
const s = t.durationSecs ?? 5;
|
|
844
|
+
(o = i.value) == null || o.animate([{ width: "0%" }, { width: "100%" }], {
|
|
845
|
+
duration: s * 1e3,
|
|
843
846
|
easing: "linear"
|
|
844
|
-
}), setTimeout(() => t.callback(),
|
|
845
|
-
}), (
|
|
846
|
-
class:
|
|
847
|
+
}), setTimeout(() => t.callback(), s * 1e3);
|
|
848
|
+
}), (s, o) => (u(), f("div", {
|
|
849
|
+
class: k(["vf-toast", s.className]),
|
|
847
850
|
onClick: te(n, ["stop"])
|
|
848
851
|
}, [
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
+
O("div", Kt, [
|
|
853
|
+
O("div", Ut, x(s.message), 1),
|
|
854
|
+
s.disableClose ? T("", !0) : (u(), f("div", jt, "x"))
|
|
852
855
|
]),
|
|
853
|
-
|
|
854
|
-
|
|
856
|
+
s.durationSecs !== null ? (u(), f("div", Wt, [
|
|
857
|
+
O("div", {
|
|
855
858
|
ref_key: "progressInnerEl",
|
|
856
|
-
ref:
|
|
859
|
+
ref: i,
|
|
857
860
|
class: "inner"
|
|
858
861
|
}, null, 512)
|
|
859
|
-
])) :
|
|
860
|
-
], 10,
|
|
862
|
+
])) : T("", !0)
|
|
863
|
+
], 10, Rt));
|
|
861
864
|
}
|
|
862
865
|
});
|
|
863
|
-
function
|
|
864
|
-
const t =
|
|
866
|
+
function Pn(e) {
|
|
867
|
+
const t = ie(Pt, {
|
|
865
868
|
...e,
|
|
866
869
|
callback: () => P(t)
|
|
867
870
|
});
|
|
868
871
|
return () => P(t);
|
|
869
872
|
}
|
|
870
|
-
function Pt(e) {
|
|
871
|
-
const t = Math.floor(Math.log(e) / Math.log(1024)), s = (e / Math.pow(1024, t)).toFixed(2), i = ["B", "KB", "MB", "GB", "TB"][t];
|
|
872
|
-
return `${s} ${i}`;
|
|
873
|
-
}
|
|
874
873
|
function qt(e) {
|
|
875
|
-
|
|
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}`;
|
|
876
876
|
}
|
|
877
877
|
function zt(e) {
|
|
878
|
-
return e
|
|
878
|
+
return e != null && String(e).length ? e : "-";
|
|
879
879
|
}
|
|
880
880
|
function Xt(e) {
|
|
881
|
-
return e
|
|
881
|
+
return e || "-";
|
|
882
882
|
}
|
|
883
883
|
function Yt(e) {
|
|
884
|
-
return e &&
|
|
884
|
+
return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : sn(Number(e));
|
|
885
885
|
}
|
|
886
886
|
function Zt(e) {
|
|
887
|
-
return e
|
|
887
|
+
return e && xt(e);
|
|
888
888
|
}
|
|
889
889
|
function Gt(e) {
|
|
890
890
|
return e ? Ze(e) : null;
|
|
891
891
|
}
|
|
892
892
|
function Qt(e) {
|
|
893
|
-
return e ? e
|
|
893
|
+
return e ? Ge(e) : null;
|
|
894
894
|
}
|
|
895
895
|
function Jt(e) {
|
|
896
|
-
return e ?
|
|
896
|
+
return e ? e.toUpperCase() : null;
|
|
897
897
|
}
|
|
898
898
|
function en(e) {
|
|
899
|
-
return Ct(e);
|
|
899
|
+
return e ? Ct(e) : null;
|
|
900
|
+
}
|
|
901
|
+
function tn(e) {
|
|
902
|
+
return Lt(e);
|
|
900
903
|
}
|
|
901
904
|
const fe = {
|
|
902
|
-
bytes:
|
|
903
|
-
dash:
|
|
904
|
-
dashZeros:
|
|
905
|
-
number:
|
|
906
|
-
phone:
|
|
907
|
-
upperFirst:
|
|
908
|
-
startCase:
|
|
909
|
-
upperCase:
|
|
910
|
-
desnake:
|
|
911
|
-
usCurrency:
|
|
912
|
-
},
|
|
905
|
+
bytes: qt,
|
|
906
|
+
dash: zt,
|
|
907
|
+
dashZeros: Xt,
|
|
908
|
+
number: Yt,
|
|
909
|
+
phone: Zt,
|
|
910
|
+
upperFirst: Gt,
|
|
911
|
+
startCase: Qt,
|
|
912
|
+
upperCase: Jt,
|
|
913
|
+
desnake: en,
|
|
914
|
+
usCurrency: tn
|
|
915
|
+
}, qn = (e) => ({
|
|
913
916
|
...fe,
|
|
914
917
|
...e(fe)
|
|
915
918
|
});
|
|
916
|
-
function
|
|
917
|
-
const
|
|
918
|
-
return
|
|
919
|
+
function zn(e, t, n) {
|
|
920
|
+
const i = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
|
|
921
|
+
return i === -1 ? !1 : (e.splice(i, 1, n), !0);
|
|
919
922
|
}
|
|
920
|
-
function
|
|
923
|
+
function Xn(e, t) {
|
|
921
924
|
const n = document.createElement("div");
|
|
922
|
-
n.classList.add("vf-overlay"), n.addEventListener("click",
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
const
|
|
926
|
-
|
|
925
|
+
n.classList.add("vf-overlay"), n.addEventListener("click", m), document.body.appendChild(n);
|
|
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) => {
|
|
927
930
|
if (p == "-") {
|
|
928
|
-
const
|
|
929
|
-
|
|
931
|
+
const d = document.createElement("div");
|
|
932
|
+
d.classList.add("separator"), i.appendChild(d);
|
|
930
933
|
return;
|
|
931
934
|
}
|
|
932
|
-
const
|
|
933
|
-
|
|
935
|
+
const a = document.createElement("div");
|
|
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());
|
|
934
937
|
});
|
|
935
|
-
const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l =
|
|
936
|
-
|
|
937
|
-
|
|
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";
|
|
938
941
|
}, 50);
|
|
939
|
-
function
|
|
940
|
-
t.targetClass &&
|
|
942
|
+
function m() {
|
|
943
|
+
t.targetClass && s.classList.remove(t.targetClass), s.classList.remove("context-menu-active"), s.style.userSelect = "", n.remove();
|
|
941
944
|
}
|
|
942
|
-
function
|
|
943
|
-
if (
|
|
944
|
-
return
|
|
945
|
-
const
|
|
946
|
-
|
|
947
|
-
const
|
|
948
|
-
|
|
945
|
+
function y(p, a, d) {
|
|
946
|
+
if (a.classList.contains("pending-confirm"))
|
|
947
|
+
return d();
|
|
948
|
+
const E = a.innerHTML;
|
|
949
|
+
a.classList.add("pending-confirm"), a.innerText = "Confirm";
|
|
950
|
+
const M = () => {
|
|
951
|
+
a.classList.remove("pending-confirm"), a.innerHTML = E, a.removeEventListener("mouseleave", M);
|
|
949
952
|
};
|
|
950
|
-
|
|
953
|
+
a.addEventListener("mouseleave", M), p.stopPropagation();
|
|
951
954
|
}
|
|
952
955
|
}
|
|
953
|
-
const
|
|
954
|
-
function
|
|
956
|
+
const nn = (e) => new Promise((t) => setTimeout(t, e)), Yn = (e) => nn(e * 1e3);
|
|
957
|
+
function sn(e) {
|
|
955
958
|
return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
956
959
|
}
|
|
957
|
-
function Yn(e, t) {
|
|
958
|
-
return e != null ? Ge(e) : t;
|
|
959
|
-
}
|
|
960
960
|
function Zn(e, t) {
|
|
961
|
+
return e != null ? Qe(e) : t;
|
|
962
|
+
}
|
|
963
|
+
function Gn(e, t) {
|
|
961
964
|
const n = { ...e };
|
|
962
|
-
for (const
|
|
963
|
-
n[
|
|
965
|
+
for (const i of t)
|
|
966
|
+
n[i] === "" && (n[i] = null);
|
|
964
967
|
return n;
|
|
965
968
|
}
|
|
966
|
-
function
|
|
969
|
+
function on(e) {
|
|
967
970
|
return e instanceof Error && "status" in e && "body" in e;
|
|
968
971
|
}
|
|
969
|
-
function
|
|
970
|
-
const r = e.request.request.bind(e.request), l = t ?? ((c,
|
|
971
|
-
e.request.request = (c) => l(c, (
|
|
972
|
-
const p = r(
|
|
973
|
-
|
|
974
|
-
if (
|
|
975
|
-
if (
|
|
976
|
-
return
|
|
977
|
-
|
|
972
|
+
function Qn({ apiClient: e, wrapper: t, onRequest: n, onError: i, afterRequest: s, CancelablePromise: o }) {
|
|
973
|
+
const r = e.request.request.bind(e.request), l = t ?? ((c, h) => h(c));
|
|
974
|
+
e.request.request = (c) => l(c, (h) => (h = ln(h), n && (h = n(h)), new o((b, m, y) => {
|
|
975
|
+
const p = r(h);
|
|
976
|
+
y(p.cancel), p.then(b).catch((a) => {
|
|
977
|
+
if (on(a) && typeof a.body == "object" && "error" in a.body) {
|
|
978
|
+
if (a.status === 422)
|
|
979
|
+
return m(new z(a.body.error));
|
|
980
|
+
a.message = `${a.body.error} (${a.status})`;
|
|
978
981
|
}
|
|
979
|
-
if (
|
|
980
|
-
const
|
|
981
|
-
if (
|
|
982
|
+
if (i) {
|
|
983
|
+
const d = i(a, h);
|
|
984
|
+
if (d === null)
|
|
982
985
|
return;
|
|
983
|
-
if (
|
|
984
|
-
return
|
|
986
|
+
if (d instanceof Error)
|
|
987
|
+
return m(d);
|
|
985
988
|
}
|
|
986
|
-
a
|
|
987
|
-
}).finally(() =>
|
|
989
|
+
m(a);
|
|
990
|
+
}).finally(() => s == null ? void 0 : s(h));
|
|
988
991
|
})));
|
|
989
992
|
}
|
|
990
993
|
class pe {
|
|
@@ -999,40 +1002,40 @@ class pe {
|
|
|
999
1002
|
this.blob = t;
|
|
1000
1003
|
}
|
|
1001
1004
|
}
|
|
1002
|
-
function
|
|
1003
|
-
if (!(typeof e.body == "object" && Object.values(e.body).some((
|
|
1005
|
+
function ln(e) {
|
|
1006
|
+
if (!(typeof e.body == "object" && Object.values(e.body).some((s) => s instanceof pe)))
|
|
1004
1007
|
return e;
|
|
1005
|
-
const n = {},
|
|
1006
|
-
for (const [
|
|
1007
|
-
o instanceof pe ? n[
|
|
1008
|
-
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" }), {
|
|
1009
1012
|
...e,
|
|
1010
1013
|
body: void 0,
|
|
1011
1014
|
formData: n
|
|
1012
1015
|
};
|
|
1013
1016
|
}
|
|
1014
1017
|
const le = Symbol("HookState");
|
|
1015
|
-
function
|
|
1018
|
+
function Jn(e, t) {
|
|
1016
1019
|
const n = t ?? ee();
|
|
1017
|
-
|
|
1020
|
+
L(() => rn(n, e), n), Se(() => an(n), n), Ce(() => me(n), n), ne(() => me(n), n);
|
|
1018
1021
|
}
|
|
1019
|
-
function
|
|
1022
|
+
function rn(e, t) {
|
|
1020
1023
|
const n = {};
|
|
1021
|
-
if (t.elScrolledToBottom && (n.el = new
|
|
1022
|
-
const
|
|
1023
|
-
|
|
1024
|
+
if (t.elScrolledToBottom && (n.el = new A(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
|
|
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);
|
|
1024
1027
|
}
|
|
1025
|
-
t.windowScrolledToBottom && (n.window = new
|
|
1028
|
+
t.windowScrolledToBottom && (n.window = new A(window, t.windowScrolledToBottom)), e[le] = n;
|
|
1026
1029
|
}
|
|
1027
|
-
function
|
|
1028
|
-
var n,
|
|
1030
|
+
function an(e) {
|
|
1031
|
+
var n, i, s;
|
|
1029
1032
|
const t = e[le];
|
|
1030
|
-
(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();
|
|
1031
1034
|
}
|
|
1032
1035
|
function me(e) {
|
|
1033
|
-
var n,
|
|
1036
|
+
var n, i, s;
|
|
1034
1037
|
const t = e[le];
|
|
1035
|
-
(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();
|
|
1036
1039
|
}
|
|
1037
1040
|
const Z = ["auto", "scroll"];
|
|
1038
1041
|
function De(e) {
|
|
@@ -1042,7 +1045,7 @@ function De(e) {
|
|
|
1042
1045
|
const n = window.getComputedStyle(t);
|
|
1043
1046
|
return Z.includes(n.overflow) || Z.includes(n.overflowX) || Z.includes(n.overflowY) ? t : De(t);
|
|
1044
1047
|
}
|
|
1045
|
-
class
|
|
1048
|
+
class A {
|
|
1046
1049
|
constructor(t, n) {
|
|
1047
1050
|
v(this, "isTripped", !1);
|
|
1048
1051
|
v(this, "onScrollWithContext", this.onScroll.bind(this));
|
|
@@ -1058,10 +1061,10 @@ class $ {
|
|
|
1058
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);
|
|
1059
1062
|
}
|
|
1060
1063
|
}
|
|
1061
|
-
function
|
|
1062
|
-
|
|
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));
|
|
1063
1066
|
}
|
|
1064
|
-
const
|
|
1067
|
+
const cn = {
|
|
1065
1068
|
mounted: ye,
|
|
1066
1069
|
updated: ye
|
|
1067
1070
|
}, ve = Symbol("HasAutoFocused");
|
|
@@ -1072,10 +1075,10 @@ function ye(e, t) {
|
|
|
1072
1075
|
const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
|
|
1073
1076
|
setTimeout(() => n.focus(), 10);
|
|
1074
1077
|
}
|
|
1075
|
-
const
|
|
1076
|
-
mounted:
|
|
1078
|
+
const dn = {
|
|
1079
|
+
mounted: un
|
|
1077
1080
|
}, _ = Symbol("ConfirmState");
|
|
1078
|
-
function
|
|
1081
|
+
function un(e) {
|
|
1079
1082
|
e.addEventListener("click", (t) => {
|
|
1080
1083
|
const n = Date.now();
|
|
1081
1084
|
if (e[_]) {
|
|
@@ -1085,20 +1088,20 @@ function dn(e) {
|
|
|
1085
1088
|
return;
|
|
1086
1089
|
}
|
|
1087
1090
|
t.preventDefault(), t.stopImmediatePropagation();
|
|
1088
|
-
const
|
|
1091
|
+
const i = {
|
|
1089
1092
|
initTime: n,
|
|
1090
1093
|
preconfirmHtml: e.innerHTML,
|
|
1091
1094
|
resetHandler: () => {
|
|
1092
|
-
e.innerHTML =
|
|
1095
|
+
e.innerHTML = i.preconfirmHtml, e.blur(), e.removeEventListener("mouseout", i.resetHandler), delete e[_];
|
|
1093
1096
|
}
|
|
1094
1097
|
};
|
|
1095
|
-
e[_] =
|
|
1098
|
+
e[_] = i, e.innerHTML = "Confirm", e.addEventListener("mouseout", i.resetHandler);
|
|
1096
1099
|
});
|
|
1097
1100
|
}
|
|
1098
|
-
const
|
|
1099
|
-
beforeMount:
|
|
1101
|
+
const hn = {
|
|
1102
|
+
beforeMount: fn
|
|
1100
1103
|
};
|
|
1101
|
-
function
|
|
1104
|
+
function fn(e) {
|
|
1102
1105
|
e.addEventListener("blur", () => {
|
|
1103
1106
|
let t = e.value;
|
|
1104
1107
|
/^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + G(/* @__PURE__ */ new Date(), "yy"));
|
|
@@ -1106,117 +1109,117 @@ function hn(e) {
|
|
|
1106
1109
|
isNaN(n) ? e.value = "" : e.value = G(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
|
|
1107
1110
|
});
|
|
1108
1111
|
}
|
|
1109
|
-
const
|
|
1112
|
+
const pn = {
|
|
1110
1113
|
beforeMount: ge,
|
|
1111
1114
|
updated: ge
|
|
1112
1115
|
};
|
|
1113
1116
|
function ge(e, t) {
|
|
1114
|
-
t.value == t.oldValue && e.innerHTML.length || (e.innerText =
|
|
1117
|
+
t.value == t.oldValue && e.innerHTML.length || (e.innerText = mn(e, t));
|
|
1115
1118
|
}
|
|
1116
|
-
function
|
|
1117
|
-
var c,
|
|
1119
|
+
function mn(e, t) {
|
|
1120
|
+
var c, h;
|
|
1118
1121
|
if (!t.value)
|
|
1119
1122
|
return ((c = e.attributes.getNamedItem("placeholder")) == null ? void 0 : c.value) ?? "";
|
|
1120
1123
|
let n = "";
|
|
1121
|
-
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);
|
|
1122
1125
|
e.attributes.getNamedItem("display-utc") !== null && o.setMinutes(o.getMinutes() - o.getTimezoneOffset());
|
|
1123
|
-
let r = (
|
|
1126
|
+
let r = (h = e.attributes.getNamedItem("format")) == null ? void 0 : h.value;
|
|
1124
1127
|
if (!r && e.attributes.getNamedItem("relative-date") !== null) {
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1128
|
+
const b = /* @__PURE__ */ new Date();
|
|
1129
|
+
b.getFullYear() == o.getFullYear() && b.getMonth() == o.getMonth() && b.getDate() == o.getDate() && (n = "at", r = "HH:mm");
|
|
1127
1130
|
}
|
|
1128
|
-
r || (r =
|
|
1131
|
+
r || (r = N.defaultDateTimeFormat);
|
|
1129
1132
|
let l = G(o, r);
|
|
1130
1133
|
return n && (l = n + " " + l), l;
|
|
1131
1134
|
}
|
|
1132
|
-
const
|
|
1135
|
+
const vn = {
|
|
1133
1136
|
beforeMount: be,
|
|
1134
1137
|
updated: be,
|
|
1135
|
-
unmounted:
|
|
1138
|
+
unmounted: yn
|
|
1136
1139
|
};
|
|
1137
1140
|
function be(e, t) {
|
|
1138
1141
|
e.tagName === "LABEL" && (t.value ? e.classList.remove("disabled") : e.classList.add("disabled"), e = e.querySelector("input")), t.value ? e.setAttribute("disabled", "disabled") : e.removeAttribute("disabled");
|
|
1139
1142
|
}
|
|
1140
|
-
function
|
|
1143
|
+
function yn(e) {
|
|
1141
1144
|
e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
|
|
1142
1145
|
}
|
|
1143
|
-
const
|
|
1146
|
+
const gn = {
|
|
1144
1147
|
beforeMount: Ee,
|
|
1145
1148
|
updated: Ee,
|
|
1146
1149
|
unmounted: Ae
|
|
1147
|
-
},
|
|
1148
|
-
function
|
|
1150
|
+
}, F = Symbol("HasAutoFocused"), re = [];
|
|
1151
|
+
function bn() {
|
|
1149
1152
|
re.forEach($e);
|
|
1150
1153
|
}
|
|
1151
|
-
setInterval(
|
|
1154
|
+
setInterval(bn, 1e3);
|
|
1152
1155
|
function Ee(e, t) {
|
|
1153
1156
|
var r;
|
|
1154
1157
|
if (t.value == t.oldValue)
|
|
1155
1158
|
return;
|
|
1156
1159
|
if (!t.value)
|
|
1157
1160
|
return Ae(e);
|
|
1158
|
-
const n = new Date(t.value),
|
|
1159
|
-
e[
|
|
1160
|
-
startTs:
|
|
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;
|
|
1162
|
+
e[F] || re.push(e), e[F] = {
|
|
1163
|
+
startTs: s,
|
|
1161
1164
|
includeSeconds: o
|
|
1162
1165
|
}, $e(e);
|
|
1163
1166
|
}
|
|
1164
1167
|
function $e(e) {
|
|
1165
|
-
const t = e[
|
|
1166
|
-
e.innerText =
|
|
1168
|
+
const t = e[F], n = Math.round((Date.now() - t.startTs) / 1e3);
|
|
1169
|
+
e.innerText = En(n, t.includeSeconds);
|
|
1167
1170
|
}
|
|
1168
1171
|
function Ae(e) {
|
|
1169
|
-
e[
|
|
1172
|
+
e[F] && (Je(re, e), delete e[F]), e.innerText = "-";
|
|
1170
1173
|
}
|
|
1171
|
-
function
|
|
1172
|
-
const n = [],
|
|
1173
|
-
|
|
1174
|
-
const
|
|
1175
|
-
(
|
|
1174
|
+
function En(e, t) {
|
|
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;
|
|
1176
1179
|
const o = Math.floor(e / 60);
|
|
1177
|
-
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(" ");
|
|
1178
1181
|
}
|
|
1179
|
-
const
|
|
1182
|
+
const D = Symbol("InfiniteScrollHandler"), On = {
|
|
1180
1183
|
mounted(e, t) {
|
|
1181
|
-
e[
|
|
1184
|
+
e[D] = new A(e, t.value);
|
|
1182
1185
|
},
|
|
1183
1186
|
updated(e, t) {
|
|
1184
1187
|
var n;
|
|
1185
|
-
(n = e[
|
|
1188
|
+
(n = e[D]) == null || n.uninstall(), e[D] = new A(e, t.value);
|
|
1186
1189
|
},
|
|
1187
1190
|
unmounted(e) {
|
|
1188
1191
|
var t;
|
|
1189
|
-
(t = e[
|
|
1192
|
+
(t = e[D]) == null || t.uninstall(), delete e[D];
|
|
1190
1193
|
}
|
|
1191
|
-
},
|
|
1194
|
+
}, wn = {
|
|
1192
1195
|
beforeMount: Oe,
|
|
1193
1196
|
updated: Oe
|
|
1194
1197
|
};
|
|
1195
1198
|
function Oe(e, t) {
|
|
1196
1199
|
e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
|
|
1197
1200
|
}
|
|
1198
|
-
const
|
|
1201
|
+
const Tn = {
|
|
1199
1202
|
mounted: we,
|
|
1200
1203
|
updated: we,
|
|
1201
1204
|
unmounted: Be
|
|
1202
|
-
},
|
|
1205
|
+
}, B = Symbol("TooltipState");
|
|
1203
1206
|
function we(e, t) {
|
|
1204
|
-
var
|
|
1205
|
-
let n = ((
|
|
1207
|
+
var i;
|
|
1208
|
+
let n = ((i = e.attributes.getNamedItem("tip")) == null ? void 0 : i.value) ?? t.value;
|
|
1206
1209
|
if (t.value || (n = null), n) {
|
|
1207
|
-
const
|
|
1210
|
+
const s = {
|
|
1208
1211
|
content: n,
|
|
1209
1212
|
html: e.getAttribute("html") !== null
|
|
1210
1213
|
};
|
|
1211
|
-
e[
|
|
1214
|
+
e[B] ? e[B].configure(s) : e[B] = new kn(e, s);
|
|
1212
1215
|
} else
|
|
1213
1216
|
Be(e);
|
|
1214
1217
|
}
|
|
1215
1218
|
function Be(e) {
|
|
1216
1219
|
var t;
|
|
1217
|
-
(t = e[
|
|
1220
|
+
(t = e[B]) == null || t.destroy(), delete e[B];
|
|
1218
1221
|
}
|
|
1219
|
-
class
|
|
1222
|
+
class kn {
|
|
1220
1223
|
constructor(t, n) {
|
|
1221
1224
|
v(this, "lastMoveEvt");
|
|
1222
1225
|
v(this, "checkInterval");
|
|
@@ -1252,9 +1255,9 @@ class Tn {
|
|
|
1252
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);
|
|
1253
1256
|
}
|
|
1254
1257
|
handleMouseMove(t) {
|
|
1255
|
-
const n = this.tipEl.offsetWidth,
|
|
1258
|
+
const n = this.tipEl.offsetWidth, i = this.tipEl.offsetHeight, s = window.innerWidth, o = window.innerHeight;
|
|
1256
1259
|
let r = t.pageX + 10, l = t.pageY + 20;
|
|
1257
|
-
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;
|
|
1258
1261
|
}
|
|
1259
1262
|
checkMoveEvent() {
|
|
1260
1263
|
var t;
|
|
@@ -1264,61 +1267,61 @@ class Tn {
|
|
|
1264
1267
|
this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext);
|
|
1265
1268
|
}
|
|
1266
1269
|
}
|
|
1267
|
-
function
|
|
1268
|
-
e.directive("autofocus",
|
|
1270
|
+
function Sn(e) {
|
|
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);
|
|
1269
1272
|
}
|
|
1270
|
-
function
|
|
1271
|
-
|
|
1273
|
+
function ti(e) {
|
|
1274
|
+
Sn(e);
|
|
1272
1275
|
}
|
|
1273
1276
|
export {
|
|
1274
1277
|
pe as FileUploadRequest,
|
|
1275
1278
|
_n as OverlayContainer,
|
|
1276
1279
|
z as UserError,
|
|
1277
|
-
|
|
1280
|
+
Hn as VfAjaxSelect,
|
|
1278
1281
|
X as VfAlertModal,
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1282
|
+
Wn as VfEzSmartSelect,
|
|
1283
|
+
gt as VfModal,
|
|
1284
|
+
Nt as VfSmartSelect,
|
|
1285
|
+
Zn as cloneProp,
|
|
1286
|
+
Vn as configureVf,
|
|
1287
|
+
qn as createFilters,
|
|
1288
|
+
ie as createOverlayInjection,
|
|
1289
|
+
Ct as desnakeCase,
|
|
1290
|
+
dt as dismissOverlayInjectionById,
|
|
1291
|
+
Dn as dismissOverlayInjectionByInstance,
|
|
1289
1292
|
Me as dismissOverlayInjectionByInternalInstance,
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1293
|
+
ct as dismissOverlayInjectionByVnode,
|
|
1294
|
+
si as escapeHtml,
|
|
1295
|
+
ut as formatError,
|
|
1296
|
+
sn as formatNumber,
|
|
1294
1297
|
xt as formatPhone,
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1298
|
+
Lt as formatUSCurrency,
|
|
1299
|
+
Nn as handleError,
|
|
1300
|
+
Fn as handleErrorAndAlert,
|
|
1301
|
+
Qn as installApiClientInterceptors,
|
|
1302
|
+
ti as installVf,
|
|
1303
|
+
on as isApiError,
|
|
1304
|
+
Rn as maskComponent,
|
|
1305
|
+
ht as maskEl,
|
|
1306
|
+
ft as maskForm,
|
|
1307
|
+
Un as nl2br,
|
|
1308
|
+
Gn as nullifyEmptyInputs,
|
|
1309
|
+
se as presentOverlay,
|
|
1307
1310
|
P as removeOverlayInjection,
|
|
1308
|
-
|
|
1311
|
+
zn as replaceElement,
|
|
1309
1312
|
de as showAlert,
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1313
|
+
$n as showConfirm,
|
|
1314
|
+
An as showConfirmDestroy,
|
|
1315
|
+
Xn as showContextMenu,
|
|
1316
|
+
Pn as showToast,
|
|
1317
|
+
Bn as showWait,
|
|
1318
|
+
nn as sleep,
|
|
1319
|
+
Yn as sleepSecs,
|
|
1317
1320
|
oe as toError,
|
|
1318
|
-
|
|
1321
|
+
Kn as unmaskComponent,
|
|
1319
1322
|
Ie as unmaskEl,
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1323
|
+
He as unmaskForm,
|
|
1324
|
+
Jn as useInfiniteScroll,
|
|
1325
|
+
ei as useResizeWatcher,
|
|
1326
|
+
jn as uuid
|
|
1324
1327
|
};
|