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