@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.
Files changed (45) hide show
  1. package/demo/components/demo-root.vue +21 -0
  2. package/demo/components/demo-vf-smart-select.vue +28 -0
  3. package/demo/index.html +14 -0
  4. package/demo/index.ts +10 -0
  5. package/demo/vite.config.ts +23 -0
  6. package/dist/demo/components/demo-root.vue.d.ts +2 -0
  7. package/dist/demo/components/demo-vf-smart-select.vue.d.ts +2 -0
  8. package/dist/demo/index.d.ts +1 -0
  9. package/dist/demo/vite.config.d.ts +2 -0
  10. package/dist/src/components/index.d.ts +5 -5
  11. package/dist/src/components/overlay-anchor.vue.d.ts +1 -1
  12. package/dist/src/components/overlay-container.d.ts +1 -1
  13. package/dist/src/components/toast-helpers.d.ts +1 -1
  14. package/dist/src/components/vf-ajax-select.vue.d.ts +26 -0
  15. package/dist/src/components/{alert-modal.vue.d.ts → vf-alert-modal.vue.d.ts} +1 -1
  16. package/dist/src/components/{ez-smart-select.vue.d.ts → vf-ez-smart-select.vue.d.ts} +13 -5
  17. package/dist/src/components/{modal.vue.d.ts → vf-modal.vue.d.ts} +1 -1
  18. package/dist/src/components/vf-smart-select.vue.d.ts +47 -0
  19. package/dist/src/components/{toast.vue.d.ts → vf-toast.vue.d.ts} +1 -1
  20. package/dist/vue-foundation.es.js +827 -893
  21. package/eslint.config.mjs +67 -0
  22. package/package.json +10 -8
  23. package/src/components/alert-helpers.ts +1 -1
  24. package/src/components/index.ts +5 -5
  25. package/src/components/overlay-container.ts +5 -1
  26. package/src/components/toast-helpers.ts +1 -1
  27. package/src/components/vf-ajax-select.vue +61 -0
  28. package/src/components/{alert-modal.vue → vf-alert-modal.vue} +5 -5
  29. package/src/components/{ez-smart-select.vue → vf-ez-smart-select.vue} +12 -8
  30. package/src/components/{modal.vue → vf-modal.vue} +3 -3
  31. package/src/components/vf-smart-select.vue +585 -0
  32. package/src/directives/duration.ts +3 -3
  33. package/src/filters/index.ts +1 -0
  34. package/src/helpers/array.ts +1 -0
  35. package/src/helpers/error.ts +4 -0
  36. package/src/helpers/object.ts +1 -0
  37. package/tsconfig.app.json +1 -1
  38. package/tsconfig.node.json +1 -1
  39. package/tsconfig.vitest.json +2 -2
  40. package/.eslintrc.cjs +0 -35
  41. package/dist/src/components/ajax-select.vue.d.ts +0 -19
  42. package/dist/src/components/smart-select.vue.d.ts +0 -115
  43. package/src/components/ajax-select.vue +0 -75
  44. package/src/components/smart-select.vue +0 -609
  45. /package/src/components/{toast.vue → vf-toast.vue} +0 -0
@@ -1,307 +1,297 @@
1
- var _e = Object.defineProperty;
2
- var Ke = (e, t, n) => t in e ? _e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var E = (e, t, n) => Ke(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { defineComponent as L, defineProps as je, defineEmits as We, ref as O, computed as N, openBlock as d, createElementBlock as h, createElementVNode as T, toDisplayString as x, withDirectives as W, createCommentVNode as b, Fragment as U, renderList as te, vModelSelect as Ue, getCurrentInstance as ne, onMounted as M, normalizeClass as k, normalizeStyle as Pe, withModifiers as se, renderSlot as j, reactive as qe, h as P, Teleport as ze, markRaw as Xe, onBeforeUnmount as ie, resolveDirective as be, createBlock as ke, createSlots as Ye, withCtx as Z, createTextVNode as de, vModelText as Ze, watch as ue, onActivated as Se, onDeactivated as Ce } from "vue";
5
- import { compact as Ge, debounce as Qe, isEqual as Le, upperFirst as Je, startCase as et, cloneDeep as tt, remove as nt, last as st } from "lodash";
6
- import { escapeHtml as it } from "@vue/shared";
7
- import { escapeHtml as ds } from "@vue/shared";
8
- import { installOpenApiClientInterceptors as ot, isOpenApiError as rt } from "@signal24/openapi-client-codegen/browser";
9
- import { format as J } from "date-fns";
10
- const lt = L({
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
- }, ct = {
13
+ }, Ut = {
45
14
  key: 0,
46
15
  value: null
47
- }, dt = ["value"];
48
- function ut(e, t, n, s, i, o) {
49
- return e.renderOptions ? W((d(), h("select", {
50
- key: 1,
51
- "onUpdate:modelValue": t[0] || (t[0] = (l) => e.selectedItem = l)
52
- }, [
53
- e.props.nullText ? (d(), h("option", ct, x(e.props.nullText), 1)) : b("", !0),
54
- (d(!0), h(U, null, te(e.renderOptions, (l, r) => {
55
- var a;
56
- return d(), h("option", {
57
- key: r,
58
- value: (a = e.options) == null ? void 0 : a[r]
59
- }, x(l), 9, dt);
60
- }), 128))
61
- ], 512)), [
62
- [Ue, e.selectedItem]
63
- ]) : (d(), h("select", at, [
64
- T("option", null, x(e.props.loadingText || "Loading..."), 1)
65
- ]));
66
- }
67
- const Fn = /* @__PURE__ */ xe(lt, [["render", ut]]), ht = /* @__PURE__ */ L({
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, s = O({ visibility: "hidden", top: "0", left: "0" }), i = O([]), o = ne();
75
- M(l);
76
- function l() {
77
- if (!o) return;
78
- const p = o.vnode.el, { styles: g, classes: m } = r(p, n);
79
- s.value = g, i.value = m;
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(p, g) {
82
- const m = t.anchor instanceof HTMLElement ? {} : t.anchor, v = g.getBoundingClientRect(), f = p.getBoundingClientRect();
83
- m.matchWidth && (f.width = v.width), m.matchHeight && (f.height = v.height);
84
- const u = m.class ? Array.isArray(m.class) ? m.class : [m.class] : [];
85
- let c, w;
86
- if (m.y === "center")
87
- c = v.top + v.height / 2 - f.height / 2, u.push("anchored-center-y");
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 D = (v.bottom + f.height < window.innerHeight || m.y === "below") && m.y !== "above";
90
- c = D ? v.bottom : v.top - f.height, u.push(D ? "anchored-top" : "anchored-bottom");
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 (m.x === "center")
93
- w = v.left + v.width / 2 - f.width / 2, u.push("anchored-center-x");
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 D = (v.left + f.width < window.innerWidth || m.x === "left") && m.x !== "right";
96
- w = D ? v.left : v.right - f.width, u.push(D ? "anchored-left" : "anchored-right");
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: `${c}px`,
101
- left: `${w}px`,
102
- ...m.matchWidth ? { width: `${f.width}px` } : {},
103
- ...m.matchHeight ? { height: `${f.height}px` } : {}
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: u
95
+ classes: a
106
96
  };
107
97
  }
108
- function a() {
109
- window.removeEventListener("click", a), mt(t.overlayId);
98
+ function d() {
99
+ window.removeEventListener("click", d), Kt(t.overlayId);
110
100
  }
111
- return M(() => {
101
+ return $(() => {
112
102
  setTimeout(() => {
113
- window.addEventListener("click", a);
103
+ window.addEventListener("click", d);
114
104
  }, 10);
115
- }), (p, g) => (d(), h("div", {
116
- class: k(["vf-overlay-anchor", i.value]),
117
- style: Pe(s.value),
118
- onClick: se(a, ["stop"])
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
- j(p.$slots, "default")
110
+ Q(h.$slots, "default")
121
111
  ], 6));
122
112
  }
123
113
  });
124
- let ft = 0;
125
- const S = qe([]), Rn = L({
114
+ let qt = 0;
115
+ const V = Ct([]), mo = _({
126
116
  setup() {
127
- return () => P("div", [
128
- te(S, (e) => P(ze, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
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 oe(e, t, n) {
133
- const s = document.getElementById("vf-overlay-target") ?? document.createElement("div");
134
- s.id = "vf-overlay-target", s.removeAttribute("inert"), document.body.appendChild(s);
135
- const i = String(++ft), o = Xe(e), l = P(o, t), r = n != null && n.anchor ? P(ht, { overlayId: i, anchor: n.anchor }, () => [l]) : void 0, a = {
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: o,
127
+ component: l,
138
128
  props: t,
139
129
  options: n ?? {},
140
- vnode: l,
130
+ vnode: c,
141
131
  wrapperVnode: r
142
132
  };
143
- return S.push(a), a;
133
+ return V.push(d), d;
144
134
  }
145
- function Nn(e) {
146
- e.$ && Me(e.$);
135
+ function ho(e) {
136
+ e.$ && Ye(e.$);
147
137
  }
148
- function Me(e) {
138
+ function Ye(e) {
149
139
  let t = e;
150
- for (; t && !pt(t.vnode); )
140
+ for (; t && !zt(t.vnode); )
151
141
  t = t.parent;
152
142
  }
153
- function pt(e) {
154
- const t = S.findIndex((n) => n.vnode.component === e.component);
155
- return t >= 0 ? (S[t].props.callback(), !0) : !1;
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 mt(e) {
158
- const t = S.findIndex((n) => n.id === e);
159
- return t >= 0 ? (S[t].props.callback(), !0) : !1;
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 q(e) {
162
- const t = S.indexOf(e);
163
- t >= 0 && S.splice(t, 1);
151
+ function ne(e) {
152
+ const t = V.indexOf(e);
153
+ t >= 0 && V.splice(t, 1);
164
154
  }
165
- async function re(e, t, n) {
166
- return new Promise((s) => {
155
+ async function we(e, t, n) {
156
+ return new Promise((o) => {
167
157
  let i = null;
168
- const l = { ...t, callback: async (r) => {
158
+ const c = { ...t, callback: async (r) => {
169
159
  if (n != null && n.onCallback) {
170
- const a = n.onCallback(r);
171
- if (typeof a == "object" && "then" in a && typeof a.then == "function" && await a === !1)
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
- q(i), s(r);
164
+ ne(i), o(r);
175
165
  } };
176
- i = oe(e, l, n);
166
+ i = Ee(e, c, n);
177
167
  });
178
168
  }
179
- function z(e, t) {
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 vt(e, t) {
186
- await re(Y, z(e, t));
175
+ async function Xt(e, t) {
176
+ await we(se, oe(e, t));
187
177
  }
188
- async function _n(e, t) {
189
- const n = z(e, t);
190
- return await re(Y, {
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 Kn(e, t) {
196
- const n = z(e, t);
197
- return await re(Y, {
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 jn(e, t) {
204
- const n = z(e, t), s = oe(Y, {
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 () => q(s);
201
+ return () => ne(o);
212
202
  }
213
- const I = {
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 Wn(e) {
220
- Object.assign(I, e);
209
+ function Eo(e) {
210
+ Object.assign(U, e);
221
211
  }
222
- class X extends Error {
212
+ class le extends Error {
223
213
  constructor(t) {
224
214
  super(t), this.name = "UserError";
225
215
  }
226
216
  }
227
- function yt(e) {
228
- return e instanceof X ? e.message : `An application error has occurred:
217
+ function Yt(e) {
218
+ return e instanceof le ? e.message : `An application error has occurred:
229
219
 
230
- ${le(e).message}
220
+ ${ke(e).message}
231
221
 
232
- Please refresh the page and try again. If this error persists, ${I.unhandledErrorSupportText}.`;
222
+ Please refresh the page and try again. If this error persists, ${U.unhandledErrorSupportText}.`;
233
223
  }
234
- function le(e) {
224
+ function ke(e) {
235
225
  return e instanceof Error ? e : new Error(String(e));
236
226
  }
237
- async function Un(e, t) {
238
- const n = le(e);
239
- return n instanceof X || I.errorHandler(n), vt({
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 Pn(e) {
246
- const t = le(e);
247
- t instanceof X || I.errorHandler(t);
235
+ async function ko(e) {
236
+ const t = ke(e);
237
+ t instanceof le || U.errorHandler(t);
248
238
  }
249
- const V = Symbol("MaskState");
250
- function qn(e, t) {
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, s = n.closest(".vf-modal");
253
- return gt(s ?? n, t);
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 zn(e) {
256
- var s;
257
- const t = (s = e.$) == null ? void 0 : s.vnode.el, n = t.closest(".vf-modal");
258
- return Ie(n ?? t);
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 gt(e, t) {
261
- if (!e[V]) {
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[V] = { maskEl: n };
253
+ n.classList.add("vf-mask"), e.appendChild(n), e[z] = { maskEl: n };
264
254
  }
265
- return e[V].maskEl.innerText = t ?? "", () => Ie(e);
255
+ return e[z].maskEl.innerText = t ?? "", () => Ze(e);
266
256
  }
267
- function Ie(e) {
268
- e[V] && e.removeChild(e[V].maskEl);
257
+ function Ze(e) {
258
+ e[z] && e.removeChild(e[z].maskEl);
269
259
  }
270
- const ee = Symbol("FormMaskState");
271
- function Et(e, t, n) {
272
- const s = e instanceof Element ? e : De(e);
273
- if (!s) return () => {
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
- s.classList.add("vf-masked");
276
- const i = t instanceof Element ? t : s.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
277
- let o;
278
- i && (o = i.tagName === "INPUT" ? i.value : i.innerHTML, i.setAttribute("disabled", "disabled"), i.innerText = n ?? "Please wait...");
279
- const r = [...s.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
280
- return r.forEach((a) => a.setAttribute("disabled", "disabled")), s[ee] = {
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: o
284
- }, () => He(s);
273
+ buttonHtml: l
274
+ }, () => Ge(o);
285
275
  }
286
- function He(e) {
287
- const t = e instanceof Element ? e : De(e);
276
+ function Ge(e) {
277
+ const t = e instanceof Element ? e : Qe(e);
288
278
  if (!t) return;
289
- const n = t[ee];
290
- n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((s) => s.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[ee]);
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 De(e) {
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 wt = ["id"], Tt = {
287
+ const Qt = ["id"], Jt = {
298
288
  key: 0,
299
289
  class: "vf-modal-header"
300
- }, Ot = { class: "vf-modal-content" }, bt = {
290
+ }, en = { class: "vf-modal-content" }, tn = {
301
291
  key: 1,
302
292
  class: "vf-modal-footer"
303
- }, kt = /* @__PURE__ */ L({
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 = ne(), s = e;
315
- t({ mask: m, unmask: v, hide: f, unhide: u });
316
- const i = O(), o = O(), l = O(!1), r = N(() => Ge([...Array.isArray(s.class) ? s.class : [s.class], l.value && "hidden"]));
317
- M(() => {
318
- var c;
319
- document.body.classList.add("vf-modal-open"), s.closeOnMaskClick && (window.addEventListener("keydown", p), (c = i.value) == null || c.addEventListener("click", a));
320
- }), ie(() => {
321
- window.removeEventListener("keydown", p), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
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 a(c) {
324
- c.target == i.value && g();
313
+ function d(u) {
314
+ u.target == i.value && k();
325
315
  }
326
- function p(c) {
327
- if (c.key === "Esc" || c.key === "Escape") {
328
- const w = document.querySelectorAll(".vf-modal-wrap");
329
- w[w.length - 1] === i.value && g();
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 g() {
333
- Me(n);
322
+ function k() {
323
+ Ye(n);
334
324
  }
335
- function m() {
336
- return Et(o.value), () => v();
325
+ function p() {
326
+ return Gt(l.value), () => E();
337
327
  }
338
- function v() {
339
- He(o.value);
328
+ function E() {
329
+ Ge(l.value);
340
330
  }
341
331
  function f() {
342
- return l.value = !0, () => u();
332
+ return c.value = !0, () => a();
343
333
  }
344
- function u() {
345
- l.value = !1;
334
+ function a() {
335
+ c.value = !1;
346
336
  }
347
- return (c, w) => (d(), h("div", {
348
- id: c.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
- T("form", {
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: o
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
- c.$slots.header ? (d(), h("div", Tt, [
361
- j(c.$slots, "header"),
362
- s.closeX ? (d(), h("i", {
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: g
366
- })) : b("", !0)
367
- ])) : b("", !0),
368
- T("div", Ot, [
369
- j(c.$slots, "default")
355
+ onClick: k
356
+ })) : D("", !0)
357
+ ])) : D("", !0),
358
+ O("div", en, [
359
+ Q(u.$slots, "default")
370
360
  ]),
371
- c.$slots.footer ? (d(), h("div", bt, [
372
- j(c.$slots, "footer")
373
- ])) : b("", !0)
361
+ u.$slots.footer ? (w(), b("div", tn, [
362
+ Q(u.$slots, "footer")
363
+ ])) : D("", !0)
374
364
  ], 34)
375
- ], 10, wt));
365
+ ], 10, Qt));
376
366
  }
377
- }), St = ["innerHtml"], Ct = ["innerText"], Y = /* @__PURE__ */ L({
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 = N(() => t.message instanceof Error ? yt(t.message) : t.message);
390
- return (s, i) => {
391
- const o = be("autofocus");
392
- return d(), ke(kt, {
393
- class: k(["vf-alert", ...s.classes ?? []])
394
- }, Ye({
395
- default: Z(() => [
396
- s.isHtml ? (d(), h("div", {
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: s.message,
388
+ innerHtml: o.message,
399
389
  class: "user-message"
400
- }, null, 8, St)) : (d(), h("div", {
390
+ }, null, 8, on)) : (w(), b("div", {
401
391
  key: 1,
402
392
  innerText: n.value
403
- }, null, 8, Ct))
393
+ }, null, 8, ln))
404
394
  ]),
405
395
  _: 2
406
396
  }, [
407
- s.title ? {
397
+ o.title ? {
408
398
  name: "header",
409
- fn: Z(() => [
410
- T("h1", null, x(s.title), 1)
399
+ fn: ce(() => [
400
+ O("h1", null, W(o.title), 1)
411
401
  ]),
412
402
  key: "0"
413
403
  } : void 0,
414
- s.isBare ? void 0 : {
404
+ o.isBare ? void 0 : {
415
405
  name: "footer",
416
- fn: Z(() => [
417
- s.shouldConfirm ? (d(), h(U, { key: 0 }, [
418
- W((d(), h("button", {
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] = () => s.callback(!0))
410
+ onClick: i[0] || (i[0] = () => o.callback(!0))
421
411
  }, i[3] || (i[3] = [
422
- de("Confirm")
412
+ De("Confirm")
423
413
  ]))), [
424
- [o]
414
+ [l]
425
415
  ]),
426
- T("button", {
416
+ O("button", {
427
417
  class: "default",
428
- onClick: i[1] || (i[1] = () => s.callback(!1))
418
+ onClick: i[1] || (i[1] = () => o.callback(!1))
429
419
  }, "Cancel")
430
- ], 64)) : W((d(), h("button", {
420
+ ], 64)) : J((w(), b("button", {
431
421
  key: 1,
432
422
  class: "default",
433
- onClick: i[2] || (i[2] = () => s.callback(!0))
423
+ onClick: i[2] || (i[2] = () => o.callback(!0))
434
424
  }, i[4] || (i[4] = [
435
- de("OK")
425
+ De("OK")
436
426
  ]))), [
437
- [o]
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 y = [];
447
- for (var G = 0; G < 256; ++G)
448
- y.push((G + 256).toString(16).slice(1));
449
- function Lt(e, t = 0) {
450
- return (y[e[t + 0]] + y[e[t + 1]] + y[e[t + 2]] + y[e[t + 3]] + "-" + y[e[t + 4]] + y[e[t + 5]] + "-" + y[e[t + 6]] + y[e[t + 7]] + "-" + y[e[t + 8]] + y[e[t + 9]] + "-" + y[e[t + 10]] + y[e[t + 11]] + y[e[t + 12]] + y[e[t + 13]] + y[e[t + 14]] + y[e[t + 15]]).toLowerCase();
451
- }
452
- var K, xt = new Uint8Array(16);
453
- function Mt() {
454
- if (!K && (K = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !K))
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 K(xt);
446
+ return G(rn);
457
447
  }
458
- var It = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
459
- const he = {
460
- randomUUID: It
448
+ var un = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
449
+ const Be = {
450
+ randomUUID: un
461
451
  };
462
- function Ht(e, t, n) {
463
- if (he.randomUUID && !t && !e)
464
- return he.randomUUID();
452
+ function cn(e, t, n) {
453
+ if (Be.randomUUID && !t && !e)
454
+ return Be.randomUUID();
465
455
  e = e || {};
466
- var s = e.random || (e.rng || Mt)();
467
- return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, Lt(s);
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 Xn(e) {
459
+ function So(e) {
470
460
  return e.replace(/\n/g, "<br>");
471
461
  }
472
- function Dt(e) {
462
+ function dn(e) {
473
463
  return e.replace(/_/g, " ");
474
464
  }
475
- function At(e) {
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 $t(e, t = 1) {
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 Yn() {
483
- return Ht();
472
+ function Co() {
473
+ return cn();
484
474
  }
485
- const A = Symbol("null"), fe = Symbol("create"), Bt = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", Vt = {
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
- type: null,
489
- default: null
490
- },
491
- loadOptions: Function,
492
- options: Object,
493
- prependOptions: Object,
494
- appendOptions: Object,
495
- onCreateItem: Function,
496
- preload: Boolean,
497
- remoteSearch: Boolean,
498
- searchFields: Object,
499
- placeholder: String,
500
- keyExtractor: Function,
501
- valueExtractor: Function,
502
- formatter: {
503
- type: Function,
504
- required: !0
505
- },
506
- subtitleFormatter: Function,
507
- nullTitle: String,
508
- noResultsText: String,
509
- disabled: Boolean,
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
- computed: {
533
- /**
534
- * EFFECTIVE PROPS
535
- */
536
- effectivePrependOptions() {
537
- return this.prependOptions ?? [];
538
- },
539
- effectiveAppendOptions() {
540
- return this.appendOptions ?? [];
541
- },
542
- effectiveDisabled() {
543
- return !!this.disabled;
544
- },
545
- effectivePlaceholder() {
546
- return !this.isLoaded && this.preload ? "Loading..." : this.nullTitle ? this.nullTitle : this.placeholder || "";
547
- },
548
- effectiveNoResultsText() {
549
- return this.noResultsText || "No options match your search.";
550
- },
551
- effectiveKeyExtractor() {
552
- return this.keyExtractor ?? this.valueExtractor;
553
- },
554
- /**
555
- * OPTIONS GENERATION
556
- */
557
- allOptions() {
558
- return [...this.effectivePrependOptions, ...this.loadedOptions, ...this.effectiveAppendOptions];
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
- ...i,
587
- title: i.title.replace(s, "<mark>$1</mark>"),
588
- subtitle: (o = i.subtitle) == null ? void 0 : o.replace(s, "<mark>$1</mark>")
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
- }), this.shouldShowCreateOption && (e.find((o) => o.searchContent === t) !== void 0 || e.push({
591
- key: fe,
592
- title: "Create <strong>" + this.searchText.trim() + "</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 this.nullTitle && e.unshift({
596
- key: A,
597
- title: this.nullTitle
545
+ } else l.nullTitle && s.unshift({
546
+ key: o,
547
+ title: l.nullTitle
598
548
  });
599
- return e;
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
- watch: {
603
- // props
604
- modelValue() {
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
- async mounted() {
626
- 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", () => {
627
- this.selectedOption !== this.modelValue && this.$emit(
628
- "update:modelValue",
629
- this.selectedOption && this.valueExtractor ? this.valueExtractor(this.selectedOption) : this.selectedOption
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 (!(e.key == "ArrowLeft" || e.key == "ArrowRight") && e.key != "Tab") {
651
- if (!this.isLoaded) {
652
- this.isSearching || e.preventDefault();
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 (e.key == "ArrowUp" || e.key == "ArrowDown")
656
- return e.preventDefault(), this.incrementHighlightedOption(e.key == "ArrowUp" ? -1 : 1);
657
- if (e.key == "PageUp" || e.key == "PageDown")
658
- return e.preventDefault(), this.incrementHighlightedOption(e.key == "PageUp" ? -10 : 10);
659
- if (e.key == "Home" || e.key == "End")
660
- return e.preventDefault(), this.incrementHighlightedOption(e.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
661
- if (e.key == "Enter") {
662
- e.preventDefault();
663
- const t = this.effectiveOptions.find((n) => n.key == this.highlightedOptionKey);
664
- if (t) return this.selectOption(t);
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 (e.key === "Delete" || e.key === "Backspace") {
667
- this.searchText.length > 1 && (this.isSearching = !0);
605
+ if (s.key === "Delete" || s.key === "Backspace") {
606
+ a.value.length > 1 && (f.value = !0);
668
607
  return;
669
608
  }
670
- !e.metaKey && Bt.includes(e.key) && (this.isSearching = !0);
609
+ !s.metaKey && wn.includes(s.key) && (f.value = !0);
671
610
  }
672
- },
673
- handleInputFocused() {
674
- this.setHighlightedOptionKey(), this.shouldDisplayOptions = !0;
675
- },
676
- setHighlightedOptionKey(e) {
677
- var t;
678
- this.selectedOption ? this.highlightedOptionKey = this.getOptionKey(this.selectedOption) : e ? this.highlightedOptionKey = ((t = this.effectiveOptions) == null ? void 0 : t[0].key) ?? A : this.nullTitle && (this.highlightedOptionKey = A);
679
- },
680
- getOptionKey(e) {
681
- var t;
682
- return this.effectiveKeyExtractor ? this.effectiveKeyExtractor(this.selectedOption) : ((t = this.getOptionDescriptor(e)) == null ? void 0 : t.key) ?? "";
683
- },
684
- getOptionDescriptor(e) {
685
- const t = this.effectiveOptions.find((i) => i.ref === e);
686
- if (t)
687
- return t;
688
- const n = this.keyExtractor ? (i, o) => this.keyExtractor(i) === this.keyExtractor(o) : Le, s = this.effectiveOptions.find((i) => n(i.ref, e));
689
- return s || null;
690
- },
691
- handleInputBlurred() {
692
- this.debug || (!this.searchText.length && this.nullTitle && (this.selectedOption = null, this.selectedOptionTitle = null), this.shouldDisplayOptions = !1);
693
- },
694
- handleOptionsDisplayed() {
695
- this.isLoaded || this.loadRemoteOptions(), this.optionsListId && this.$refs.optionsContainer.setAttribute("id", this.optionsListId), this.teleportOptionsContainer();
696
- },
697
- teleportOptionsContainer() {
698
- const e = this.$el.getBoundingClientRect(), t = e.y + e.height + 2, n = e.x, s = this.$refs.optionsContainer, i = window.getComputedStyle(this.$el);
699
- for (let o in i)
700
- /^(font|text)/.test(o) && (s.style[o] = i[o]);
701
- if (s.style.top = t + "px", s.style.left = n + "px", s.style.minWidth = e.width + "px", !i.maxHeight || i.maxHeight == "none") {
702
- const o = window.innerHeight - t - 12;
703
- s.style.maxHeight = o + "px";
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
- s.style.visibility = "visible", document.body.appendChild(s), setTimeout(this.highlightInitialOption, 0);
706
- },
707
- highlightInitialOption() {
708
- if (!this.isLoaded || !this.highlightedOptionKey) return;
709
- const e = this.effectiveOptions.findIndex((s) => s.key == this.highlightedOptionKey), t = this.$refs.optionsContainer, n = t.querySelectorAll(".option")[e];
710
- t.scrollTop = n.offsetTop;
711
- },
712
- handleOptionHover(e) {
713
- this.highlightedOptionKey = e ? e.key : null;
714
- },
715
- incrementHighlightedOption(e) {
716
- const t = this.effectiveOptions.findIndex((o) => o.key == this.highlightedOptionKey);
717
- let n = t + e;
718
- if (n < 0 ? n = 0 : n >= this.effectiveOptions.length && (n = this.effectiveOptions.length - 1), t == n) return;
719
- this.highlightedOptionKey = this.effectiveOptions[n].key;
720
- const s = this.$refs.optionsContainer, i = s.querySelectorAll(".option")[n];
721
- i.offsetTop < s.scrollTop ? s.scrollTop = i.offsetTop : i.offsetTop + i.offsetHeight > s.scrollTop + s.clientHeight && (s.scrollTop = i.offsetTop + i.offsetHeight - s.clientHeight);
722
- },
723
- selectOption(e) {
724
- var t;
725
- if (this.isSearching = !1, e.key == A)
726
- this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null;
727
- else if (e.key === fe) {
728
- const n = this.searchText.trim();
729
- this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null, (t = this.onCreateItem) == null || t.call(this, n);
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 s = this.optionsDescriptors.find((i) => i.key == e.key).ref;
732
- this.selectedOption = s, this.selectedOptionTitle = this.formatter(s), this.searchText = this.selectedOptionTitle || "";
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
- this.$refs.searchField.blur();
735
- },
736
- handleValueChanged() {
737
- 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 = "");
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
- }, Ft = ["placeholder", "required"], Rt = {
744
- key: 0,
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, s = N(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: r })) : Object.entries(n.options).map(([r, a]) => ({
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: a
813
- }))), i = N(() => n.formatter ? (r) => {
814
- var a;
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
- l.value = s.value.find((a) => a.value === r) ?? null;
753
+ c.value = o.value.find((d) => d.value === r) ?? null;
821
754
  }
822
- ), ue(l, (r) => {
823
- var a;
824
- o("update:modelValue", r ? ((a = s.value.find((p) => Le(p, r))) == null ? void 0 : a.value) ?? null : null);
825
- }), (r, a) => (d(), ke(Pt, {
826
- modelValue: l.value,
827
- "onUpdate:modelValue": a[0] || (a[0] = (p) => l.value = p),
828
- options: s.value,
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
- }), qt = { class: "content" }, zt = { class: "message" }, Xt = {
767
+ }), bn = { class: "content" }, Tn = { class: "message" }, Sn = {
834
768
  key: 0,
835
769
  class: "close"
836
- }, Yt = {
770
+ }, Cn = {
837
771
  key: 0,
838
772
  class: "progress-bar"
839
- }, Zt = /* @__PURE__ */ L({
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 s = O();
855
- return t.durationSecs !== null && M(() => {
856
- var o;
788
+ const o = T();
789
+ return t.durationSecs !== null && $(() => {
790
+ var l;
857
791
  const i = t.durationSecs ?? 5;
858
- (o = s.value) == null || o.animate([{ width: "0%" }, { width: "100%" }], {
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, o) => (d(), h("div", {
863
- class: k(["vf-toast", i.className]),
864
- onClick: se(n, ["stop"])
796
+ }), (i, l) => (w(), b("div", {
797
+ class: B(["vf-toast", i.className]),
798
+ onClick: ye(n, ["stop"])
865
799
  }, [
866
- T("div", qt, [
867
- T("div", zt, x(i.message), 1),
868
- i.disableClose ? b("", !0) : (d(), h("div", Xt, "x"))
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 ? (d(), h("div", Yt, [
871
- T("div", {
804
+ i.durationSecs !== null ? (w(), b("div", Cn, [
805
+ O("div", {
872
806
  ref_key: "progressInnerEl",
873
- ref: s,
807
+ ref: o,
874
808
  class: "inner"
875
809
  }, null, 512)
876
- ])) : b("", !0)
810
+ ])) : D("", !0)
877
811
  ], 2));
878
812
  }
879
813
  });
880
- function Gn(e) {
881
- const t = oe(Zt, {
814
+ function xo(e) {
815
+ const t = Ee(Ln, {
882
816
  ...e,
883
- callback: () => q(t)
817
+ callback: () => ne(t)
884
818
  });
885
- return () => q(t);
819
+ return () => ne(t);
886
820
  }
887
- function Gt(e) {
888
- 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];
889
- return `${s} ${i}`;
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 Qt(e) {
825
+ function Mn(e) {
892
826
  return e != null && String(e).length ? e : "-";
893
827
  }
894
- function Jt(e) {
828
+ function In(e) {
895
829
  return e || "-";
896
830
  }
897
- function en(e) {
898
- return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : cn(Number(e));
831
+ function Hn(e) {
832
+ return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : _n(Number(e));
899
833
  }
900
- function tn(e) {
901
- return e && At(e);
834
+ function An(e) {
835
+ return e && fn(e);
902
836
  }
903
- function nn(e) {
904
- return e ? Je(e) : null;
837
+ function Fn(e) {
838
+ return e ? Ot(e) : null;
905
839
  }
906
- function sn(e) {
907
- return e ? et(e) : null;
840
+ function On(e) {
841
+ return e ? Dt(e) : null;
908
842
  }
909
- function on(e) {
843
+ function Dn(e) {
910
844
  return e ? e.toUpperCase() : null;
911
845
  }
912
- function rn(e) {
913
- return e ? Dt(e) : null;
914
- }
915
- function ln(e, t = 1) {
916
- return $t(e, t);
917
- }
918
- const pe = {
919
- bytes: Gt,
920
- dash: Qt,
921
- dashZeros: Jt,
922
- number: en,
923
- phone: tn,
924
- upperFirst: nn,
925
- startCase: sn,
926
- upperCase: on,
927
- desnake: rn,
928
- usCurrency: ln
929
- }, Qn = (e) => ({
930
- ...pe,
931
- ...e(pe)
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 Jn(e, t, n) {
934
- const s = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
935
- return s === -1 ? !1 : (e.splice(s, 1, n), !0);
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 es(e, t) {
871
+ function Ho(e, t) {
938
872
  const n = document.createElement("div");
939
- n.classList.add("vf-overlay"), n.addEventListener("click", m), document.body.appendChild(n);
940
- const s = document.createElement("div");
941
- s.classList.add("vf-context-menu"), s.style.position = "absolute", n.appendChild(s);
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 && s.classList.add(t.class), t.items.forEach((f) => {
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 c = document.createElement("div");
946
- c.classList.add("separator"), s.appendChild(c);
879
+ const u = document.createElement("div");
880
+ u.classList.add("separator"), o.appendChild(u);
947
881
  return;
948
882
  }
949
- const u = document.createElement("div");
950
- u.classList.add("item"), u.style.userSelect = "none", u.innerText = f.title, s.appendChild(u), f.class && u.classList.add(f.class), f.shouldConfirm ? u.addEventListener("click", (c) => v(c, u, f.handler)) : u.addEventListener("click", () => f.handler());
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 o = window.innerWidth - e.clientX, l = window.innerHeight - e.clientY, r = s.offsetHeight, a = s.offsetWidth, p = o < a ? e.clientX - a - 1 : e.clientX + 1, g = l < r ? e.clientY - r - 1 : e.clientY + 1;
953
- s.style.left = p + "px", s.style.top = g + "px", setTimeout(() => {
954
- s.style.width = s.offsetWidth + "px";
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 m() {
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 v(f, u, c) {
960
- if (u.classList.contains("pending-confirm"))
961
- return c();
962
- const w = u.innerHTML;
963
- u.classList.add("pending-confirm"), u.innerText = "Confirm";
964
- const H = () => {
965
- u.classList.remove("pending-confirm"), u.innerHTML = w, u.removeEventListener("mouseleave", H);
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
- u.addEventListener("mouseleave", H), f.stopPropagation();
901
+ a.addEventListener("mouseleave", I), f.stopPropagation();
968
902
  }
969
903
  }
970
- const an = (e) => new Promise((t) => setTimeout(t, e)), ts = (e) => an(e * 1e3);
971
- function cn(e) {
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 ns(e, t) {
975
- return e != null ? tt(e) : t;
908
+ function Fo(e, t) {
909
+ return e != null ? Bt(e) : t;
976
910
  }
977
- function ss(e, t) {
911
+ function Oo(e, t) {
978
912
  const n = { ...e };
979
- for (const s of t)
980
- n[s] === "" && (n[s] = null);
913
+ for (const o of t)
914
+ n[o] === "" && (n[o] = null);
981
915
  return n;
982
916
  }
983
- function is(e) {
984
- ot({
917
+ function Do(e) {
918
+ Nt({
985
919
  ...e,
986
920
  onError(t, n) {
987
921
  var i;
988
- rt(t) && t.status === 422 && typeof t.body == "object" && "error" in t.body && (t = new X(t.body.error));
989
- const s = (i = e.onError) == null ? void 0 : i.call(e, t, n);
990
- return s !== void 0 ? s : t;
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 ae = Symbol("HookState");
995
- function os(e, t) {
996
- const n = t ?? ne();
997
- M(() => dn(n, e), n), Se(() => un(n), n), Ce(() => me(n), n), ie(() => me(n), n);
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 dn(e, t) {
933
+ function Nn(e, t) {
1000
934
  const n = {};
1001
- if (t.elScrolledToBottom && (n.el = new F(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
1002
- const s = Ae(e.vnode.el);
1003
- s ? n.ancestor = new F(s, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
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 F(window, t.windowScrolledToBottom)), e[ae] = n;
939
+ t.windowScrolledToBottom && (n.window = new K(window, t.windowScrolledToBottom)), e[be] = n;
1006
940
  }
1007
- function un(e) {
1008
- var n, s, i;
1009
- const t = e[ae];
1010
- (n = t == null ? void 0 : t.el) == null || n.install(), (s = t == null ? void 0 : t.ancestor) == null || s.install(), (i = t == null ? void 0 : t.window) == null || i.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 me(e) {
1013
- var n, s, i;
1014
- const t = e[ae];
1015
- (n = t == null ? void 0 : t.el) == null || n.uninstall(), (s = t == null ? void 0 : t.ancestor) == null || s.uninstall(), (i = t == null ? void 0 : t.window) == null || i.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 Q = ["auto", "scroll"];
1018
- function Ae(e) {
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 Q.includes(n.overflow) || Q.includes(n.overflowX) || Q.includes(n.overflowY) ? t : Ae(t);
956
+ return fe.includes(n.overflow) || fe.includes(n.overflowX) || fe.includes(n.overflowY) ? t : Je(t);
1023
957
  }
1024
- class F {
958
+ class K {
1025
959
  constructor(t, n) {
1026
- E(this, "isTripped", !1);
1027
- E(this, "onScrollWithContext", this.onScroll.bind(this));
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 rs(e) {
1041
- M(() => window.addEventListener("resize", e)), Se(() => window.addEventListener("resize", e)), Ce(() => window.removeEventListener("resize", e)), ie(() => window.removeEventListener("resize", e));
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 hn = {
1044
- mounted: ye,
1045
- updated: ye
1046
- }, ve = Symbol("HasAutoFocused");
1047
- function ye(e, t) {
1048
- if (t.value === void 0 && e[ve] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
1049
- e[ve] = !0;
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 fn = {
1054
- mounted: pn
1055
- }, $ = Symbol("ConfirmState");
1056
- function pn(e, t) {
987
+ const Un = {
988
+ mounted: jn
989
+ }, P = Symbol("ConfirmState");
990
+ function jn(e, t) {
1057
991
  e.addEventListener("click", (n) => {
1058
- var l, r;
1059
- const s = Date.now(), i = ((l = t.value) == null ? void 0 : l.text) !== void 0 ? t.value.text : "Confirm";
1060
- if (e[$]) {
1061
- if (s - e[$].initTime < 300)
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[$].resetHandler(), e.dispatchEvent(new Event("confirm"));
997
+ e[P].resetHandler(), e.dispatchEvent(new Event("confirm"));
1064
998
  return;
1065
999
  }
1066
1000
  n.preventDefault(), n.stopImmediatePropagation();
1067
- const o = {
1068
- initTime: s,
1001
+ const l = {
1002
+ initTime: o,
1069
1003
  preconfirmHtml: e.innerHTML,
1070
1004
  resetHandler: () => {
1071
- var a;
1072
- i && (e.innerHTML = o.preconfirmHtml), (a = t.value) != null && a.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", o.resetHandler), delete e[$];
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[$] = o, i && (e.innerHTML = i), (r = t.value) != null && r.class && e.classList.add(t.value.class), e.addEventListener("mouseout", o.resetHandler);
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 mn = {
1079
- beforeMount: vn
1012
+ const Pn = {
1013
+ beforeMount: qn
1080
1014
  };
1081
- function vn(e) {
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 += "/" + J(/* @__PURE__ */ new Date(), "yy"));
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 = J(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
1020
+ isNaN(n) ? e.value = "" : e.value = ve(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
1087
1021
  });
1088
1022
  }
1089
- const yn = {
1090
- beforeMount: ge,
1091
- updated: ge
1023
+ const zn = {
1024
+ beforeMount: Re,
1025
+ updated: Re
1092
1026
  };
1093
- function ge(e, t) {
1094
- t.value == t.oldValue && e.innerHTML.length || (e.innerText = gn(e, t));
1027
+ function Re(e, t) {
1028
+ t.value == t.oldValue && e.innerHTML.length || (e.innerText = Kn(e, t));
1095
1029
  }
1096
- function gn(e, t) {
1097
- var a, p;
1030
+ function Kn(e, t) {
1031
+ var d, h;
1098
1032
  if (!t.value)
1099
- return ((a = e.attributes.getNamedItem("placeholder")) == null ? void 0 : a.value) ?? "";
1033
+ return ((d = e.attributes.getNamedItem("placeholder")) == null ? void 0 : d.value) ?? "";
1100
1034
  let n = "";
1101
- const s = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), i = e.attributes.getNamedItem("local") !== null ? s.replace(/Z$/, "") : s.replace(/(Z|\+00:00)?$/, "Z"), o = new Date(i);
1102
- e.attributes.getNamedItem("display-utc") !== null && o.setMinutes(o.getMinutes() - o.getTimezoneOffset());
1103
- let l = (p = e.attributes.getNamedItem("format")) == null ? void 0 : p.value;
1104
- if (!l && e.attributes.getNamedItem("relative-date") !== null) {
1105
- const g = /* @__PURE__ */ new Date();
1106
- g.getFullYear() == o.getFullYear() && g.getMonth() == o.getMonth() && g.getDate() == o.getDate() && (n = "at", l = "HH:mm");
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
- l || (e.attributes.getNamedItem("date-only") !== null ? l = I.defaultDateFormat : l = I.defaultDateTimeFormat);
1109
- let r = J(o, l);
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 En = {
1113
- beforeMount: Ee,
1114
- updated: Ee,
1115
- unmounted: wn
1046
+ const Xn = {
1047
+ beforeMount: We,
1048
+ updated: We,
1049
+ unmounted: Yn
1116
1050
  };
1117
- function Ee(e, t) {
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 wn(e) {
1054
+ function Yn(e) {
1121
1055
  e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
1122
1056
  }
1123
- const Tn = {
1124
- beforeMount: we,
1125
- updated: we,
1126
- unmounted: Be
1127
- }, _ = Symbol("HasAutoFocused"), ce = [];
1128
- function On() {
1129
- ce.forEach($e);
1130
- }
1131
- setInterval(On, 1e3);
1132
- function we(e, t) {
1133
- var l;
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 Be(e);
1136
- const n = new Date(t.value), s = (l = e.attributes.getNamedItem("base-time")) == null ? void 0 : l.value, i = n.getTime() - (s ? new Date(s).getTime() - t.value * 1e3 : 0), o = e.getAttribute("no-seconds") === null;
1137
- e[_] || ce.push(e), 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: o
1140
- }, $e(e);
1073
+ includeSeconds: l
1074
+ }, et(e);
1141
1075
  }
1142
- function $e(e) {
1143
- const t = e[_], n = Math.round((Date.now() - t.startTs) / 1e3);
1144
- e.innerText = bn(n, t.includeSeconds);
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 Be(e) {
1147
- e[_] && (nt(ce, e), delete e[_]), e.innerText = "-";
1080
+ function tt(e) {
1081
+ e[Y] && ($t(Te, e), delete e[Y]), e.innerText = "-";
1148
1082
  }
1149
- function bn(e, t) {
1150
- const n = [], s = Math.floor(e / 86400);
1151
- s && n.push(s + "d"), e -= s * 86400;
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
- (s || i) && n.push(i + "h"), e -= i * 3600;
1154
- const o = Math.floor(e / 60);
1155
- return (s || i || o) && n.push(o + "m"), t ? n.length || n.push("0m") : (e -= o * 60, n.push(e + "s")), n.join(" ");
1156
- }
1157
- const kn = {
1158
- mounted: Ve,
1159
- updated: Sn,
1160
- unmounted: Fe
1161
- }, C = /* @__PURE__ */ new Map();
1162
- function Ve(e, t) {
1163
- C.size === 0 && window.addEventListener("keydown", Re), C.set(t.value.toLowerCase(), [...C.get(t.value.toLowerCase()) ?? [], e]);
1164
- }
1165
- function Fe(e, t) {
1166
- const n = C.get(t.value.toLowerCase());
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 s = n.indexOf(e);
1169
- s !== -1 && n.splice(s, 1), n.length === 0 && C.delete(t.value.toLowerCase());
1102
+ const o = n.indexOf(e);
1103
+ o !== -1 && n.splice(o, 1), n.length === 0 && N.delete(t.value.toLowerCase());
1170
1104
  }
1171
- C.size === 0 && window.removeEventListener("keydown", Re);
1105
+ N.size === 0 && window.removeEventListener("keydown", lt);
1172
1106
  }
1173
- function Sn(e, t) {
1174
- Fe(e, t), Ve(e, t);
1107
+ function eo(e, t) {
1108
+ ot(e, t), nt(e, t);
1175
1109
  }
1176
- function Re(e) {
1110
+ function lt(e) {
1177
1111
  if (typeof e.key != "string") return;
1178
- const t = e.key.toLowerCase(), n = C.get(t);
1112
+ const t = e.key.toLowerCase(), n = N.get(t);
1179
1113
  if (n) {
1180
- const s = st(n);
1181
- s == null || s.click(), e.preventDefault();
1114
+ const o = Vt(n);
1115
+ o == null || o.click(), e.preventDefault();
1182
1116
  }
1183
1117
  }
1184
- const B = Symbol("InfiniteScrollHandler"), Cn = {
1118
+ const q = Symbol("InfiniteScrollHandler"), to = {
1185
1119
  mounted(e, t) {
1186
- e[B] = new F(e, t.value);
1120
+ e[q] = new K(e, t.value);
1187
1121
  },
1188
1122
  updated(e, t) {
1189
1123
  var n;
1190
- (n = e[B]) == null || n.uninstall(), e[B] = new F(e, t.value);
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[B]) == null || t.uninstall(), delete e[B];
1128
+ (t = e[q]) == null || t.uninstall(), delete e[q];
1195
1129
  }
1196
- }, Ln = {
1197
- beforeMount: Te,
1198
- updated: Te
1130
+ }, no = {
1131
+ beforeMount: je,
1132
+ updated: je
1199
1133
  };
1200
- function Te(e, t) {
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 xn = {
1204
- mounted: Oe,
1205
- updated: Oe,
1206
- unmounted: Ne
1207
- }, R = Symbol("TooltipState");
1208
- function Oe(e, t) {
1209
- var s;
1210
- let n = ((s = e.attributes.getNamedItem("tip")) == null ? void 0 : s.value) ?? t.value;
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[R] ? e[R].configure(i) : e[R] = new Mn(e, i);
1150
+ e[X] ? e[X].configure(i) : e[X] = new lo(e, i);
1217
1151
  } else
1218
- Ne(e);
1152
+ st(e);
1219
1153
  }
1220
- function Ne(e) {
1154
+ function st(e) {
1221
1155
  var t;
1222
- (t = e[R]) == null || t.destroy(), delete e[R];
1156
+ (t = e[X]) == null || t.destroy(), delete e[X];
1223
1157
  }
1224
- class Mn {
1158
+ class lo {
1225
1159
  constructor(t, n) {
1226
- E(this, "lastMoveEvt");
1227
- E(this, "checkInterval");
1228
- E(this, "shouldShow", !1);
1229
- E(this, "tipEl");
1230
- E(this, "titleEl");
1231
- E(this, "contentEl");
1232
- E(this, "mouseMoveBound", !1);
1233
- E(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
1234
- E(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
1235
- E(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
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, s = this.tipEl.offsetHeight, i = window.innerWidth, o = window.innerHeight;
1261
- let l = t.pageX + 10, r = t.pageY + 20;
1262
- l + n > i && (l = t.pageX - 5 - n), r + s > o && (r = t.pageY - 5 - s), this.tipEl.style.left = l + "px", this.tipEl.style.top = r + "px", this.lastMoveEvt = t;
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 In(e) {
1273
- e.directive("autofocus", hn), e.directive("confirm-button", fn), e.directive("date-input", mn), e.directive("datetime", yn), e.directive("disabled", En), e.directive("duration", Tn), e.directive("hotkey", kn), e.directive("infinite-scroll", Cn), e.directive("readonly", Ln), e.directive("tooltip", xn);
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 ls(e) {
1276
- In(e);
1209
+ function Vo(e) {
1210
+ so(e);
1277
1211
  }
1278
1212
  export {
1279
- Rn as OverlayContainer,
1280
- X as UserError,
1281
- Fn as VfAjaxSelect,
1282
- Y as VfAlertModal,
1283
- Zn as VfEzSmartSelect,
1284
- kt as VfModal,
1285
- Pt as VfSmartSelect,
1286
- ns as cloneProp,
1287
- Wn as configureVf,
1288
- Qn as createFilters,
1289
- oe as createOverlayInjection,
1290
- Dt as desnakeCase,
1291
- mt as dismissOverlayInjectionById,
1292
- Nn as dismissOverlayInjectionByInstance,
1293
- Me as dismissOverlayInjectionByInternalInstance,
1294
- pt as dismissOverlayInjectionByVnode,
1295
- ds as escapeHtml,
1296
- yt as formatError,
1297
- cn as formatNumber,
1298
- At as formatPhone,
1299
- $t as formatUSCurrency,
1300
- Pn as handleError,
1301
- Un as handleErrorAndAlert,
1302
- is as installApiClientInterceptors,
1303
- ls as installVf,
1304
- qn as maskComponent,
1305
- gt as maskEl,
1306
- Et as maskForm,
1307
- Xn as nl2br,
1308
- ss as nullifyEmptyInputs,
1309
- re as presentOverlay,
1310
- q as removeOverlayInjection,
1311
- Jn as replaceElement,
1312
- vt as showAlert,
1313
- _n as showConfirm,
1314
- Kn as showConfirmDestroy,
1315
- es as showContextMenu,
1316
- Gn as showToast,
1317
- jn as showWait,
1318
- an as sleep,
1319
- ts as sleepSecs,
1320
- le as toError,
1321
- zn as unmaskComponent,
1322
- Ie as unmaskEl,
1323
- He as unmaskForm,
1324
- os as useInfiniteScroll,
1325
- rs as useResizeWatcher,
1326
- Yn as uuid
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
  };