@vc-shell/framework 2.5.0-pr318.ac8415b → 2.5.0-pr319.1b94321
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-agent/index.js +3 -3
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-Cfv6Pk05.js +1363 -0
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-Cfv6Pk05.js.map +1 -0
- package/dist/chunks/{VcAiAgentPanel.vue_vue_type_style_index_0_lang-CZdY18Hq.js → VcAiAgentPanel.vue_vue_type_style_index_0_lang-0llGMIi1.js} +74 -68
- package/dist/chunks/{VcAiAgentPanel.vue_vue_type_style_index_0_lang-CZdY18Hq.js.map → VcAiAgentPanel.vue_vue_type_style_index_0_lang-0llGMIi1.js.map} +1 -1
- package/dist/chunks/{VcScheduler.vue_vue_type_script_setup_true_lang-BmlVL_rn.js → VcScheduler.vue_vue_type_script_setup_true_lang-DbDPPJ_9.js} +5903 -6544
- package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-DbDPPJ_9.js.map +1 -0
- package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-CwXsJo6H.js +4828 -0
- package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-CwXsJo6H.js.map +1 -0
- package/dist/chunks/{dashboard-feed-row.vue_vue_type_script_setup_true_lang-BCsJG_hk.js → dashboard-feed-row.vue_vue_type_script_setup_true_lang-DIV6xL6V.js} +43 -43
- package/dist/chunks/{dashboard-feed-row.vue_vue_type_script_setup_true_lang-BCsJG_hk.js.map → dashboard-feed-row.vue_vue_type_script_setup_true_lang-DIV6xL6V.js.map} +1 -1
- package/dist/chunks/{index-B7RhGTNx.js → index-rImb-nAa.js} +2 -2
- package/dist/chunks/{index-B7RhGTNx.js.map → index-rImb-nAa.js.map} +1 -1
- package/dist/core/blade-navigation/types/index.d.ts +17 -0
- package/dist/core/blade-navigation/types/index.d.ts.map +1 -1
- package/dist/core/blade-navigation/utils/urlSync.d.ts +28 -2
- package/dist/core/blade-navigation/utils/urlSync.d.ts.map +1 -1
- package/dist/core/composables/index.d.ts +0 -1
- package/dist/core/composables/index.d.ts.map +1 -1
- package/dist/core/composables/useBlade/index.d.ts.map +1 -1
- package/dist/core/composables/useBladeNavigationAdapter/index.d.ts.map +1 -1
- package/dist/core/composables/useSidebarState/_internal.d.ts +37 -0
- package/dist/core/composables/useSidebarState/_internal.d.ts.map +1 -0
- package/dist/core/composables/useSidebarState/index.d.ts +4 -27
- package/dist/core/composables/useSidebarState/index.d.ts.map +1 -1
- package/dist/core/composables/useToolbar/index.d.ts +8 -0
- package/dist/core/composables/useToolbar/index.d.ts.map +1 -1
- package/dist/core/services/index.d.ts +0 -1
- package/dist/core/services/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/framework.js +1184 -1182
- package/dist/framework.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/shell/_internal/blade-navigation/components/vc-blade-navigation/vc-blade-navigation-new.vue.d.ts.map +1 -1
- package/dist/shell/_internal/blade-navigation/plugin-v2.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/organisms/vc-data-table/VcDataTable.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/components/VcColumn.vue.d.ts +2 -1
- package/dist/ui/components/organisms/vc-data-table/components/VcColumn.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/components/cells/DynamicCellRenderer.vue.d.ts +30 -6
- package/dist/ui/components/organisms/vc-data-table/components/cells/DynamicCellRenderer.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/composables/builtinCells.d.ts +12 -0
- package/dist/ui/components/organisms/vc-data-table/composables/builtinCells.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-data-table/composables/useCellRegistry.d.ts +10 -4
- package/dist/ui/components/organisms/vc-data-table/composables/useCellRegistry.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/composables/useDataTableOrchestrator.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/index.d.ts +2 -0
- package/dist/ui/components/organisms/vc-data-table/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/keys.d.ts +0 -10
- package/dist/ui/components/organisms/vc-data-table/keys.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/types.d.ts +7 -2
- package/dist/ui/components/organisms/vc-data-table/types.d.ts.map +1 -1
- package/dist/ui/index.js +153 -150
- package/package.json +4 -4
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-9mBLzIi1.js +0 -1402
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-9mBLzIi1.js.map +0 -1
- package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-BmlVL_rn.js.map +0 -1
- package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BTg4PjTB.js +0 -4125
- package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BTg4PjTB.js.map +0 -1
- package/dist/core/composables/useMenuExpanded/index.d.ts +0 -9
- package/dist/core/composables/useMenuExpanded/index.d.ts.map +0 -1
- package/dist/core/services/global-search-service/index.d.ts +0 -10
- package/dist/core/services/global-search-service/index.d.ts.map +0 -1
|
@@ -0,0 +1,4828 @@
|
|
|
1
|
+
import { mergeProps as ne, computed as $, toValue as ge, inject as G, useId as an, ref as S, onBeforeUnmount as lt, reactive as Ye, provide as $t, getCurrentScope as ln, onScopeDispose as on, getCurrentInstance as qe, onErrorCaptured as rn, nextTick as he, defineComponent as V, watch as Y, unref as r, openBlock as v, createElementBlock as b, normalizeClass as j, createBlock as N, createCommentVNode as w, renderSlot as C, createElementVNode as L, toDisplayString as T, Fragment as we, renderList as ot, normalizeStyle as Re, resolveDynamicComponent as it, withCtx as O, withKeys as Z, withModifiers as H, createVNode as x, watchEffect as Qe, shallowReactive as _e, markRaw as et, createSlots as ie, createTextVNode as Q, Transition as Ae, withDirectives as rt, vModelText as sn, useAttrs as wt, vModelDynamic as un, onMounted as Ue, onUnmounted as Ot, Teleport as cn, normalizeProps as xe, guardReactiveProps as Te } from "vue";
|
|
2
|
+
import { c as de, ai as dn, O as fn, v as vn, r as gn, o as mn, I as pn, q as bn, p as yn, B as Et, b as hn, i as kn, _ as U, T as Lt, a as Bt, V as In, w as Sn, u as $n } from "./VcAiAgentPanel.vue_vue_type_style_index_0_lang-0llGMIi1.js";
|
|
3
|
+
import { defineRule as Oe, Field as wn } from "vee-validate";
|
|
4
|
+
import { a as bt } from "./vendor-vee-validate-rules-4oWUZPpG.js";
|
|
5
|
+
import { a as Ct, s as On, c as En, b as Je, e as Me } from "./vendor-lodash-es-D2n90GJy.js";
|
|
6
|
+
import { X as Ln } from "./vendor-microsoft-applicationinsights-core-js-CR3vyuZc.js";
|
|
7
|
+
import { d as xt, e as Bn, f as Cn, g as xn } from "./vendor-vueuse-core-BFa9je5E.js";
|
|
8
|
+
import { c as Tn, u as Ie } from "./vendor-vue-i18n-LO-EJStU.js";
|
|
9
|
+
import { j as Mn } from "./vendor-vueuse-shared-kZH3-Km1.js";
|
|
10
|
+
import { k as Rn } from "./vendor-tiptap-core-CZbeo7XQ.js";
|
|
11
|
+
import "./vendor-tiptap-extension-text-style-Bc6nvmn0.js";
|
|
12
|
+
import { q as An } from "./vendor-vuepic-vue-datepicker-D0bvbIbh.js";
|
|
13
|
+
import { C as Nn, u as Dn } from "./vendor-vue-currency-input-CckB4kjx.js";
|
|
14
|
+
import { u as Vn } from "./vendor-floating-ui-vue-sCrhit51.js";
|
|
15
|
+
import { f as Tt, s as Mt, o as tt, b as Pn } from "./vendor-floating-ui-dom-BvVXFZ4B.js";
|
|
16
|
+
import { v as Fn } from "./vendor-vueuse-components-CoR2FSn3.js";
|
|
17
|
+
import { p as Rt } from "./vendor-dompurify-DpIUMBYC.js";
|
|
18
|
+
import { S as ye, h as zn, T as qn } from "./vendor-date-fns-C-55OMpS.js";
|
|
19
|
+
import { t as Un } from "./vendor-truncate-html-ChA1T5zy.js";
|
|
20
|
+
const ke = Tn({
|
|
21
|
+
legacy: !1,
|
|
22
|
+
globalInjection: !0,
|
|
23
|
+
locale: "en",
|
|
24
|
+
fallbackLocale: "en",
|
|
25
|
+
formatFallbackMessages: !0
|
|
26
|
+
});
|
|
27
|
+
function nt() {
|
|
28
|
+
return Math.random().toString(36).substring(2, 9);
|
|
29
|
+
}
|
|
30
|
+
class re extends Error {
|
|
31
|
+
constructor(t, n, a) {
|
|
32
|
+
super(t), this.code = n, this.context = a, this.name = "FrameworkError", Error.captureStackTrace && Error.captureStackTrace(this, re);
|
|
33
|
+
}
|
|
34
|
+
toJSON() {
|
|
35
|
+
return {
|
|
36
|
+
name: this.name,
|
|
37
|
+
code: this.code,
|
|
38
|
+
message: this.message,
|
|
39
|
+
context: this.context,
|
|
40
|
+
stack: this.stack
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class Pi extends re {
|
|
45
|
+
constructor(t, n) {
|
|
46
|
+
super(t, "VALIDATION_ERROR", n), this.name = "ValidationError";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
class Fi extends re {
|
|
50
|
+
constructor(t, n) {
|
|
51
|
+
super(t, "SERVICE_ERROR", n), this.name = "ServiceError";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
class Kn extends re {
|
|
55
|
+
constructor(t, n) {
|
|
56
|
+
super(`${t} not provided. Make sure to call the corresponding 'provide' function.`, "INJECTION_ERROR", {
|
|
57
|
+
serviceName: t,
|
|
58
|
+
...n
|
|
59
|
+
}), this.name = "InjectionError";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
class zi extends re {
|
|
63
|
+
constructor(t, n, a) {
|
|
64
|
+
super(`Failed to register '${t}': ${n}`, "REGISTRATION_ERROR", {
|
|
65
|
+
componentName: t,
|
|
66
|
+
...a
|
|
67
|
+
}), this.name = "RegistrationError";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
class qi extends re {
|
|
71
|
+
constructor(t, n, a) {
|
|
72
|
+
super(t, "BLADE_ERROR", {
|
|
73
|
+
bladeId: n,
|
|
74
|
+
...a
|
|
75
|
+
}), this.name = "BladeError";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
class Ui extends re {
|
|
79
|
+
constructor(t, n, a) {
|
|
80
|
+
super(`Failed to load module '${t}': ${n}`, "MODULE_LOAD_ERROR", {
|
|
81
|
+
moduleId: t,
|
|
82
|
+
...a
|
|
83
|
+
}), this.name = "ModuleLoadError";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function Wn(e) {
|
|
87
|
+
return e instanceof re;
|
|
88
|
+
}
|
|
89
|
+
function Ki(e, t = "UNKNOWN_ERROR") {
|
|
90
|
+
return Wn(e) ? e : e instanceof Error ? new re(e.message, t, {
|
|
91
|
+
originalError: e.name,
|
|
92
|
+
stack: e.stack
|
|
93
|
+
}) : new re(String(e), t);
|
|
94
|
+
}
|
|
95
|
+
class me extends Error {
|
|
96
|
+
details;
|
|
97
|
+
originalError;
|
|
98
|
+
constructor(t, n, a) {
|
|
99
|
+
super(t), this.name = "DisplayableError", this.details = n, this.originalError = a;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function jn(e) {
|
|
103
|
+
return e instanceof Error && typeof e.status == "number" && typeof e.response == "string";
|
|
104
|
+
}
|
|
105
|
+
function Pe(e) {
|
|
106
|
+
if (e instanceof me)
|
|
107
|
+
return e;
|
|
108
|
+
if (jn(e)) {
|
|
109
|
+
const { status: t, response: n } = e;
|
|
110
|
+
try {
|
|
111
|
+
return Pe(JSON.parse(n));
|
|
112
|
+
} catch {
|
|
113
|
+
const a = `${t}: ${e.message || "Error"}`;
|
|
114
|
+
return new me(a, n || e.message, e);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (e instanceof Error && "response" in e && e.response)
|
|
118
|
+
return Pe(e.response);
|
|
119
|
+
if (e instanceof Error)
|
|
120
|
+
return new me(e.message, e.stack || String(e), e);
|
|
121
|
+
if (typeof e == "string")
|
|
122
|
+
try {
|
|
123
|
+
const t = JSON.parse(e);
|
|
124
|
+
return Pe(t);
|
|
125
|
+
} catch {
|
|
126
|
+
return new me(e, e, e);
|
|
127
|
+
}
|
|
128
|
+
if (typeof e == "object" && e !== null) {
|
|
129
|
+
const t = e;
|
|
130
|
+
if ("status" in t && "data" in t) {
|
|
131
|
+
const o = t.status, i = t.statusText || "Error", l = `${o}: ${i}`, s = t.data;
|
|
132
|
+
let u = "";
|
|
133
|
+
return s ? typeof s.exceptionMessage == "string" ? u = s.exceptionMessage : typeof s.message == "string" ? u = s.message : Array.isArray(s.errors) ? u = s.errors.join(`
|
|
134
|
+
`) : typeof s == "string" ? u = s : u = JSON.stringify(s, null, 2) : u = JSON.stringify(t, null, 2), new me(l, u, e);
|
|
135
|
+
}
|
|
136
|
+
const n = t.message || "An unexpected error occurred.", a = t.stack || JSON.stringify(t, null, 2);
|
|
137
|
+
return new me(n, a, e);
|
|
138
|
+
}
|
|
139
|
+
return new me("An unknown error occurred.", String(e), e);
|
|
140
|
+
}
|
|
141
|
+
const Hn = [
|
|
142
|
+
["LLLL", "PPPp"],
|
|
143
|
+
["LLL", "PPp"],
|
|
144
|
+
["LTS", "pp"],
|
|
145
|
+
["LT", "p"],
|
|
146
|
+
["LL", "PP"],
|
|
147
|
+
["L", "P"]
|
|
148
|
+
], Gn = [
|
|
149
|
+
[/YYYY/g, "yyyy"],
|
|
150
|
+
[/YY/g, "yy"],
|
|
151
|
+
[/dddd/g, "EEEE"],
|
|
152
|
+
[/ddd/g, "EEE"],
|
|
153
|
+
[/DD/g, "dd"],
|
|
154
|
+
[/Do/g, "do"],
|
|
155
|
+
[/D(?![\w])/g, "d"],
|
|
156
|
+
[/A/g, "a"]
|
|
157
|
+
];
|
|
158
|
+
function Yn(e) {
|
|
159
|
+
let t = e;
|
|
160
|
+
for (const [n, a] of Hn)
|
|
161
|
+
t = t.split(n).join(a);
|
|
162
|
+
for (const [n, a] of Gn)
|
|
163
|
+
t = t.replace(n, a);
|
|
164
|
+
return t;
|
|
165
|
+
}
|
|
166
|
+
const ue = /* @__PURE__ */ new Map();
|
|
167
|
+
ue.set("en-US", ye);
|
|
168
|
+
ue.set("en", ye);
|
|
169
|
+
async function Jn(e) {
|
|
170
|
+
if (ue.has(e))
|
|
171
|
+
return ue.get(e);
|
|
172
|
+
try {
|
|
173
|
+
const t = await import(
|
|
174
|
+
/* @vite-ignore */
|
|
175
|
+
`date-fns/locale/${e}`
|
|
176
|
+
), n = e.replace("-", ""), a = t.default ?? t[n] ?? ye;
|
|
177
|
+
return ue.set(e, a), a;
|
|
178
|
+
} catch {
|
|
179
|
+
const t = e.split("-")[0];
|
|
180
|
+
if (t !== e)
|
|
181
|
+
try {
|
|
182
|
+
const n = await import(
|
|
183
|
+
/* @vite-ignore */
|
|
184
|
+
`date-fns/locale/${t}`
|
|
185
|
+
), a = n.default ?? n[t] ?? ye;
|
|
186
|
+
return ue.set(e, a), a;
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
return ue.set(e, ye), ye;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
function At(e) {
|
|
193
|
+
return ue.has(e) ? ue.get(e) : (Jn(e), ye);
|
|
194
|
+
}
|
|
195
|
+
function Nt(e) {
|
|
196
|
+
if (e == null || e === "") return null;
|
|
197
|
+
if (e instanceof Date) return isNaN(e.getTime()) ? null : e;
|
|
198
|
+
const t = new Date(e);
|
|
199
|
+
return isNaN(t.getTime()) ? null : t;
|
|
200
|
+
}
|
|
201
|
+
function Xn(e, t) {
|
|
202
|
+
const n = Nt(e);
|
|
203
|
+
if (!n) return "";
|
|
204
|
+
const a = t ? At(t) : void 0;
|
|
205
|
+
return qn(n, { addSuffix: !0, locale: a });
|
|
206
|
+
}
|
|
207
|
+
function Zn(e, t, n) {
|
|
208
|
+
const a = Nt(e);
|
|
209
|
+
if (!a) return "";
|
|
210
|
+
const o = Yn(t), i = n ? At(n) : void 0;
|
|
211
|
+
return zn(a, o, { locale: i });
|
|
212
|
+
}
|
|
213
|
+
const Qn = de("color-utils");
|
|
214
|
+
function _n(e) {
|
|
215
|
+
if (!e || typeof e != "string")
|
|
216
|
+
return null;
|
|
217
|
+
try {
|
|
218
|
+
const t = document.createElement("canvas");
|
|
219
|
+
t.width = 1, t.height = 1;
|
|
220
|
+
const n = t.getContext("2d");
|
|
221
|
+
return !n || (n.fillStyle = e.trim(), n.fillStyle === "#000000" && e.trim().toLowerCase() !== "black") ? null : n.fillStyle;
|
|
222
|
+
} catch (t) {
|
|
223
|
+
return Qn.warn("Error converting color name to hex:", t), null;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function ea(e) {
|
|
227
|
+
if (!e || typeof e != "string")
|
|
228
|
+
return !1;
|
|
229
|
+
const t = e.startsWith("#") ? e : `#${e}`;
|
|
230
|
+
return /^#[0-9A-Fa-f]{6}$/.test(t);
|
|
231
|
+
}
|
|
232
|
+
function yt(e) {
|
|
233
|
+
return !e || typeof e != "string" ? "" : e.startsWith("#") ? e : `#${e}`;
|
|
234
|
+
}
|
|
235
|
+
function ta(e, t) {
|
|
236
|
+
if (!e || !t || e.includes(`_${t}`)) return e;
|
|
237
|
+
const n = e.lastIndexOf("/"), a = e.indexOf("?", n), i = (a > -1 ? e.slice(n + 1, a) : e.slice(n + 1)).lastIndexOf(".");
|
|
238
|
+
if (i <= 0)
|
|
239
|
+
return e;
|
|
240
|
+
const l = n + 1 + i, s = e.slice(0, l), u = e.slice(l);
|
|
241
|
+
return `${s}_${t}${u}`;
|
|
242
|
+
}
|
|
243
|
+
function Wi(e) {
|
|
244
|
+
return e <= 64 ? "64x64" : e <= 128 ? "128x128" : e <= 168 ? "168x168" : e <= 216 ? "216x216" : e <= 348 ? "348x348" : "lg";
|
|
245
|
+
}
|
|
246
|
+
function na(e) {
|
|
247
|
+
let t = null;
|
|
248
|
+
return {
|
|
249
|
+
register(n) {
|
|
250
|
+
t = n, e?.(t);
|
|
251
|
+
},
|
|
252
|
+
get() {
|
|
253
|
+
return t;
|
|
254
|
+
},
|
|
255
|
+
reset() {
|
|
256
|
+
t = null, e?.(t);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function ji() {
|
|
261
|
+
const e = /* @__PURE__ */ new Map();
|
|
262
|
+
return {
|
|
263
|
+
register(t, n) {
|
|
264
|
+
e.set(t, n);
|
|
265
|
+
},
|
|
266
|
+
get(t) {
|
|
267
|
+
return e.get(t);
|
|
268
|
+
},
|
|
269
|
+
reset() {
|
|
270
|
+
e.clear();
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
const st = () => {
|
|
275
|
+
const e = dn();
|
|
276
|
+
return {
|
|
277
|
+
user: e.user,
|
|
278
|
+
loading: e.loading,
|
|
279
|
+
isAdministrator: e.isAdministrator,
|
|
280
|
+
isAuthenticated: e.isAuthenticated,
|
|
281
|
+
validateToken: e.validateToken,
|
|
282
|
+
validatePassword: e.validatePassword,
|
|
283
|
+
resetPasswordByToken: e.resetPasswordByToken,
|
|
284
|
+
getLoginType: e.getLoginType,
|
|
285
|
+
loadUser: e.loadUser,
|
|
286
|
+
requestPasswordReset: e.requestPasswordReset,
|
|
287
|
+
changeUserPassword: e.changeUserPassword,
|
|
288
|
+
signIn: e.signIn,
|
|
289
|
+
signOut: e.signOut
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
function aa() {
|
|
293
|
+
const { user: e } = st();
|
|
294
|
+
function t(n) {
|
|
295
|
+
const a = e.value?.permissions ?? [];
|
|
296
|
+
if (!n || Array.isArray(n) && n.length === 0 || e.value?.isAdministrator)
|
|
297
|
+
return !0;
|
|
298
|
+
if (Array.isArray(n))
|
|
299
|
+
return n.some((o) => a.includes(o));
|
|
300
|
+
if (typeof n == "string")
|
|
301
|
+
return a.includes(n);
|
|
302
|
+
throw new Error("Permissions must be a string or an array of strings");
|
|
303
|
+
}
|
|
304
|
+
return {
|
|
305
|
+
hasAccess: t
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
const be = de("notification"), ve = na();
|
|
309
|
+
function la(e) {
|
|
310
|
+
ve.register(e);
|
|
311
|
+
}
|
|
312
|
+
function Ne(e, t) {
|
|
313
|
+
const n = ve.get();
|
|
314
|
+
if (!n) {
|
|
315
|
+
be.debug("Backend not yet registered — notification call ignored.");
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
return t = ne(
|
|
319
|
+
n.defaultOptions,
|
|
320
|
+
t
|
|
321
|
+
), (!t.notificationId || typeof t.notificationId != "string" && typeof t.notificationId != "number") && (t.notificationId = nt()), t = {
|
|
322
|
+
...t,
|
|
323
|
+
content: e
|
|
324
|
+
}, n.appendInstance(t), t.notificationId;
|
|
325
|
+
}
|
|
326
|
+
const se = (e, t) => Ne(e, { ...t, type: "default" });
|
|
327
|
+
se.error = (e, t) => Ne(e, { ...t, type: "error" });
|
|
328
|
+
se.warning = (e, t) => Ne(e, { ...t, type: "warning" });
|
|
329
|
+
se.success = (e, t) => Ne(e, { ...t, type: "success" });
|
|
330
|
+
se.clearAll = () => {
|
|
331
|
+
ve.get()?.actions.clear();
|
|
332
|
+
};
|
|
333
|
+
se.remove = (e) => {
|
|
334
|
+
const t = ve.get();
|
|
335
|
+
t && (e ? t.actions.dismiss(e) : t.actions.clear());
|
|
336
|
+
};
|
|
337
|
+
se.update = (e, t) => {
|
|
338
|
+
const n = ve.get();
|
|
339
|
+
if (!n) return e;
|
|
340
|
+
if (!n.hasNotification(e))
|
|
341
|
+
return be.warn(`Cannot update: notification with ID ${e} not found`), e;
|
|
342
|
+
const a = n.getNotification(String(e));
|
|
343
|
+
if (a)
|
|
344
|
+
if (t.position && t.position !== a.position) {
|
|
345
|
+
const o = {
|
|
346
|
+
...a,
|
|
347
|
+
...t,
|
|
348
|
+
updateId: nt(),
|
|
349
|
+
notificationId: e
|
|
350
|
+
};
|
|
351
|
+
let i;
|
|
352
|
+
if (t.content !== void 0 ? (i = t.content, delete o.content) : a.content && (i = a.content, delete o.content), i)
|
|
353
|
+
return n.actions.remove(e), Ne(i, o);
|
|
354
|
+
} else {
|
|
355
|
+
const o = {
|
|
356
|
+
...t,
|
|
357
|
+
updateId: nt(),
|
|
358
|
+
notificationId: e
|
|
359
|
+
};
|
|
360
|
+
return n.actions.update(o), e;
|
|
361
|
+
}
|
|
362
|
+
return e;
|
|
363
|
+
};
|
|
364
|
+
se.setPosition = (e) => {
|
|
365
|
+
const t = ve.get();
|
|
366
|
+
t && (t.defaultOptions.position = e);
|
|
367
|
+
};
|
|
368
|
+
se.clearPosition = (e) => {
|
|
369
|
+
const t = ve.get();
|
|
370
|
+
if (!t) return;
|
|
371
|
+
t.getAllNotifications().filter((a) => (a.position || t.defaultOptions.position) === e).forEach((a) => {
|
|
372
|
+
a.notificationId && t.actions.dismiss(a.notificationId);
|
|
373
|
+
});
|
|
374
|
+
};
|
|
375
|
+
se.debug = () => {
|
|
376
|
+
const e = ve.get();
|
|
377
|
+
if (!e)
|
|
378
|
+
return be.debug("Backend not registered"), { active: [], defaultOptions: {} };
|
|
379
|
+
Object.entries(e.defaultOptions).forEach(([n, a]) => {
|
|
380
|
+
be.debug(`Default option ${n}: `, a);
|
|
381
|
+
}), Object.entries(e.actions).forEach(([n]) => {
|
|
382
|
+
be.debug(`Available action: ${n}`);
|
|
383
|
+
});
|
|
384
|
+
const t = e.getAllNotifications().reduce((n, a) => {
|
|
385
|
+
const o = a.position || e.defaultOptions.position;
|
|
386
|
+
return n[o] || (n[o] = []), n[o].push({
|
|
387
|
+
id: a.notificationId || "unknown",
|
|
388
|
+
type: a.type,
|
|
389
|
+
content: typeof a.content == "string" ? a.content : "[Component]"
|
|
390
|
+
}), n;
|
|
391
|
+
}, {});
|
|
392
|
+
return Object.entries(t).forEach(([n, a]) => {
|
|
393
|
+
be.debug(`Position ${n}: ${a.length} notifications`), a.forEach((o) => be.debug(` - ${o.id} (${o.type}): ${o.content}`));
|
|
394
|
+
}), {
|
|
395
|
+
active: e.getAllNotifications(),
|
|
396
|
+
defaultOptions: e.defaultOptions
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
const oa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
400
|
+
__proto__: null,
|
|
401
|
+
notification: se,
|
|
402
|
+
setNotificationBackend: la
|
|
403
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
404
|
+
function ia(e, t, n = {}) {
|
|
405
|
+
const a = $(() => ge(n.placement) ?? "bottom"), o = $(() => ge(n.strategy) ?? "absolute"), i = $(() => {
|
|
406
|
+
const u = ge(n.middleware);
|
|
407
|
+
if (u?.length)
|
|
408
|
+
return u;
|
|
409
|
+
const f = [];
|
|
410
|
+
ge(n.enableFlip) !== !1 && f.push(Tt({ padding: n.shiftPadding ?? 8 })), ge(n.enableShift) !== !1 && f.push(Mt({ padding: n.shiftPadding ?? 8 }));
|
|
411
|
+
const m = ge(n.offset);
|
|
412
|
+
return typeof m == "number" ? f.push(tt(m)) : f.push(
|
|
413
|
+
tt({
|
|
414
|
+
mainAxis: m?.mainAxis ?? 0,
|
|
415
|
+
crossAxis: m?.crossAxis ?? 0,
|
|
416
|
+
alignmentAxis: m?.alignmentAxis
|
|
417
|
+
})
|
|
418
|
+
), f;
|
|
419
|
+
}), l = Vn(e, t, {
|
|
420
|
+
placement: a,
|
|
421
|
+
strategy: o,
|
|
422
|
+
whileElementsMounted: ge(n.autoUpdate) === !1 ? void 0 : Pn,
|
|
423
|
+
middleware: i
|
|
424
|
+
}), s = $(() => ({
|
|
425
|
+
position: o.value,
|
|
426
|
+
top: `${l.y.value ?? 0}px`,
|
|
427
|
+
left: `${l.x.value ?? 0}px`
|
|
428
|
+
}));
|
|
429
|
+
return {
|
|
430
|
+
...l,
|
|
431
|
+
floatingStyle: s,
|
|
432
|
+
resolvedPlacement: a,
|
|
433
|
+
resolvedStrategy: o
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
const ra = Symbol("vc-input-group-context");
|
|
437
|
+
function Ke(e) {
|
|
438
|
+
const t = G(ra, null), n = an(), a = $(() => `vc-field-${n}`), o = $(() => `${a.value}-label`), i = $(() => `${a.value}-error`), l = $(() => `${a.value}-hint`), s = $(() => !!e.error || !!e.errorMessage || !!t?.invalid.value), u = $(() => !!e.disabled || !!t?.disabled.value), f = $(() => t?.name.value || e.name), m = $(() => e.required ? !0 : void 0), g = $(() => {
|
|
439
|
+
const c = /* @__PURE__ */ new Set();
|
|
440
|
+
return t?.describedBy.value && t.describedBy.value.split(/\s+/).forEach((d) => c.add(d)), e.errorMessage && c.add(i.value), e.hint && c.add(l.value), c.size ? Array.from(c).join(" ") : void 0;
|
|
441
|
+
});
|
|
442
|
+
return {
|
|
443
|
+
fieldId: a,
|
|
444
|
+
labelId: o,
|
|
445
|
+
errorId: i,
|
|
446
|
+
hintId: l,
|
|
447
|
+
invalid: s,
|
|
448
|
+
resolvedDisabled: u,
|
|
449
|
+
resolvedName: f,
|
|
450
|
+
ariaRequired: m,
|
|
451
|
+
ariaDescribedBy: g,
|
|
452
|
+
groupContext: t
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
function sa(e, t = {}) {
|
|
456
|
+
const { speed: n = 2 } = t, a = S(!1), o = S(!1);
|
|
457
|
+
let i = null;
|
|
458
|
+
function l() {
|
|
459
|
+
const f = e.value;
|
|
460
|
+
if (!f) {
|
|
461
|
+
a.value = !1, o.value = !1;
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
a.value = f.scrollTop > 0, o.value = Math.ceil(f.scrollTop) < f.scrollHeight - f.clientHeight;
|
|
465
|
+
}
|
|
466
|
+
function s(f) {
|
|
467
|
+
u();
|
|
468
|
+
const m = e.value;
|
|
469
|
+
if (!m) return;
|
|
470
|
+
function g() {
|
|
471
|
+
m && (m.scrollTop += f === "up" ? -n : n, l(), i = requestAnimationFrame(g));
|
|
472
|
+
}
|
|
473
|
+
i = requestAnimationFrame(g);
|
|
474
|
+
}
|
|
475
|
+
function u() {
|
|
476
|
+
i !== null && (cancelAnimationFrame(i), i = null);
|
|
477
|
+
}
|
|
478
|
+
return xt(e, l), lt(() => {
|
|
479
|
+
u();
|
|
480
|
+
}), {
|
|
481
|
+
canScrollUp: a,
|
|
482
|
+
canScrollDown: o,
|
|
483
|
+
startScroll: s,
|
|
484
|
+
stopScroll: u,
|
|
485
|
+
updateScrollState: l
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
function Se() {
|
|
489
|
+
return G(fn, S(!1));
|
|
490
|
+
}
|
|
491
|
+
Object.keys(bt).forEach((e) => {
|
|
492
|
+
Oe(e, bt[e]);
|
|
493
|
+
});
|
|
494
|
+
const ua = (e, [t, n]) => {
|
|
495
|
+
if (!e?.files || !e.files?.length)
|
|
496
|
+
return !0;
|
|
497
|
+
const a = (l, s, u) => {
|
|
498
|
+
const f = window.URL || window.webkitURL;
|
|
499
|
+
return new Promise((m) => {
|
|
500
|
+
const g = new Image(), c = f.createObjectURL(l);
|
|
501
|
+
g.onerror = () => {
|
|
502
|
+
f.revokeObjectURL(c), m(!1);
|
|
503
|
+
}, g.onload = () => {
|
|
504
|
+
f.revokeObjectURL(c);
|
|
505
|
+
const d = g.width >= Number(s) && g.height >= Number(u);
|
|
506
|
+
m(d ? !0 : ke.global.t("messages.min_dimensions.error", { width: s, height: u }));
|
|
507
|
+
}, g.src = c;
|
|
508
|
+
});
|
|
509
|
+
}, o = [], i = e.files;
|
|
510
|
+
for (let l = 0; l < i.length; l++) {
|
|
511
|
+
if (!/\.(jpg|svg|jpeg|png|bmp|gif)$/i.test(i[l].name))
|
|
512
|
+
return Promise.resolve(ke.global.t("messages.min_dimensions.not_image_error"));
|
|
513
|
+
o.push(i[l]);
|
|
514
|
+
}
|
|
515
|
+
return Promise.all(o.map((l) => a(l, t, n))).then((l) => {
|
|
516
|
+
const s = l.find((u) => u !== !0);
|
|
517
|
+
return s === !1 || typeof s == "string" ? s : !0;
|
|
518
|
+
});
|
|
519
|
+
};
|
|
520
|
+
Oe("mindimensions", ua);
|
|
521
|
+
const ca = (e, [t]) => {
|
|
522
|
+
if (!e?.files || !e.files?.length)
|
|
523
|
+
return !0;
|
|
524
|
+
const n = t * 1e3, a = (s) => s.size > n, o = [];
|
|
525
|
+
for (let s = 0; s < e.files.length; s++)
|
|
526
|
+
o.push(e.files[s]);
|
|
527
|
+
return o.map((s) => a(s)).find((s) => s === !0) ? ke.global.t("messages.file_weight", { size: t }) : !0;
|
|
528
|
+
};
|
|
529
|
+
Oe("fileWeight", ca);
|
|
530
|
+
const Dt = (e, [t], n, a) => {
|
|
531
|
+
if (!e || typeof e == "string" && !e.length)
|
|
532
|
+
return !0;
|
|
533
|
+
let o, i;
|
|
534
|
+
return e instanceof Date && (o = e), t instanceof Date && (i = t), typeof e == "string" && (o = new Date(e)), typeof t == "string" && (i = new Date(t)), o?.getTime && o?.getTime() > 0 && i?.getTime && i?.getTime() > 0 && n(i.getTime(), o.getTime()) ? a : !0;
|
|
535
|
+
}, da = (e, [t]) => Dt(e, [t], (n, a) => n < a, ke.global.t("messages.before"));
|
|
536
|
+
Oe("before", da);
|
|
537
|
+
const fa = (e, [t]) => Dt(e, [t], (n, a) => n > a, ke.global.t("messages.after"));
|
|
538
|
+
Oe("after", fa);
|
|
539
|
+
const va = (e) => Number.isSafeInteger(parseInt(e)) ? !0 : ke.global.t("messages.bigint");
|
|
540
|
+
Oe("bigint", va);
|
|
541
|
+
function Ee(e) {
|
|
542
|
+
const t = de(`${e.name}-bus`), n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
543
|
+
function o(c) {
|
|
544
|
+
const d = e.getKey(c);
|
|
545
|
+
n.set(d, c), a.size > 0 && m((y) => {
|
|
546
|
+
try {
|
|
547
|
+
e.registerIntoService(y, c);
|
|
548
|
+
} catch (h) {
|
|
549
|
+
t.warn(`Failed to live-register item (key=${d}):`, h);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
function i(c) {
|
|
554
|
+
n.delete(c), e.unregisterFromService && a.size > 0 && a.forEach((d) => {
|
|
555
|
+
try {
|
|
556
|
+
e.unregisterFromService(d, c);
|
|
557
|
+
} catch (y) {
|
|
558
|
+
t.warn(`Failed to live-unregister item (id=${c}):`, y);
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
function l(c) {
|
|
563
|
+
for (const [d, y] of n)
|
|
564
|
+
c(y) && n.delete(d);
|
|
565
|
+
}
|
|
566
|
+
function s() {
|
|
567
|
+
return Array.from(n.values());
|
|
568
|
+
}
|
|
569
|
+
function u(c) {
|
|
570
|
+
a.add(c), n.forEach((d, y) => {
|
|
571
|
+
try {
|
|
572
|
+
e.registerIntoService(c, d);
|
|
573
|
+
} catch (h) {
|
|
574
|
+
t.warn(`Failed to replay item (key=${y}):`, h);
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
function f(c) {
|
|
579
|
+
a.delete(c);
|
|
580
|
+
}
|
|
581
|
+
function m(c) {
|
|
582
|
+
a.forEach((d) => c(d));
|
|
583
|
+
}
|
|
584
|
+
function g() {
|
|
585
|
+
return a.values().next().value;
|
|
586
|
+
}
|
|
587
|
+
return {
|
|
588
|
+
preregister: o,
|
|
589
|
+
unregister: i,
|
|
590
|
+
removePreregistered: l,
|
|
591
|
+
getPreregistered: s,
|
|
592
|
+
replayInto: u,
|
|
593
|
+
dispose: f,
|
|
594
|
+
broadcast: m,
|
|
595
|
+
getFirstInstance: g,
|
|
596
|
+
get instanceCount() {
|
|
597
|
+
return a.size;
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
function Vt(e) {
|
|
602
|
+
const t = Ye({}), n = Ye([]), a = Ye(/* @__PURE__ */ new Map());
|
|
603
|
+
function o(c) {
|
|
604
|
+
a.set(c, (a.get(c) ?? 0) + 1);
|
|
605
|
+
}
|
|
606
|
+
function i(c) {
|
|
607
|
+
const d = a.get(c);
|
|
608
|
+
if (!d || d <= 1) {
|
|
609
|
+
a.delete(c);
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
a.set(c, d - 1);
|
|
613
|
+
}
|
|
614
|
+
function l(c, d) {
|
|
615
|
+
const y = d.toLowerCase();
|
|
616
|
+
t[y] || (t[y] = []);
|
|
617
|
+
const h = t[y].find((p) => p.id === c.id);
|
|
618
|
+
if (h) {
|
|
619
|
+
Object.assign(h, c, { bladeId: y });
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
const B = { ...c, bladeId: y };
|
|
623
|
+
t[y].push(B), n.push(e.createRegistration(y, B)), o(c.id);
|
|
624
|
+
}
|
|
625
|
+
function s(c, d) {
|
|
626
|
+
const y = d.toLowerCase(), h = t[y];
|
|
627
|
+
if (h) {
|
|
628
|
+
const p = h.findIndex((I) => I.id === c);
|
|
629
|
+
if (p !== -1) {
|
|
630
|
+
const [I] = h.splice(p, 1);
|
|
631
|
+
I && i(I.id);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
const B = n.findIndex(
|
|
635
|
+
(p) => e.getRegistrationBladeId(p) === y && e.getRegistrationItemId(p) === c
|
|
636
|
+
);
|
|
637
|
+
B !== -1 && n.splice(B, 1);
|
|
638
|
+
}
|
|
639
|
+
function u(c) {
|
|
640
|
+
const d = c ? c.toLowerCase() : "";
|
|
641
|
+
return [...t[d] || []];
|
|
642
|
+
}
|
|
643
|
+
function f(c) {
|
|
644
|
+
const d = c.toLowerCase(), y = t[d];
|
|
645
|
+
y && (y.forEach((B) => i(B.id)), delete t[d]), n.map((B, p) => e.getRegistrationBladeId(B) === d ? p : -1).filter((B) => B !== -1).reverse().forEach((B) => {
|
|
646
|
+
n.splice(B, 1);
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
function m(c, d, y) {
|
|
650
|
+
const h = d.toLowerCase(), B = t[h]?.find((p) => p.id === c);
|
|
651
|
+
B && Object.assign(B, y, { bladeId: h });
|
|
652
|
+
}
|
|
653
|
+
function g(c) {
|
|
654
|
+
return a.has(c);
|
|
655
|
+
}
|
|
656
|
+
return {
|
|
657
|
+
registry: t,
|
|
658
|
+
registrations: n,
|
|
659
|
+
register: l,
|
|
660
|
+
unregister: s,
|
|
661
|
+
get: u,
|
|
662
|
+
clear: f,
|
|
663
|
+
update: m,
|
|
664
|
+
isRegistered: g
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
function ga(e) {
|
|
668
|
+
const t = S(/* @__PURE__ */ new Map()), n = $(() => Array.from(t.value.values()).sort((i, l) => (i.order ?? 0) - (l.order ?? 0)));
|
|
669
|
+
function a(i) {
|
|
670
|
+
const l = e.getId(i) || crypto.randomUUID(), s = e.createItem(i, t.value.size);
|
|
671
|
+
return t.value.set(l, { ...s, id: l }), l;
|
|
672
|
+
}
|
|
673
|
+
function o(i) {
|
|
674
|
+
t.value.delete(i);
|
|
675
|
+
}
|
|
676
|
+
return {
|
|
677
|
+
itemsMap: t,
|
|
678
|
+
sortedItems: n,
|
|
679
|
+
register: a,
|
|
680
|
+
unregister: o
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
function Pt(e) {
|
|
684
|
+
const t = ga({
|
|
685
|
+
createItem: e.createItem,
|
|
686
|
+
getId: e.getId
|
|
687
|
+
}), n = {
|
|
688
|
+
register: (a) => t.register(a),
|
|
689
|
+
unregister: (a) => t.unregister(a),
|
|
690
|
+
items: t.sortedItems
|
|
691
|
+
};
|
|
692
|
+
return e.bus.replayInto(n), n;
|
|
693
|
+
}
|
|
694
|
+
function ze(e) {
|
|
695
|
+
return e.id !== void 0 ? `id:${String(e.id)}` : e.routeId ? `route:${e.routeId}` : e.url ? `url:${e.url}` : e.groupConfig?.id ? `gc:${e.groupConfig.id}:${e.title}` : e.group ? `g:${e.group}:${e.title}` : `hash:${JSON.stringify(Ct(e, "title"))}`;
|
|
696
|
+
}
|
|
697
|
+
const De = S(/* @__PURE__ */ new Map()), ce = Ee({
|
|
698
|
+
name: "menu-service",
|
|
699
|
+
getKey: ze,
|
|
700
|
+
registerIntoService: (e, t) => e.addMenuItem(t)
|
|
701
|
+
});
|
|
702
|
+
function Hi(e) {
|
|
703
|
+
ce.preregister(e);
|
|
704
|
+
}
|
|
705
|
+
function Gi(e) {
|
|
706
|
+
ce.removePreregistered((t) => ut(t, e)), ce.broadcast((t) => t.removeMenuItem(e));
|
|
707
|
+
}
|
|
708
|
+
function Yi(e, t) {
|
|
709
|
+
De.value.set(e, t), ce.broadcast((n) => {
|
|
710
|
+
n.menuBadges.value.set(e, t);
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
function Ji(e) {
|
|
714
|
+
const t = ce.getFirstInstance();
|
|
715
|
+
return t ? t.menuBadges.value.get(e) : De.value.get(e);
|
|
716
|
+
}
|
|
717
|
+
function Xi(e) {
|
|
718
|
+
De.value.delete(e), ce.broadcast((t) => {
|
|
719
|
+
t.menuBadges.value.delete(e);
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
function Zi() {
|
|
723
|
+
return ce.getFirstInstance()?.menuBadges ?? De;
|
|
724
|
+
}
|
|
725
|
+
const at = 1 / 0, ma = 1 / 0;
|
|
726
|
+
function ut(e, t) {
|
|
727
|
+
return ze(e) === ze(t);
|
|
728
|
+
}
|
|
729
|
+
function pa(e) {
|
|
730
|
+
return e.groupConfig ? {
|
|
731
|
+
groupId: e.groupConfig.id,
|
|
732
|
+
groupTitle: e.groupConfig.title || e.groupConfig.id,
|
|
733
|
+
groupIcon: e.groupConfig.icon,
|
|
734
|
+
groupPriority: e.groupConfig.priority,
|
|
735
|
+
groupPermissions: e.groupConfig.permissions
|
|
736
|
+
} : {
|
|
737
|
+
groupId: "group_" + On(e.group),
|
|
738
|
+
groupTitle: e.group,
|
|
739
|
+
groupIcon: e.groupIcon,
|
|
740
|
+
groupPriority: e.priority,
|
|
741
|
+
groupPermissions: void 0
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
function ba(e, t) {
|
|
745
|
+
return (e.priority ?? at) - (t.priority ?? at);
|
|
746
|
+
}
|
|
747
|
+
function ya(e, t) {
|
|
748
|
+
const n = (a) => a.inGroupPriority ?? a.priority ?? ma;
|
|
749
|
+
return n(e) - n(t);
|
|
750
|
+
}
|
|
751
|
+
function ha(e, t) {
|
|
752
|
+
const n = pa(e), a = {
|
|
753
|
+
...Ct(e, ["group", "groupIcon", "groupPriority", "groupConfig"])
|
|
754
|
+
}, o = t.get(n.groupId);
|
|
755
|
+
if (o) {
|
|
756
|
+
const i = [...o.children ?? []], l = i.findIndex((s) => ut(s, a));
|
|
757
|
+
l > -1 ? i[l] = a : i.push(a), t.set(n.groupId, {
|
|
758
|
+
...o,
|
|
759
|
+
children: i,
|
|
760
|
+
...e.groupConfig?.title && { title: e.groupConfig.title },
|
|
761
|
+
...e.groupConfig?.icon !== void 0 && { groupIcon: e.groupConfig.icon },
|
|
762
|
+
...e.groupConfig?.priority !== void 0 && { priority: e.groupConfig.priority },
|
|
763
|
+
...e.groupConfig?.permissions !== void 0 && { permissions: e.groupConfig.permissions }
|
|
764
|
+
});
|
|
765
|
+
} else
|
|
766
|
+
t.set(n.groupId, {
|
|
767
|
+
groupId: n.groupId,
|
|
768
|
+
groupIcon: n.groupIcon ?? "",
|
|
769
|
+
title: n.groupTitle,
|
|
770
|
+
children: [a],
|
|
771
|
+
priority: n.groupPriority ?? e.priority ?? at,
|
|
772
|
+
permissions: n.groupPermissions
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
function ht(e) {
|
|
776
|
+
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
777
|
+
for (const a of e)
|
|
778
|
+
a.group || a.groupConfig ? ha(a, t) : a.title && n.set(ze(a), { ...a });
|
|
779
|
+
return ka([...t.values(), ...n.values()]);
|
|
780
|
+
}
|
|
781
|
+
function ka(e) {
|
|
782
|
+
return e.map(
|
|
783
|
+
(t) => ({
|
|
784
|
+
...t,
|
|
785
|
+
children: t.children ? [...t.children].sort(ya) : void 0
|
|
786
|
+
})
|
|
787
|
+
).sort(ba);
|
|
788
|
+
}
|
|
789
|
+
function Ia() {
|
|
790
|
+
const e = S([]);
|
|
791
|
+
let t = [];
|
|
792
|
+
const n = S(new Map(De.value));
|
|
793
|
+
function a(l) {
|
|
794
|
+
t.push(l), e.value = ht(t);
|
|
795
|
+
}
|
|
796
|
+
function o(l) {
|
|
797
|
+
const s = t.length;
|
|
798
|
+
t = t.filter((u) => !ut(u, l)), t.length !== s && (e.value = ht(t));
|
|
799
|
+
}
|
|
800
|
+
const i = {
|
|
801
|
+
addMenuItem: a,
|
|
802
|
+
menuItems: e,
|
|
803
|
+
removeMenuItem: o,
|
|
804
|
+
menuBadges: n
|
|
805
|
+
};
|
|
806
|
+
return ce.replayInto(i), i;
|
|
807
|
+
}
|
|
808
|
+
function We(e) {
|
|
809
|
+
const { key: t, create: n, bus: a, name: o, onMissing: i } = e;
|
|
810
|
+
function l() {
|
|
811
|
+
const u = G(t, null);
|
|
812
|
+
if (u)
|
|
813
|
+
return u;
|
|
814
|
+
const f = n();
|
|
815
|
+
return $t(t, f), ln() && on(() => a.dispose(f)), f;
|
|
816
|
+
}
|
|
817
|
+
function s() {
|
|
818
|
+
const u = G(t, null);
|
|
819
|
+
if (!u)
|
|
820
|
+
throw i?.(), new Kn(o);
|
|
821
|
+
return u;
|
|
822
|
+
}
|
|
823
|
+
return {
|
|
824
|
+
provide: l,
|
|
825
|
+
use: s
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
const Sa = de("use-menu-service"), Ft = We({
|
|
829
|
+
key: vn,
|
|
830
|
+
create: Ia,
|
|
831
|
+
bus: ce,
|
|
832
|
+
name: "MenuService",
|
|
833
|
+
onMissing: () => Sa.error("Menu service not found in current context. Injection chain:", qe())
|
|
834
|
+
});
|
|
835
|
+
function Qi() {
|
|
836
|
+
return Ft.provide();
|
|
837
|
+
}
|
|
838
|
+
function _i() {
|
|
839
|
+
return Ft.use();
|
|
840
|
+
}
|
|
841
|
+
function je() {
|
|
842
|
+
return {
|
|
843
|
+
isMobile: G(yn, S(!1)),
|
|
844
|
+
isDesktop: G(bn, S(!0)),
|
|
845
|
+
isPhone: G(pn, S(!1)),
|
|
846
|
+
isTablet: G(mn, S(!1)),
|
|
847
|
+
isTouch: G(gn, !1)
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
const $a = Symbol("AppInsightsOptions"), wa = Symbol("AppInsightsInstance");
|
|
851
|
+
function Oa() {
|
|
852
|
+
const e = G(wa, null), { user: t } = st(), n = G($a, void 0);
|
|
853
|
+
function a() {
|
|
854
|
+
const o = n?.appName ? `[${n.appName}] ` : "", i = (u) => `${o}${u.name}`;
|
|
855
|
+
function l(u) {
|
|
856
|
+
if (!e) return;
|
|
857
|
+
const f = i(u);
|
|
858
|
+
e.context.telemetryTrace.traceID = Ln(), e.context.telemetryTrace.name = u.name, e.startTrackPage(f);
|
|
859
|
+
}
|
|
860
|
+
function s(u) {
|
|
861
|
+
if (!e) return;
|
|
862
|
+
const f = i(u), m = location.protocol + "//" + location.host + u.fullPath;
|
|
863
|
+
e.stopTrackPage(f, m, {
|
|
864
|
+
userId: t.value?.id ?? "",
|
|
865
|
+
userName: t.value?.userName ?? ""
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
return {
|
|
869
|
+
beforeEach: l,
|
|
870
|
+
afterEach: s
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
return {
|
|
874
|
+
setupPageTracking: a(),
|
|
875
|
+
appInsights: e
|
|
876
|
+
};
|
|
877
|
+
}
|
|
878
|
+
const Ea = de("use-error-handler");
|
|
879
|
+
function La(e) {
|
|
880
|
+
const t = S(null), n = qe(), { appInsights: a } = Oa(), { user: o } = st(), i = S(!1);
|
|
881
|
+
function l() {
|
|
882
|
+
t.value = null, n && n.emit("reset");
|
|
883
|
+
}
|
|
884
|
+
return rn((s) => {
|
|
885
|
+
if (i.value)
|
|
886
|
+
return !e;
|
|
887
|
+
i.value = !0;
|
|
888
|
+
const u = Pe(s);
|
|
889
|
+
return t.value = u, a && a.trackException({
|
|
890
|
+
exception: u,
|
|
891
|
+
properties: {
|
|
892
|
+
userId: o.value?.id ?? "",
|
|
893
|
+
userName: o.value?.userName ?? ""
|
|
894
|
+
}
|
|
895
|
+
}), Ea.error("Captured Error:", u.originalError), n && n.emit("error", u), he(() => {
|
|
896
|
+
i.value = !1;
|
|
897
|
+
}), !e;
|
|
898
|
+
}), {
|
|
899
|
+
error: t,
|
|
900
|
+
reset: l
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
const Fe = /* @__PURE__ */ new WeakMap();
|
|
904
|
+
function er(e, t, n) {
|
|
905
|
+
Fe.set(e, { timerId: t, notifId: n });
|
|
906
|
+
}
|
|
907
|
+
function Ba(e) {
|
|
908
|
+
if (e && typeof e == "object") {
|
|
909
|
+
const t = Fe.get(e), n = "originalError" in e && e.originalError && typeof e.originalError == "object" ? e.originalError : void 0, a = t ?? (n ? Fe.get(n) : void 0), o = t ? e : n;
|
|
910
|
+
if (a && o)
|
|
911
|
+
return clearTimeout(a.timerId), Promise.resolve().then(() => oa).then(({ notification: i }) => {
|
|
912
|
+
i.remove(a.notifId);
|
|
913
|
+
}), Fe.delete(o), !0;
|
|
914
|
+
}
|
|
915
|
+
return !1;
|
|
916
|
+
}
|
|
917
|
+
const tr = V({
|
|
918
|
+
name: "ErrorInterceptor",
|
|
919
|
+
props: {
|
|
920
|
+
capture: {
|
|
921
|
+
default: !1,
|
|
922
|
+
type: Boolean
|
|
923
|
+
}
|
|
924
|
+
},
|
|
925
|
+
emits: {
|
|
926
|
+
error(e) {
|
|
927
|
+
return e && e instanceof Error || typeof e == "string";
|
|
928
|
+
},
|
|
929
|
+
reset() {
|
|
930
|
+
return !0;
|
|
931
|
+
}
|
|
932
|
+
},
|
|
933
|
+
setup(e, { slots: t }) {
|
|
934
|
+
const n = G(Et, void 0), a = G(hn, void 0), o = !!(n && a), { error: i, reset: l } = La(o || e.capture);
|
|
935
|
+
return o && Y(i, (s) => {
|
|
936
|
+
const u = n.value.id;
|
|
937
|
+
if (s) {
|
|
938
|
+
if (Ba(s), kn())
|
|
939
|
+
return;
|
|
940
|
+
a.setBladeError(u, s);
|
|
941
|
+
} else
|
|
942
|
+
a.clearBladeError(u);
|
|
943
|
+
}), () => t.default?.({
|
|
944
|
+
error: i.value,
|
|
945
|
+
reset: l
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
}), Ca = Symbol("vc-button-group"), xa = ["type", "disabled", "aria-label", "aria-busy", "aria-pressed"], Ta = {
|
|
949
|
+
key: 2,
|
|
950
|
+
class: "vc-button__title"
|
|
951
|
+
}, Ma = /* @__PURE__ */ V({
|
|
952
|
+
__name: "vc-button",
|
|
953
|
+
props: {
|
|
954
|
+
icon: {},
|
|
955
|
+
iconClass: {},
|
|
956
|
+
iconSize: { default: "s" },
|
|
957
|
+
variant: { default: "primary" },
|
|
958
|
+
disabled: { type: Boolean },
|
|
959
|
+
size: { default: "default" },
|
|
960
|
+
selected: { type: Boolean },
|
|
961
|
+
text: { type: Boolean },
|
|
962
|
+
type: { default: "button" },
|
|
963
|
+
loading: { type: Boolean, default: !1 },
|
|
964
|
+
ariaLabel: {}
|
|
965
|
+
},
|
|
966
|
+
emits: ["click"],
|
|
967
|
+
setup(e, { emit: t }) {
|
|
968
|
+
const n = {
|
|
969
|
+
base: "default",
|
|
970
|
+
xs: "sm"
|
|
971
|
+
}, a = e, o = Se(), i = t, l = G(Ca, null), s = $(() => {
|
|
972
|
+
const m = l?.size?.value ?? a.size;
|
|
973
|
+
return n[m] ?? m;
|
|
974
|
+
}), u = $(() => [
|
|
975
|
+
"vc-button",
|
|
976
|
+
{
|
|
977
|
+
[`vc-button-${a.variant}`]: a.variant,
|
|
978
|
+
[`vc-button--${s.value}`]: s.value,
|
|
979
|
+
"vc-button--selected": a.selected,
|
|
980
|
+
"vc-button--text": a.text,
|
|
981
|
+
"vc-button--disabled": a.disabled || a.loading,
|
|
982
|
+
"vc-button--loading": a.loading
|
|
983
|
+
}
|
|
984
|
+
]);
|
|
985
|
+
function f(m) {
|
|
986
|
+
!a.disabled && !a.loading && (m.preventDefault(), i("click", m));
|
|
987
|
+
}
|
|
988
|
+
return (m, g) => r(o) ? w("", !0) : (v(), b("button", {
|
|
989
|
+
key: 0,
|
|
990
|
+
class: j(u.value),
|
|
991
|
+
type: e.type,
|
|
992
|
+
disabled: e.disabled || e.loading,
|
|
993
|
+
"aria-label": e.ariaLabel,
|
|
994
|
+
"aria-busy": e.loading || void 0,
|
|
995
|
+
"aria-pressed": e.selected || void 0,
|
|
996
|
+
onClick: f
|
|
997
|
+
}, [
|
|
998
|
+
e.loading ? (v(), N(r(U), {
|
|
999
|
+
key: 0,
|
|
1000
|
+
icon: "lucide-loader-2",
|
|
1001
|
+
class: "vc-button__icon tw-animate-spin",
|
|
1002
|
+
size: e.iconSize
|
|
1003
|
+
}, null, 8, ["size"])) : e.icon ? (v(), N(r(U), {
|
|
1004
|
+
key: 1,
|
|
1005
|
+
class: j(["vc-button--icon", e.iconClass]),
|
|
1006
|
+
icon: e.icon,
|
|
1007
|
+
size: e.iconSize
|
|
1008
|
+
}, null, 8, ["class", "icon", "size"])) : w("", !0),
|
|
1009
|
+
m.$slots.default ? (v(), b("span", Ta, [
|
|
1010
|
+
C(m.$slots, "default")
|
|
1011
|
+
])) : w("", !0)
|
|
1012
|
+
], 10, xa));
|
|
1013
|
+
}
|
|
1014
|
+
}), ct = Ee({
|
|
1015
|
+
name: "toolbar-service",
|
|
1016
|
+
getKey: (e) => `${e.bladeId.toLowerCase()}::${e.toolbarItem.id}`,
|
|
1017
|
+
registerIntoService: (e, t) => e.registerToolbarItem(t.toolbarItem, t.bladeId)
|
|
1018
|
+
});
|
|
1019
|
+
function nr(e, t) {
|
|
1020
|
+
const n = t.toLowerCase();
|
|
1021
|
+
ct.preregister({
|
|
1022
|
+
bladeId: n,
|
|
1023
|
+
toolbarItem: e
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
function zt() {
|
|
1027
|
+
const e = Vt({
|
|
1028
|
+
createRegistration: (s, u) => ({ bladeId: s, toolbarItem: u }),
|
|
1029
|
+
getRegistrationBladeId: (s) => s.bladeId,
|
|
1030
|
+
getRegistrationItemId: (s) => s.toolbarItem.id
|
|
1031
|
+
}), t = (s, u) => {
|
|
1032
|
+
e.register(s, u);
|
|
1033
|
+
}, n = (s, u) => {
|
|
1034
|
+
e.unregister(s, u);
|
|
1035
|
+
}, a = (s) => {
|
|
1036
|
+
const u = s ? s.toLowerCase() : "", f = e.get(u), m = e.get("*"), g = [...f], c = new Set(g.map((d) => d.id));
|
|
1037
|
+
return m.forEach((d) => {
|
|
1038
|
+
c.has(d.id) || g.push(d);
|
|
1039
|
+
}), [...g];
|
|
1040
|
+
}, o = (s) => {
|
|
1041
|
+
e.clear(s);
|
|
1042
|
+
}, i = ({
|
|
1043
|
+
id: s,
|
|
1044
|
+
bladeId: u,
|
|
1045
|
+
toolbarItem: f
|
|
1046
|
+
}) => {
|
|
1047
|
+
e.update(s, u, f);
|
|
1048
|
+
}, l = {
|
|
1049
|
+
registerToolbarItem: t,
|
|
1050
|
+
unregisterToolbarItem: n,
|
|
1051
|
+
getToolbarItems: a,
|
|
1052
|
+
clearBladeToolbarItems: o,
|
|
1053
|
+
registeredToolbarItems: e.registrations,
|
|
1054
|
+
isToolbarItemRegistered: (s) => e.isRegistered(s),
|
|
1055
|
+
updateToolbarItem: i
|
|
1056
|
+
};
|
|
1057
|
+
return ct.replayInto(l), l;
|
|
1058
|
+
}
|
|
1059
|
+
const Ra = "fallback-blade-id";
|
|
1060
|
+
let Xe = null;
|
|
1061
|
+
const Aa = We({
|
|
1062
|
+
key: Lt,
|
|
1063
|
+
create: zt,
|
|
1064
|
+
bus: ct,
|
|
1065
|
+
name: "ToolbarService"
|
|
1066
|
+
});
|
|
1067
|
+
function ar() {
|
|
1068
|
+
return Aa.provide();
|
|
1069
|
+
}
|
|
1070
|
+
function lr(e = {}) {
|
|
1071
|
+
const { autoCleanup: t = !0 } = e, n = G(Lt, null);
|
|
1072
|
+
!n && !Xe && (Xe = zt());
|
|
1073
|
+
const a = n || Xe;
|
|
1074
|
+
if (!a)
|
|
1075
|
+
throw new Error("Toolbar service is not available");
|
|
1076
|
+
const o = G(Et, void 0), i = $(() => o?.value?.id ?? Ra), l = (d) => d ?? i.value, s = (d, y) => {
|
|
1077
|
+
a.registerToolbarItem(d, l(y));
|
|
1078
|
+
}, u = (d, y) => {
|
|
1079
|
+
a.unregisterToolbarItem(d, l(y));
|
|
1080
|
+
}, f = (d, y, h) => {
|
|
1081
|
+
a.updateToolbarItem({ id: d, bladeId: l(h), toolbarItem: y });
|
|
1082
|
+
}, m = (d) => a.getToolbarItems(l(d)), g = (d) => {
|
|
1083
|
+
a.clearBladeToolbarItems(l(d));
|
|
1084
|
+
};
|
|
1085
|
+
return qe() && t && lt(() => {
|
|
1086
|
+
g();
|
|
1087
|
+
}), {
|
|
1088
|
+
registerToolbarItem: s,
|
|
1089
|
+
unregisterToolbarItem: u,
|
|
1090
|
+
updateToolbarItem: f,
|
|
1091
|
+
getToolbarItems: m,
|
|
1092
|
+
clearBladeToolbarItems: g,
|
|
1093
|
+
isToolbarItemRegistered: a.isToolbarItemRegistered,
|
|
1094
|
+
registeredToolbarItems: a.registeredToolbarItems
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
const Na = ["aria-label"], Da = { class: "tw-sr-only" }, Va = ["aria-label"], Pa = { class: "tw-sr-only" }, le = /* @__PURE__ */ V({
|
|
1098
|
+
__name: "vc-skeleton",
|
|
1099
|
+
props: {
|
|
1100
|
+
variant: { default: "text" },
|
|
1101
|
+
rows: { default: 1 },
|
|
1102
|
+
width: {},
|
|
1103
|
+
height: {},
|
|
1104
|
+
animated: { type: Boolean, default: !0 },
|
|
1105
|
+
ariaLabel: { default: "Loading..." }
|
|
1106
|
+
},
|
|
1107
|
+
setup(e) {
|
|
1108
|
+
const t = e;
|
|
1109
|
+
function n(o) {
|
|
1110
|
+
return o === t.rows ? "60%" : "100%";
|
|
1111
|
+
}
|
|
1112
|
+
function a(o) {
|
|
1113
|
+
if (o !== void 0)
|
|
1114
|
+
return typeof o == "number" ? `${o}px` : o;
|
|
1115
|
+
}
|
|
1116
|
+
return (o, i) => e.variant === "text" ? (v(), b("div", {
|
|
1117
|
+
key: 0,
|
|
1118
|
+
class: j(["vc-skeleton", {
|
|
1119
|
+
"vc-skeleton--animated": e.animated
|
|
1120
|
+
}]),
|
|
1121
|
+
role: "status",
|
|
1122
|
+
"aria-busy": "true",
|
|
1123
|
+
"aria-label": e.ariaLabel
|
|
1124
|
+
}, [
|
|
1125
|
+
L("span", Da, T(e.ariaLabel), 1),
|
|
1126
|
+
(v(!0), b(we, null, ot(e.rows, (l) => (v(), b("div", {
|
|
1127
|
+
key: l,
|
|
1128
|
+
class: "vc-skeleton__row",
|
|
1129
|
+
style: Re({
|
|
1130
|
+
width: n(l)
|
|
1131
|
+
}),
|
|
1132
|
+
"aria-hidden": "true"
|
|
1133
|
+
}, null, 4))), 128))
|
|
1134
|
+
], 10, Na)) : (v(), b("div", {
|
|
1135
|
+
key: 1,
|
|
1136
|
+
class: j(["vc-skeleton__shape", [`vc-skeleton__shape--${e.variant}`, { "tw-animate-pulse": e.animated }]]),
|
|
1137
|
+
style: Re({
|
|
1138
|
+
width: a(e.width),
|
|
1139
|
+
height: a(e.height)
|
|
1140
|
+
}),
|
|
1141
|
+
role: "status",
|
|
1142
|
+
"aria-busy": "true",
|
|
1143
|
+
"aria-label": e.ariaLabel
|
|
1144
|
+
}, [
|
|
1145
|
+
L("span", Pa, T(e.ariaLabel), 1)
|
|
1146
|
+
], 14, Va));
|
|
1147
|
+
}
|
|
1148
|
+
}), or = /* @__PURE__ */ V({
|
|
1149
|
+
__name: "vc-container",
|
|
1150
|
+
props: {
|
|
1151
|
+
shadow: { type: Boolean },
|
|
1152
|
+
noPadding: { type: Boolean },
|
|
1153
|
+
ariaLabel: {}
|
|
1154
|
+
},
|
|
1155
|
+
emits: ["scroll"],
|
|
1156
|
+
setup(e, { expose: t, emit: n }) {
|
|
1157
|
+
const a = n, o = S(), i = S(!1), l = () => {
|
|
1158
|
+
o.value && o.value.scroll(0, 0);
|
|
1159
|
+
};
|
|
1160
|
+
function s(u) {
|
|
1161
|
+
a("scroll", u);
|
|
1162
|
+
}
|
|
1163
|
+
return xt(o, () => {
|
|
1164
|
+
i.value = !!(o.value && o.value.clientHeight < o.value.scrollHeight);
|
|
1165
|
+
}), t({
|
|
1166
|
+
scrollTop: l,
|
|
1167
|
+
component: o
|
|
1168
|
+
}), (u, f) => (v(), N(it(e.ariaLabel ? "section" : "div"), {
|
|
1169
|
+
class: j([
|
|
1170
|
+
"vc-container",
|
|
1171
|
+
{
|
|
1172
|
+
"vc-container--shadow": e.shadow && i.value,
|
|
1173
|
+
"vc-container--nopadding": e.noPadding
|
|
1174
|
+
}
|
|
1175
|
+
]),
|
|
1176
|
+
"aria-label": e.ariaLabel
|
|
1177
|
+
}, {
|
|
1178
|
+
default: O(() => [
|
|
1179
|
+
L("div", {
|
|
1180
|
+
ref_key: "component",
|
|
1181
|
+
ref: o,
|
|
1182
|
+
class: "vc-container__inner",
|
|
1183
|
+
tabindex: "0",
|
|
1184
|
+
onScroll: s
|
|
1185
|
+
}, [
|
|
1186
|
+
C(u.$slots, "default")
|
|
1187
|
+
], 544)
|
|
1188
|
+
]),
|
|
1189
|
+
_: 3
|
|
1190
|
+
}, 8, ["class", "aria-label"]));
|
|
1191
|
+
}
|
|
1192
|
+
}), Fa = ["id", "role"], za = /* @__PURE__ */ V({
|
|
1193
|
+
__name: "vc-hint",
|
|
1194
|
+
props: {
|
|
1195
|
+
id: {},
|
|
1196
|
+
error: { type: Boolean }
|
|
1197
|
+
},
|
|
1198
|
+
setup(e) {
|
|
1199
|
+
return (t, n) => (v(), b("div", {
|
|
1200
|
+
id: e.id,
|
|
1201
|
+
class: j(["vc-hint", {
|
|
1202
|
+
"vc-hint--error": e.error
|
|
1203
|
+
}]),
|
|
1204
|
+
role: e.error ? "alert" : void 0
|
|
1205
|
+
}, [
|
|
1206
|
+
C(t.$slots, "default")
|
|
1207
|
+
], 10, Fa));
|
|
1208
|
+
}
|
|
1209
|
+
}), fe = za, qa = ["role", "tabindex", "aria-label", "onKeydown"], Ua = {
|
|
1210
|
+
key: 0,
|
|
1211
|
+
class: "vc-image__placeholder",
|
|
1212
|
+
"aria-hidden": "true"
|
|
1213
|
+
}, Ka = /* @__PURE__ */ V({
|
|
1214
|
+
__name: "vc-image",
|
|
1215
|
+
props: {
|
|
1216
|
+
aspect: { default: "1x1" },
|
|
1217
|
+
rounded: { type: Boolean },
|
|
1218
|
+
bordered: { type: Boolean },
|
|
1219
|
+
clickable: { type: Boolean },
|
|
1220
|
+
src: {},
|
|
1221
|
+
size: { default: "auto" },
|
|
1222
|
+
background: { default: "cover" },
|
|
1223
|
+
emptyIcon: { default: "lucide-image" },
|
|
1224
|
+
alt: {},
|
|
1225
|
+
thumbnailSize: {}
|
|
1226
|
+
},
|
|
1227
|
+
emits: ["click"],
|
|
1228
|
+
setup(e, { emit: t }) {
|
|
1229
|
+
const n = de("vc-image"), a = e, o = t;
|
|
1230
|
+
function i(g) {
|
|
1231
|
+
if (!g) return g;
|
|
1232
|
+
try {
|
|
1233
|
+
const c = new URL(g);
|
|
1234
|
+
if (c.protocol === "http:" && window.location.protocol === "https:")
|
|
1235
|
+
return c.protocol = "https:", c.href;
|
|
1236
|
+
} catch {
|
|
1237
|
+
n.warn("Invalid URL:", g);
|
|
1238
|
+
}
|
|
1239
|
+
return g;
|
|
1240
|
+
}
|
|
1241
|
+
const l = $(() => ta(a.src, a.thumbnailSize) ?? a.src), s = S(!1), u = $(() => s.value ? a.src : l.value);
|
|
1242
|
+
Y(
|
|
1243
|
+
() => [a.src, a.thumbnailSize],
|
|
1244
|
+
() => {
|
|
1245
|
+
s.value = !1;
|
|
1246
|
+
}
|
|
1247
|
+
), Y(
|
|
1248
|
+
u,
|
|
1249
|
+
(g) => {
|
|
1250
|
+
if (!g || !a.thumbnailSize || s.value || g === a.src) return;
|
|
1251
|
+
const c = new Image();
|
|
1252
|
+
c.src = i(g), c.onerror = () => {
|
|
1253
|
+
s.value = !0;
|
|
1254
|
+
};
|
|
1255
|
+
},
|
|
1256
|
+
{ immediate: !0 }
|
|
1257
|
+
);
|
|
1258
|
+
const f = $(() => {
|
|
1259
|
+
if (u.value) {
|
|
1260
|
+
const g = i(u.value);
|
|
1261
|
+
return `background: url(${CSS.escape(g)}) center / ${a.background} no-repeat`;
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
function m() {
|
|
1265
|
+
a.clickable && o("click");
|
|
1266
|
+
}
|
|
1267
|
+
return (g, c) => (v(), b("div", {
|
|
1268
|
+
class: j(["vc-image", [`vc-image_${e.size}`]])
|
|
1269
|
+
}, [
|
|
1270
|
+
L("div", {
|
|
1271
|
+
class: j([
|
|
1272
|
+
"vc-image__container",
|
|
1273
|
+
`vc-image_${e.aspect}`,
|
|
1274
|
+
{
|
|
1275
|
+
"vc-image__container--rounded": e.rounded,
|
|
1276
|
+
"vc-image__container--bordered": e.bordered,
|
|
1277
|
+
"vc-image__container--clickable": e.clickable
|
|
1278
|
+
}
|
|
1279
|
+
]),
|
|
1280
|
+
style: Re(f.value),
|
|
1281
|
+
role: e.clickable ? "button" : e.src && e.alt ? "img" : void 0,
|
|
1282
|
+
tabindex: e.clickable ? 0 : void 0,
|
|
1283
|
+
"aria-label": e.alt || (e.clickable ? g.$t("COMPONENTS.ATOMS.VC_IMAGE.LABEL") : void 0),
|
|
1284
|
+
onClick: m,
|
|
1285
|
+
onKeydown: [
|
|
1286
|
+
Z(H(m, ["prevent"]), ["enter"]),
|
|
1287
|
+
Z(H(m, ["prevent"]), ["space"])
|
|
1288
|
+
]
|
|
1289
|
+
}, [
|
|
1290
|
+
e.src ? w("", !0) : (v(), b("div", Ua, [
|
|
1291
|
+
x(r(U), {
|
|
1292
|
+
icon: e.emptyIcon,
|
|
1293
|
+
size: "xl"
|
|
1294
|
+
}, null, 8, ["icon"])
|
|
1295
|
+
]))
|
|
1296
|
+
], 46, qa)
|
|
1297
|
+
], 2));
|
|
1298
|
+
}
|
|
1299
|
+
}), Wa = { class: "vc-label__text" }, ja = { class: "vc-label__content" }, Ha = {
|
|
1300
|
+
key: 0,
|
|
1301
|
+
class: "vc-label__required",
|
|
1302
|
+
"aria-hidden": "true"
|
|
1303
|
+
}, Ga = {
|
|
1304
|
+
key: 0,
|
|
1305
|
+
class: "vc-label__tooltip"
|
|
1306
|
+
}, Ya = {
|
|
1307
|
+
key: 1,
|
|
1308
|
+
class: "vc-label__language"
|
|
1309
|
+
}, He = /* @__PURE__ */ V({
|
|
1310
|
+
__name: "vc-label",
|
|
1311
|
+
props: {
|
|
1312
|
+
required: { type: Boolean },
|
|
1313
|
+
tooltipIcon: { default: "lucide-info" },
|
|
1314
|
+
multilanguage: { type: Boolean },
|
|
1315
|
+
currentLanguage: {},
|
|
1316
|
+
error: { type: Boolean },
|
|
1317
|
+
htmlFor: {}
|
|
1318
|
+
},
|
|
1319
|
+
setup(e) {
|
|
1320
|
+
return (t, n) => (v(), N(it(e.htmlFor ? "label" : "div"), {
|
|
1321
|
+
class: j(["vc-label", {
|
|
1322
|
+
"vc-label--error": e.error
|
|
1323
|
+
}]),
|
|
1324
|
+
for: e.htmlFor || void 0
|
|
1325
|
+
}, {
|
|
1326
|
+
default: O(() => [
|
|
1327
|
+
L("div", Wa, [
|
|
1328
|
+
L("span", ja, [
|
|
1329
|
+
C(t.$slots, "default")
|
|
1330
|
+
]),
|
|
1331
|
+
e.required ? (v(), b("span", Ha, "*")) : w("", !0)
|
|
1332
|
+
]),
|
|
1333
|
+
t.$slots.tooltip ? (v(), b("span", Ga, [
|
|
1334
|
+
x(r(Bt), { placement: "top-start" }, {
|
|
1335
|
+
tooltip: O(() => [
|
|
1336
|
+
C(t.$slots, "tooltip")
|
|
1337
|
+
]),
|
|
1338
|
+
default: O(() => [
|
|
1339
|
+
x(r(U), {
|
|
1340
|
+
class: "vc-label__tooltip-icon",
|
|
1341
|
+
icon: e.tooltipIcon,
|
|
1342
|
+
size: "s"
|
|
1343
|
+
}, null, 8, ["icon"])
|
|
1344
|
+
]),
|
|
1345
|
+
_: 3
|
|
1346
|
+
})
|
|
1347
|
+
])) : w("", !0),
|
|
1348
|
+
e.multilanguage ? (v(), b("div", Ya, T(e.currentLanguage), 1)) : w("", !0)
|
|
1349
|
+
]),
|
|
1350
|
+
_: 3
|
|
1351
|
+
}, 8, ["class", "for"]));
|
|
1352
|
+
}
|
|
1353
|
+
}), Ja = ["disabled", "aria-disabled"], Xa = { class: "vc-link__text" }, Za = /* @__PURE__ */ V({
|
|
1354
|
+
__name: "vc-link",
|
|
1355
|
+
props: {
|
|
1356
|
+
active: { type: Boolean },
|
|
1357
|
+
disabled: { type: Boolean },
|
|
1358
|
+
onClick: { type: Function }
|
|
1359
|
+
},
|
|
1360
|
+
emits: ["click"],
|
|
1361
|
+
setup(e, { emit: t }) {
|
|
1362
|
+
const n = e, a = t;
|
|
1363
|
+
function o() {
|
|
1364
|
+
n.disabled || a("click");
|
|
1365
|
+
}
|
|
1366
|
+
return (i, l) => (v(), b("button", {
|
|
1367
|
+
type: "button",
|
|
1368
|
+
class: j(["vc-link", {
|
|
1369
|
+
"vc-link--active": e.active,
|
|
1370
|
+
"vc-link--disabled": e.disabled
|
|
1371
|
+
}]),
|
|
1372
|
+
disabled: e.disabled,
|
|
1373
|
+
"aria-disabled": e.disabled,
|
|
1374
|
+
onClick: o
|
|
1375
|
+
}, [
|
|
1376
|
+
L("span", Xa, [
|
|
1377
|
+
C(i.$slots, "default")
|
|
1378
|
+
])
|
|
1379
|
+
], 10, Ja));
|
|
1380
|
+
}
|
|
1381
|
+
}), Qa = Za, _a = ["aria-label"], el = { class: "vc-status__content" }, tl = /* @__PURE__ */ V({
|
|
1382
|
+
__name: "vc-status",
|
|
1383
|
+
props: {
|
|
1384
|
+
variant: { default: "info" },
|
|
1385
|
+
extend: { type: Boolean },
|
|
1386
|
+
dot: { type: Boolean, default: !1 }
|
|
1387
|
+
},
|
|
1388
|
+
setup(e) {
|
|
1389
|
+
return (t, n) => (v(), b("div", {
|
|
1390
|
+
class: j(["vc-status", [
|
|
1391
|
+
`vc-status--${e.variant}`,
|
|
1392
|
+
{
|
|
1393
|
+
"vc-status--extended": e.extend,
|
|
1394
|
+
"vc-status--dot": e.dot
|
|
1395
|
+
}
|
|
1396
|
+
]]),
|
|
1397
|
+
role: "status",
|
|
1398
|
+
"aria-label": e.dot ? e.variant : void 0
|
|
1399
|
+
}, [
|
|
1400
|
+
L("div", el, [
|
|
1401
|
+
C(t.$slots, "default")
|
|
1402
|
+
])
|
|
1403
|
+
], 10, _a));
|
|
1404
|
+
}
|
|
1405
|
+
}), nl = ["aria-label"], al = /* @__PURE__ */ V({
|
|
1406
|
+
__name: "vc-status-icon",
|
|
1407
|
+
props: {
|
|
1408
|
+
status: { type: Boolean }
|
|
1409
|
+
},
|
|
1410
|
+
setup(e) {
|
|
1411
|
+
return (t, n) => (v(), b("div", {
|
|
1412
|
+
class: "vc-status-icon",
|
|
1413
|
+
role: "img",
|
|
1414
|
+
"aria-label": e.status ? "Active" : "Inactive"
|
|
1415
|
+
}, [
|
|
1416
|
+
e.status ? (v(), N(r(U), {
|
|
1417
|
+
key: 0,
|
|
1418
|
+
icon: "lucide-circle-check",
|
|
1419
|
+
class: "vc-status-icon__icon vc-status-icon__icon--success",
|
|
1420
|
+
"aria-hidden": "true"
|
|
1421
|
+
})) : (v(), N(r(U), {
|
|
1422
|
+
key: 1,
|
|
1423
|
+
icon: "lucide-circle-x",
|
|
1424
|
+
class: "vc-status-icon__icon vc-status-icon__icon--inactive",
|
|
1425
|
+
"aria-hidden": "true"
|
|
1426
|
+
}))
|
|
1427
|
+
], 8, nl));
|
|
1428
|
+
}
|
|
1429
|
+
}), ll = ["aria-label"], kt = 40, ol = /* @__PURE__ */ V({
|
|
1430
|
+
__name: "vc-scrollable-container",
|
|
1431
|
+
props: {
|
|
1432
|
+
speed: { default: void 0 }
|
|
1433
|
+
},
|
|
1434
|
+
setup(e, { expose: t }) {
|
|
1435
|
+
const n = e, a = S(null), o = {};
|
|
1436
|
+
n.speed !== void 0 && (o.speed = n.speed);
|
|
1437
|
+
const { canScrollUp: i, canScrollDown: l, startScroll: s, stopScroll: u, updateScrollState: f } = sa(
|
|
1438
|
+
a,
|
|
1439
|
+
o
|
|
1440
|
+
);
|
|
1441
|
+
function m(g) {
|
|
1442
|
+
if (!a.value) return;
|
|
1443
|
+
const c = g === "up" ? -kt : kt;
|
|
1444
|
+
a.value.scrollBy({ top: c, behavior: "smooth" });
|
|
1445
|
+
}
|
|
1446
|
+
return t({
|
|
1447
|
+
viewportRef: a,
|
|
1448
|
+
updateScrollState: f
|
|
1449
|
+
}), (g, c) => (v(), b("div", {
|
|
1450
|
+
class: "vc-scrollable-container",
|
|
1451
|
+
role: "region",
|
|
1452
|
+
"aria-label": g.$t("COMPONENTS.ATOMS.VC_SCROLLABLE_CONTAINER.LABEL")
|
|
1453
|
+
}, [
|
|
1454
|
+
L("div", {
|
|
1455
|
+
class: j(["vc-scrollable-container__arrow", { "vc-scrollable-container__arrow--hidden": !r(i) }]),
|
|
1456
|
+
"aria-hidden": "true",
|
|
1457
|
+
onPointerenter: c[0] || (c[0] = (d) => r(s)("up")),
|
|
1458
|
+
onPointerleave: c[1] || (c[1] = //@ts-ignore
|
|
1459
|
+
(...d) => r(u) && r(u)(...d))
|
|
1460
|
+
}, [
|
|
1461
|
+
C(g.$slots, "arrow-up", {}, () => [
|
|
1462
|
+
x(r(U), {
|
|
1463
|
+
icon: "lucide-chevron-up",
|
|
1464
|
+
size: "xs"
|
|
1465
|
+
})
|
|
1466
|
+
])
|
|
1467
|
+
], 34),
|
|
1468
|
+
L("div", {
|
|
1469
|
+
ref_key: "viewportRef",
|
|
1470
|
+
ref: a,
|
|
1471
|
+
class: "vc-scrollable-container__viewport",
|
|
1472
|
+
tabindex: "0",
|
|
1473
|
+
onScroll: c[2] || (c[2] = //@ts-ignore
|
|
1474
|
+
(...d) => r(f) && r(f)(...d)),
|
|
1475
|
+
onKeydown: [
|
|
1476
|
+
c[3] || (c[3] = Z(H((d) => m("up"), ["prevent"]), ["up"])),
|
|
1477
|
+
c[4] || (c[4] = Z(H((d) => m("down"), ["prevent"]), ["down"]))
|
|
1478
|
+
]
|
|
1479
|
+
}, [
|
|
1480
|
+
C(g.$slots, "default")
|
|
1481
|
+
], 544),
|
|
1482
|
+
L("div", {
|
|
1483
|
+
class: j(["vc-scrollable-container__arrow", { "vc-scrollable-container__arrow--hidden": !r(l) }]),
|
|
1484
|
+
"aria-hidden": "true",
|
|
1485
|
+
onPointerenter: c[5] || (c[5] = (d) => r(s)("down")),
|
|
1486
|
+
onPointerleave: c[6] || (c[6] = //@ts-ignore
|
|
1487
|
+
(...d) => r(u) && r(u)(...d))
|
|
1488
|
+
}, [
|
|
1489
|
+
C(g.$slots, "arrow-down", {}, () => [
|
|
1490
|
+
x(r(U), {
|
|
1491
|
+
icon: "lucide-chevron-down",
|
|
1492
|
+
size: "xs"
|
|
1493
|
+
})
|
|
1494
|
+
])
|
|
1495
|
+
], 34)
|
|
1496
|
+
], 8, ll));
|
|
1497
|
+
}
|
|
1498
|
+
}), dt = /* @__PURE__ */ new Map();
|
|
1499
|
+
function il(e) {
|
|
1500
|
+
return e?.map((t) => t.toLowerCase());
|
|
1501
|
+
}
|
|
1502
|
+
function ir(e) {
|
|
1503
|
+
dt.set(e.id, {
|
|
1504
|
+
...e,
|
|
1505
|
+
targetBlades: il(e.targetBlades)
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
function rl(e) {
|
|
1509
|
+
const t = e.toLowerCase();
|
|
1510
|
+
return Array.from(dt.values()).filter((n) => !n.targetBlades || n.targetBlades.includes(t)).map((n) => ({ ...n, targetBlades: n.targetBlades ? [...n.targetBlades] : void 0 }));
|
|
1511
|
+
}
|
|
1512
|
+
function sl() {
|
|
1513
|
+
return Array.from(dt.values()).map((e) => ({
|
|
1514
|
+
...e,
|
|
1515
|
+
targetBlades: e.targetBlades ? [...e.targetBlades] : void 0
|
|
1516
|
+
}));
|
|
1517
|
+
}
|
|
1518
|
+
function ul(e) {
|
|
1519
|
+
return En(e);
|
|
1520
|
+
}
|
|
1521
|
+
const qt = Ee({
|
|
1522
|
+
name: "widget-service",
|
|
1523
|
+
getKey: (e) => `${e.bladeId.toLowerCase()}::${e.widget.id}`,
|
|
1524
|
+
registerIntoService: (e, t) => e.registerWidget(t.widget, t.bladeId)
|
|
1525
|
+
});
|
|
1526
|
+
function rr(e, t) {
|
|
1527
|
+
const n = t.toLowerCase();
|
|
1528
|
+
qt.preregister({
|
|
1529
|
+
bladeId: n,
|
|
1530
|
+
widget: e
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1533
|
+
function sr() {
|
|
1534
|
+
const e = Vt({
|
|
1535
|
+
createRegistration: (a, o) => ({ bladeId: a, widget: o }),
|
|
1536
|
+
getRegistrationBladeId: (a) => a.bladeId,
|
|
1537
|
+
getRegistrationItemId: (a) => a.widget.id
|
|
1538
|
+
}), n = {
|
|
1539
|
+
registerWidget: (a, o) => e.register(a, o),
|
|
1540
|
+
unregisterWidget: (a, o) => e.unregister(a, o),
|
|
1541
|
+
getWidgets: (a) => e.get(a),
|
|
1542
|
+
updateWidget: ({ id: a, bladeId: o, widget: i }) => e.update(a, o, i),
|
|
1543
|
+
getExternalWidgetsForBlade: (a) => rl(a.toLowerCase()),
|
|
1544
|
+
getAllExternalWidgets: sl,
|
|
1545
|
+
cloneWidget: ul
|
|
1546
|
+
};
|
|
1547
|
+
return qt.replayInto(n), n;
|
|
1548
|
+
}
|
|
1549
|
+
const cl = de("use-theme"), pe = S([
|
|
1550
|
+
{ key: "light", localizationKey: "CORE.THEMES.LIGHT" },
|
|
1551
|
+
{ key: "dark", localizationKey: "CORE.THEMES.DARK" }
|
|
1552
|
+
]), ur = Mn(() => {
|
|
1553
|
+
const { t: e } = ke.global;
|
|
1554
|
+
function t(f) {
|
|
1555
|
+
(Array.isArray(f) ? f : [f]).forEach((m) => {
|
|
1556
|
+
pe.value.some((g) => g.key === m.key) || pe.value.push(m);
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
function n(f) {
|
|
1560
|
+
(Array.isArray(f) ? f : [f]).forEach((m) => {
|
|
1561
|
+
const g = pe.value.findIndex((c) => c.key === m);
|
|
1562
|
+
g >= 0 && pe.value.splice(g, 1);
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
const a = $(() => pe.value.map((f) => f.key)), o = Bn({
|
|
1566
|
+
attribute: "data-theme",
|
|
1567
|
+
emitAuto: !0,
|
|
1568
|
+
initialValue: "light",
|
|
1569
|
+
// Should align with a default theme in _themeRegistry
|
|
1570
|
+
modes: {
|
|
1571
|
+
// Dynamically build modes from registered theme keys
|
|
1572
|
+
...a.value.reduce(
|
|
1573
|
+
(f, m) => (f[m] = m, f),
|
|
1574
|
+
{}
|
|
1575
|
+
)
|
|
1576
|
+
}
|
|
1577
|
+
}), { state: i, next: l } = Cn(a, { initialValue: o });
|
|
1578
|
+
Qe(() => {
|
|
1579
|
+
i.value && (o.value = i.value);
|
|
1580
|
+
});
|
|
1581
|
+
function s(f) {
|
|
1582
|
+
a.value.includes(f) ? i.value = f : cl.warn(`Attempted to set an unregistered theme: ${f}`);
|
|
1583
|
+
}
|
|
1584
|
+
const u = $(() => {
|
|
1585
|
+
const f = pe.value.find((m) => m.key === i.value);
|
|
1586
|
+
return f ? f.localizationKey ? e(f.localizationKey) : Je(f.key) : i.value ? Je(i.value) : "";
|
|
1587
|
+
});
|
|
1588
|
+
return {
|
|
1589
|
+
themes: $(
|
|
1590
|
+
() => pe.value.map((f) => ({
|
|
1591
|
+
key: f.key,
|
|
1592
|
+
name: f.localizationKey ? e(f.localizationKey) : Je(f.key)
|
|
1593
|
+
}))
|
|
1594
|
+
),
|
|
1595
|
+
currentThemeKey: i,
|
|
1596
|
+
currentLocalizedName: u,
|
|
1597
|
+
next: l,
|
|
1598
|
+
register: t,
|
|
1599
|
+
unregister: n,
|
|
1600
|
+
setTheme: s
|
|
1601
|
+
};
|
|
1602
|
+
}), ft = Ee({
|
|
1603
|
+
name: "dashboard-service",
|
|
1604
|
+
getKey: (e) => e.id,
|
|
1605
|
+
registerIntoService: (e, t) => e.registerWidget(t)
|
|
1606
|
+
});
|
|
1607
|
+
function cr(e) {
|
|
1608
|
+
ft.preregister(e);
|
|
1609
|
+
}
|
|
1610
|
+
const dl = () => ({
|
|
1611
|
+
widgets: _e(/* @__PURE__ */ new Map()),
|
|
1612
|
+
layout: _e(/* @__PURE__ */ new Map())
|
|
1613
|
+
});
|
|
1614
|
+
function fl(e = {}) {
|
|
1615
|
+
const t = dl(), n = e.hasAccess ?? (() => !0), s = {
|
|
1616
|
+
registerWidget: (u) => {
|
|
1617
|
+
if (t.widgets.has(u.id))
|
|
1618
|
+
throw new Error(`Widget with id ${u.id} already registered`);
|
|
1619
|
+
t.widgets.set(u.id, {
|
|
1620
|
+
...u,
|
|
1621
|
+
permissions: u.permissions ? [...u.permissions] : void 0,
|
|
1622
|
+
position: u.position ? { ...u.position } : void 0,
|
|
1623
|
+
props: u.props ? { ...u.props } : void 0
|
|
1624
|
+
}), u.position && t.layout.set(u.id, { ...u.position });
|
|
1625
|
+
},
|
|
1626
|
+
getWidgets: () => Array.from(t.widgets.values()).filter((u) => !u.permissions || u.permissions.length === 0 || n(u.permissions)).map((u) => ({
|
|
1627
|
+
...u,
|
|
1628
|
+
permissions: u.permissions ? [...u.permissions] : void 0,
|
|
1629
|
+
position: u.position ? { ...u.position } : void 0,
|
|
1630
|
+
props: u.props ? { ...u.props } : void 0
|
|
1631
|
+
})),
|
|
1632
|
+
updateWidgetPosition: (u, f) => {
|
|
1633
|
+
if (!t.widgets.has(u))
|
|
1634
|
+
throw new Error(`Widget with id ${u} not found`);
|
|
1635
|
+
t.layout.set(u, { ...f });
|
|
1636
|
+
},
|
|
1637
|
+
getLayout: () => new Map(t.layout)
|
|
1638
|
+
};
|
|
1639
|
+
return ft.replayInto(s), s;
|
|
1640
|
+
}
|
|
1641
|
+
const It = de("use-dashboard"), Ut = We({
|
|
1642
|
+
key: In,
|
|
1643
|
+
bus: ft,
|
|
1644
|
+
name: "DashboardService",
|
|
1645
|
+
create: () => {
|
|
1646
|
+
let e = () => !0;
|
|
1647
|
+
try {
|
|
1648
|
+
const { hasAccess: t } = aa();
|
|
1649
|
+
e = (n) => t(n);
|
|
1650
|
+
} catch (t) {
|
|
1651
|
+
It.warn("Permissions composable unavailable, dashboard falls back to allow-all access check", t);
|
|
1652
|
+
}
|
|
1653
|
+
return fl({
|
|
1654
|
+
hasAccess: e
|
|
1655
|
+
});
|
|
1656
|
+
},
|
|
1657
|
+
onMissing: () => It.error("Dashboard service not found")
|
|
1658
|
+
});
|
|
1659
|
+
function dr() {
|
|
1660
|
+
return Ut.provide();
|
|
1661
|
+
}
|
|
1662
|
+
function fr() {
|
|
1663
|
+
return Ut.use();
|
|
1664
|
+
}
|
|
1665
|
+
const Kt = Ee({
|
|
1666
|
+
name: "app-bar-menu-service",
|
|
1667
|
+
getKey: (e) => e.id || crypto.randomUUID(),
|
|
1668
|
+
registerIntoService: (e, t) => e.register(t),
|
|
1669
|
+
unregisterFromService: (e, t) => e.unregister(t)
|
|
1670
|
+
});
|
|
1671
|
+
function vr(e) {
|
|
1672
|
+
Kt.preregister(e);
|
|
1673
|
+
}
|
|
1674
|
+
function gr() {
|
|
1675
|
+
return Pt({
|
|
1676
|
+
bus: Kt,
|
|
1677
|
+
createItem: (e, t) => ({
|
|
1678
|
+
id: e.id || "",
|
|
1679
|
+
order: e.order ?? t,
|
|
1680
|
+
title: e.title,
|
|
1681
|
+
icon: typeof e.icon == "object" ? et(e.icon) : e.icon,
|
|
1682
|
+
component: e.component ? et(e.component) : void 0,
|
|
1683
|
+
props: e.props,
|
|
1684
|
+
onClick: e.onClick,
|
|
1685
|
+
slot: e.slot,
|
|
1686
|
+
badge: e.badge,
|
|
1687
|
+
searchTerms: e.searchTerms
|
|
1688
|
+
}),
|
|
1689
|
+
getId: (e) => e.id || ""
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
const vt = Ee({
|
|
1693
|
+
name: "settings-menu-service",
|
|
1694
|
+
getKey: (e) => e.id || crypto.randomUUID(),
|
|
1695
|
+
registerIntoService: (e, t) => e.register(t),
|
|
1696
|
+
unregisterFromService: (e, t) => e.unregister(t)
|
|
1697
|
+
});
|
|
1698
|
+
function mr(e) {
|
|
1699
|
+
vt.preregister(e);
|
|
1700
|
+
}
|
|
1701
|
+
function vl() {
|
|
1702
|
+
return Pt({
|
|
1703
|
+
bus: vt,
|
|
1704
|
+
createItem: (e, t) => ({
|
|
1705
|
+
id: e.id || "",
|
|
1706
|
+
order: e.order ?? t,
|
|
1707
|
+
group: e.group,
|
|
1708
|
+
component: et(e.component),
|
|
1709
|
+
props: e.props
|
|
1710
|
+
}),
|
|
1711
|
+
getId: (e) => e.id || ""
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
const gl = de("use-settings-menu"), Wt = We({
|
|
1715
|
+
key: Sn,
|
|
1716
|
+
create: vl,
|
|
1717
|
+
bus: vt,
|
|
1718
|
+
name: "SettingsMenuService",
|
|
1719
|
+
onMissing: () => gl.error("Settings menu service not found")
|
|
1720
|
+
});
|
|
1721
|
+
function pr() {
|
|
1722
|
+
return Wt.provide();
|
|
1723
|
+
}
|
|
1724
|
+
function br() {
|
|
1725
|
+
return Wt.use();
|
|
1726
|
+
}
|
|
1727
|
+
const ml = {
|
|
1728
|
+
key: 0,
|
|
1729
|
+
class: "vc-date-picker vc-date-picker--skeleton"
|
|
1730
|
+
}, pl = { class: "vc-date-picker__field-container" }, bl = { class: "vc-date-picker__field" }, yl = ["aria-label"], hl = {
|
|
1731
|
+
key: 0,
|
|
1732
|
+
class: "vc-date-picker__loading"
|
|
1733
|
+
}, kl = { key: 0 }, Il = { key: 1 }, Sl = /* @__PURE__ */ V({
|
|
1734
|
+
__name: "vc-date-picker",
|
|
1735
|
+
props: {
|
|
1736
|
+
modelValue: {},
|
|
1737
|
+
type: { default: "date" },
|
|
1738
|
+
datePickerOptions: {},
|
|
1739
|
+
placeholder: {},
|
|
1740
|
+
hint: {},
|
|
1741
|
+
clearable: { type: Boolean },
|
|
1742
|
+
loading: { type: Boolean },
|
|
1743
|
+
autofocus: { type: Boolean },
|
|
1744
|
+
size: { default: "default" },
|
|
1745
|
+
multilanguage: { type: Boolean },
|
|
1746
|
+
currentLanguage: {},
|
|
1747
|
+
label: {},
|
|
1748
|
+
tooltip: {},
|
|
1749
|
+
disabled: { type: Boolean },
|
|
1750
|
+
required: { type: Boolean },
|
|
1751
|
+
name: { default: "Field" },
|
|
1752
|
+
error: { type: Boolean },
|
|
1753
|
+
errorMessage: {}
|
|
1754
|
+
},
|
|
1755
|
+
emits: ["update:modelValue", "blur", "focus"],
|
|
1756
|
+
setup(e, { emit: t }) {
|
|
1757
|
+
const n = e, a = t, o = Se(), { isMobile: i, isDesktop: l } = je(), { labelId: s, errorId: u, hintId: f, invalid: m, resolvedDisabled: g, ariaRequired: c, ariaDescribedBy: d } = Ke(n), y = S(!1), h = window.navigator.language, B = S(n.modelValue), p = S(null), I = $(() => n.type === "date" && "9999-12-31" || void 0), P = (() => {
|
|
1758
|
+
const k = new Intl.DateTimeFormat(h, { hour: "numeric" }).format();
|
|
1759
|
+
return Number.isInteger(Number(k));
|
|
1760
|
+
})(), J = $(() => {
|
|
1761
|
+
const k = n.type === "datetime-local", M = new Intl.DateTimeFormat(h, {
|
|
1762
|
+
year: "numeric",
|
|
1763
|
+
month: "2-digit",
|
|
1764
|
+
day: "2-digit",
|
|
1765
|
+
...k ? { hour: "2-digit", minute: "2-digit", hour12: !P } : {}
|
|
1766
|
+
}).formatToParts(new Date(2e3, 0, 15, 13, 30)), K = {
|
|
1767
|
+
year: "yyyy",
|
|
1768
|
+
month: "MM",
|
|
1769
|
+
day: "dd",
|
|
1770
|
+
hour: P ? "HH" : "hh",
|
|
1771
|
+
minute: "mm",
|
|
1772
|
+
dayPeriod: "aa"
|
|
1773
|
+
};
|
|
1774
|
+
return M.map((te) => K[te.type] ?? te.value).join("");
|
|
1775
|
+
}), ae = $(() => {
|
|
1776
|
+
if (!n.datePickerOptions?.textInput) return n.datePickerOptions;
|
|
1777
|
+
const k = { ...n.datePickerOptions }, M = typeof k.textInput == "object" ? k.textInput : {};
|
|
1778
|
+
return k.textInput = {
|
|
1779
|
+
format: J.value,
|
|
1780
|
+
rangeSeparator: " - ",
|
|
1781
|
+
...M
|
|
1782
|
+
}, k;
|
|
1783
|
+
}), ee = (k) => {
|
|
1784
|
+
const M = {
|
|
1785
|
+
year: "numeric",
|
|
1786
|
+
month: "numeric",
|
|
1787
|
+
day: "numeric"
|
|
1788
|
+
};
|
|
1789
|
+
n.type === "datetime-local" && (M.hour = "numeric", M.minute = "numeric", M.hour12 = !P);
|
|
1790
|
+
const K = (te) => new Intl.DateTimeFormat(h, M).format(te);
|
|
1791
|
+
return Array.isArray(k) ? k.map((te) => te != null ? K(te) : "").join(" - ") : K(k);
|
|
1792
|
+
};
|
|
1793
|
+
Y(
|
|
1794
|
+
() => n.modelValue,
|
|
1795
|
+
(k) => {
|
|
1796
|
+
B.value !== k && (B.value = k);
|
|
1797
|
+
}
|
|
1798
|
+
), Y(B, (k, M) => {
|
|
1799
|
+
k !== M && k !== n.modelValue && (p.value = null, a("update:modelValue", k));
|
|
1800
|
+
});
|
|
1801
|
+
function F() {
|
|
1802
|
+
B.value = null, a("update:modelValue", null);
|
|
1803
|
+
}
|
|
1804
|
+
function D(k) {
|
|
1805
|
+
p.value = k;
|
|
1806
|
+
}
|
|
1807
|
+
function z() {
|
|
1808
|
+
p.value = null;
|
|
1809
|
+
}
|
|
1810
|
+
function W(k) {
|
|
1811
|
+
p.value != null && (B.value = [p.value, null], p.value = null), y.value = !1, a("blur", k);
|
|
1812
|
+
}
|
|
1813
|
+
function X() {
|
|
1814
|
+
y.value = !0, a("focus");
|
|
1815
|
+
}
|
|
1816
|
+
return (k, M) => r(o) ? (v(), b("div", ml, [
|
|
1817
|
+
e.label ? (v(), N(r(le), {
|
|
1818
|
+
key: 0,
|
|
1819
|
+
variant: "block",
|
|
1820
|
+
width: 60 + (e.label?.length || 0) * 4,
|
|
1821
|
+
height: 11
|
|
1822
|
+
}, null, 8, ["width"])) : w("", !0),
|
|
1823
|
+
x(r(le), {
|
|
1824
|
+
variant: "block",
|
|
1825
|
+
width: "100%",
|
|
1826
|
+
height: 36
|
|
1827
|
+
})
|
|
1828
|
+
])) : (v(), b("div", {
|
|
1829
|
+
key: 1,
|
|
1830
|
+
class: j(["vc-date-picker", [
|
|
1831
|
+
{
|
|
1832
|
+
"vc-date-picker--error": r(m),
|
|
1833
|
+
"vc-date-picker--disabled": r(g),
|
|
1834
|
+
"vc-date-picker--focused": y.value
|
|
1835
|
+
}
|
|
1836
|
+
]])
|
|
1837
|
+
}, [
|
|
1838
|
+
e.label ? (v(), N(r(He), {
|
|
1839
|
+
key: 0,
|
|
1840
|
+
id: r(s),
|
|
1841
|
+
class: "vc-date-picker__label",
|
|
1842
|
+
required: e.required,
|
|
1843
|
+
multilanguage: e.multilanguage,
|
|
1844
|
+
"current-language": e.currentLanguage,
|
|
1845
|
+
error: r(m)
|
|
1846
|
+
}, ie({
|
|
1847
|
+
default: O(() => [
|
|
1848
|
+
L("span", null, T(e.label), 1)
|
|
1849
|
+
]),
|
|
1850
|
+
_: 2
|
|
1851
|
+
}, [
|
|
1852
|
+
e.tooltip ? {
|
|
1853
|
+
name: "tooltip",
|
|
1854
|
+
fn: O(() => [
|
|
1855
|
+
Q(T(e.tooltip), 1)
|
|
1856
|
+
]),
|
|
1857
|
+
key: "0"
|
|
1858
|
+
} : void 0
|
|
1859
|
+
]), 1032, ["id", "required", "multilanguage", "current-language", "error"])) : w("", !0),
|
|
1860
|
+
L("div", {
|
|
1861
|
+
class: j(["vc-date-picker__field-wrapper", {
|
|
1862
|
+
"vc-date-picker__field-wrapper--default": e.size === "default",
|
|
1863
|
+
"vc-date-picker__field-wrapper--small": e.size === "small"
|
|
1864
|
+
}])
|
|
1865
|
+
}, [
|
|
1866
|
+
L("div", pl, [
|
|
1867
|
+
L("div", bl, [
|
|
1868
|
+
x(r(An), ne({
|
|
1869
|
+
modelValue: B.value,
|
|
1870
|
+
"onUpdate:modelValue": M[0] || (M[0] = (K) => B.value = K),
|
|
1871
|
+
placeholder: e.placeholder || (e.type === "datetime-local" ? k.$t("COMPONENTS.MOLECULES.VC_INPUT.DATE_TIME_PLACEHOLDER") : k.$t("COMPONENTS.MOLECULES.VC_INPUT.DATE_PLACEHOLDER")),
|
|
1872
|
+
disabled: r(g),
|
|
1873
|
+
name: e.name,
|
|
1874
|
+
autofocus: e.autofocus,
|
|
1875
|
+
"max-date": I.value,
|
|
1876
|
+
"time-picker-inline": "",
|
|
1877
|
+
"enable-time-picker": e.type === "datetime-local",
|
|
1878
|
+
format: ee,
|
|
1879
|
+
locale: r(h),
|
|
1880
|
+
"start-time": { hours: 0, minutes: 0 },
|
|
1881
|
+
clearable: !1,
|
|
1882
|
+
config: { closeOnAutoApply: !1 },
|
|
1883
|
+
"auto-apply": "",
|
|
1884
|
+
"teleport-center": r(i),
|
|
1885
|
+
is24: r(P)
|
|
1886
|
+
}, ae.value, {
|
|
1887
|
+
teleport: r(l) ? "body" : void 0,
|
|
1888
|
+
"aria-invalid": r(m) || void 0,
|
|
1889
|
+
"aria-required": r(c),
|
|
1890
|
+
"aria-describedby": r(d),
|
|
1891
|
+
"aria-labelledby": e.label ? r(s) : void 0,
|
|
1892
|
+
class: "vc-date-picker__input",
|
|
1893
|
+
tabindex: "0",
|
|
1894
|
+
onFocus: X,
|
|
1895
|
+
onClosed: W,
|
|
1896
|
+
onRangeStart: D,
|
|
1897
|
+
onRangeEnd: z,
|
|
1898
|
+
onTooltipOpen: X,
|
|
1899
|
+
onTooltipClose: W
|
|
1900
|
+
}), null, 16, ["modelValue", "placeholder", "disabled", "name", "autofocus", "max-date", "enable-time-picker", "locale", "teleport-center", "is24", "teleport", "aria-invalid", "aria-required", "aria-describedby", "aria-labelledby"]),
|
|
1901
|
+
e.clearable && B.value && !e.disabled ? (v(), b("button", {
|
|
1902
|
+
key: 0,
|
|
1903
|
+
type: "button",
|
|
1904
|
+
class: "vc-date-picker__clear",
|
|
1905
|
+
"aria-label": k.$t("COMPONENTS.MOLECULES.VC_DATE_PICKER.CLEAR"),
|
|
1906
|
+
onClick: F
|
|
1907
|
+
}, [
|
|
1908
|
+
x(r(U), {
|
|
1909
|
+
size: "xs",
|
|
1910
|
+
icon: "lucide-x"
|
|
1911
|
+
})
|
|
1912
|
+
], 8, yl)) : w("", !0)
|
|
1913
|
+
]),
|
|
1914
|
+
e.loading ? (v(), b("div", hl, [
|
|
1915
|
+
x(r(U), {
|
|
1916
|
+
icon: "lucide-loader-2",
|
|
1917
|
+
class: "vc-date-picker__loading-icon",
|
|
1918
|
+
size: "m"
|
|
1919
|
+
})
|
|
1920
|
+
])) : w("", !0)
|
|
1921
|
+
])
|
|
1922
|
+
], 2),
|
|
1923
|
+
x(Ae, {
|
|
1924
|
+
name: "slide-up",
|
|
1925
|
+
mode: "out-in"
|
|
1926
|
+
}, {
|
|
1927
|
+
default: O(() => [
|
|
1928
|
+
r(m) && e.errorMessage ? (v(), b("div", kl, [
|
|
1929
|
+
x(r(fe), {
|
|
1930
|
+
id: r(u),
|
|
1931
|
+
class: "vc-date-picker__hint-error",
|
|
1932
|
+
error: !0
|
|
1933
|
+
}, {
|
|
1934
|
+
default: O(() => [
|
|
1935
|
+
Q(T(e.errorMessage), 1)
|
|
1936
|
+
]),
|
|
1937
|
+
_: 1
|
|
1938
|
+
}, 8, ["id"])
|
|
1939
|
+
])) : (v(), b("div", Il, [
|
|
1940
|
+
e.hint ? (v(), N(r(fe), {
|
|
1941
|
+
key: 0,
|
|
1942
|
+
id: r(f),
|
|
1943
|
+
class: "vc-date-picker__desc"
|
|
1944
|
+
}, {
|
|
1945
|
+
default: O(() => [
|
|
1946
|
+
Q(T(e.hint), 1)
|
|
1947
|
+
]),
|
|
1948
|
+
_: 1
|
|
1949
|
+
}, 8, ["id"])) : w("", !0)
|
|
1950
|
+
]))
|
|
1951
|
+
]),
|
|
1952
|
+
_: 1
|
|
1953
|
+
})
|
|
1954
|
+
], 2));
|
|
1955
|
+
}
|
|
1956
|
+
}), $l = {
|
|
1957
|
+
key: 0,
|
|
1958
|
+
class: "vc-color-input vc-color-input--skeleton"
|
|
1959
|
+
}, wl = { class: "vc-color-input__field-container" }, Ol = { class: "vc-color-input__field" }, El = ["id", "placeholder", "disabled", "name", "autofocus", "aria-invalid", "aria-required", "aria-describedby", "aria-labelledby"], Ll = { class: "vc-color-input__color-container" }, Bl = ["aria-label"], Cl = ["value"], xl = ["aria-label"], Tl = {
|
|
1960
|
+
key: 0,
|
|
1961
|
+
class: "vc-color-input__loading"
|
|
1962
|
+
}, Ml = { key: 0 }, Rl = { key: 1 }, Al = /* @__PURE__ */ V({
|
|
1963
|
+
__name: "vc-color-input",
|
|
1964
|
+
props: {
|
|
1965
|
+
modelValue: {},
|
|
1966
|
+
placeholder: {},
|
|
1967
|
+
hint: {},
|
|
1968
|
+
clearable: { type: Boolean },
|
|
1969
|
+
loading: { type: Boolean },
|
|
1970
|
+
autofocus: { type: Boolean },
|
|
1971
|
+
size: { default: "default" },
|
|
1972
|
+
multilanguage: { type: Boolean },
|
|
1973
|
+
currentLanguage: {},
|
|
1974
|
+
label: {},
|
|
1975
|
+
tooltip: {},
|
|
1976
|
+
disabled: { type: Boolean },
|
|
1977
|
+
required: { type: Boolean },
|
|
1978
|
+
name: { default: "Field" },
|
|
1979
|
+
error: { type: Boolean },
|
|
1980
|
+
errorMessage: {}
|
|
1981
|
+
},
|
|
1982
|
+
emits: ["update:modelValue", "blur", "focus"],
|
|
1983
|
+
setup(e, { expose: t, emit: n }) {
|
|
1984
|
+
const a = Se(), o = e, i = n, {
|
|
1985
|
+
fieldId: l,
|
|
1986
|
+
labelId: s,
|
|
1987
|
+
errorId: u,
|
|
1988
|
+
hintId: f,
|
|
1989
|
+
invalid: m,
|
|
1990
|
+
resolvedDisabled: g,
|
|
1991
|
+
ariaRequired: c,
|
|
1992
|
+
ariaDescribedBy: d
|
|
1993
|
+
} = Ke(o), y = S(!1), h = S(!1), B = S(), p = S(), I = S(o.modelValue ?? ""), P = S("");
|
|
1994
|
+
function J(k) {
|
|
1995
|
+
if (!k || typeof k != "string") {
|
|
1996
|
+
P.value = "";
|
|
1997
|
+
return;
|
|
1998
|
+
}
|
|
1999
|
+
const M = k.trim();
|
|
2000
|
+
if (ea(M)) {
|
|
2001
|
+
P.value = yt(M);
|
|
2002
|
+
return;
|
|
2003
|
+
}
|
|
2004
|
+
const K = _n(M);
|
|
2005
|
+
K && (P.value = K);
|
|
2006
|
+
}
|
|
2007
|
+
Y(
|
|
2008
|
+
() => o.modelValue,
|
|
2009
|
+
(k) => {
|
|
2010
|
+
h.value || (h.value = !0, I.value = k ?? "", he(() => {
|
|
2011
|
+
J(k ?? ""), h.value = !1;
|
|
2012
|
+
}));
|
|
2013
|
+
},
|
|
2014
|
+
{ immediate: !0 }
|
|
2015
|
+
), Y(P, (k) => {
|
|
2016
|
+
k && p.value && (p.value.value = k);
|
|
2017
|
+
});
|
|
2018
|
+
function ae() {
|
|
2019
|
+
h.value || (h.value = !0, i("update:modelValue", I.value || null), he(() => {
|
|
2020
|
+
J(I.value), h.value = !1;
|
|
2021
|
+
}));
|
|
2022
|
+
}
|
|
2023
|
+
function ee(k) {
|
|
2024
|
+
const M = k.target;
|
|
2025
|
+
if (M?.value) {
|
|
2026
|
+
const K = yt(M.value);
|
|
2027
|
+
P.value = K, I.value = K, i("update:modelValue", K);
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
function F() {
|
|
2031
|
+
p.value?.click();
|
|
2032
|
+
}
|
|
2033
|
+
function D() {
|
|
2034
|
+
I.value = "", P.value = "", i("update:modelValue", null);
|
|
2035
|
+
}
|
|
2036
|
+
function z(k) {
|
|
2037
|
+
y.value = !1, i("blur", k);
|
|
2038
|
+
}
|
|
2039
|
+
function W() {
|
|
2040
|
+
y.value = !0, i("focus");
|
|
2041
|
+
}
|
|
2042
|
+
function X() {
|
|
2043
|
+
B.value?.focus();
|
|
2044
|
+
}
|
|
2045
|
+
return t({ focus: X }), (k, M) => r(a) ? (v(), b("div", $l, [
|
|
2046
|
+
e.label ? (v(), N(r(le), {
|
|
2047
|
+
key: 0,
|
|
2048
|
+
variant: "block",
|
|
2049
|
+
width: 60 + (e.label?.length || 0) * 4,
|
|
2050
|
+
height: 11
|
|
2051
|
+
}, null, 8, ["width"])) : w("", !0),
|
|
2052
|
+
x(r(le), {
|
|
2053
|
+
variant: "block",
|
|
2054
|
+
width: "100%",
|
|
2055
|
+
height: 36
|
|
2056
|
+
})
|
|
2057
|
+
])) : (v(), b("div", {
|
|
2058
|
+
key: 1,
|
|
2059
|
+
class: j(["vc-color-input", [
|
|
2060
|
+
{
|
|
2061
|
+
"vc-color-input--error": r(m),
|
|
2062
|
+
"vc-color-input--disabled": r(g),
|
|
2063
|
+
"vc-color-input--focused": y.value
|
|
2064
|
+
}
|
|
2065
|
+
]])
|
|
2066
|
+
}, [
|
|
2067
|
+
e.label ? (v(), N(r(He), {
|
|
2068
|
+
key: 0,
|
|
2069
|
+
id: r(s),
|
|
2070
|
+
"html-for": r(l),
|
|
2071
|
+
class: "vc-color-input__label",
|
|
2072
|
+
required: e.required,
|
|
2073
|
+
multilanguage: e.multilanguage,
|
|
2074
|
+
"current-language": e.currentLanguage,
|
|
2075
|
+
error: r(m)
|
|
2076
|
+
}, ie({
|
|
2077
|
+
default: O(() => [
|
|
2078
|
+
L("span", null, T(e.label), 1)
|
|
2079
|
+
]),
|
|
2080
|
+
_: 2
|
|
2081
|
+
}, [
|
|
2082
|
+
e.tooltip ? {
|
|
2083
|
+
name: "tooltip",
|
|
2084
|
+
fn: O(() => [
|
|
2085
|
+
Q(T(e.tooltip), 1)
|
|
2086
|
+
]),
|
|
2087
|
+
key: "0"
|
|
2088
|
+
} : void 0
|
|
2089
|
+
]), 1032, ["id", "html-for", "required", "multilanguage", "current-language", "error"])) : w("", !0),
|
|
2090
|
+
L("div", {
|
|
2091
|
+
class: j(["vc-color-input__field-wrapper", {
|
|
2092
|
+
"vc-color-input__field-wrapper--default": e.size === "default",
|
|
2093
|
+
"vc-color-input__field-wrapper--small": e.size === "small"
|
|
2094
|
+
}])
|
|
2095
|
+
}, [
|
|
2096
|
+
L("div", wl, [
|
|
2097
|
+
L("div", Ol, [
|
|
2098
|
+
rt(L("input", {
|
|
2099
|
+
id: r(l),
|
|
2100
|
+
ref_key: "inputRef",
|
|
2101
|
+
ref: B,
|
|
2102
|
+
"onUpdate:modelValue": M[0] || (M[0] = (K) => I.value = K),
|
|
2103
|
+
placeholder: e.placeholder,
|
|
2104
|
+
type: "text",
|
|
2105
|
+
disabled: r(g),
|
|
2106
|
+
name: e.name,
|
|
2107
|
+
autofocus: e.autofocus,
|
|
2108
|
+
"aria-invalid": r(m) || void 0,
|
|
2109
|
+
"aria-required": r(c),
|
|
2110
|
+
"aria-describedby": r(d),
|
|
2111
|
+
"aria-labelledby": e.label ? r(s) : void 0,
|
|
2112
|
+
class: "vc-color-input__input",
|
|
2113
|
+
tabindex: "0",
|
|
2114
|
+
onBlur: z,
|
|
2115
|
+
onFocus: W,
|
|
2116
|
+
onInput: ae
|
|
2117
|
+
}, null, 40, El), [
|
|
2118
|
+
[sn, I.value]
|
|
2119
|
+
]),
|
|
2120
|
+
L("div", Ll, [
|
|
2121
|
+
L("button", {
|
|
2122
|
+
type: "button",
|
|
2123
|
+
class: "vc-color-input__color-square",
|
|
2124
|
+
style: Re({ backgroundColor: P.value || "#ffffff" }),
|
|
2125
|
+
"aria-label": `Pick color${P.value ? ": " + P.value : ""}`,
|
|
2126
|
+
onClick: F
|
|
2127
|
+
}, null, 12, Bl),
|
|
2128
|
+
L("input", {
|
|
2129
|
+
ref_key: "colorPickerRef",
|
|
2130
|
+
ref: p,
|
|
2131
|
+
type: "color",
|
|
2132
|
+
value: P.value,
|
|
2133
|
+
class: "vc-color-input__color-picker-hidden",
|
|
2134
|
+
tabindex: "-1",
|
|
2135
|
+
"aria-hidden": "true",
|
|
2136
|
+
onChange: ee
|
|
2137
|
+
}, null, 40, Cl)
|
|
2138
|
+
]),
|
|
2139
|
+
e.clearable && I.value && !e.disabled ? (v(), b("button", {
|
|
2140
|
+
key: 0,
|
|
2141
|
+
type: "button",
|
|
2142
|
+
class: "vc-color-input__clear",
|
|
2143
|
+
"aria-label": k.$t("COMPONENTS.MOLECULES.VC_COLOR_INPUT.CLEAR"),
|
|
2144
|
+
onClick: D
|
|
2145
|
+
}, [
|
|
2146
|
+
x(r(U), {
|
|
2147
|
+
size: "xs",
|
|
2148
|
+
icon: "lucide-x"
|
|
2149
|
+
})
|
|
2150
|
+
], 8, xl)) : w("", !0)
|
|
2151
|
+
]),
|
|
2152
|
+
e.loading ? (v(), b("div", Tl, [
|
|
2153
|
+
x(r(U), {
|
|
2154
|
+
icon: "lucide-loader-2",
|
|
2155
|
+
class: "vc-color-input__loading-icon",
|
|
2156
|
+
size: "m"
|
|
2157
|
+
})
|
|
2158
|
+
])) : w("", !0)
|
|
2159
|
+
])
|
|
2160
|
+
], 2),
|
|
2161
|
+
x(Ae, {
|
|
2162
|
+
name: "slide-up",
|
|
2163
|
+
mode: "out-in"
|
|
2164
|
+
}, {
|
|
2165
|
+
default: O(() => [
|
|
2166
|
+
r(m) && e.errorMessage ? (v(), b("div", Ml, [
|
|
2167
|
+
x(r(fe), {
|
|
2168
|
+
id: r(u),
|
|
2169
|
+
class: "vc-color-input__hint-error",
|
|
2170
|
+
error: !0
|
|
2171
|
+
}, {
|
|
2172
|
+
default: O(() => [
|
|
2173
|
+
Q(T(e.errorMessage), 1)
|
|
2174
|
+
]),
|
|
2175
|
+
_: 1
|
|
2176
|
+
}, 8, ["id"])
|
|
2177
|
+
])) : (v(), b("div", Rl, [
|
|
2178
|
+
e.hint ? (v(), N(r(fe), {
|
|
2179
|
+
key: 0,
|
|
2180
|
+
id: r(f),
|
|
2181
|
+
class: "vc-color-input__desc"
|
|
2182
|
+
}, {
|
|
2183
|
+
default: O(() => [
|
|
2184
|
+
Q(T(e.hint), 1)
|
|
2185
|
+
]),
|
|
2186
|
+
_: 1
|
|
2187
|
+
}, 8, ["id"])) : w("", !0)
|
|
2188
|
+
]))
|
|
2189
|
+
]),
|
|
2190
|
+
_: 1
|
|
2191
|
+
})
|
|
2192
|
+
], 2));
|
|
2193
|
+
}
|
|
2194
|
+
}), Nl = { class: "vc-input__container" }, Dl = {
|
|
2195
|
+
key: 0,
|
|
2196
|
+
class: "vc-input__prepend"
|
|
2197
|
+
}, Vl = { class: "vc-input__field-container" }, Pl = {
|
|
2198
|
+
key: 0,
|
|
2199
|
+
class: "vc-input__prepend-inner"
|
|
2200
|
+
}, Fl = { class: "vc-input__field" }, zl = {
|
|
2201
|
+
key: 0,
|
|
2202
|
+
class: "vc-input__prefix"
|
|
2203
|
+
}, ql = ["id", "placeholder", "type", "disabled", "name", "maxlength", "autofocus", "autocomplete", "aria-invalid", "aria-required", "aria-describedby", "aria-labelledby"], Ul = {
|
|
2204
|
+
key: 1,
|
|
2205
|
+
class: "vc-input__suffix"
|
|
2206
|
+
}, Kl = ["aria-label"], Wl = ["aria-label"], jl = {
|
|
2207
|
+
key: 1,
|
|
2208
|
+
class: "vc-input__append-inner"
|
|
2209
|
+
}, Hl = {
|
|
2210
|
+
key: 2,
|
|
2211
|
+
class: "vc-input__loading"
|
|
2212
|
+
}, Gl = {
|
|
2213
|
+
key: 1,
|
|
2214
|
+
class: "vc-input__append"
|
|
2215
|
+
}, Yl = { key: 0 }, Jl = { key: 1 }, gt = /* @__PURE__ */ V({
|
|
2216
|
+
inheritAttrs: !1,
|
|
2217
|
+
__name: "vc-input",
|
|
2218
|
+
props: {
|
|
2219
|
+
modelValue: {},
|
|
2220
|
+
type: { default: "text" },
|
|
2221
|
+
prefix: {},
|
|
2222
|
+
suffix: {},
|
|
2223
|
+
debounce: {},
|
|
2224
|
+
maxlength: { default: "1024" },
|
|
2225
|
+
step: { default: "1" },
|
|
2226
|
+
autocomplete: {},
|
|
2227
|
+
datePickerOptions: {},
|
|
2228
|
+
placeholder: {},
|
|
2229
|
+
hint: {},
|
|
2230
|
+
clearable: { type: Boolean },
|
|
2231
|
+
loading: { type: Boolean },
|
|
2232
|
+
autofocus: { type: Boolean },
|
|
2233
|
+
size: { default: "default" },
|
|
2234
|
+
multilanguage: { type: Boolean },
|
|
2235
|
+
currentLanguage: {},
|
|
2236
|
+
label: {},
|
|
2237
|
+
tooltip: {},
|
|
2238
|
+
disabled: { type: Boolean },
|
|
2239
|
+
required: { type: Boolean },
|
|
2240
|
+
name: { default: "Field" },
|
|
2241
|
+
error: { type: Boolean },
|
|
2242
|
+
errorMessage: {}
|
|
2243
|
+
},
|
|
2244
|
+
emits: ["update:modelValue", "blur", "focus"],
|
|
2245
|
+
setup(e, { emit: t }) {
|
|
2246
|
+
const n = e, a = wt(), o = $(() => {
|
|
2247
|
+
const { class: E, ...q } = a;
|
|
2248
|
+
return q;
|
|
2249
|
+
}), i = t, l = Se(), {
|
|
2250
|
+
fieldId: s,
|
|
2251
|
+
labelId: u,
|
|
2252
|
+
errorId: f,
|
|
2253
|
+
hintId: m,
|
|
2254
|
+
invalid: g,
|
|
2255
|
+
resolvedDisabled: c,
|
|
2256
|
+
resolvedName: d,
|
|
2257
|
+
ariaRequired: y,
|
|
2258
|
+
ariaDescribedBy: h
|
|
2259
|
+
} = Ke(n);
|
|
2260
|
+
let B, p;
|
|
2261
|
+
const I = S(), P = S(), J = S(r(n.type)), ae = S(!1), ee = S(), F = $({
|
|
2262
|
+
get() {
|
|
2263
|
+
return J.value === "integer" ? "number" : J.value;
|
|
2264
|
+
},
|
|
2265
|
+
set(E) {
|
|
2266
|
+
J.value = E;
|
|
2267
|
+
}
|
|
2268
|
+
}), D = $(() => r(n.modelValue)), z = $({
|
|
2269
|
+
get() {
|
|
2270
|
+
return (n.type === "integer" || n.type === "number") && isNaN(I.value) ? "" : I.value;
|
|
2271
|
+
},
|
|
2272
|
+
set(E) {
|
|
2273
|
+
(n.type === "number" || n.type === "integer") && E < 0 ? I.value = Math.abs(E) : I.value = E, X(I.value);
|
|
2274
|
+
}
|
|
2275
|
+
});
|
|
2276
|
+
Y(
|
|
2277
|
+
D,
|
|
2278
|
+
(E) => {
|
|
2279
|
+
n.type === "number" && E !== null ? ee.value = parseFloat(E) : n.type === "integer" && E !== null ? ee.value = Math.trunc(E) : ee.value = E, I.value !== ee.value && (I.value = ee.value);
|
|
2280
|
+
},
|
|
2281
|
+
{ immediate: !0 }
|
|
2282
|
+
);
|
|
2283
|
+
function W(E) {
|
|
2284
|
+
const q = ["Backspace", "Delete", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], A = E.key;
|
|
2285
|
+
if ((n.type === "number" || n.type === "integer") && (A === "-" || A === "e" || A === "+") && E.preventDefault(), n.type === "integer" && !/^\d$/.test(A) && !q.includes(A)) {
|
|
2286
|
+
E.preventDefault();
|
|
2287
|
+
return;
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
function X(E) {
|
|
2291
|
+
k(E);
|
|
2292
|
+
}
|
|
2293
|
+
function k(E) {
|
|
2294
|
+
p = () => {
|
|
2295
|
+
if (ee.value !== E) {
|
|
2296
|
+
let q;
|
|
2297
|
+
n.type === "number" && E !== null && E !== void 0 ? q = E !== "" ? parseFloat(E) : null : n.type === "integer" && E !== null && E !== void 0 ? q = E !== "" ? Math.trunc(parseInt(E)) : null : q = E, i("update:modelValue", q);
|
|
2298
|
+
}
|
|
2299
|
+
p = void 0;
|
|
2300
|
+
}, n.debounce !== void 0 ? (clearTimeout(B), B = setTimeout(p, +n.debounce)) : p();
|
|
2301
|
+
}
|
|
2302
|
+
function M() {
|
|
2303
|
+
I.value = null, i("update:modelValue", null);
|
|
2304
|
+
}
|
|
2305
|
+
function K(E) {
|
|
2306
|
+
ae.value = !1, i("blur", E);
|
|
2307
|
+
}
|
|
2308
|
+
function te() {
|
|
2309
|
+
P.value?.focus();
|
|
2310
|
+
}
|
|
2311
|
+
function Ve() {
|
|
2312
|
+
ae.value = !0, i("focus");
|
|
2313
|
+
}
|
|
2314
|
+
return (E, q) => r(l) ? (v(), b("div", ne({ key: 0 }, o.value, {
|
|
2315
|
+
class: ["vc-input vc-input--skeleton", E.$attrs.class]
|
|
2316
|
+
}), [
|
|
2317
|
+
e.label ? (v(), N(r(le), {
|
|
2318
|
+
key: 0,
|
|
2319
|
+
variant: "block",
|
|
2320
|
+
width: 60 + (e.label?.length || 0) * 4,
|
|
2321
|
+
height: 11
|
|
2322
|
+
}, null, 8, ["width"])) : w("", !0),
|
|
2323
|
+
x(r(le), {
|
|
2324
|
+
variant: "block",
|
|
2325
|
+
width: "100%",
|
|
2326
|
+
height: 36
|
|
2327
|
+
})
|
|
2328
|
+
], 16)) : e.type === "date" || e.type === "datetime-local" ? (v(), N(r(Sl), ne({ key: 1 }, r(a), {
|
|
2329
|
+
"model-value": e.modelValue,
|
|
2330
|
+
type: e.type,
|
|
2331
|
+
"date-picker-options": e.datePickerOptions,
|
|
2332
|
+
label: e.label,
|
|
2333
|
+
placeholder: e.placeholder,
|
|
2334
|
+
hint: e.hint,
|
|
2335
|
+
disabled: e.disabled,
|
|
2336
|
+
error: e.error,
|
|
2337
|
+
"error-message": e.errorMessage,
|
|
2338
|
+
required: e.required,
|
|
2339
|
+
clearable: e.clearable,
|
|
2340
|
+
loading: e.loading,
|
|
2341
|
+
autofocus: e.autofocus,
|
|
2342
|
+
size: e.size,
|
|
2343
|
+
tooltip: e.tooltip,
|
|
2344
|
+
multilanguage: e.multilanguage,
|
|
2345
|
+
"current-language": e.currentLanguage,
|
|
2346
|
+
name: e.name,
|
|
2347
|
+
"onUpdate:modelValue": q[0] || (q[0] = (A) => i("update:modelValue", A ?? null)),
|
|
2348
|
+
onBlur: q[1] || (q[1] = (A) => i("blur", A)),
|
|
2349
|
+
onFocus: q[2] || (q[2] = (A) => i("focus"))
|
|
2350
|
+
}), null, 16, ["model-value", "type", "date-picker-options", "label", "placeholder", "hint", "disabled", "error", "error-message", "required", "clearable", "loading", "autofocus", "size", "tooltip", "multilanguage", "current-language", "name"])) : e.type === "color" ? (v(), N(r(Al), ne({ key: 2 }, r(a), {
|
|
2351
|
+
"model-value": e.modelValue ?? null,
|
|
2352
|
+
label: e.label,
|
|
2353
|
+
placeholder: e.placeholder,
|
|
2354
|
+
hint: e.hint,
|
|
2355
|
+
disabled: e.disabled,
|
|
2356
|
+
error: e.error,
|
|
2357
|
+
"error-message": e.errorMessage,
|
|
2358
|
+
required: e.required,
|
|
2359
|
+
clearable: e.clearable,
|
|
2360
|
+
loading: e.loading,
|
|
2361
|
+
autofocus: e.autofocus,
|
|
2362
|
+
size: e.size,
|
|
2363
|
+
tooltip: e.tooltip,
|
|
2364
|
+
multilanguage: e.multilanguage,
|
|
2365
|
+
"current-language": e.currentLanguage,
|
|
2366
|
+
name: e.name,
|
|
2367
|
+
"onUpdate:modelValue": q[3] || (q[3] = (A) => i("update:modelValue", A)),
|
|
2368
|
+
onBlur: q[4] || (q[4] = (A) => i("blur", A)),
|
|
2369
|
+
onFocus: q[5] || (q[5] = (A) => i("focus"))
|
|
2370
|
+
}), null, 16, ["model-value", "label", "placeholder", "hint", "disabled", "error", "error-message", "required", "clearable", "loading", "autofocus", "size", "tooltip", "multilanguage", "current-language", "name"])) : (v(), b("div", ne({ key: 3 }, o.value, {
|
|
2371
|
+
class: ["vc-input", [
|
|
2372
|
+
E.$attrs.class,
|
|
2373
|
+
`vc-input--${e.type}`,
|
|
2374
|
+
{
|
|
2375
|
+
"vc-input--clearable": e.clearable,
|
|
2376
|
+
"vc-input--error": r(g),
|
|
2377
|
+
"vc-input--disabled": r(c),
|
|
2378
|
+
"vc-input--focused": ae.value
|
|
2379
|
+
}
|
|
2380
|
+
]]
|
|
2381
|
+
}), [
|
|
2382
|
+
e.label ? (v(), N(r(He), {
|
|
2383
|
+
key: 0,
|
|
2384
|
+
id: r(u),
|
|
2385
|
+
"html-for": r(s),
|
|
2386
|
+
class: "vc-input__label",
|
|
2387
|
+
required: e.required,
|
|
2388
|
+
multilanguage: e.multilanguage,
|
|
2389
|
+
"current-language": e.currentLanguage,
|
|
2390
|
+
error: r(g)
|
|
2391
|
+
}, ie({
|
|
2392
|
+
default: O(() => [
|
|
2393
|
+
L("span", null, T(e.label), 1)
|
|
2394
|
+
]),
|
|
2395
|
+
_: 2
|
|
2396
|
+
}, [
|
|
2397
|
+
e.tooltip ? {
|
|
2398
|
+
name: "tooltip",
|
|
2399
|
+
fn: O(() => [
|
|
2400
|
+
Q(T(e.tooltip), 1)
|
|
2401
|
+
]),
|
|
2402
|
+
key: "0"
|
|
2403
|
+
} : void 0
|
|
2404
|
+
]), 1032, ["id", "html-for", "required", "multilanguage", "current-language", "error"])) : w("", !0),
|
|
2405
|
+
L("div", Nl, [
|
|
2406
|
+
E.$slots.prepend ? (v(), b("div", Dl, [
|
|
2407
|
+
C(E.$slots, "prepend", { focus: te })
|
|
2408
|
+
])) : w("", !0),
|
|
2409
|
+
L("div", {
|
|
2410
|
+
class: j(["vc-input__field-wrapper", {
|
|
2411
|
+
"vc-input__field-wrapper--default": e.size === "default",
|
|
2412
|
+
"vc-input__field-wrapper--small": e.size === "small"
|
|
2413
|
+
}])
|
|
2414
|
+
}, [
|
|
2415
|
+
L("div", Vl, [
|
|
2416
|
+
E.$slots["prepend-inner"] ? (v(), b("div", Pl, [
|
|
2417
|
+
C(E.$slots, "prepend-inner", { focus: te })
|
|
2418
|
+
])) : w("", !0),
|
|
2419
|
+
L("div", Fl, [
|
|
2420
|
+
e.prefix ? (v(), b("div", zl, T(e.prefix), 1)) : w("", !0),
|
|
2421
|
+
C(E.$slots, "control", {
|
|
2422
|
+
editable: r(c),
|
|
2423
|
+
focused: e.autofocus,
|
|
2424
|
+
modelValue: z.value,
|
|
2425
|
+
emitValue: k,
|
|
2426
|
+
placeholder: e.placeholder
|
|
2427
|
+
}, () => [
|
|
2428
|
+
rt(L("input", {
|
|
2429
|
+
id: r(s),
|
|
2430
|
+
ref_key: "inputRef",
|
|
2431
|
+
ref: P,
|
|
2432
|
+
"onUpdate:modelValue": q[6] || (q[6] = (A) => z.value = A),
|
|
2433
|
+
placeholder: e.placeholder,
|
|
2434
|
+
type: F.value,
|
|
2435
|
+
disabled: r(c),
|
|
2436
|
+
name: r(d),
|
|
2437
|
+
maxlength: e.maxlength,
|
|
2438
|
+
autofocus: e.autofocus,
|
|
2439
|
+
autocomplete: e.autocomplete,
|
|
2440
|
+
"aria-invalid": r(g) || void 0,
|
|
2441
|
+
"aria-required": r(y),
|
|
2442
|
+
"aria-describedby": r(h),
|
|
2443
|
+
"aria-labelledby": e.label ? r(u) : void 0,
|
|
2444
|
+
class: "vc-input__input",
|
|
2445
|
+
tabindex: "0",
|
|
2446
|
+
onKeydown: W,
|
|
2447
|
+
onBlur: K,
|
|
2448
|
+
onFocus: Ve
|
|
2449
|
+
}, null, 40, ql), [
|
|
2450
|
+
[un, z.value]
|
|
2451
|
+
])
|
|
2452
|
+
]),
|
|
2453
|
+
e.suffix ? (v(), b("div", Ul, T(e.suffix), 1)) : w("", !0),
|
|
2454
|
+
e.clearable && ee.value && !r(c) && e.type !== "password" ? (v(), b("button", {
|
|
2455
|
+
key: 2,
|
|
2456
|
+
type: "button",
|
|
2457
|
+
class: "vc-input__clear",
|
|
2458
|
+
"aria-label": E.$t("COMPONENTS.CONTROLS.CLEAR"),
|
|
2459
|
+
onClick: M
|
|
2460
|
+
}, [
|
|
2461
|
+
x(r(U), {
|
|
2462
|
+
size: "xs",
|
|
2463
|
+
icon: "lucide-x"
|
|
2464
|
+
})
|
|
2465
|
+
], 8, Kl)) : w("", !0),
|
|
2466
|
+
e.type === "password" ? (v(), b("button", {
|
|
2467
|
+
key: 3,
|
|
2468
|
+
type: "button",
|
|
2469
|
+
class: "vc-input__showhide",
|
|
2470
|
+
"aria-label": J.value === "password" ? E.$t("COMPONENTS.CONTROLS.SHOW_PASSWORD") : E.$t("COMPONENTS.CONTROLS.HIDE_PASSWORD"),
|
|
2471
|
+
onClick: q[7] || (q[7] = (A) => J.value = J.value === "password" ? "text" : "password")
|
|
2472
|
+
}, [
|
|
2473
|
+
x(r(U), {
|
|
2474
|
+
size: "s",
|
|
2475
|
+
icon: J.value === "password" ? "lucide-eye-off" : "lucide-eye"
|
|
2476
|
+
}, null, 8, ["icon"])
|
|
2477
|
+
], 8, Wl)) : w("", !0)
|
|
2478
|
+
]),
|
|
2479
|
+
E.$slots["append-inner"] ? (v(), b("div", jl, [
|
|
2480
|
+
C(E.$slots, "append-inner", { focus: te })
|
|
2481
|
+
])) : w("", !0),
|
|
2482
|
+
e.loading ? (v(), b("div", Hl, [
|
|
2483
|
+
x(r(U), {
|
|
2484
|
+
icon: "lucide-loader-2",
|
|
2485
|
+
class: "vc-input__loading-icon",
|
|
2486
|
+
size: "m"
|
|
2487
|
+
})
|
|
2488
|
+
])) : w("", !0)
|
|
2489
|
+
])
|
|
2490
|
+
], 2),
|
|
2491
|
+
E.$slots.append ? (v(), b("div", Gl, [
|
|
2492
|
+
C(E.$slots, "append", { focus: te })
|
|
2493
|
+
])) : w("", !0)
|
|
2494
|
+
]),
|
|
2495
|
+
x(Ae, {
|
|
2496
|
+
name: "slide-up",
|
|
2497
|
+
mode: "out-in"
|
|
2498
|
+
}, {
|
|
2499
|
+
default: O(() => [
|
|
2500
|
+
r(g) && e.errorMessage ? (v(), b("div", Yl, [
|
|
2501
|
+
C(E.$slots, "error", {}, () => [
|
|
2502
|
+
x(r(fe), {
|
|
2503
|
+
id: r(f),
|
|
2504
|
+
class: "vc-input__hint-error",
|
|
2505
|
+
error: !0
|
|
2506
|
+
}, {
|
|
2507
|
+
default: O(() => [
|
|
2508
|
+
Q(T(e.errorMessage), 1)
|
|
2509
|
+
]),
|
|
2510
|
+
_: 1
|
|
2511
|
+
}, 8, ["id"])
|
|
2512
|
+
])
|
|
2513
|
+
])) : (v(), b("div", Jl, [
|
|
2514
|
+
C(E.$slots, "hint", {}, () => [
|
|
2515
|
+
e.hint ? (v(), N(r(fe), {
|
|
2516
|
+
key: 0,
|
|
2517
|
+
id: r(m),
|
|
2518
|
+
class: "vc-input__desc"
|
|
2519
|
+
}, {
|
|
2520
|
+
default: O(() => [
|
|
2521
|
+
Q(T(e.hint), 1)
|
|
2522
|
+
]),
|
|
2523
|
+
_: 1
|
|
2524
|
+
}, 8, ["id"])) : w("", !0)
|
|
2525
|
+
])
|
|
2526
|
+
]))
|
|
2527
|
+
]),
|
|
2528
|
+
_: 3
|
|
2529
|
+
})
|
|
2530
|
+
], 16));
|
|
2531
|
+
}
|
|
2532
|
+
}), yr = Rn.create({
|
|
2533
|
+
name: "fontSize",
|
|
2534
|
+
addOptions() {
|
|
2535
|
+
return {
|
|
2536
|
+
types: ["textStyle"]
|
|
2537
|
+
};
|
|
2538
|
+
},
|
|
2539
|
+
addGlobalAttributes() {
|
|
2540
|
+
return [
|
|
2541
|
+
{
|
|
2542
|
+
types: this.options.types,
|
|
2543
|
+
attributes: {
|
|
2544
|
+
fontSize: {
|
|
2545
|
+
default: null,
|
|
2546
|
+
parseHTML: (e) => e.style.fontSize?.replace(/['"]+/g, ""),
|
|
2547
|
+
renderHTML: (e) => e.fontSize ? {
|
|
2548
|
+
style: `font-size: ${e.fontSize}`
|
|
2549
|
+
} : {}
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
];
|
|
2554
|
+
},
|
|
2555
|
+
addCommands() {
|
|
2556
|
+
return {
|
|
2557
|
+
setFontSize: (e) => ({ chain: t }) => t().setMark("textStyle", { fontSize: e }).run(),
|
|
2558
|
+
unsetFontSize: () => ({ chain: e }) => e().setMark("textStyle", { fontSize: null }).run()
|
|
2559
|
+
};
|
|
2560
|
+
}
|
|
2561
|
+
});
|
|
2562
|
+
function Xl(e = {}) {
|
|
2563
|
+
const {
|
|
2564
|
+
containerSelector: t = '[role="menu"]',
|
|
2565
|
+
itemSelector: n = '[tabindex="0"]',
|
|
2566
|
+
onEnter: a,
|
|
2567
|
+
onEscape: o,
|
|
2568
|
+
loop: i = !0
|
|
2569
|
+
} = e, l = S(null), s = S(-1), u = (p) => {
|
|
2570
|
+
(s.value >= p.length || s.value < 0) && (s.value = p.length > 0 ? 0 : -1);
|
|
2571
|
+
}, f = (p) => {
|
|
2572
|
+
if (!l.value) return;
|
|
2573
|
+
const I = Array.from(l.value.querySelectorAll(n));
|
|
2574
|
+
if (I.length)
|
|
2575
|
+
switch (u(I), p.key) {
|
|
2576
|
+
case "Tab":
|
|
2577
|
+
m(p, I);
|
|
2578
|
+
break;
|
|
2579
|
+
case "ArrowDown":
|
|
2580
|
+
p.preventDefault(), g(I);
|
|
2581
|
+
break;
|
|
2582
|
+
case "ArrowUp":
|
|
2583
|
+
p.preventDefault(), c(I);
|
|
2584
|
+
break;
|
|
2585
|
+
case "Enter":
|
|
2586
|
+
case " ":
|
|
2587
|
+
if (s.value >= 0 && s.value < I.length) {
|
|
2588
|
+
const P = I[s.value];
|
|
2589
|
+
P && (p.preventDefault(), a ? a(P) : typeof P.click == "function" && P.click());
|
|
2590
|
+
}
|
|
2591
|
+
break;
|
|
2592
|
+
case "Escape":
|
|
2593
|
+
o && (p.preventDefault(), o());
|
|
2594
|
+
break;
|
|
2595
|
+
}
|
|
2596
|
+
}, m = (p, I) => {
|
|
2597
|
+
p.shiftKey ? c(I) : g(I);
|
|
2598
|
+
}, g = (p) => {
|
|
2599
|
+
if (!p.length) return;
|
|
2600
|
+
if (u(p), s.value < p.length - 1)
|
|
2601
|
+
s.value++;
|
|
2602
|
+
else if (i)
|
|
2603
|
+
s.value = 0;
|
|
2604
|
+
else
|
|
2605
|
+
return;
|
|
2606
|
+
const I = p[s.value];
|
|
2607
|
+
I && typeof I.focus == "function" && I.focus();
|
|
2608
|
+
}, c = (p) => {
|
|
2609
|
+
if (!p.length) return;
|
|
2610
|
+
if (u(p), s.value > 0)
|
|
2611
|
+
s.value--;
|
|
2612
|
+
else if (i)
|
|
2613
|
+
s.value = p.length - 1;
|
|
2614
|
+
else
|
|
2615
|
+
return;
|
|
2616
|
+
const I = p[s.value];
|
|
2617
|
+
I && typeof I.focus == "function" && I.focus();
|
|
2618
|
+
}, d = (p) => {
|
|
2619
|
+
if (!p.length) return;
|
|
2620
|
+
s.value = 0;
|
|
2621
|
+
const I = p[0];
|
|
2622
|
+
I && typeof I.focus == "function" && I.focus();
|
|
2623
|
+
}, y = (p) => {
|
|
2624
|
+
if (!p.length) return;
|
|
2625
|
+
s.value = p.length - 1;
|
|
2626
|
+
const I = p[p.length - 1];
|
|
2627
|
+
I && typeof I.focus == "function" && I.focus();
|
|
2628
|
+
}, h = (p) => {
|
|
2629
|
+
l.value && l.value.removeEventListener("keydown", f), l.value = p, p.addEventListener("keydown", f);
|
|
2630
|
+
}, B = () => {
|
|
2631
|
+
l.value && (l.value.removeEventListener("keydown", f), l.value = null);
|
|
2632
|
+
};
|
|
2633
|
+
return Ue(() => {
|
|
2634
|
+
if (typeof document < "u" && t) {
|
|
2635
|
+
const p = document.querySelector(t);
|
|
2636
|
+
p && h(p);
|
|
2637
|
+
}
|
|
2638
|
+
}), lt(() => {
|
|
2639
|
+
B();
|
|
2640
|
+
}), {
|
|
2641
|
+
initKeyboardNavigation: h,
|
|
2642
|
+
cleanupKeyboardNavigation: B,
|
|
2643
|
+
focusNextElement: () => {
|
|
2644
|
+
if (l.value) {
|
|
2645
|
+
const p = Array.from(l.value.querySelectorAll(n));
|
|
2646
|
+
g(p);
|
|
2647
|
+
}
|
|
2648
|
+
},
|
|
2649
|
+
focusPreviousElement: () => {
|
|
2650
|
+
if (l.value) {
|
|
2651
|
+
const p = Array.from(l.value.querySelectorAll(n));
|
|
2652
|
+
c(p);
|
|
2653
|
+
}
|
|
2654
|
+
},
|
|
2655
|
+
focusFirstElement: () => {
|
|
2656
|
+
if (l.value) {
|
|
2657
|
+
const p = Array.from(l.value.querySelectorAll(n));
|
|
2658
|
+
d(p);
|
|
2659
|
+
}
|
|
2660
|
+
},
|
|
2661
|
+
focusLastElement: () => {
|
|
2662
|
+
if (l.value) {
|
|
2663
|
+
const p = Array.from(l.value.querySelectorAll(n));
|
|
2664
|
+
y(p);
|
|
2665
|
+
}
|
|
2666
|
+
},
|
|
2667
|
+
setFocusedIndex: (p) => {
|
|
2668
|
+
if (l.value) {
|
|
2669
|
+
const I = Array.from(l.value.querySelectorAll(n));
|
|
2670
|
+
p >= 0 && p < I.length && (s.value = p);
|
|
2671
|
+
}
|
|
2672
|
+
},
|
|
2673
|
+
getFocusedIndex: () => s.value
|
|
2674
|
+
};
|
|
2675
|
+
}
|
|
2676
|
+
function St(e, t) {
|
|
2677
|
+
const n = e !== void 0 ? e : t;
|
|
2678
|
+
return typeof n == "function" ? n : (a) => a === null || typeof a != "object" ? a : n && n in a ? a[n] : a;
|
|
2679
|
+
}
|
|
2680
|
+
function Zl(e) {
|
|
2681
|
+
const t = $(() => St(e.optionValue(), "id")), n = $(() => St(e.optionLabel(), "title"));
|
|
2682
|
+
function a(l, s, u, f) {
|
|
2683
|
+
const m = (g) => Me(t.value(g), l);
|
|
2684
|
+
return u.find(m) || f.find(m) || s.find(m) || l;
|
|
2685
|
+
}
|
|
2686
|
+
function o(l) {
|
|
2687
|
+
return n.value(l);
|
|
2688
|
+
}
|
|
2689
|
+
function i(l) {
|
|
2690
|
+
return l != null && ("" + l).length > 0;
|
|
2691
|
+
}
|
|
2692
|
+
return {
|
|
2693
|
+
getOptionValue: t,
|
|
2694
|
+
getOptionLabel: n,
|
|
2695
|
+
getOption: a,
|
|
2696
|
+
getEmittingOptionValue: o,
|
|
2697
|
+
fieldValueIsFilled: i
|
|
2698
|
+
};
|
|
2699
|
+
}
|
|
2700
|
+
function Ql() {
|
|
2701
|
+
const e = S(null), t = S(!1);
|
|
2702
|
+
let n = null, a = null;
|
|
2703
|
+
function o() {
|
|
2704
|
+
if (e.value && !t.value) {
|
|
2705
|
+
const l = e.value.getBoundingClientRect();
|
|
2706
|
+
l.top < window.innerHeight && l.bottom > 0 && l.left < window.innerWidth && l.right > 0 && (t.value = !0);
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
function i() {
|
|
2710
|
+
if (!t.value && e.value) {
|
|
2711
|
+
const l = e.value.getBoundingClientRect();
|
|
2712
|
+
l.top < window.innerHeight && l.bottom > 0 && l.left < window.innerWidth && l.right > 0 && (t.value = !0);
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
return Ue(() => {
|
|
2716
|
+
e.value && (n = new IntersectionObserver(
|
|
2717
|
+
([l]) => {
|
|
2718
|
+
t.value = l.isIntersecting;
|
|
2719
|
+
},
|
|
2720
|
+
{ threshold: 0.1 }
|
|
2721
|
+
), n.observe(e.value), a = setTimeout(o, 100));
|
|
2722
|
+
}), Ot(() => {
|
|
2723
|
+
a !== null && (clearTimeout(a), a = null), n && e.value && n.unobserve(e.value), n && n.disconnect();
|
|
2724
|
+
}), {
|
|
2725
|
+
selectRootRef: e,
|
|
2726
|
+
isSelectVisible: t,
|
|
2727
|
+
ensureVisibility: i
|
|
2728
|
+
};
|
|
2729
|
+
}
|
|
2730
|
+
function _l(e) {
|
|
2731
|
+
const t = S(!1), n = S(!1), a = S(null), o = S(null);
|
|
2732
|
+
function i() {
|
|
2733
|
+
return {
|
|
2734
|
+
name: "sameWidth",
|
|
2735
|
+
fn({ rects: f }) {
|
|
2736
|
+
return {
|
|
2737
|
+
data: {
|
|
2738
|
+
width: e.outline() ? `${f.reference.width}px` : "max-content"
|
|
2739
|
+
}
|
|
2740
|
+
};
|
|
2741
|
+
}
|
|
2742
|
+
};
|
|
2743
|
+
}
|
|
2744
|
+
const l = ia(a, o, {
|
|
2745
|
+
placement: $(() => e.placement),
|
|
2746
|
+
middleware: $(() => [
|
|
2747
|
+
Tt({ fallbackPlacements: ["top", "bottom"] }),
|
|
2748
|
+
Mt({ mainAxis: !1 }),
|
|
2749
|
+
i(),
|
|
2750
|
+
tt({ mainAxis: 4 })
|
|
2751
|
+
])
|
|
2752
|
+
}), s = $(() => ({
|
|
2753
|
+
top: `${l.y.value ?? 0}px`,
|
|
2754
|
+
left: `${l.x.value ?? 0}px`,
|
|
2755
|
+
width: l.middlewareData.value.sameWidth?.width
|
|
2756
|
+
}));
|
|
2757
|
+
Y(
|
|
2758
|
+
() => l.isPositioned.value,
|
|
2759
|
+
(f) => {
|
|
2760
|
+
f && l.update();
|
|
2761
|
+
}
|
|
2762
|
+
);
|
|
2763
|
+
function u() {
|
|
2764
|
+
e.disabled() || (!t.value && !e.isSelectVisible.value && e.ensureVisibility(), t.value = !t.value);
|
|
2765
|
+
}
|
|
2766
|
+
return {
|
|
2767
|
+
isOpened: t,
|
|
2768
|
+
isFocused: n,
|
|
2769
|
+
dropdownToggleRef: a,
|
|
2770
|
+
dropdownRef: o,
|
|
2771
|
+
popper: l,
|
|
2772
|
+
dropdownStyle: s,
|
|
2773
|
+
toggleDropdown: u
|
|
2774
|
+
};
|
|
2775
|
+
}
|
|
2776
|
+
function eo(e) {
|
|
2777
|
+
const t = S([]), n = S(null), a = S(0), o = S(!1), i = S(!1), l = S(), s = S([]), u = S(!1), f = /* @__PURE__ */ new Map();
|
|
2778
|
+
let m = !1, g;
|
|
2779
|
+
const c = $(() => n.value ?? t.value), d = $(() => t.value.length < a.value);
|
|
2780
|
+
function y(F) {
|
|
2781
|
+
for (const D of F) {
|
|
2782
|
+
const z = String(e.getOptionValue.value(D));
|
|
2783
|
+
f.set(z, D);
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
async function h() {
|
|
2787
|
+
if (m)
|
|
2788
|
+
return;
|
|
2789
|
+
const F = e.options();
|
|
2790
|
+
if (typeof F == "function")
|
|
2791
|
+
try {
|
|
2792
|
+
o.value = !0;
|
|
2793
|
+
const D = await F(void 0, 0);
|
|
2794
|
+
t.value = D?.results ?? [], a.value = D?.totalCount ?? 0, y(t.value), m = !0;
|
|
2795
|
+
} catch (D) {
|
|
2796
|
+
console.error("useSelectDataSource: error loading options", D), t.value = [], a.value = 0;
|
|
2797
|
+
} finally {
|
|
2798
|
+
o.value = !1;
|
|
2799
|
+
}
|
|
2800
|
+
else Array.isArray(F) && (t.value = [...F], a.value = t.value.length, y(t.value), m = !0);
|
|
2801
|
+
}
|
|
2802
|
+
function B() {
|
|
2803
|
+
n.value = null, l.value = void 0, g && (clearTimeout(g), g = void 0);
|
|
2804
|
+
}
|
|
2805
|
+
async function p() {
|
|
2806
|
+
const F = e.options();
|
|
2807
|
+
if (!(typeof F != "function" || o.value))
|
|
2808
|
+
try {
|
|
2809
|
+
o.value = !0;
|
|
2810
|
+
const D = await F(l.value, t.value.length), z = new Set(t.value.map((X) => String(e.getOptionValue.value(X)))), W = (D?.results ?? []).filter(
|
|
2811
|
+
(X) => !z.has(String(e.getOptionValue.value(X)))
|
|
2812
|
+
);
|
|
2813
|
+
t.value = [...t.value, ...W], a.value = D?.totalCount ?? a.value, y(W);
|
|
2814
|
+
} catch (D) {
|
|
2815
|
+
console.error("useSelectDataSource: error loading more", D);
|
|
2816
|
+
} finally {
|
|
2817
|
+
o.value = !1;
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
async function I(F) {
|
|
2821
|
+
l.value = F;
|
|
2822
|
+
const D = e.options();
|
|
2823
|
+
if (typeof D == "function")
|
|
2824
|
+
try {
|
|
2825
|
+
i.value = !0;
|
|
2826
|
+
const z = await D(F);
|
|
2827
|
+
n.value = z?.results ?? [], a.value = z?.totalCount ?? 0, y(n.value);
|
|
2828
|
+
} catch (z) {
|
|
2829
|
+
console.error("useSelectDataSource: error searching", z), n.value = [];
|
|
2830
|
+
} finally {
|
|
2831
|
+
i.value = !1;
|
|
2832
|
+
}
|
|
2833
|
+
else
|
|
2834
|
+
n.value = t.value.filter((z) => {
|
|
2835
|
+
const W = e.getOptionLabel.value(z);
|
|
2836
|
+
return String(W).toLowerCase().includes(F.toLowerCase());
|
|
2837
|
+
});
|
|
2838
|
+
}
|
|
2839
|
+
function P(F) {
|
|
2840
|
+
if (!F?.target) return;
|
|
2841
|
+
const D = F.target.value, z = Number(e.debounce());
|
|
2842
|
+
g && clearTimeout(g), z > 0 ? g = setTimeout(() => {
|
|
2843
|
+
e.emit.search(D), I(D);
|
|
2844
|
+
}, z) : (e.emit.search(D), I(D));
|
|
2845
|
+
}
|
|
2846
|
+
function J() {
|
|
2847
|
+
n.value = null, l.value = void 0, g && (clearTimeout(g), g = void 0), a.value = t.value.length;
|
|
2848
|
+
}
|
|
2849
|
+
async function ae(F) {
|
|
2850
|
+
if (F.length === 0) return [];
|
|
2851
|
+
const z = F.filter((k) => !f.has(String(k))).filter((k) => {
|
|
2852
|
+
const M = t.value.find((K) => Me(e.getOptionValue.value(K), k));
|
|
2853
|
+
return M ? (f.set(String(k), M), !1) : !0;
|
|
2854
|
+
}), W = e.options();
|
|
2855
|
+
if (z.length > 0 && typeof W == "function") {
|
|
2856
|
+
try {
|
|
2857
|
+
u.value = !0;
|
|
2858
|
+
const M = await W(void 0, void 0, z);
|
|
2859
|
+
M?.results && y(M.results);
|
|
2860
|
+
} catch (M) {
|
|
2861
|
+
console.error("useSelectDataSource: error resolving", M);
|
|
2862
|
+
} finally {
|
|
2863
|
+
u.value = !1;
|
|
2864
|
+
}
|
|
2865
|
+
z.filter((M) => !f.has(String(M))).length > 0 && !m && await h();
|
|
2866
|
+
} else if (z.length > 0 && Array.isArray(W))
|
|
2867
|
+
for (const k of W) {
|
|
2868
|
+
const M = String(e.getOptionValue.value(k));
|
|
2869
|
+
z.includes(M) && f.set(M, k);
|
|
2870
|
+
}
|
|
2871
|
+
const X = F.map((k) => f.get(String(k))).filter(Boolean);
|
|
2872
|
+
return s.value = X, X;
|
|
2873
|
+
}
|
|
2874
|
+
async function ee() {
|
|
2875
|
+
t.value = [], n.value = null, a.value = 0, f.clear(), s.value = [], m = !1, await h();
|
|
2876
|
+
}
|
|
2877
|
+
return Y(
|
|
2878
|
+
e.options,
|
|
2879
|
+
async () => {
|
|
2880
|
+
t.value = [], n.value = null, a.value = 0, f.clear(), m = !1;
|
|
2881
|
+
const F = e.options();
|
|
2882
|
+
if (Array.isArray(F) && (t.value = [...F], a.value = t.value.length, y(t.value), m = !0, s.value.length === 0)) {
|
|
2883
|
+
const D = s.value;
|
|
2884
|
+
(D.length === 0 ? t.value.filter((W) => {
|
|
2885
|
+
const X = String(e.getOptionValue.value(W));
|
|
2886
|
+
return f.has(X);
|
|
2887
|
+
}) : D).length;
|
|
2888
|
+
}
|
|
2889
|
+
},
|
|
2890
|
+
{ deep: !1 }
|
|
2891
|
+
), {
|
|
2892
|
+
displayItems: c,
|
|
2893
|
+
loading: o,
|
|
2894
|
+
searchLoading: i,
|
|
2895
|
+
hasMore: d,
|
|
2896
|
+
filterString: l,
|
|
2897
|
+
resolvedDefaults: s,
|
|
2898
|
+
defaultOptionLoading: u,
|
|
2899
|
+
cachedItems: t,
|
|
2900
|
+
open: h,
|
|
2901
|
+
close: B,
|
|
2902
|
+
onInput: P,
|
|
2903
|
+
clearSearch: J,
|
|
2904
|
+
loadMore: p,
|
|
2905
|
+
resolve: ae,
|
|
2906
|
+
refresh: ee
|
|
2907
|
+
};
|
|
2908
|
+
}
|
|
2909
|
+
function to(e) {
|
|
2910
|
+
let t = [];
|
|
2911
|
+
const n = $(() => {
|
|
2912
|
+
const g = e.mapOptions() === !0 && e.multiple() !== !0, c = e.modelValue() !== void 0 && (e.modelValue() !== null || g === !0) ? e.multiple() === !0 && Array.isArray(e.modelValue()) ? e.modelValue() : [e.modelValue()] : [];
|
|
2913
|
+
if (e.mapOptions() === !0 && Array.isArray(e.displayItems.value) === !0) {
|
|
2914
|
+
const d = e.mapOptions() === !0 && t !== void 0 ? t : [], y = c.map((h) => {
|
|
2915
|
+
const B = e.getOption(h, d, e.resolvedDefaults.value, e.displayItems.value);
|
|
2916
|
+
if (B === h && e.cachedItems.value.length > 0) {
|
|
2917
|
+
const p = e.getOption(h, d, e.resolvedDefaults.value, e.cachedItems.value);
|
|
2918
|
+
if (p !== h) return p;
|
|
2919
|
+
}
|
|
2920
|
+
return B;
|
|
2921
|
+
});
|
|
2922
|
+
return e.modelValue() === null && g === !0 ? y.filter((h) => h !== null) : y;
|
|
2923
|
+
}
|
|
2924
|
+
return c;
|
|
2925
|
+
});
|
|
2926
|
+
Y(
|
|
2927
|
+
n,
|
|
2928
|
+
(g) => {
|
|
2929
|
+
t = g;
|
|
2930
|
+
},
|
|
2931
|
+
{ immediate: !0 }
|
|
2932
|
+
);
|
|
2933
|
+
const a = $(() => n.value.map((g) => e.getOptionValue.value(g)));
|
|
2934
|
+
function o(g) {
|
|
2935
|
+
const c = e.getOptionValue.value(g);
|
|
2936
|
+
return a.value.find((d) => Me(d, c)) !== void 0;
|
|
2937
|
+
}
|
|
2938
|
+
const i = $(
|
|
2939
|
+
() => n.value.map((g, c) => ({
|
|
2940
|
+
index: c,
|
|
2941
|
+
opt: g,
|
|
2942
|
+
selected: !0,
|
|
2943
|
+
toggleOption: u,
|
|
2944
|
+
removeAtIndex: f
|
|
2945
|
+
}))
|
|
2946
|
+
), l = $(() => e.fieldValueIsFilled(n.value)), s = $(() => e.displayItems.value.map((g, c) => ({
|
|
2947
|
+
index: c,
|
|
2948
|
+
opt: g,
|
|
2949
|
+
selected: o(g) === !0,
|
|
2950
|
+
label: e.getOptionLabel.value(g),
|
|
2951
|
+
toggleOption: u
|
|
2952
|
+
})));
|
|
2953
|
+
function u(g) {
|
|
2954
|
+
if (g === void 0)
|
|
2955
|
+
return;
|
|
2956
|
+
const c = e.getOptionValue.value(g);
|
|
2957
|
+
if (e.multiple() !== !0) {
|
|
2958
|
+
(n.value.length === 0 || Me(e.getOptionValue.value(n.value[0]), c) !== !0) && e.emit.updateModelValue(e.emitValue() === !0 ? c : g), e.isOpened.value = !1, e.emit.close();
|
|
2959
|
+
return;
|
|
2960
|
+
}
|
|
2961
|
+
if (n.value.length === 0) {
|
|
2962
|
+
const h = e.emitValue() === !0 ? c : g;
|
|
2963
|
+
e.emit.updateModelValue(e.multiple() === !0 ? [h] : h);
|
|
2964
|
+
return;
|
|
2965
|
+
}
|
|
2966
|
+
const d = e.modelValue().slice(), y = a.value.findIndex((h) => Me(h, c));
|
|
2967
|
+
if (y > -1)
|
|
2968
|
+
d.splice(y, 1);
|
|
2969
|
+
else {
|
|
2970
|
+
const h = e.emitValue() === !0 ? c : g;
|
|
2971
|
+
d.push(h);
|
|
2972
|
+
}
|
|
2973
|
+
e.emit.updateModelValue(d), e.isOpened.value && e.popperUpdate();
|
|
2974
|
+
}
|
|
2975
|
+
function f(g) {
|
|
2976
|
+
if (g > -1 && g < n.value.length)
|
|
2977
|
+
if (e.multiple() === !0) {
|
|
2978
|
+
const c = e.modelValue().slice();
|
|
2979
|
+
c.splice(g, 1), e.emit.updateModelValue(c);
|
|
2980
|
+
} else
|
|
2981
|
+
e.emit.updateModelValue(null);
|
|
2982
|
+
}
|
|
2983
|
+
function m() {
|
|
2984
|
+
if (e.multiple()) {
|
|
2985
|
+
e.emit.updateModelValue([]);
|
|
2986
|
+
return;
|
|
2987
|
+
}
|
|
2988
|
+
e.emit.updateModelValue(null);
|
|
2989
|
+
}
|
|
2990
|
+
return {
|
|
2991
|
+
innerValue: n,
|
|
2992
|
+
selectedScope: i,
|
|
2993
|
+
hasValue: l,
|
|
2994
|
+
innerOptionsValue: a,
|
|
2995
|
+
optionScope: s,
|
|
2996
|
+
toggleOption: u,
|
|
2997
|
+
removeAtIndex: f,
|
|
2998
|
+
isOptionSelected: o,
|
|
2999
|
+
onReset: m
|
|
3000
|
+
};
|
|
3001
|
+
}
|
|
3002
|
+
const no = { class: "vc-select__control" }, ao = {
|
|
3003
|
+
key: 0,
|
|
3004
|
+
class: "vc-select__prepend"
|
|
3005
|
+
}, lo = { class: "vc-select__field" }, oo = { class: "vc-select__field-inner" }, io = { class: "vc-select__field-content" }, ro = {
|
|
3006
|
+
key: 0,
|
|
3007
|
+
class: "vc-select__prepend-inner"
|
|
3008
|
+
}, so = { class: "vc-select__field-main" }, uo = {
|
|
3009
|
+
key: 0,
|
|
3010
|
+
class: "vc-select__prefix"
|
|
3011
|
+
}, co = ["aria-expanded", "aria-controls", "aria-labelledby", "aria-describedby", "aria-required", "aria-invalid"], fo = {
|
|
3012
|
+
key: 0,
|
|
3013
|
+
class: "vc-select__placeholder"
|
|
3014
|
+
}, vo = {
|
|
3015
|
+
key: 1,
|
|
3016
|
+
class: "vc-select__selected"
|
|
3017
|
+
}, go = { class: "vc-select__multiple-item" }, mo = {
|
|
3018
|
+
key: 0,
|
|
3019
|
+
class: "vc-select__loading"
|
|
3020
|
+
}, po = { key: 1 }, bo = ["aria-label", "onClick", "onKeydown"], yo = {
|
|
3021
|
+
key: 0,
|
|
3022
|
+
class: "vc-select__loading"
|
|
3023
|
+
}, ho = {
|
|
3024
|
+
key: 1,
|
|
3025
|
+
class: "vc-select__suffix"
|
|
3026
|
+
}, ko = ["aria-label"], Io = {
|
|
3027
|
+
key: 1,
|
|
3028
|
+
class: "vc-select__append-inner"
|
|
3029
|
+
}, So = {
|
|
3030
|
+
key: 2,
|
|
3031
|
+
class: "vc-select__loading-icon"
|
|
3032
|
+
}, $o = ["aria-label"], wo = { class: "vc-select__chevron" }, Oo = { class: "vc-select__hint-error" }, Eo = { key: 0 }, Lo = { key: 1 }, Bo = {
|
|
3033
|
+
key: 1,
|
|
3034
|
+
class: "vc-select__append"
|
|
3035
|
+
}, Co = /* @__PURE__ */ V({
|
|
3036
|
+
__name: "SelectTrigger",
|
|
3037
|
+
props: {
|
|
3038
|
+
isOpened: { type: Boolean },
|
|
3039
|
+
hasValue: { type: Boolean },
|
|
3040
|
+
selectedScope: {},
|
|
3041
|
+
multiple: { type: Boolean },
|
|
3042
|
+
loading: { type: Boolean },
|
|
3043
|
+
disabled: { type: Boolean },
|
|
3044
|
+
clearable: { type: Boolean },
|
|
3045
|
+
placeholder: {},
|
|
3046
|
+
prefix: {},
|
|
3047
|
+
suffix: {},
|
|
3048
|
+
size: {},
|
|
3049
|
+
error: { type: Boolean },
|
|
3050
|
+
errorMessage: {},
|
|
3051
|
+
hint: {},
|
|
3052
|
+
listLoading: { type: Boolean },
|
|
3053
|
+
defaultOptionLoading: { type: Boolean },
|
|
3054
|
+
listboxId: {},
|
|
3055
|
+
labelId: {},
|
|
3056
|
+
label: {},
|
|
3057
|
+
ariaDescribedBy: {},
|
|
3058
|
+
ariaRequired: { type: Boolean },
|
|
3059
|
+
errorId: {},
|
|
3060
|
+
hintId: {},
|
|
3061
|
+
toggleDropdown: { type: Function },
|
|
3062
|
+
getOptionLabel: { type: Function },
|
|
3063
|
+
getEmittingOptionValue: { type: Function }
|
|
3064
|
+
},
|
|
3065
|
+
emits: ["focus", "blur", "reset", "removeAtIndex"],
|
|
3066
|
+
setup(e, { expose: t }) {
|
|
3067
|
+
const { t: n } = Ie({ useScope: "global" }), a = S(null);
|
|
3068
|
+
return t({
|
|
3069
|
+
toggleRef: a
|
|
3070
|
+
}), (o, i) => (v(), b("div", {
|
|
3071
|
+
ref_key: "toggleRef",
|
|
3072
|
+
ref: a,
|
|
3073
|
+
class: "vc-select__dropdown-toggle"
|
|
3074
|
+
}, [
|
|
3075
|
+
C(o.$slots, "control", {
|
|
3076
|
+
toggleHandler: e.toggleDropdown,
|
|
3077
|
+
isOpened: e.isOpened
|
|
3078
|
+
}, () => [
|
|
3079
|
+
L("div", no, [
|
|
3080
|
+
o.$slots.prepend ? (v(), b("div", ao, [
|
|
3081
|
+
C(o.$slots, "prepend")
|
|
3082
|
+
])) : w("", !0),
|
|
3083
|
+
L("div", {
|
|
3084
|
+
class: j(["vc-select__field-wrapper", {
|
|
3085
|
+
"vc-select__field-wrapper--default": e.size === "default",
|
|
3086
|
+
"vc-select__field-wrapper--small": e.size === "small"
|
|
3087
|
+
}])
|
|
3088
|
+
}, [
|
|
3089
|
+
L("div", lo, [
|
|
3090
|
+
L("div", oo, [
|
|
3091
|
+
L("div", io, [
|
|
3092
|
+
o.$slots["prepend-inner"] ? (v(), b("div", ro, [
|
|
3093
|
+
C(o.$slots, "prepend-inner")
|
|
3094
|
+
])) : w("", !0),
|
|
3095
|
+
L("div", so, [
|
|
3096
|
+
e.prefix ? (v(), b("div", uo, T(e.prefix), 1)) : w("", !0),
|
|
3097
|
+
L("div", {
|
|
3098
|
+
"data-test-id": "dropdown-toggle",
|
|
3099
|
+
class: "vc-select__input",
|
|
3100
|
+
role: "combobox",
|
|
3101
|
+
tabindex: "0",
|
|
3102
|
+
"aria-expanded": e.isOpened,
|
|
3103
|
+
"aria-haspopup": "listbox",
|
|
3104
|
+
"aria-controls": e.isOpened ? e.listboxId : void 0,
|
|
3105
|
+
"aria-labelledby": e.label ? e.labelId : void 0,
|
|
3106
|
+
"aria-describedby": e.ariaDescribedBy,
|
|
3107
|
+
"aria-required": e.ariaRequired,
|
|
3108
|
+
"aria-invalid": e.error || void 0,
|
|
3109
|
+
onClick: i[0] || (i[0] = H(
|
|
3110
|
+
//@ts-ignore
|
|
3111
|
+
(...l) => e.toggleDropdown && e.toggleDropdown(...l),
|
|
3112
|
+
["stop"]
|
|
3113
|
+
)),
|
|
3114
|
+
onKeydown: [
|
|
3115
|
+
i[1] || (i[1] = Z(H(
|
|
3116
|
+
//@ts-ignore
|
|
3117
|
+
(...l) => e.toggleDropdown && e.toggleDropdown(...l),
|
|
3118
|
+
["stop"]
|
|
3119
|
+
), ["enter"])),
|
|
3120
|
+
i[2] || (i[2] = Z(H(
|
|
3121
|
+
//@ts-ignore
|
|
3122
|
+
(...l) => e.toggleDropdown && e.toggleDropdown(...l),
|
|
3123
|
+
["stop"]
|
|
3124
|
+
), ["space"]))
|
|
3125
|
+
],
|
|
3126
|
+
onFocus: i[3] || (i[3] = (l) => o.$emit("focus")),
|
|
3127
|
+
onBlur: i[4] || (i[4] = (l) => o.$emit("blur"))
|
|
3128
|
+
}, [
|
|
3129
|
+
e.hasValue ? e.selectedScope && e.selectedScope.length && e.hasValue ? (v(), b("div", vo, [
|
|
3130
|
+
(v(!0), b(we, null, ot(e.selectedScope, (l, s) => (v(), b("div", {
|
|
3131
|
+
key: s,
|
|
3132
|
+
class: "vc-select__selected-item"
|
|
3133
|
+
}, [
|
|
3134
|
+
e.multiple ? C(o.$slots, "selected-item", ne({
|
|
3135
|
+
key: 0,
|
|
3136
|
+
ref_for: !0
|
|
3137
|
+
}, l), () => [
|
|
3138
|
+
L("div", go, [
|
|
3139
|
+
e.loading ? (v(), b("span", mo, T(r(n)("COMPONENTS.MOLECULES.VC_SELECT.LOADING")), 1)) : (v(), b("span", po, T(e.getOptionLabel(l.opt)), 1)),
|
|
3140
|
+
e.disabled ? w("", !0) : (v(), b("button", {
|
|
3141
|
+
key: 2,
|
|
3142
|
+
type: "button",
|
|
3143
|
+
class: "vc-select__chip-remove",
|
|
3144
|
+
"aria-label": `Remove ${e.getOptionLabel(l.opt) || ""}`,
|
|
3145
|
+
tabindex: "0",
|
|
3146
|
+
onClick: H((u) => o.$emit("removeAtIndex", l.index), ["stop"]),
|
|
3147
|
+
onKeydown: Z(H((u) => o.$emit("removeAtIndex", l.index), ["stop", "prevent"]), ["enter"])
|
|
3148
|
+
}, [
|
|
3149
|
+
x(r(U), {
|
|
3150
|
+
class: "vc-select__icon-remove",
|
|
3151
|
+
icon: "lucide-x",
|
|
3152
|
+
size: "xs"
|
|
3153
|
+
})
|
|
3154
|
+
], 40, bo))
|
|
3155
|
+
])
|
|
3156
|
+
]) : e.multiple ? w("", !0) : (v(), b(we, { key: 1 }, [
|
|
3157
|
+
e.loading ? (v(), b("span", yo, T(r(n)("COMPONENTS.MOLECULES.VC_SELECT.LOADING")), 1)) : C(o.$slots, "selected-item", ne({
|
|
3158
|
+
key: 1,
|
|
3159
|
+
ref_for: !0
|
|
3160
|
+
}, l), () => [
|
|
3161
|
+
Q(T(e.loading ? r(n)("COMPONENTS.MOLECULES.VC_SELECT.LOADING") : e.getEmittingOptionValue(l.opt)), 1)
|
|
3162
|
+
])
|
|
3163
|
+
], 64))
|
|
3164
|
+
]))), 128))
|
|
3165
|
+
])) : w("", !0) : (v(), b("div", fo, [
|
|
3166
|
+
e.placeholder ? (v(), b(we, { key: 0 }, [
|
|
3167
|
+
Q(T(e.placeholder), 1)
|
|
3168
|
+
], 64)) : (v(), b(we, { key: 1 }, [
|
|
3169
|
+
Q(T(r(n)("COMPONENTS.MOLECULES.VC_SELECT.CLICK_TO_SELECT")), 1)
|
|
3170
|
+
], 64))
|
|
3171
|
+
]))
|
|
3172
|
+
], 40, co),
|
|
3173
|
+
e.suffix ? (v(), b("div", ho, T(e.suffix), 1)) : w("", !0),
|
|
3174
|
+
e.clearable && e.hasValue && !e.disabled ? (v(), b("div", {
|
|
3175
|
+
key: 2,
|
|
3176
|
+
class: "vc-select__clear",
|
|
3177
|
+
role: "button",
|
|
3178
|
+
"aria-label": o.$t("COMPONENTS.CONTROLS.CLEAR_SELECTION"),
|
|
3179
|
+
tabindex: "0",
|
|
3180
|
+
onClick: i[5] || (i[5] = (l) => o.$emit("reset")),
|
|
3181
|
+
onKeydown: [
|
|
3182
|
+
i[6] || (i[6] = Z((l) => o.$emit("reset"), ["enter"])),
|
|
3183
|
+
i[7] || (i[7] = Z((l) => o.$emit("reset"), ["space"]))
|
|
3184
|
+
]
|
|
3185
|
+
}, [
|
|
3186
|
+
x(r(U), {
|
|
3187
|
+
size: "xs",
|
|
3188
|
+
icon: "lucide-x"
|
|
3189
|
+
})
|
|
3190
|
+
], 40, ko)) : w("", !0)
|
|
3191
|
+
]),
|
|
3192
|
+
o.$slots["append-inner"] ? (v(), b("div", Io, [
|
|
3193
|
+
C(o.$slots, "append-inner")
|
|
3194
|
+
])) : w("", !0),
|
|
3195
|
+
e.loading || e.listLoading || e.defaultOptionLoading ? (v(), b("div", So, [
|
|
3196
|
+
x(r(U), {
|
|
3197
|
+
icon: "lucide-loader-2",
|
|
3198
|
+
class: "tw-animate-spin",
|
|
3199
|
+
size: "m"
|
|
3200
|
+
})
|
|
3201
|
+
])) : w("", !0),
|
|
3202
|
+
e.disabled ? w("", !0) : (v(), b("div", {
|
|
3203
|
+
key: 3,
|
|
3204
|
+
class: "vc-select__chevron-container",
|
|
3205
|
+
role: "button",
|
|
3206
|
+
"aria-label": o.$t("COMPONENTS.CONTROLS.TOGGLE_DROPDOWN"),
|
|
3207
|
+
tabindex: "0",
|
|
3208
|
+
onClick: i[8] || (i[8] = H(
|
|
3209
|
+
//@ts-ignore
|
|
3210
|
+
(...l) => e.toggleDropdown && e.toggleDropdown(...l),
|
|
3211
|
+
["stop"]
|
|
3212
|
+
)),
|
|
3213
|
+
onKeydown: [
|
|
3214
|
+
i[9] || (i[9] = Z(H(
|
|
3215
|
+
//@ts-ignore
|
|
3216
|
+
(...l) => e.toggleDropdown && e.toggleDropdown(...l),
|
|
3217
|
+
["stop"]
|
|
3218
|
+
), ["enter"])),
|
|
3219
|
+
i[10] || (i[10] = Z(H(
|
|
3220
|
+
//@ts-ignore
|
|
3221
|
+
(...l) => e.toggleDropdown && e.toggleDropdown(...l),
|
|
3222
|
+
["stop"]
|
|
3223
|
+
), ["space"]))
|
|
3224
|
+
]
|
|
3225
|
+
}, [
|
|
3226
|
+
L("div", wo, [
|
|
3227
|
+
x(r(U), {
|
|
3228
|
+
size: "s",
|
|
3229
|
+
icon: "lucide-chevron-down"
|
|
3230
|
+
})
|
|
3231
|
+
])
|
|
3232
|
+
], 40, $o))
|
|
3233
|
+
])
|
|
3234
|
+
])
|
|
3235
|
+
]),
|
|
3236
|
+
L("div", Oo, [
|
|
3237
|
+
x(Ae, {
|
|
3238
|
+
name: "slide-up",
|
|
3239
|
+
mode: "out-in"
|
|
3240
|
+
}, {
|
|
3241
|
+
default: O(() => [
|
|
3242
|
+
e.error && e.errorMessage ? (v(), b("div", Eo, [
|
|
3243
|
+
C(o.$slots, "error", {}, () => [
|
|
3244
|
+
x(r(fe), {
|
|
3245
|
+
id: e.errorId,
|
|
3246
|
+
class: "vc-select__error-message",
|
|
3247
|
+
error: !0
|
|
3248
|
+
}, {
|
|
3249
|
+
default: O(() => [
|
|
3250
|
+
Q(T(e.errorMessage), 1)
|
|
3251
|
+
]),
|
|
3252
|
+
_: 1
|
|
3253
|
+
}, 8, ["id"])
|
|
3254
|
+
])
|
|
3255
|
+
])) : (v(), b("div", Lo, [
|
|
3256
|
+
C(o.$slots, "hint", {}, () => [
|
|
3257
|
+
e.hint ? (v(), N(r(fe), {
|
|
3258
|
+
key: 0,
|
|
3259
|
+
id: e.hintId,
|
|
3260
|
+
class: "vc-select__hint"
|
|
3261
|
+
}, {
|
|
3262
|
+
default: O(() => [
|
|
3263
|
+
Q(T(e.hint), 1)
|
|
3264
|
+
]),
|
|
3265
|
+
_: 1
|
|
3266
|
+
}, 8, ["id"])) : w("", !0)
|
|
3267
|
+
])
|
|
3268
|
+
]))
|
|
3269
|
+
]),
|
|
3270
|
+
_: 3
|
|
3271
|
+
})
|
|
3272
|
+
])
|
|
3273
|
+
], 2),
|
|
3274
|
+
o.$slots.append ? (v(), b("div", Bo, [
|
|
3275
|
+
C(o.$slots, "append")
|
|
3276
|
+
])) : w("", !0)
|
|
3277
|
+
])
|
|
3278
|
+
])
|
|
3279
|
+
], 512));
|
|
3280
|
+
}
|
|
3281
|
+
}), xo = ["id", "aria-label"], To = ["aria-label"], Mo = ["aria-selected", "data-index", "onClick", "onKeydown"], Ro = {
|
|
3282
|
+
key: 0,
|
|
3283
|
+
class: "vc-select__check-icon"
|
|
3284
|
+
}, Ao = {
|
|
3285
|
+
key: 0,
|
|
3286
|
+
class: "vc-select__list-loading-indicator"
|
|
3287
|
+
}, No = { class: "tw-ml-1" }, Do = {
|
|
3288
|
+
key: 1,
|
|
3289
|
+
class: "vc-select__no-options"
|
|
3290
|
+
}, Vo = { class: "vc-select__no-options-text" }, Po = /* @__PURE__ */ V({
|
|
3291
|
+
__name: "SelectDropdown",
|
|
3292
|
+
props: {
|
|
3293
|
+
isOpened: { type: Boolean },
|
|
3294
|
+
listboxId: {},
|
|
3295
|
+
ariaLabel: {},
|
|
3296
|
+
dropdownStyle: {},
|
|
3297
|
+
searchable: { type: Boolean },
|
|
3298
|
+
optionScope: {},
|
|
3299
|
+
listLoading: { type: Boolean },
|
|
3300
|
+
optionsListLength: {},
|
|
3301
|
+
hasNextPage: { type: Boolean },
|
|
3302
|
+
dropdownToggleRef: {}
|
|
3303
|
+
},
|
|
3304
|
+
emits: ["input", "clickOutside"],
|
|
3305
|
+
setup(e, { expose: t, emit: n }) {
|
|
3306
|
+
const a = e, o = n, { t: i } = Ie({ useScope: "global" }), { teleportTarget: l } = $n(), s = S(null), u = S(null), f = S(null), m = S(null), g = $(() => f.value?.viewportRef ?? null);
|
|
3307
|
+
function c(d) {
|
|
3308
|
+
const y = g.value;
|
|
3309
|
+
if (!y) return;
|
|
3310
|
+
if (y.contains(d.target)) {
|
|
3311
|
+
const B = y.scrollTop <= 0 && d.deltaY < 0, p = Math.ceil(y.scrollTop) >= y.scrollHeight - y.clientHeight && d.deltaY > 0;
|
|
3312
|
+
(B || p) && d.preventDefault();
|
|
3313
|
+
} else
|
|
3314
|
+
d.preventDefault(), y.scrollTop += d.deltaY;
|
|
3315
|
+
f.value?.updateScrollState();
|
|
3316
|
+
}
|
|
3317
|
+
return Y(
|
|
3318
|
+
() => a.isOpened,
|
|
3319
|
+
(d) => {
|
|
3320
|
+
d && he(() => f.value?.updateScrollState());
|
|
3321
|
+
}
|
|
3322
|
+
), Y(
|
|
3323
|
+
() => a.optionScope.length,
|
|
3324
|
+
() => {
|
|
3325
|
+
a.isOpened && he(() => f.value?.updateScrollState());
|
|
3326
|
+
}
|
|
3327
|
+
), t({
|
|
3328
|
+
dropdownElRef: s,
|
|
3329
|
+
searchInputRef: u,
|
|
3330
|
+
viewportRef: g,
|
|
3331
|
+
loadMoreRef: m
|
|
3332
|
+
}), (d, y) => (v(), N(cn, { to: r(l) }, [
|
|
3333
|
+
x(Ae, { name: "select-dropdown" }, {
|
|
3334
|
+
default: O(() => [
|
|
3335
|
+
e.isOpened ? rt((v(), b("div", {
|
|
3336
|
+
key: 0,
|
|
3337
|
+
id: e.listboxId,
|
|
3338
|
+
ref_key: "dropdownElRef",
|
|
3339
|
+
ref: s,
|
|
3340
|
+
"data-test-id": "dropdown",
|
|
3341
|
+
class: "vc-select__dropdown",
|
|
3342
|
+
role: "listbox",
|
|
3343
|
+
"aria-label": e.ariaLabel,
|
|
3344
|
+
style: Re(e.dropdownStyle),
|
|
3345
|
+
onWheel: c
|
|
3346
|
+
}, [
|
|
3347
|
+
e.searchable ? (v(), b("input", {
|
|
3348
|
+
key: 0,
|
|
3349
|
+
ref_key: "searchInputRef",
|
|
3350
|
+
ref: u,
|
|
3351
|
+
class: "vc-select__search-input",
|
|
3352
|
+
tabindex: "0",
|
|
3353
|
+
"aria-label": d.$t("COMPONENTS.CONTROLS.SEARCH_OPTIONS"),
|
|
3354
|
+
autocomplete: "off",
|
|
3355
|
+
onInput: y[0] || (y[0] = (h) => o("input", h)),
|
|
3356
|
+
onKeydown: [
|
|
3357
|
+
y[1] || (y[1] = Z(H(() => {
|
|
3358
|
+
}, ["stop"]), ["space"])),
|
|
3359
|
+
y[2] || (y[2] = Z(H(() => {
|
|
3360
|
+
}, ["stop"]), ["enter"]))
|
|
3361
|
+
]
|
|
3362
|
+
}, null, 40, To)) : w("", !0),
|
|
3363
|
+
x(r(ol), {
|
|
3364
|
+
ref_key: "scrollContainerRef",
|
|
3365
|
+
ref: f,
|
|
3366
|
+
class: "vc-select__scroll-container"
|
|
3367
|
+
}, {
|
|
3368
|
+
default: O(() => [
|
|
3369
|
+
(v(!0), b(we, null, ot(e.optionScope, (h, B) => (v(), b("div", {
|
|
3370
|
+
key: B,
|
|
3371
|
+
class: j(["vc-select__option", { "vc-select__option--selected": h.selected }]),
|
|
3372
|
+
"data-test-id": "option",
|
|
3373
|
+
role: "option",
|
|
3374
|
+
"aria-selected": h.selected,
|
|
3375
|
+
tabindex: "0",
|
|
3376
|
+
"data-index": B,
|
|
3377
|
+
onClick: (p) => h.toggleOption(h.opt),
|
|
3378
|
+
onKeydown: [
|
|
3379
|
+
Z((p) => h.toggleOption(h.opt), ["enter"]),
|
|
3380
|
+
Z((p) => h.toggleOption(h.opt), ["space"])
|
|
3381
|
+
]
|
|
3382
|
+
}, [
|
|
3383
|
+
C(d.$slots, "option", ne({ ref_for: !0 }, h), () => [
|
|
3384
|
+
Q(T(h.label), 1)
|
|
3385
|
+
]),
|
|
3386
|
+
h.selected ? (v(), b("span", Ro, [
|
|
3387
|
+
x(r(U), {
|
|
3388
|
+
icon: "lucide-check",
|
|
3389
|
+
size: "xs"
|
|
3390
|
+
})
|
|
3391
|
+
])) : w("", !0)
|
|
3392
|
+
], 42, Mo))), 128)),
|
|
3393
|
+
e.listLoading ? (v(), b("div", Ao, [
|
|
3394
|
+
x(r(U), {
|
|
3395
|
+
icon: "lucide-loader-2",
|
|
3396
|
+
class: "tw-animate-spin",
|
|
3397
|
+
size: "m"
|
|
3398
|
+
}),
|
|
3399
|
+
L("span", No, T(e.optionsListLength > 0 ? r(i)("COMPONENTS.MOLECULES.VC_SELECT.LOADING_MORE") : r(i)("COMPONENTS.MOLECULES.VC_SELECT.LOADING")), 1)
|
|
3400
|
+
])) : w("", !0),
|
|
3401
|
+
!e.listLoading && !e.optionsListLength ? (v(), b("div", Do, [
|
|
3402
|
+
C(d.$slots, "no-options", {}, () => [
|
|
3403
|
+
L("span", Vo, T(r(i)("COMPONENTS.MOLECULES.VC_SELECT.NO_OPTIONS")), 1)
|
|
3404
|
+
])
|
|
3405
|
+
])) : w("", !0),
|
|
3406
|
+
e.hasNextPage && !e.listLoading ? (v(), b("span", {
|
|
3407
|
+
key: 2,
|
|
3408
|
+
ref_key: "loadMoreRef",
|
|
3409
|
+
ref: m,
|
|
3410
|
+
class: "vc-select__load-more-trigger"
|
|
3411
|
+
}, null, 512)) : w("", !0)
|
|
3412
|
+
]),
|
|
3413
|
+
_: 3
|
|
3414
|
+
}, 512)
|
|
3415
|
+
], 44, xo)), [
|
|
3416
|
+
[r(Fn), [() => o("clickOutside"), { ignore: [e.dropdownToggleRef] }]]
|
|
3417
|
+
]) : w("", !0)
|
|
3418
|
+
]),
|
|
3419
|
+
_: 3
|
|
3420
|
+
})
|
|
3421
|
+
], 8, ["to"]));
|
|
3422
|
+
}
|
|
3423
|
+
}), Fo = ["innerHTML"], zo = { class: "vc-select__field-container" }, qo = /* @__PURE__ */ V({
|
|
3424
|
+
inheritAttrs: !1,
|
|
3425
|
+
__name: "vc-select",
|
|
3426
|
+
props: {
|
|
3427
|
+
label: {},
|
|
3428
|
+
tooltip: {},
|
|
3429
|
+
disabled: { type: Boolean },
|
|
3430
|
+
required: { type: Boolean },
|
|
3431
|
+
name: { default: "Field" },
|
|
3432
|
+
error: { type: Boolean },
|
|
3433
|
+
errorMessage: {},
|
|
3434
|
+
mapOptions: { type: Boolean, default: !0 },
|
|
3435
|
+
hint: {},
|
|
3436
|
+
prefix: {},
|
|
3437
|
+
suffix: {},
|
|
3438
|
+
loading: { type: Boolean },
|
|
3439
|
+
clearable: { type: Boolean, default: !0 },
|
|
3440
|
+
multiple: { type: Boolean },
|
|
3441
|
+
options: { type: [Function, Array], default: () => [] },
|
|
3442
|
+
optionValue: { type: [Function, String], default: "id" },
|
|
3443
|
+
optionLabel: { type: [Function, String], default: "title" },
|
|
3444
|
+
debounce: { default: 500 },
|
|
3445
|
+
placeholder: {},
|
|
3446
|
+
searchable: { type: Boolean },
|
|
3447
|
+
multilanguage: { type: Boolean },
|
|
3448
|
+
currentLanguage: {},
|
|
3449
|
+
size: { default: "default" },
|
|
3450
|
+
outline: { type: Boolean, default: !0 },
|
|
3451
|
+
placement: { default: "bottom" },
|
|
3452
|
+
modelValue: {},
|
|
3453
|
+
emitValue: { type: Boolean, default: !0 }
|
|
3454
|
+
},
|
|
3455
|
+
emits: ["update:modelValue", "search", "close"],
|
|
3456
|
+
setup(e, { emit: t }) {
|
|
3457
|
+
const n = e, a = wt(), o = $(() => {
|
|
3458
|
+
const { class: R, ..._ } = a;
|
|
3459
|
+
return _;
|
|
3460
|
+
}), i = t, { t: l } = Ie({ useScope: "global" }), s = Se(), {
|
|
3461
|
+
fieldId: u,
|
|
3462
|
+
labelId: f,
|
|
3463
|
+
errorId: m,
|
|
3464
|
+
hintId: g,
|
|
3465
|
+
invalid: c,
|
|
3466
|
+
resolvedDisabled: d,
|
|
3467
|
+
resolvedName: y,
|
|
3468
|
+
ariaRequired: h,
|
|
3469
|
+
ariaDescribedBy: B
|
|
3470
|
+
} = Ke(n), p = $(() => `${u.value}-listbox`), I = S(null), P = S(null), { selectRootRef: J, isSelectVisible: ae, ensureVisibility: ee } = Ql(), { getOptionValue: F, getOptionLabel: D, getOption: z, getEmittingOptionValue: W, fieldValueIsFilled: X } = Zl({
|
|
3471
|
+
optionValue: () => n.optionValue,
|
|
3472
|
+
optionLabel: () => n.optionLabel
|
|
3473
|
+
}), { isOpened: k, isFocused: M, dropdownToggleRef: K, dropdownRef: te, popper: Ve, dropdownStyle: E, toggleDropdown: q } = _l({
|
|
3474
|
+
placement: n.placement,
|
|
3475
|
+
outline: () => n.outline,
|
|
3476
|
+
isSelectVisible: ae,
|
|
3477
|
+
selectRootRef: J,
|
|
3478
|
+
disabled: () => n.disabled ?? !1,
|
|
3479
|
+
ensureVisibility: ee
|
|
3480
|
+
});
|
|
3481
|
+
Qe(() => {
|
|
3482
|
+
K.value = I.value?.toggleRef ?? null;
|
|
3483
|
+
}), Qe(() => {
|
|
3484
|
+
te.value = P.value?.dropdownElRef ?? null;
|
|
3485
|
+
});
|
|
3486
|
+
const A = eo({
|
|
3487
|
+
options: () => n.options,
|
|
3488
|
+
getOptionValue: F,
|
|
3489
|
+
getOptionLabel: D,
|
|
3490
|
+
isSelectVisible: ae,
|
|
3491
|
+
debounce: () => n.debounce ?? 500,
|
|
3492
|
+
emit: {
|
|
3493
|
+
search: (R) => i("search", R)
|
|
3494
|
+
}
|
|
3495
|
+
}), { selectedScope: Jt, hasValue: Xt, optionScope: Le, removeAtIndex: Zt, onReset: Qt } = to({
|
|
3496
|
+
modelValue: () => n.modelValue,
|
|
3497
|
+
multiple: () => n.multiple,
|
|
3498
|
+
emitValue: () => n.emitValue ?? !0,
|
|
3499
|
+
mapOptions: () => n.mapOptions ?? !0,
|
|
3500
|
+
displayItems: A.displayItems,
|
|
3501
|
+
resolvedDefaults: A.resolvedDefaults,
|
|
3502
|
+
cachedItems: A.cachedItems,
|
|
3503
|
+
getOptionValue: F,
|
|
3504
|
+
getOptionLabel: D,
|
|
3505
|
+
getOption: z,
|
|
3506
|
+
fieldValueIsFilled: X,
|
|
3507
|
+
isOpened: k,
|
|
3508
|
+
popperUpdate: () => Ve.update(),
|
|
3509
|
+
emit: {
|
|
3510
|
+
updateModelValue: (R) => i("update:modelValue", R),
|
|
3511
|
+
close: () => i("close")
|
|
3512
|
+
}
|
|
3513
|
+
}), _t = $(() => P.value?.loadMoreRef ?? null), en = $(() => P.value?.viewportRef ?? null);
|
|
3514
|
+
xn(
|
|
3515
|
+
_t,
|
|
3516
|
+
([{ isIntersecting: R }]) => {
|
|
3517
|
+
R && A.hasMore.value && A.loadMore();
|
|
3518
|
+
},
|
|
3519
|
+
{ threshold: 1, root: en }
|
|
3520
|
+
);
|
|
3521
|
+
const Ge = Xl({
|
|
3522
|
+
onEnter: (R) => {
|
|
3523
|
+
const _ = parseInt(R.getAttribute("data-index") || "0", 10);
|
|
3524
|
+
Le.value && Le.value[_] && Le.value[_].toggleOption(Le.value[_].opt);
|
|
3525
|
+
},
|
|
3526
|
+
onEscape: () => {
|
|
3527
|
+
k.value = !1, i("close"), he(() => {
|
|
3528
|
+
I.value?.toggleRef?.querySelector('[role="combobox"]')?.focus();
|
|
3529
|
+
});
|
|
3530
|
+
}
|
|
3531
|
+
});
|
|
3532
|
+
function tn() {
|
|
3533
|
+
k.value = !1, i("close");
|
|
3534
|
+
}
|
|
3535
|
+
return Y(k, async (R) => {
|
|
3536
|
+
R ? (await A.open(), he(() => {
|
|
3537
|
+
Ve.update();
|
|
3538
|
+
const _ = P.value?.dropdownElRef, oe = P.value?.searchInputRef;
|
|
3539
|
+
if (_)
|
|
3540
|
+
if (Ge.initKeyboardNavigation(_), n.searchable && oe)
|
|
3541
|
+
oe.focus();
|
|
3542
|
+
else {
|
|
3543
|
+
const Be = _.querySelector(
|
|
3544
|
+
'.vc-select__option[tabindex="0"], .vc-select__search-input[tabindex="0"]'
|
|
3545
|
+
);
|
|
3546
|
+
Be ? Be.focus() : Ge.focusFirstElement();
|
|
3547
|
+
}
|
|
3548
|
+
})) : (Ge.cleanupKeyboardNavigation(), A.close());
|
|
3549
|
+
}), Y(
|
|
3550
|
+
() => n.modelValue,
|
|
3551
|
+
async (R) => {
|
|
3552
|
+
if (R == null || Array.isArray(R) && R.length === 0) {
|
|
3553
|
+
A.resolvedDefaults.value = [];
|
|
3554
|
+
return;
|
|
3555
|
+
}
|
|
3556
|
+
const _ = n.emitValue ?? !0;
|
|
3557
|
+
if (n.mapOptions ?? !0) {
|
|
3558
|
+
const Be = Array.isArray(R) ? R : [R], pt = _ ? Be : Be.filter((Ce) => Ce != null && typeof Ce != "object");
|
|
3559
|
+
if (pt.length > 0) {
|
|
3560
|
+
const Ce = pt.filter((nn) => nn != null).map(String);
|
|
3561
|
+
Ce.length > 0 && await A.resolve(Ce);
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
},
|
|
3565
|
+
{ immediate: !0 }
|
|
3566
|
+
), (R, _) => r(s) ? (v(), b("div", ne({ key: 0 }, o.value, {
|
|
3567
|
+
class: ["vc-select vc-select--skeleton", R.$attrs.class]
|
|
3568
|
+
}), [
|
|
3569
|
+
e.label ? (v(), N(r(le), {
|
|
3570
|
+
key: 0,
|
|
3571
|
+
variant: "block",
|
|
3572
|
+
width: 60 + (e.label?.length || 0) * 4,
|
|
3573
|
+
height: 11
|
|
3574
|
+
}, null, 8, ["width"])) : w("", !0),
|
|
3575
|
+
x(r(le), {
|
|
3576
|
+
variant: "block",
|
|
3577
|
+
width: "100%",
|
|
3578
|
+
height: 36
|
|
3579
|
+
})
|
|
3580
|
+
], 16)) : (v(), b("div", ne({
|
|
3581
|
+
key: 1,
|
|
3582
|
+
ref_key: "selectRootRef",
|
|
3583
|
+
ref: J
|
|
3584
|
+
}, o.value, {
|
|
3585
|
+
class: ["vc-select", [
|
|
3586
|
+
R.$attrs.class,
|
|
3587
|
+
{
|
|
3588
|
+
"vc-select--opened": r(k),
|
|
3589
|
+
"vc-select--error": r(c),
|
|
3590
|
+
"vc-select--disabled": r(d),
|
|
3591
|
+
"vc-select--has-hint-or-error": r(c) || e.hint,
|
|
3592
|
+
"vc-select--no-outline": !e.outline,
|
|
3593
|
+
"vc-select--focused": r(M)
|
|
3594
|
+
}
|
|
3595
|
+
]]
|
|
3596
|
+
}), [
|
|
3597
|
+
e.label ? (v(), N(r(He), {
|
|
3598
|
+
key: 0,
|
|
3599
|
+
id: r(f),
|
|
3600
|
+
class: "vc-select__label",
|
|
3601
|
+
required: e.required,
|
|
3602
|
+
multilanguage: e.multilanguage,
|
|
3603
|
+
"current-language": e.currentLanguage,
|
|
3604
|
+
error: r(c)
|
|
3605
|
+
}, ie({
|
|
3606
|
+
default: O(() => [
|
|
3607
|
+
L("span", null, T(e.label), 1)
|
|
3608
|
+
]),
|
|
3609
|
+
_: 2
|
|
3610
|
+
}, [
|
|
3611
|
+
e.tooltip ? {
|
|
3612
|
+
name: "tooltip",
|
|
3613
|
+
fn: O(() => [
|
|
3614
|
+
L("span", {
|
|
3615
|
+
innerHTML: r(Rt).sanitize(e.tooltip)
|
|
3616
|
+
}, null, 8, Fo)
|
|
3617
|
+
]),
|
|
3618
|
+
key: "0"
|
|
3619
|
+
} : void 0
|
|
3620
|
+
]), 1032, ["id", "required", "multilanguage", "current-language", "error"])) : w("", !0),
|
|
3621
|
+
L("div", zo, [
|
|
3622
|
+
x(Co, {
|
|
3623
|
+
ref_key: "selectTriggerRef",
|
|
3624
|
+
ref: I,
|
|
3625
|
+
"is-opened": r(k),
|
|
3626
|
+
"has-value": r(Xt),
|
|
3627
|
+
"selected-scope": r(Jt),
|
|
3628
|
+
multiple: e.multiple,
|
|
3629
|
+
loading: e.loading,
|
|
3630
|
+
disabled: r(d),
|
|
3631
|
+
clearable: e.clearable,
|
|
3632
|
+
placeholder: e.placeholder,
|
|
3633
|
+
prefix: e.prefix,
|
|
3634
|
+
suffix: e.suffix,
|
|
3635
|
+
size: e.size,
|
|
3636
|
+
error: r(c),
|
|
3637
|
+
"error-message": e.errorMessage,
|
|
3638
|
+
hint: e.hint,
|
|
3639
|
+
"list-loading": r(A).loading.value || r(A).searchLoading.value,
|
|
3640
|
+
"default-option-loading": r(A).defaultOptionLoading.value,
|
|
3641
|
+
"listbox-id": p.value,
|
|
3642
|
+
"label-id": r(f),
|
|
3643
|
+
label: e.label,
|
|
3644
|
+
"aria-described-by": r(B),
|
|
3645
|
+
"aria-required": r(h),
|
|
3646
|
+
"error-id": r(m),
|
|
3647
|
+
"hint-id": r(g),
|
|
3648
|
+
"toggle-dropdown": r(q),
|
|
3649
|
+
"get-option-label": r(D),
|
|
3650
|
+
"get-emitting-option-value": r(W),
|
|
3651
|
+
onFocus: _[0] || (_[0] = (oe) => M.value = !0),
|
|
3652
|
+
onBlur: _[1] || (_[1] = (oe) => M.value = !1),
|
|
3653
|
+
onReset: r(Qt),
|
|
3654
|
+
onRemoveAtIndex: r(Zt)
|
|
3655
|
+
}, ie({ _: 2 }, [
|
|
3656
|
+
R.$slots.control ? {
|
|
3657
|
+
name: "control",
|
|
3658
|
+
fn: O((oe) => [
|
|
3659
|
+
C(R.$slots, "control", xe(Te(oe)))
|
|
3660
|
+
]),
|
|
3661
|
+
key: "0"
|
|
3662
|
+
} : void 0,
|
|
3663
|
+
R.$slots.prepend ? {
|
|
3664
|
+
name: "prepend",
|
|
3665
|
+
fn: O(() => [
|
|
3666
|
+
C(R.$slots, "prepend")
|
|
3667
|
+
]),
|
|
3668
|
+
key: "1"
|
|
3669
|
+
} : void 0,
|
|
3670
|
+
R.$slots.append ? {
|
|
3671
|
+
name: "append",
|
|
3672
|
+
fn: O(() => [
|
|
3673
|
+
C(R.$slots, "append")
|
|
3674
|
+
]),
|
|
3675
|
+
key: "2"
|
|
3676
|
+
} : void 0,
|
|
3677
|
+
R.$slots["prepend-inner"] ? {
|
|
3678
|
+
name: "prepend-inner",
|
|
3679
|
+
fn: O(() => [
|
|
3680
|
+
C(R.$slots, "prepend-inner")
|
|
3681
|
+
]),
|
|
3682
|
+
key: "3"
|
|
3683
|
+
} : void 0,
|
|
3684
|
+
R.$slots["append-inner"] ? {
|
|
3685
|
+
name: "append-inner",
|
|
3686
|
+
fn: O(() => [
|
|
3687
|
+
C(R.$slots, "append-inner")
|
|
3688
|
+
]),
|
|
3689
|
+
key: "4"
|
|
3690
|
+
} : void 0,
|
|
3691
|
+
R.$slots["selected-item"] ? {
|
|
3692
|
+
name: "selected-item",
|
|
3693
|
+
fn: O((oe) => [
|
|
3694
|
+
C(R.$slots, "selected-item", xe(Te(oe)))
|
|
3695
|
+
]),
|
|
3696
|
+
key: "5"
|
|
3697
|
+
} : void 0,
|
|
3698
|
+
R.$slots.error ? {
|
|
3699
|
+
name: "error",
|
|
3700
|
+
fn: O(() => [
|
|
3701
|
+
C(R.$slots, "error")
|
|
3702
|
+
]),
|
|
3703
|
+
key: "6"
|
|
3704
|
+
} : void 0,
|
|
3705
|
+
R.$slots.hint ? {
|
|
3706
|
+
name: "hint",
|
|
3707
|
+
fn: O(() => [
|
|
3708
|
+
C(R.$slots, "hint")
|
|
3709
|
+
]),
|
|
3710
|
+
key: "7"
|
|
3711
|
+
} : void 0
|
|
3712
|
+
]), 1032, ["is-opened", "has-value", "selected-scope", "multiple", "loading", "disabled", "clearable", "placeholder", "prefix", "suffix", "size", "error", "error-message", "hint", "list-loading", "default-option-loading", "listbox-id", "label-id", "label", "aria-described-by", "aria-required", "error-id", "hint-id", "toggle-dropdown", "get-option-label", "get-emitting-option-value", "onReset", "onRemoveAtIndex"]),
|
|
3713
|
+
x(Po, ne({
|
|
3714
|
+
ref_key: "selectDropdownRef",
|
|
3715
|
+
ref: P,
|
|
3716
|
+
"is-opened": r(k),
|
|
3717
|
+
"listbox-id": p.value
|
|
3718
|
+
}, { ariaLabel: e.label || e.name }, {
|
|
3719
|
+
"dropdown-style": r(E),
|
|
3720
|
+
searchable: e.searchable,
|
|
3721
|
+
"option-scope": r(Le),
|
|
3722
|
+
"list-loading": r(A).loading.value || r(A).searchLoading.value,
|
|
3723
|
+
"options-list-length": r(A).displayItems.value.length,
|
|
3724
|
+
"has-next-page": r(A).hasMore.value,
|
|
3725
|
+
"dropdown-toggle-ref": I.value?.toggleRef ?? null,
|
|
3726
|
+
onInput: r(A).onInput,
|
|
3727
|
+
onClickOutside: tn
|
|
3728
|
+
}), ie({ _: 2 }, [
|
|
3729
|
+
R.$slots.option ? {
|
|
3730
|
+
name: "option",
|
|
3731
|
+
fn: O((oe) => [
|
|
3732
|
+
C(R.$slots, "option", xe(Te(oe)))
|
|
3733
|
+
]),
|
|
3734
|
+
key: "0"
|
|
3735
|
+
} : void 0,
|
|
3736
|
+
R.$slots["no-options"] ? {
|
|
3737
|
+
name: "no-options",
|
|
3738
|
+
fn: O(() => [
|
|
3739
|
+
C(R.$slots, "no-options")
|
|
3740
|
+
]),
|
|
3741
|
+
key: "1"
|
|
3742
|
+
} : void 0
|
|
3743
|
+
]), 1040, ["is-opened", "listbox-id", "dropdown-style", "searchable", "option-scope", "list-loading", "options-list-length", "has-next-page", "dropdown-toggle-ref", "onInput"])
|
|
3744
|
+
])
|
|
3745
|
+
], 16));
|
|
3746
|
+
}
|
|
3747
|
+
}), Uo = {
|
|
3748
|
+
key: 0,
|
|
3749
|
+
class: "vc-input-dropdown vc-input-dropdown--skeleton"
|
|
3750
|
+
}, Ko = { class: "tw-flex tw-items-center" }, Wo = ["aria-label", "aria-expanded", "onClick", "onKeydown"], jo = /* @__PURE__ */ V({
|
|
3751
|
+
__name: "vc-input-dropdown",
|
|
3752
|
+
props: {
|
|
3753
|
+
modelValue: {},
|
|
3754
|
+
prefix: {},
|
|
3755
|
+
suffix: {},
|
|
3756
|
+
debounce: { default: 0 },
|
|
3757
|
+
maxlength: {},
|
|
3758
|
+
option: {},
|
|
3759
|
+
options: {},
|
|
3760
|
+
optionValue: {},
|
|
3761
|
+
optionLabel: {},
|
|
3762
|
+
searchable: { type: Boolean, default: !1 },
|
|
3763
|
+
inputType: { default: "text" },
|
|
3764
|
+
placeholder: {},
|
|
3765
|
+
hint: {},
|
|
3766
|
+
clearable: { type: Boolean },
|
|
3767
|
+
loading: { type: Boolean },
|
|
3768
|
+
autofocus: { type: Boolean },
|
|
3769
|
+
size: {},
|
|
3770
|
+
multilanguage: { type: Boolean },
|
|
3771
|
+
currentLanguage: {},
|
|
3772
|
+
label: {},
|
|
3773
|
+
tooltip: {},
|
|
3774
|
+
disabled: { type: Boolean },
|
|
3775
|
+
required: { type: Boolean },
|
|
3776
|
+
name: {},
|
|
3777
|
+
error: { type: Boolean },
|
|
3778
|
+
errorMessage: {}
|
|
3779
|
+
},
|
|
3780
|
+
emits: ["update:model-value", "update:option", "change", "blur"],
|
|
3781
|
+
setup(e) {
|
|
3782
|
+
const t = Se();
|
|
3783
|
+
return (n, a) => r(t) ? (v(), b("div", Uo, [
|
|
3784
|
+
e.label ? (v(), N(r(le), {
|
|
3785
|
+
key: 0,
|
|
3786
|
+
variant: "block",
|
|
3787
|
+
width: 60 + (e.label?.length || 0) * 4,
|
|
3788
|
+
height: 11
|
|
3789
|
+
}, null, 8, ["width"])) : w("", !0),
|
|
3790
|
+
x(r(le), {
|
|
3791
|
+
variant: "block",
|
|
3792
|
+
width: "100%",
|
|
3793
|
+
height: 36
|
|
3794
|
+
})
|
|
3795
|
+
])) : (v(), N(r(qo), {
|
|
3796
|
+
key: 1,
|
|
3797
|
+
class: "vc-input-dropdown",
|
|
3798
|
+
options: e.options,
|
|
3799
|
+
"option-label": e.optionLabel,
|
|
3800
|
+
"option-value": e.optionValue,
|
|
3801
|
+
searchable: e.searchable,
|
|
3802
|
+
debounce: e.debounce,
|
|
3803
|
+
disabled: e.disabled,
|
|
3804
|
+
label: e.label,
|
|
3805
|
+
required: e.required,
|
|
3806
|
+
"model-value": e.option,
|
|
3807
|
+
tooltip: e.tooltip,
|
|
3808
|
+
multilanguage: e.multilanguage,
|
|
3809
|
+
"current-language": e.currentLanguage,
|
|
3810
|
+
"onUpdate:modelValue": a[2] || (a[2] = (o) => n.$emit("update:option", o))
|
|
3811
|
+
}, {
|
|
3812
|
+
option: O((o) => [
|
|
3813
|
+
C(n.$slots, "option", xe(Te(o)))
|
|
3814
|
+
]),
|
|
3815
|
+
control: O(({ toggleHandler: o, isOpened: i }) => [
|
|
3816
|
+
x(r(gt), {
|
|
3817
|
+
placeholder: e.placeholder,
|
|
3818
|
+
hint: e.hint,
|
|
3819
|
+
clearable: e.clearable,
|
|
3820
|
+
prefix: e.prefix,
|
|
3821
|
+
suffix: e.suffix,
|
|
3822
|
+
name: e.name,
|
|
3823
|
+
"model-value": e.modelValue,
|
|
3824
|
+
loading: e.loading,
|
|
3825
|
+
disabled: e.disabled,
|
|
3826
|
+
autofocus: e.autofocus,
|
|
3827
|
+
error: e.error,
|
|
3828
|
+
"error-message": e.errorMessage,
|
|
3829
|
+
maxlength: e.maxlength,
|
|
3830
|
+
type: e.inputType,
|
|
3831
|
+
class: "vc-input-dropdown__input",
|
|
3832
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => n.$emit("update:model-value", l)),
|
|
3833
|
+
onBlur: a[1] || (a[1] = (l) => n.$emit("blur", l))
|
|
3834
|
+
}, ie({
|
|
3835
|
+
"append-inner": O(() => [
|
|
3836
|
+
L("div", Ko, [
|
|
3837
|
+
C(n.$slots, "button", { toggleHandler: o }, () => [
|
|
3838
|
+
e.options && e.options.length ? (v(), b("button", {
|
|
3839
|
+
key: 0,
|
|
3840
|
+
type: "button",
|
|
3841
|
+
class: "vc-input-dropdown__toggle-button",
|
|
3842
|
+
tabindex: "0",
|
|
3843
|
+
"aria-label": n.$t("COMPONENTS.CONTROLS.SELECT_OPTION"),
|
|
3844
|
+
"aria-expanded": i,
|
|
3845
|
+
"aria-haspopup": "listbox",
|
|
3846
|
+
onClick: H(o, ["stop", "prevent"]),
|
|
3847
|
+
onKeydown: [
|
|
3848
|
+
Z(H(o, ["stop", "prevent"]), ["enter"]),
|
|
3849
|
+
Z(H(o, ["stop", "prevent"]), ["space"])
|
|
3850
|
+
]
|
|
3851
|
+
}, T(r(e.option)), 41, Wo)) : w("", !0)
|
|
3852
|
+
]),
|
|
3853
|
+
e.options && e.options.length ? (v(), N(r(Ma), {
|
|
3854
|
+
key: 0,
|
|
3855
|
+
icon: i ? "lucide-chevron-up" : "lucide-chevron-down",
|
|
3856
|
+
"icon-size": "s",
|
|
3857
|
+
text: "",
|
|
3858
|
+
"aria-label": n.$t("COMPONENTS.CONTROLS.TOGGLE_DROPDOWN"),
|
|
3859
|
+
"icon-class": "vc-input-dropdown__toggle-button-icon",
|
|
3860
|
+
onClick: H(o, ["stop", "prevent"])
|
|
3861
|
+
}, null, 8, ["icon", "aria-label", "onClick"])) : w("", !0)
|
|
3862
|
+
]),
|
|
3863
|
+
n.$slots["append-inner"] ? C(n.$slots, "append-inner", { key: 0 }) : w("", !0)
|
|
3864
|
+
]),
|
|
3865
|
+
_: 2
|
|
3866
|
+
}, [
|
|
3867
|
+
n.$slots.control ? {
|
|
3868
|
+
name: "control",
|
|
3869
|
+
fn: O((l) => [
|
|
3870
|
+
C(n.$slots, "control", xe(Te(l)))
|
|
3871
|
+
]),
|
|
3872
|
+
key: "0"
|
|
3873
|
+
} : void 0,
|
|
3874
|
+
n.$slots["prepend-inner"] ? {
|
|
3875
|
+
name: "prepend-inner",
|
|
3876
|
+
fn: O(() => [
|
|
3877
|
+
C(n.$slots, "prepend-inner")
|
|
3878
|
+
]),
|
|
3879
|
+
key: "1"
|
|
3880
|
+
} : void 0,
|
|
3881
|
+
n.$slots.append ? {
|
|
3882
|
+
name: "append",
|
|
3883
|
+
fn: O(() => [
|
|
3884
|
+
C(n.$slots, "append")
|
|
3885
|
+
]),
|
|
3886
|
+
key: "2"
|
|
3887
|
+
} : void 0,
|
|
3888
|
+
n.$slots.prepend ? {
|
|
3889
|
+
name: "prepend",
|
|
3890
|
+
fn: O(() => [
|
|
3891
|
+
C(n.$slots, "prepend")
|
|
3892
|
+
]),
|
|
3893
|
+
key: "3"
|
|
3894
|
+
} : void 0
|
|
3895
|
+
]), 1032, ["placeholder", "hint", "clearable", "prefix", "suffix", "name", "model-value", "loading", "disabled", "autofocus", "error", "error-message", "maxlength", "type"])
|
|
3896
|
+
]),
|
|
3897
|
+
_: 3
|
|
3898
|
+
}, 8, ["options", "option-label", "option-value", "searchable", "debounce", "disabled", "label", "required", "model-value", "tooltip", "multilanguage", "current-language"]));
|
|
3899
|
+
}
|
|
3900
|
+
}), Ho = {
|
|
3901
|
+
key: 0,
|
|
3902
|
+
class: "vc-input-currency vc-input-currency--skeleton"
|
|
3903
|
+
}, Go = ["disabled", "placeholder", "aria-label"], Yo = /* @__PURE__ */ V({
|
|
3904
|
+
__name: "vc-input-currency",
|
|
3905
|
+
props: {
|
|
3906
|
+
modelValue: {},
|
|
3907
|
+
placeholder: {},
|
|
3908
|
+
hint: {},
|
|
3909
|
+
clearable: { type: Boolean },
|
|
3910
|
+
prefix: {},
|
|
3911
|
+
suffix: {},
|
|
3912
|
+
loading: { type: Boolean },
|
|
3913
|
+
debounce: { default: 0 },
|
|
3914
|
+
autofocus: { type: Boolean },
|
|
3915
|
+
maxlength: {},
|
|
3916
|
+
option: {},
|
|
3917
|
+
options: {},
|
|
3918
|
+
optionValue: {},
|
|
3919
|
+
optionLabel: {},
|
|
3920
|
+
currencyDisplay: { default: Nn.hidden },
|
|
3921
|
+
precision: { default: 2 },
|
|
3922
|
+
searchable: { type: Boolean, default: !1 },
|
|
3923
|
+
label: {},
|
|
3924
|
+
tooltip: {},
|
|
3925
|
+
disabled: { type: Boolean },
|
|
3926
|
+
required: { type: Boolean },
|
|
3927
|
+
name: {},
|
|
3928
|
+
error: { type: Boolean },
|
|
3929
|
+
errorMessage: {}
|
|
3930
|
+
},
|
|
3931
|
+
emits: ["update:model-value", "update:option", "change", "blur"],
|
|
3932
|
+
setup(e, { emit: t }) {
|
|
3933
|
+
const n = e, a = t, o = Se(), { inputRef: i, setOptions: l, numberValue: s, setValue: u } = Dn(
|
|
3934
|
+
{
|
|
3935
|
+
locale: navigator.language,
|
|
3936
|
+
currency: n.option || "USD",
|
|
3937
|
+
currencyDisplay: n.currencyDisplay,
|
|
3938
|
+
hideGroupingSeparatorOnFocus: !1,
|
|
3939
|
+
precision: n.precision,
|
|
3940
|
+
hideCurrencySymbolOnFocus: !1,
|
|
3941
|
+
hideNegligibleDecimalDigitsOnFocus: !1
|
|
3942
|
+
}
|
|
3943
|
+
);
|
|
3944
|
+
Y(
|
|
3945
|
+
() => n.option,
|
|
3946
|
+
(d) => {
|
|
3947
|
+
d && l({
|
|
3948
|
+
locale: navigator.language,
|
|
3949
|
+
currency: d,
|
|
3950
|
+
currencyDisplay: n.currencyDisplay,
|
|
3951
|
+
hideGroupingSeparatorOnFocus: !1,
|
|
3952
|
+
precision: n.precision,
|
|
3953
|
+
hideCurrencySymbolOnFocus: !1,
|
|
3954
|
+
hideNegligibleDecimalDigitsOnFocus: !1
|
|
3955
|
+
});
|
|
3956
|
+
}
|
|
3957
|
+
), Y(
|
|
3958
|
+
() => n.modelValue,
|
|
3959
|
+
(d) => {
|
|
3960
|
+
u(d);
|
|
3961
|
+
}
|
|
3962
|
+
), Y(s, (d) => {
|
|
3963
|
+
a("update:model-value", d);
|
|
3964
|
+
});
|
|
3965
|
+
function f(d) {
|
|
3966
|
+
i.value && (i.value.value = d), s.value = typeof d == "number" ? d : d === null ? null : parseFloat(String(d)) || null, a("update:model-value", s.value);
|
|
3967
|
+
}
|
|
3968
|
+
function m(d) {
|
|
3969
|
+
a("blur", d);
|
|
3970
|
+
}
|
|
3971
|
+
function g(d) {
|
|
3972
|
+
if ((d.key === "-" || d.key === "e") && d.preventDefault(), d.key !== "Tab") {
|
|
3973
|
+
if (d.key === "Enter") {
|
|
3974
|
+
d.target && d.target.blur();
|
|
3975
|
+
const y = Array.from(document.querySelectorAll('[tabindex="0"]:not(:disabled)')), h = y.indexOf(d.target);
|
|
3976
|
+
h >= 0 && h < y.length - 1 && y[h + 1].focus();
|
|
3977
|
+
}
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
function c(d) {
|
|
3981
|
+
const y = d.clipboardData?.getData("text/plain");
|
|
3982
|
+
typeof y < "u" && parseInt(y) < 0 && d.preventDefault();
|
|
3983
|
+
}
|
|
3984
|
+
return (d, y) => r(o) ? (v(), b("div", Ho, [
|
|
3985
|
+
e.label ? (v(), N(r(le), {
|
|
3986
|
+
key: 0,
|
|
3987
|
+
variant: "block",
|
|
3988
|
+
width: 60 + (e.label?.length || 0) * 4,
|
|
3989
|
+
height: 11
|
|
3990
|
+
}, null, 8, ["width"])) : w("", !0),
|
|
3991
|
+
x(r(le), {
|
|
3992
|
+
variant: "block",
|
|
3993
|
+
width: "100%",
|
|
3994
|
+
height: 36
|
|
3995
|
+
})
|
|
3996
|
+
])) : (v(), N(r(jo), {
|
|
3997
|
+
key: 1,
|
|
3998
|
+
class: "vc-input-currency",
|
|
3999
|
+
options: e.options,
|
|
4000
|
+
"option-label": e.optionLabel,
|
|
4001
|
+
"option-value": e.optionValue,
|
|
4002
|
+
searchable: e.searchable,
|
|
4003
|
+
debounce: e.debounce,
|
|
4004
|
+
disabled: e.disabled,
|
|
4005
|
+
label: e.label,
|
|
4006
|
+
required: e.required,
|
|
4007
|
+
option: e.option,
|
|
4008
|
+
"model-value": r(s),
|
|
4009
|
+
tooltip: e.tooltip,
|
|
4010
|
+
placeholder: e.placeholder,
|
|
4011
|
+
hint: e.hint,
|
|
4012
|
+
clearable: e.clearable,
|
|
4013
|
+
prefix: e.prefix,
|
|
4014
|
+
suffix: e.suffix,
|
|
4015
|
+
name: e.name,
|
|
4016
|
+
loading: e.loading,
|
|
4017
|
+
autofocus: e.autofocus,
|
|
4018
|
+
error: e.error,
|
|
4019
|
+
"error-message": e.errorMessage,
|
|
4020
|
+
maxlength: e.maxlength,
|
|
4021
|
+
"input-type": "number",
|
|
4022
|
+
"onUpdate:modelValue": f,
|
|
4023
|
+
"onUpdate:option": y[0] || (y[0] = (h) => d.$emit("update:option", h)),
|
|
4024
|
+
onBlur: m
|
|
4025
|
+
}, {
|
|
4026
|
+
control: O(({ placeholder: h }) => [
|
|
4027
|
+
L("input", {
|
|
4028
|
+
ref_key: "inputRef",
|
|
4029
|
+
ref: i,
|
|
4030
|
+
type: "text",
|
|
4031
|
+
disabled: e.disabled,
|
|
4032
|
+
placeholder: h,
|
|
4033
|
+
"aria-label": e.label || void 0,
|
|
4034
|
+
class: "vc-input-currency__control",
|
|
4035
|
+
tabindex: "0",
|
|
4036
|
+
onBlur: m,
|
|
4037
|
+
onKeydown: g,
|
|
4038
|
+
onPaste: c
|
|
4039
|
+
}, null, 40, Go)
|
|
4040
|
+
]),
|
|
4041
|
+
_: 1
|
|
4042
|
+
}, 8, ["options", "option-label", "option-value", "searchable", "debounce", "disabled", "label", "required", "option", "model-value", "tooltip", "placeholder", "hint", "clearable", "prefix", "suffix", "name", "loading", "autofocus", "error", "error-message", "maxlength"]));
|
|
4043
|
+
}
|
|
4044
|
+
}), jt = Symbol("VcAppBarState"), Jo = {
|
|
4045
|
+
activeWidgetId: S(null),
|
|
4046
|
+
activeMobileActionId: S(null)
|
|
4047
|
+
};
|
|
4048
|
+
function hr() {
|
|
4049
|
+
const e = {
|
|
4050
|
+
activeWidgetId: S(null),
|
|
4051
|
+
activeMobileActionId: S(null)
|
|
4052
|
+
};
|
|
4053
|
+
return $t(jt, e), e;
|
|
4054
|
+
}
|
|
4055
|
+
function kr() {
|
|
4056
|
+
return G(jt, Jo);
|
|
4057
|
+
}
|
|
4058
|
+
const Ir = Symbol("TableContext"), Xo = Symbol("ColumnCollector"), Sr = Symbol("FillerWidth"), $r = Symbol("IsColumnReordering"), wr = (e, t) => {
|
|
4059
|
+
const n = e.__vccOpts || e;
|
|
4060
|
+
for (const [a, o] of t)
|
|
4061
|
+
n[a] = o;
|
|
4062
|
+
return n;
|
|
4063
|
+
}, Or = V({
|
|
4064
|
+
name: "VcColumn",
|
|
4065
|
+
inheritAttrs: !1,
|
|
4066
|
+
props: {
|
|
4067
|
+
// === Identity ===
|
|
4068
|
+
/** Unique column identifier (must be unique within the table) */
|
|
4069
|
+
id: {
|
|
4070
|
+
type: String,
|
|
4071
|
+
required: !0
|
|
4072
|
+
},
|
|
4073
|
+
/** Data field path to read from each item (default: same as `id`) */
|
|
4074
|
+
field: {
|
|
4075
|
+
type: String,
|
|
4076
|
+
default: void 0
|
|
4077
|
+
},
|
|
4078
|
+
// === Display ===
|
|
4079
|
+
/** Column header title text */
|
|
4080
|
+
title: {
|
|
4081
|
+
type: String,
|
|
4082
|
+
default: void 0
|
|
4083
|
+
},
|
|
4084
|
+
/** Cell formatter type — determines how cell value is rendered */
|
|
4085
|
+
type: {
|
|
4086
|
+
type: String,
|
|
4087
|
+
default: "text"
|
|
4088
|
+
},
|
|
4089
|
+
/** Field name to read currency code from (used with `type="money"`, default: `"currency"`) */
|
|
4090
|
+
currencyField: {
|
|
4091
|
+
type: String,
|
|
4092
|
+
default: "currency"
|
|
4093
|
+
},
|
|
4094
|
+
/** Date/number format string (e.g. `"DD.MM.YYYY"`) */
|
|
4095
|
+
format: {
|
|
4096
|
+
type: String,
|
|
4097
|
+
default: void 0
|
|
4098
|
+
},
|
|
4099
|
+
// === Sizing ===
|
|
4100
|
+
/** Column width in px or CSS string (e.g. `200`, `"150px"`) */
|
|
4101
|
+
width: {
|
|
4102
|
+
type: [String, Number],
|
|
4103
|
+
default: void 0
|
|
4104
|
+
},
|
|
4105
|
+
/** Minimum column width (default: `60px`) */
|
|
4106
|
+
minWidth: {
|
|
4107
|
+
type: [String, Number],
|
|
4108
|
+
default: void 0
|
|
4109
|
+
},
|
|
4110
|
+
/** Maximum column width */
|
|
4111
|
+
maxWidth: {
|
|
4112
|
+
type: [String, Number],
|
|
4113
|
+
default: void 0
|
|
4114
|
+
},
|
|
4115
|
+
// === Alignment ===
|
|
4116
|
+
/** Cell text alignment */
|
|
4117
|
+
align: {
|
|
4118
|
+
type: String,
|
|
4119
|
+
default: void 0
|
|
4120
|
+
},
|
|
4121
|
+
/** Header text alignment (default: same as `align`) */
|
|
4122
|
+
headerAlign: {
|
|
4123
|
+
type: String,
|
|
4124
|
+
default: void 0
|
|
4125
|
+
},
|
|
4126
|
+
// === Sorting ===
|
|
4127
|
+
/** Whether the column is sortable (shows sort icon on hover) */
|
|
4128
|
+
sortable: {
|
|
4129
|
+
type: Boolean,
|
|
4130
|
+
default: !1
|
|
4131
|
+
},
|
|
4132
|
+
/** Override backend field name for sorting (default: column `id`) */
|
|
4133
|
+
sortField: {
|
|
4134
|
+
type: String,
|
|
4135
|
+
default: void 0
|
|
4136
|
+
},
|
|
4137
|
+
// === Filtering ===
|
|
4138
|
+
/** Declarative filter config: `true` for text, `"field"` for text with custom field, or object for select/dateRange */
|
|
4139
|
+
filter: {
|
|
4140
|
+
type: [Boolean, String, Object],
|
|
4141
|
+
default: void 0
|
|
4142
|
+
},
|
|
4143
|
+
/** Override backend field name for filtering (default: column `id`) */
|
|
4144
|
+
filterField: {
|
|
4145
|
+
type: String,
|
|
4146
|
+
default: void 0
|
|
4147
|
+
},
|
|
4148
|
+
/** Placeholder text for the filter input */
|
|
4149
|
+
filterPlaceholder: {
|
|
4150
|
+
type: String,
|
|
4151
|
+
default: void 0
|
|
4152
|
+
},
|
|
4153
|
+
// === Visibility ===
|
|
4154
|
+
/** Whether the column is visible (default: `true`). Hidden columns can be toggled via column switcher */
|
|
4155
|
+
visible: {
|
|
4156
|
+
type: Boolean,
|
|
4157
|
+
default: !0
|
|
4158
|
+
},
|
|
4159
|
+
/** If `true`, column stays visible even when `showAllColumns=false` (e.g. when blade narrows) */
|
|
4160
|
+
alwaysVisible: {
|
|
4161
|
+
type: Boolean,
|
|
4162
|
+
default: !1
|
|
4163
|
+
},
|
|
4164
|
+
// === Editing ===
|
|
4165
|
+
/** Whether the cell is editable (enables inline edit on click) */
|
|
4166
|
+
editable: {
|
|
4167
|
+
type: Boolean,
|
|
4168
|
+
default: !1
|
|
4169
|
+
},
|
|
4170
|
+
/** Validation rules for the editable cell (field name → validator) */
|
|
4171
|
+
rules: {
|
|
4172
|
+
type: Object,
|
|
4173
|
+
default: void 0
|
|
4174
|
+
},
|
|
4175
|
+
// === Styling ===
|
|
4176
|
+
/** Custom CSS class applied to the entire column (header + body cells) */
|
|
4177
|
+
class: {
|
|
4178
|
+
type: String,
|
|
4179
|
+
default: void 0
|
|
4180
|
+
},
|
|
4181
|
+
/** Custom CSS class applied only to the header cell */
|
|
4182
|
+
headerClass: {
|
|
4183
|
+
type: String,
|
|
4184
|
+
default: void 0
|
|
4185
|
+
},
|
|
4186
|
+
/** Custom CSS class applied only to body cells */
|
|
4187
|
+
bodyClass: {
|
|
4188
|
+
type: String,
|
|
4189
|
+
default: void 0
|
|
4190
|
+
},
|
|
4191
|
+
/** Number of lines to clamp cell text to (`0` = no clamp, default: `2`) */
|
|
4192
|
+
lineClamp: {
|
|
4193
|
+
type: Number,
|
|
4194
|
+
default: 2
|
|
4195
|
+
},
|
|
4196
|
+
// === Special modes ===
|
|
4197
|
+
/** Renders a selection checkbox column (`"single"` = radio, `"multiple"` = checkbox) */
|
|
4198
|
+
selectionMode: {
|
|
4199
|
+
type: String,
|
|
4200
|
+
default: void 0
|
|
4201
|
+
},
|
|
4202
|
+
/** Renders row edit save/cancel buttons in this column */
|
|
4203
|
+
rowEditor: {
|
|
4204
|
+
type: Boolean,
|
|
4205
|
+
default: !1
|
|
4206
|
+
},
|
|
4207
|
+
/** Renders a drag handle for row reordering */
|
|
4208
|
+
rowReorder: {
|
|
4209
|
+
type: Boolean,
|
|
4210
|
+
default: !1
|
|
4211
|
+
},
|
|
4212
|
+
/** Renders an expand/collapse toggle for row expansion */
|
|
4213
|
+
expander: {
|
|
4214
|
+
type: Boolean,
|
|
4215
|
+
default: !1
|
|
4216
|
+
},
|
|
4217
|
+
// === Mobile ===
|
|
4218
|
+
/**
|
|
4219
|
+
* Mobile card role — determines how column is displayed on mobile.
|
|
4220
|
+
* - `"title"`: Primary identifier, displayed at top (full width, bold)
|
|
4221
|
+
* - `"image"`: Visual element, displayed on left side
|
|
4222
|
+
* - `"field"`: Data with label, auto-distributed in 2x2 grid (max 4)
|
|
4223
|
+
* - `"status"`: Status badge, displayed at bottom (multiple allowed)
|
|
4224
|
+
*/
|
|
4225
|
+
mobileRole: {
|
|
4226
|
+
type: String,
|
|
4227
|
+
default: void 0
|
|
4228
|
+
},
|
|
4229
|
+
/** Explicit grid position for mobile card layout */
|
|
4230
|
+
mobilePosition: {
|
|
4231
|
+
type: String,
|
|
4232
|
+
default: void 0
|
|
4233
|
+
},
|
|
4234
|
+
/** Whether column is visible on mobile (default: `true` — hidden unless `mobileRole` is specified) */
|
|
4235
|
+
mobileVisible: {
|
|
4236
|
+
type: Boolean,
|
|
4237
|
+
default: !0
|
|
4238
|
+
}
|
|
4239
|
+
},
|
|
4240
|
+
setup(e, { slots: t }) {
|
|
4241
|
+
const n = G(Xo, null), a = qe();
|
|
4242
|
+
return Ue(() => {
|
|
4243
|
+
n && a && n.add({
|
|
4244
|
+
instance: a,
|
|
4245
|
+
props: e,
|
|
4246
|
+
slots: t
|
|
4247
|
+
});
|
|
4248
|
+
}), Ot(() => {
|
|
4249
|
+
n && a && n.delete(a);
|
|
4250
|
+
}), () => null;
|
|
4251
|
+
}
|
|
4252
|
+
}), $e = _e(/* @__PURE__ */ new Map());
|
|
4253
|
+
function Ht() {
|
|
4254
|
+
return {
|
|
4255
|
+
register: (l) => {
|
|
4256
|
+
$e.set(l.type, l);
|
|
4257
|
+
},
|
|
4258
|
+
get: (l) => $e.get(l),
|
|
4259
|
+
has: (l) => $e.has(l),
|
|
4260
|
+
getRegisteredTypes: () => Array.from($e.keys()),
|
|
4261
|
+
unregister: (l) => $e.delete(l),
|
|
4262
|
+
clear: () => {
|
|
4263
|
+
$e.clear();
|
|
4264
|
+
}
|
|
4265
|
+
};
|
|
4266
|
+
}
|
|
4267
|
+
const Zo = { class: "vc-table-cell-editable__error-tooltip" }, mt = /* @__PURE__ */ V({
|
|
4268
|
+
__name: "CellEditableWrapper",
|
|
4269
|
+
props: {
|
|
4270
|
+
label: {},
|
|
4271
|
+
fieldName: {},
|
|
4272
|
+
modelValue: {},
|
|
4273
|
+
rules: {},
|
|
4274
|
+
validateOnMount: { type: Boolean }
|
|
4275
|
+
},
|
|
4276
|
+
setup(e) {
|
|
4277
|
+
const t = e, n = S(null);
|
|
4278
|
+
return Ue(() => {
|
|
4279
|
+
const a = t.modelValue === void 0 || t.modelValue === null || t.modelValue === "";
|
|
4280
|
+
(t.validateOnMount || a && t.rules) && n.value?.validate();
|
|
4281
|
+
}), (a, o) => (v(), N(r(wn), {
|
|
4282
|
+
ref_key: "fieldRef",
|
|
4283
|
+
ref: n,
|
|
4284
|
+
label: e.label,
|
|
4285
|
+
name: e.fieldName,
|
|
4286
|
+
"model-value": e.modelValue,
|
|
4287
|
+
rules: e.rules
|
|
4288
|
+
}, {
|
|
4289
|
+
default: O(({ errors: i, errorMessage: l }) => [
|
|
4290
|
+
x(Bt, { placement: "bottom" }, ie({
|
|
4291
|
+
default: O(() => [
|
|
4292
|
+
C(a.$slots, "default", {
|
|
4293
|
+
errors: i,
|
|
4294
|
+
errorMessage: l
|
|
4295
|
+
})
|
|
4296
|
+
]),
|
|
4297
|
+
_: 2
|
|
4298
|
+
}, [
|
|
4299
|
+
l ? {
|
|
4300
|
+
name: "tooltip",
|
|
4301
|
+
fn: O(() => [
|
|
4302
|
+
L("div", Zo, T(l), 1)
|
|
4303
|
+
]),
|
|
4304
|
+
key: "0"
|
|
4305
|
+
} : void 0
|
|
4306
|
+
]), 1024)
|
|
4307
|
+
]),
|
|
4308
|
+
_: 3
|
|
4309
|
+
}, 8, ["label", "name", "model-value", "rules"]));
|
|
4310
|
+
}
|
|
4311
|
+
}), Qo = {
|
|
4312
|
+
key: 1,
|
|
4313
|
+
class: "vc-table-cell-default"
|
|
4314
|
+
}, Gt = /* @__PURE__ */ V({
|
|
4315
|
+
__name: "CellDefault",
|
|
4316
|
+
props: {
|
|
4317
|
+
value: {},
|
|
4318
|
+
editable: { type: Boolean },
|
|
4319
|
+
label: {},
|
|
4320
|
+
fieldName: {},
|
|
4321
|
+
fieldId: {},
|
|
4322
|
+
rules: {},
|
|
4323
|
+
rowIndex: {},
|
|
4324
|
+
validateOnMount: { type: Boolean }
|
|
4325
|
+
},
|
|
4326
|
+
emits: ["update", "blur"],
|
|
4327
|
+
setup(e, { emit: t }) {
|
|
4328
|
+
const n = e, a = t, { isMobile: o, isDesktop: i } = je(), l = (s) => {
|
|
4329
|
+
s && s.length > 0 || a("blur", { row: n.rowIndex, field: n.fieldId || "" });
|
|
4330
|
+
};
|
|
4331
|
+
return (s, u) => e.editable ? (v(), N(mt, {
|
|
4332
|
+
key: 0,
|
|
4333
|
+
label: e.label || "",
|
|
4334
|
+
"field-name": e.fieldName || "",
|
|
4335
|
+
"model-value": e.value,
|
|
4336
|
+
rules: e.rules,
|
|
4337
|
+
"validate-on-mount": e.validateOnMount
|
|
4338
|
+
}, {
|
|
4339
|
+
default: O(({ errors: f, errorMessage: m }) => [
|
|
4340
|
+
x(gt, {
|
|
4341
|
+
"model-value": e.value,
|
|
4342
|
+
class: "vc-table-cell-default__input",
|
|
4343
|
+
error: f.length > 0,
|
|
4344
|
+
"error-message": r(o) ? m : void 0,
|
|
4345
|
+
"onUpdate:modelValue": u[0] || (u[0] = (g) => s.$emit("update", { field: e.fieldId || "", value: g })),
|
|
4346
|
+
onBlur: (g) => l(f)
|
|
4347
|
+
}, ie({ _: 2 }, [
|
|
4348
|
+
r(i) && f.length > 0 ? {
|
|
4349
|
+
name: "append-inner",
|
|
4350
|
+
fn: O(() => [
|
|
4351
|
+
x(r(U), {
|
|
4352
|
+
icon: "lucide-circle-alert",
|
|
4353
|
+
class: "vc-table-cell-default__error-icon"
|
|
4354
|
+
})
|
|
4355
|
+
]),
|
|
4356
|
+
key: "0"
|
|
4357
|
+
} : void 0
|
|
4358
|
+
]), 1032, ["model-value", "error", "error-message", "onBlur"])
|
|
4359
|
+
]),
|
|
4360
|
+
_: 1
|
|
4361
|
+
}, 8, ["label", "field-name", "model-value", "rules", "validate-on-mount"])) : (v(), b("span", Qo, T(e.value), 1));
|
|
4362
|
+
}
|
|
4363
|
+
}), _o = {
|
|
4364
|
+
key: 1,
|
|
4365
|
+
class: "vc-table-cell-money"
|
|
4366
|
+
}, ei = {
|
|
4367
|
+
key: 2,
|
|
4368
|
+
class: "vc-table-cell-money vc-table-cell-money--not-set"
|
|
4369
|
+
}, ti = /* @__PURE__ */ V({
|
|
4370
|
+
__name: "CellMoney",
|
|
4371
|
+
props: {
|
|
4372
|
+
value: {},
|
|
4373
|
+
currency: {},
|
|
4374
|
+
editable: { type: Boolean },
|
|
4375
|
+
label: {},
|
|
4376
|
+
fieldName: {},
|
|
4377
|
+
fieldId: {},
|
|
4378
|
+
rules: {},
|
|
4379
|
+
rowIndex: {},
|
|
4380
|
+
validateOnMount: { type: Boolean }
|
|
4381
|
+
},
|
|
4382
|
+
emits: ["update", "blur"],
|
|
4383
|
+
setup(e, { emit: t }) {
|
|
4384
|
+
const n = e, a = t, { t: o } = Ie({ useScope: "global" }), i = window.navigator.language, { isMobile: l, isDesktop: s } = je(), u = $(() => typeof n.value > "u" || n.value === null || Number(n.value) === 0), f = $(() => {
|
|
4385
|
+
const g = Number(n.value);
|
|
4386
|
+
return isNaN(g) ? String(n.value) : new Intl.NumberFormat(i, {
|
|
4387
|
+
style: "currency",
|
|
4388
|
+
currency: n.currency || "USD"
|
|
4389
|
+
}).format(g);
|
|
4390
|
+
}), m = (g) => {
|
|
4391
|
+
g && g.length > 0 || a("blur", { row: n.rowIndex, field: n.fieldId || "" });
|
|
4392
|
+
};
|
|
4393
|
+
return (g, c) => e.editable ? (v(), N(mt, {
|
|
4394
|
+
key: 0,
|
|
4395
|
+
label: e.label || "",
|
|
4396
|
+
"field-name": e.fieldName || "",
|
|
4397
|
+
"model-value": e.value,
|
|
4398
|
+
rules: e.rules,
|
|
4399
|
+
"validate-on-mount": e.validateOnMount
|
|
4400
|
+
}, {
|
|
4401
|
+
default: O(({ errors: d, errorMessage: y }) => [
|
|
4402
|
+
x(Yo, {
|
|
4403
|
+
"model-value": e.value,
|
|
4404
|
+
options: [],
|
|
4405
|
+
option: e.currency || "USD",
|
|
4406
|
+
"currency-display": "symbol",
|
|
4407
|
+
class: "vc-table-cell-money__input",
|
|
4408
|
+
error: d.length > 0,
|
|
4409
|
+
"error-message": r(l) ? y : void 0,
|
|
4410
|
+
"onUpdate:modelValue": c[0] || (c[0] = (h) => g.$emit("update", { field: e.fieldId || "", value: h })),
|
|
4411
|
+
onBlur: (h) => m(d)
|
|
4412
|
+
}, ie({ _: 2 }, [
|
|
4413
|
+
r(s) && d.length > 0 ? {
|
|
4414
|
+
name: "append-inner",
|
|
4415
|
+
fn: O(() => [
|
|
4416
|
+
x(r(U), {
|
|
4417
|
+
icon: "lucide-circle-alert",
|
|
4418
|
+
class: "vc-table-cell-money__error-icon"
|
|
4419
|
+
})
|
|
4420
|
+
]),
|
|
4421
|
+
key: "0"
|
|
4422
|
+
} : void 0
|
|
4423
|
+
]), 1032, ["model-value", "option", "error", "error-message", "onBlur"])
|
|
4424
|
+
]),
|
|
4425
|
+
_: 1
|
|
4426
|
+
}, 8, ["label", "field-name", "model-value", "rules", "validate-on-mount"])) : u.value ? (v(), b("span", ei, T(r(o)("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET")), 1)) : (v(), b("span", _o, T(f.value), 1));
|
|
4427
|
+
}
|
|
4428
|
+
}), ni = {
|
|
4429
|
+
key: 1,
|
|
4430
|
+
class: "vc-table-cell-number"
|
|
4431
|
+
}, ai = {
|
|
4432
|
+
key: 2,
|
|
4433
|
+
class: "vc-table-cell-number vc-table-cell-number--not-set"
|
|
4434
|
+
}, li = /* @__PURE__ */ V({
|
|
4435
|
+
__name: "CellNumber",
|
|
4436
|
+
props: {
|
|
4437
|
+
value: {},
|
|
4438
|
+
editable: { type: Boolean },
|
|
4439
|
+
label: {},
|
|
4440
|
+
fieldName: {},
|
|
4441
|
+
fieldId: {},
|
|
4442
|
+
rules: {},
|
|
4443
|
+
rowIndex: {},
|
|
4444
|
+
validateOnMount: { type: Boolean }
|
|
4445
|
+
},
|
|
4446
|
+
emits: ["update", "blur"],
|
|
4447
|
+
setup(e, { emit: t }) {
|
|
4448
|
+
const n = e, a = t, { t: o } = Ie({ useScope: "global" }), { isMobile: i, isDesktop: l } = je(), s = $(() => {
|
|
4449
|
+
if (n.value === null || n.value === void 0) return !0;
|
|
4450
|
+
const m = Number(n.value);
|
|
4451
|
+
return isNaN(m) || m < 0;
|
|
4452
|
+
}), u = $(() => {
|
|
4453
|
+
const m = Number(n.value);
|
|
4454
|
+
return isNaN(m) ? String(n.value) : m.toFixed(0);
|
|
4455
|
+
}), f = (m) => {
|
|
4456
|
+
m && m.length > 0 || a("blur", { row: n.rowIndex, field: n.fieldId || "" });
|
|
4457
|
+
};
|
|
4458
|
+
return (m, g) => e.editable ? (v(), N(mt, {
|
|
4459
|
+
key: 0,
|
|
4460
|
+
label: e.label || "",
|
|
4461
|
+
"field-name": e.fieldName || "",
|
|
4462
|
+
"model-value": e.value,
|
|
4463
|
+
rules: e.rules,
|
|
4464
|
+
"validate-on-mount": e.validateOnMount
|
|
4465
|
+
}, {
|
|
4466
|
+
default: O(({ errors: c, errorMessage: d }) => [
|
|
4467
|
+
x(gt, {
|
|
4468
|
+
"model-value": e.value,
|
|
4469
|
+
class: "vc-table-cell-number__input",
|
|
4470
|
+
type: "number",
|
|
4471
|
+
error: c.length > 0,
|
|
4472
|
+
"error-message": r(i) ? d : void 0,
|
|
4473
|
+
"onUpdate:modelValue": g[0] || (g[0] = (y) => m.$emit("update", { field: e.fieldId || "", value: y })),
|
|
4474
|
+
onBlur: (y) => f(c)
|
|
4475
|
+
}, ie({ _: 2 }, [
|
|
4476
|
+
r(l) && c.length > 0 ? {
|
|
4477
|
+
name: "append-inner",
|
|
4478
|
+
fn: O(() => [
|
|
4479
|
+
x(r(U), {
|
|
4480
|
+
icon: "lucide-circle-alert",
|
|
4481
|
+
class: "vc-table-cell-number__error-icon"
|
|
4482
|
+
})
|
|
4483
|
+
]),
|
|
4484
|
+
key: "0"
|
|
4485
|
+
} : void 0
|
|
4486
|
+
]), 1032, ["model-value", "error", "error-message", "onBlur"])
|
|
4487
|
+
]),
|
|
4488
|
+
_: 1
|
|
4489
|
+
}, 8, ["label", "field-name", "model-value", "rules", "validate-on-mount"])) : s.value ? (v(), b("span", ai, T(r(o)("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET")), 1)) : (v(), b("span", ni, T(u.value), 1));
|
|
4490
|
+
}
|
|
4491
|
+
}), oi = {
|
|
4492
|
+
key: 0,
|
|
4493
|
+
class: "vc-table-cell-date"
|
|
4494
|
+
}, ii = {
|
|
4495
|
+
key: 1,
|
|
4496
|
+
class: "vc-table-cell-date vc-table-cell-date--not-set"
|
|
4497
|
+
}, Ze = /* @__PURE__ */ V({
|
|
4498
|
+
__name: "CellDate",
|
|
4499
|
+
props: {
|
|
4500
|
+
value: {},
|
|
4501
|
+
variant: {},
|
|
4502
|
+
format: {}
|
|
4503
|
+
},
|
|
4504
|
+
setup(e) {
|
|
4505
|
+
const t = e, { t: n } = Ie({ useScope: "global" }), a = window.navigator.language, o = $(() => {
|
|
4506
|
+
if (!t.value) return "";
|
|
4507
|
+
if (t.format)
|
|
4508
|
+
return Zn(t.value, t.format, a);
|
|
4509
|
+
const i = t.value instanceof Date ? t.value : new Date(t.value), l = t.variant || "date";
|
|
4510
|
+
return l === "time" ? i.toLocaleTimeString(a) : l === "date-time" ? i.toLocaleString(a) : i.toLocaleDateString(a);
|
|
4511
|
+
});
|
|
4512
|
+
return (i, l) => e.value ? (v(), b("span", oi, T(o.value), 1)) : (v(), b("span", ii, T(r(n)("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET")), 1));
|
|
4513
|
+
}
|
|
4514
|
+
}), ri = ["title"], si = {
|
|
4515
|
+
key: 1,
|
|
4516
|
+
class: "vc-table-cell-date-ago vc-table-cell-date-ago--not-set"
|
|
4517
|
+
}, ui = /* @__PURE__ */ V({
|
|
4518
|
+
__name: "CellDateAgo",
|
|
4519
|
+
props: {
|
|
4520
|
+
value: {}
|
|
4521
|
+
},
|
|
4522
|
+
setup(e) {
|
|
4523
|
+
const t = e, { t: n } = Ie({ useScope: "global" }), a = window.navigator.language, o = $(() => t.value ? (t.value instanceof Date ? t.value : new Date(t.value)).toLocaleString(a) : ""), i = $(() => t.value ? Xn(t.value) : "");
|
|
4524
|
+
return (l, s) => e.value ? (v(), b("span", {
|
|
4525
|
+
key: 0,
|
|
4526
|
+
class: "vc-table-cell-date-ago",
|
|
4527
|
+
title: o.value
|
|
4528
|
+
}, T(i.value), 9, ri)) : (v(), b("span", si, T(r(n)("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET")), 1));
|
|
4529
|
+
}
|
|
4530
|
+
}), ci = /* @__PURE__ */ V({
|
|
4531
|
+
__name: "CellImage",
|
|
4532
|
+
props: {
|
|
4533
|
+
value: {},
|
|
4534
|
+
emptyIcon: {}
|
|
4535
|
+
},
|
|
4536
|
+
setup(e) {
|
|
4537
|
+
return (t, n) => (v(), N(r(Ka), {
|
|
4538
|
+
class: "vc-table-cell-image",
|
|
4539
|
+
bordered: !0,
|
|
4540
|
+
size: "s",
|
|
4541
|
+
aspect: "1x1",
|
|
4542
|
+
src: e.value,
|
|
4543
|
+
"empty-icon": e.emptyIcon,
|
|
4544
|
+
background: "contain",
|
|
4545
|
+
"thumbnail-size": "sm"
|
|
4546
|
+
}, null, 8, ["src", "empty-icon"]));
|
|
4547
|
+
}
|
|
4548
|
+
}), di = /* @__PURE__ */ V({
|
|
4549
|
+
__name: "CellStatus",
|
|
4550
|
+
props: {
|
|
4551
|
+
value: {}
|
|
4552
|
+
},
|
|
4553
|
+
setup(e) {
|
|
4554
|
+
return (t, n) => (v(), N(r(tl), { class: "vc-table-cell-status" }, {
|
|
4555
|
+
default: O(() => [
|
|
4556
|
+
Q(T(e.value), 1)
|
|
4557
|
+
]),
|
|
4558
|
+
_: 1
|
|
4559
|
+
}));
|
|
4560
|
+
}
|
|
4561
|
+
}), fi = { class: "vc-table-cell-status-icon" }, vi = /* @__PURE__ */ V({
|
|
4562
|
+
__name: "CellStatusIcon",
|
|
4563
|
+
props: {
|
|
4564
|
+
value: {}
|
|
4565
|
+
},
|
|
4566
|
+
setup(e) {
|
|
4567
|
+
return (t, n) => (v(), b("div", fi, [
|
|
4568
|
+
typeof e.value == "boolean" ? (v(), N(r(al), {
|
|
4569
|
+
key: 0,
|
|
4570
|
+
status: e.value
|
|
4571
|
+
}, null, 8, ["status"])) : w("", !0)
|
|
4572
|
+
]));
|
|
4573
|
+
}
|
|
4574
|
+
}), gi = /* @__PURE__ */ V({
|
|
4575
|
+
__name: "CellLink",
|
|
4576
|
+
props: {
|
|
4577
|
+
value: {}
|
|
4578
|
+
},
|
|
4579
|
+
setup(e) {
|
|
4580
|
+
return (t, n) => (v(), N(r(Qa), { class: "vc-table-cell-link" }, {
|
|
4581
|
+
default: O(() => [
|
|
4582
|
+
Q(T(e.value), 1)
|
|
4583
|
+
]),
|
|
4584
|
+
_: 1
|
|
4585
|
+
}));
|
|
4586
|
+
}
|
|
4587
|
+
}), mi = ["innerHTML"], pi = 500, bi = /* @__PURE__ */ V({
|
|
4588
|
+
__name: "CellHtml",
|
|
4589
|
+
props: {
|
|
4590
|
+
value: {},
|
|
4591
|
+
maxLength: {}
|
|
4592
|
+
},
|
|
4593
|
+
setup(e) {
|
|
4594
|
+
const t = e, n = /* @__PURE__ */ new Map();
|
|
4595
|
+
function a(l) {
|
|
4596
|
+
if (n.has(l))
|
|
4597
|
+
return n.get(l);
|
|
4598
|
+
const s = Rt.sanitize(l, {
|
|
4599
|
+
ALLOWED_TAGS: [
|
|
4600
|
+
"p",
|
|
4601
|
+
"br",
|
|
4602
|
+
"strong",
|
|
4603
|
+
"em",
|
|
4604
|
+
"u",
|
|
4605
|
+
"s",
|
|
4606
|
+
"h1",
|
|
4607
|
+
"h2",
|
|
4608
|
+
"h3",
|
|
4609
|
+
"h4",
|
|
4610
|
+
"h5",
|
|
4611
|
+
"h6",
|
|
4612
|
+
"ul",
|
|
4613
|
+
"ol",
|
|
4614
|
+
"li",
|
|
4615
|
+
"blockquote",
|
|
4616
|
+
"pre",
|
|
4617
|
+
"code",
|
|
4618
|
+
"a",
|
|
4619
|
+
"img",
|
|
4620
|
+
"table",
|
|
4621
|
+
"thead",
|
|
4622
|
+
"tbody",
|
|
4623
|
+
"tr",
|
|
4624
|
+
"th",
|
|
4625
|
+
"td",
|
|
4626
|
+
"hr",
|
|
4627
|
+
"div",
|
|
4628
|
+
"span"
|
|
4629
|
+
],
|
|
4630
|
+
ALLOWED_ATTR: ["href", "src", "alt", "title", "class", "id", "colspan", "rowspan", "align", "valign"],
|
|
4631
|
+
FORBID_TAGS: ["script", "object", "embed", "form", "input"],
|
|
4632
|
+
FORBID_ATTR: ["onerror", "onload", "onclick", "onmouseover", "onfocus", "onblur", "style"]
|
|
4633
|
+
});
|
|
4634
|
+
if (n.size >= pi) {
|
|
4635
|
+
const u = n.keys().next().value;
|
|
4636
|
+
u !== void 0 && n.delete(u);
|
|
4637
|
+
}
|
|
4638
|
+
return n.set(l, s), s;
|
|
4639
|
+
}
|
|
4640
|
+
const o = $(() => t.value ? a(String(t.value)) : ""), i = $(() => Un(o.value, t.maxLength || 30));
|
|
4641
|
+
return (l, s) => (v(), b("div", {
|
|
4642
|
+
class: "vc-table-cell-html",
|
|
4643
|
+
innerHTML: i.value
|
|
4644
|
+
}, null, 8, mi));
|
|
4645
|
+
}
|
|
4646
|
+
}), Yt = [
|
|
4647
|
+
{ type: "text", component: Gt, config: { editable: !0 } },
|
|
4648
|
+
{ type: "number", component: li, config: { editable: !0 } },
|
|
4649
|
+
{ type: "money", component: ti, config: { editable: !0 } },
|
|
4650
|
+
{ type: "date", component: Ze, config: { editable: !1 } },
|
|
4651
|
+
{ type: "time", component: Ze, config: { editable: !1 } },
|
|
4652
|
+
{ type: "datetime", component: Ze, config: { editable: !1 } },
|
|
4653
|
+
{ type: "date-ago", component: ui, config: { editable: !1 } },
|
|
4654
|
+
{ type: "image", component: ci, config: { editable: !1 } },
|
|
4655
|
+
{ type: "status", component: di, config: { editable: !1 } },
|
|
4656
|
+
{ type: "status-icon", component: vi, config: { editable: !1 } },
|
|
4657
|
+
{ type: "link", component: gi, config: { editable: !1 } },
|
|
4658
|
+
{ type: "html", component: bi, config: { editable: !1 } }
|
|
4659
|
+
], Er = Object.freeze(Yt.map((e) => e.type));
|
|
4660
|
+
function yi() {
|
|
4661
|
+
const { register: e, has: t } = Ht();
|
|
4662
|
+
for (const n of Yt)
|
|
4663
|
+
t(n.type) || e(n);
|
|
4664
|
+
}
|
|
4665
|
+
yi();
|
|
4666
|
+
const Lr = /* @__PURE__ */ V({
|
|
4667
|
+
__name: "DynamicCellRenderer",
|
|
4668
|
+
props: {
|
|
4669
|
+
type: {},
|
|
4670
|
+
value: {},
|
|
4671
|
+
editable: { type: Boolean },
|
|
4672
|
+
label: {},
|
|
4673
|
+
fieldName: {},
|
|
4674
|
+
fieldId: {},
|
|
4675
|
+
rules: {},
|
|
4676
|
+
rowIndex: {},
|
|
4677
|
+
currency: {},
|
|
4678
|
+
format: {},
|
|
4679
|
+
variant: {},
|
|
4680
|
+
validateOnMount: { type: Boolean }
|
|
4681
|
+
},
|
|
4682
|
+
emits: ["update", "blur"],
|
|
4683
|
+
setup(e) {
|
|
4684
|
+
const { get: t } = Ht(), n = e, a = $(() => t(n.type)?.component || Gt), o = $(() => {
|
|
4685
|
+
const l = t(n.type)?.config?.editable ?? !1, s = {
|
|
4686
|
+
value: n.value
|
|
4687
|
+
};
|
|
4688
|
+
return l && n.editable && (s.editable = n.editable, s.label = n.label, s.fieldName = n.fieldName, s.fieldId = n.fieldId, s.rules = n.rules, s.rowIndex = n.rowIndex, n.validateOnMount && (s.validateOnMount = !0)), n.type === "money" && n.currency && (s.currency = n.currency), (n.type === "date" || n.type === "time" || n.type === "datetime") && n.variant && (s.variant = n.variant), n.format && (s.format = n.format), s;
|
|
4689
|
+
});
|
|
4690
|
+
return (i, l) => (v(), N(it(a.value), ne(o.value, {
|
|
4691
|
+
onUpdate: l[0] || (l[0] = (s) => i.$emit("update", s)),
|
|
4692
|
+
onBlur: l[1] || (l[1] = (s) => i.$emit("blur", s))
|
|
4693
|
+
}), null, 16));
|
|
4694
|
+
}
|
|
4695
|
+
}), Br = V({
|
|
4696
|
+
name: "SlotProxy",
|
|
4697
|
+
props: {
|
|
4698
|
+
slotFn: { type: Function, required: !0 },
|
|
4699
|
+
scope: { type: Object, default: () => ({}) }
|
|
4700
|
+
},
|
|
4701
|
+
setup(e) {
|
|
4702
|
+
return () => e.slotFn(e.scope);
|
|
4703
|
+
}
|
|
4704
|
+
}), Cr = (e, t) => {
|
|
4705
|
+
const n = t.arg ? parseInt(t.arg, 10) : 9e3, a = typeof t.value == "object" ? t.value : { blur: !0 };
|
|
4706
|
+
t.value ? (e.classList.add("v-loading"), a.size && e.setAttribute("data-loading-size", a.size), a.color && e.style.setProperty("--v-loading-spinner-color", a.color), a.blur === !1 && e.classList.add("v-loading--no-blur"), a.fullscreen && e.classList.add("v-loading--fullscreen"), e.style.setProperty("--v-loading-z-index", `${n}`)) : (e.classList.remove("v-loading", "v-loading--no-blur", "v-loading--fullscreen"), e.removeAttribute("data-loading-size"), e.style.removeProperty("--v-loading-z-index"), e.style.removeProperty("--v-loading-spinner-color"));
|
|
4707
|
+
};
|
|
4708
|
+
export {
|
|
4709
|
+
zt as $,
|
|
4710
|
+
Cr as A,
|
|
4711
|
+
Er as B,
|
|
4712
|
+
hr as C,
|
|
4713
|
+
yi as D,
|
|
4714
|
+
kr as E,
|
|
4715
|
+
Se as F,
|
|
4716
|
+
Ht as G,
|
|
4717
|
+
ia as H,
|
|
4718
|
+
Ke as I,
|
|
4719
|
+
sa as J,
|
|
4720
|
+
wr as K,
|
|
4721
|
+
fr as L,
|
|
4722
|
+
or as M,
|
|
4723
|
+
aa as N,
|
|
4724
|
+
st as O,
|
|
4725
|
+
se as P,
|
|
4726
|
+
ke as Q,
|
|
4727
|
+
Pe as R,
|
|
4728
|
+
er as S,
|
|
4729
|
+
Kn as T,
|
|
4730
|
+
nt as U,
|
|
4731
|
+
fe as V,
|
|
4732
|
+
la as W,
|
|
4733
|
+
je as X,
|
|
4734
|
+
ur as Y,
|
|
4735
|
+
sr as Z,
|
|
4736
|
+
Ze as _,
|
|
4737
|
+
Ca as a,
|
|
4738
|
+
Xo as a$,
|
|
4739
|
+
gr as a0,
|
|
4740
|
+
Ia as a1,
|
|
4741
|
+
vl as a2,
|
|
4742
|
+
$a as a3,
|
|
4743
|
+
wa as a4,
|
|
4744
|
+
Oa as a5,
|
|
4745
|
+
qi as a6,
|
|
4746
|
+
me as a7,
|
|
4747
|
+
Ra as a8,
|
|
4748
|
+
re as a9,
|
|
4749
|
+
Qi as aA,
|
|
4750
|
+
pr as aB,
|
|
4751
|
+
ar as aC,
|
|
4752
|
+
cr as aD,
|
|
4753
|
+
ir as aE,
|
|
4754
|
+
nr as aF,
|
|
4755
|
+
rr as aG,
|
|
4756
|
+
Xi as aH,
|
|
4757
|
+
Gi as aI,
|
|
4758
|
+
Jn as aJ,
|
|
4759
|
+
At as aK,
|
|
4760
|
+
Yi as aL,
|
|
4761
|
+
La as aM,
|
|
4762
|
+
_i as aN,
|
|
4763
|
+
br as aO,
|
|
4764
|
+
lr as aP,
|
|
4765
|
+
Ki as aQ,
|
|
4766
|
+
tr as aR,
|
|
4767
|
+
Kt as aS,
|
|
4768
|
+
yr as aT,
|
|
4769
|
+
Xl as aU,
|
|
4770
|
+
ra as aV,
|
|
4771
|
+
Ir as aW,
|
|
4772
|
+
Sr as aX,
|
|
4773
|
+
$r as aY,
|
|
4774
|
+
Br as aZ,
|
|
4775
|
+
Lr as a_,
|
|
4776
|
+
Ui as aa,
|
|
4777
|
+
zi as ab,
|
|
4778
|
+
Fi as ac,
|
|
4779
|
+
Pi as ad,
|
|
4780
|
+
vr as ae,
|
|
4781
|
+
Hi as af,
|
|
4782
|
+
mr as ag,
|
|
4783
|
+
fa as ah,
|
|
4784
|
+
da as ai,
|
|
4785
|
+
va as aj,
|
|
4786
|
+
_n as ak,
|
|
4787
|
+
Yn as al,
|
|
4788
|
+
na as am,
|
|
4789
|
+
ji as an,
|
|
4790
|
+
ca as ao,
|
|
4791
|
+
Xn as ap,
|
|
4792
|
+
Zn as aq,
|
|
4793
|
+
Wi as ar,
|
|
4794
|
+
Ji as as,
|
|
4795
|
+
Zi as at,
|
|
4796
|
+
ta as au,
|
|
4797
|
+
Wn as av,
|
|
4798
|
+
ea as aw,
|
|
4799
|
+
ua as ax,
|
|
4800
|
+
yt as ay,
|
|
4801
|
+
dr as az,
|
|
4802
|
+
ui as b,
|
|
4803
|
+
oa as b0,
|
|
4804
|
+
Gt as c,
|
|
4805
|
+
mt as d,
|
|
4806
|
+
bi as e,
|
|
4807
|
+
ci as f,
|
|
4808
|
+
gi as g,
|
|
4809
|
+
ti as h,
|
|
4810
|
+
li as i,
|
|
4811
|
+
di as j,
|
|
4812
|
+
vi as k,
|
|
4813
|
+
Ma as l,
|
|
4814
|
+
Al as m,
|
|
4815
|
+
Or as n,
|
|
4816
|
+
Sl as o,
|
|
4817
|
+
Ka as p,
|
|
4818
|
+
gt as q,
|
|
4819
|
+
Yo as r,
|
|
4820
|
+
jo as s,
|
|
4821
|
+
He as t,
|
|
4822
|
+
Qa as u,
|
|
4823
|
+
ol as v,
|
|
4824
|
+
qo as w,
|
|
4825
|
+
le as x,
|
|
4826
|
+
tl as y,
|
|
4827
|
+
al as z
|
|
4828
|
+
};
|