inertia-bootstrap-forms 4.0.3 → 4.0.5
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/index.cjs +1 -1
- package/dist/index.js +1298 -1139
- package/dist/style.css +1 -1
- package/index.d.ts +5 -1
- package/package.json +1 -1
- package/src/CheckboxToggle.vue +5 -0
- package/src/CreditCardInput.vue +106 -0
- package/src/ShebaInput.vue +125 -0
- package/src/index.js +7 -1
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { defineComponent as F, createElementBlock as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { u as Q, a as Le, l as
|
|
5
|
-
import { useForm as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
1
|
+
import * as nn from "vue";
|
|
2
|
+
import { defineComponent as F, createElementBlock as v, openBlock as m, normalizeClass as q, renderSlot as L, createElementVNode as h, createCommentVNode as M, toDisplayString as V, computed as S, withDirectives as re, vModelText as fn, normalizeStyle as se, ref as E, onMounted as J, watch as U, vModelDynamic as Se, createTextVNode as x, nextTick as X, shallowRef as Sn, onBeforeUnmount as pn, Fragment as W, renderList as ae, reactive as ie, resolveComponent as oe, createBlock as le, mergeProps as Qe, withModifiers as tn, provide as De, inject as me, withCtx as xe, createVNode as Ne, h as kn, vModelCheckbox as In, Teleport as Cn } from "vue";
|
|
3
|
+
import { _ as R, f as z, u as P } from "./chunks/_plugin-vue_export-helper-13TPlHFF.js";
|
|
4
|
+
import { u as Q, a as Le, l as qe, c as Tn } from "./chunks/http-DV3dRBe5.js";
|
|
5
|
+
import { useForm as Mn } from "@inertiajs/vue3";
|
|
6
|
+
const Bn = "۰۱۲۳۴۵۶۷۸۹", En = "٠١٢٣٤٥٦٧٨٩";
|
|
7
|
+
function ke(e) {
|
|
8
8
|
return String(e ?? "").replace(/[۰-۹٠-٩]/g, (n) => {
|
|
9
|
-
const a =
|
|
10
|
-
return String(a !== -1 ? a :
|
|
9
|
+
const a = Bn.indexOf(n);
|
|
10
|
+
return String(a !== -1 ? a : En.indexOf(n));
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Fe(e) {
|
|
14
14
|
if (e == null || e === "") return "";
|
|
15
15
|
const n = Number(e);
|
|
16
16
|
return Number.isNaN(n) ? "" : n.toLocaleString("en-US");
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const n =
|
|
18
|
+
function mn(e) {
|
|
19
|
+
const n = ke(e).replace(/\D/g, "");
|
|
20
20
|
return n === "" ? null : parseInt(n, 10);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const An = F({
|
|
23
23
|
name: "AmountInput",
|
|
24
24
|
emits: ["update:modelValue", "change", "input", "focus", "blur"],
|
|
25
25
|
props: {
|
|
@@ -33,33 +33,33 @@ const Tn = F({
|
|
|
33
33
|
locale: { type: String, default: null }
|
|
34
34
|
},
|
|
35
35
|
setup(e, { emit: n }) {
|
|
36
|
-
const a =
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
a.model.value =
|
|
40
|
-
const o =
|
|
41
|
-
|
|
36
|
+
const a = P(e, n), { t: l } = Q(() => e.locale), u = S(() => Fe(a.model.value)), i = S(() => e.unit ?? l("amount.unit")), t = S(() => e.size ? `form-control-${e.size}` : null);
|
|
37
|
+
function d(w) {
|
|
38
|
+
const g = w.target, p = g.value.slice(0, g.selectionStart ?? 0), $ = ke(p).replace(/\D/g, "").length, k = mn(g.value);
|
|
39
|
+
a.model.value = k;
|
|
40
|
+
const o = Fe(k);
|
|
41
|
+
g.value = o;
|
|
42
42
|
let r = 0, s = 0;
|
|
43
|
-
for (; r < o.length && s <
|
|
43
|
+
for (; r < o.length && s < $; )
|
|
44
44
|
/\d/.test(o[r]) && s++, r++;
|
|
45
|
-
document.activeElement ===
|
|
45
|
+
document.activeElement === g && g.setSelectionRange(r, r), n("input", k, w);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
let
|
|
49
|
-
|
|
47
|
+
function y(w) {
|
|
48
|
+
let g = a.model.value;
|
|
49
|
+
g != null && (e.max !== null && g > e.max && (g = e.max), e.min !== null && g < e.min && (g = e.min), g !== a.model.value && (a.model.value = g)), a.emitChange(g, w);
|
|
50
50
|
}
|
|
51
|
-
return { ...a, displayValue:
|
|
51
|
+
return { ...a, displayValue: u, unitText: i, sizeClass: t, onInput: d, clamp: y, t: l };
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), On = ["name", "id", "value", "placeholder", "required", "readonly", "disabled", "aria-invalid"], Vn = {
|
|
54
54
|
key: 0,
|
|
55
55
|
class: "input-group-text fanum"
|
|
56
56
|
};
|
|
57
|
-
function
|
|
58
|
-
return m(),
|
|
57
|
+
function Dn(e, n, a, l, u, i) {
|
|
58
|
+
return m(), v("div", {
|
|
59
59
|
class: q(["input-group", { "is-invalid": e.isInvalid }])
|
|
60
60
|
}, [
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
L(e.$slots, "prefix"),
|
|
62
|
+
h("input", {
|
|
63
63
|
name: e.name,
|
|
64
64
|
id: e.inputId,
|
|
65
65
|
value: e.displayValue,
|
|
@@ -76,12 +76,12 @@ function En(e, n, a, l, c, i) {
|
|
|
76
76
|
onChange: n[1] || (n[1] = (...t) => e.clamp && e.clamp(...t)),
|
|
77
77
|
onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
|
|
78
78
|
onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
|
|
79
|
-
}, null, 42,
|
|
80
|
-
e.unitText ? (m(),
|
|
81
|
-
|
|
79
|
+
}, null, 42, On),
|
|
80
|
+
e.unitText ? (m(), v("span", Vn, V(e.unitText), 1)) : M("", !0),
|
|
81
|
+
L(e.$slots, "suffix")
|
|
82
82
|
], 2);
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const Nn = /* @__PURE__ */ R(An, [["render", Dn]]), qn = F({
|
|
85
85
|
name: "CaptchaInput",
|
|
86
86
|
emits: ["update:modelValue", "change", "input", "refresh"],
|
|
87
87
|
props: {
|
|
@@ -97,32 +97,32 @@ const An = /* @__PURE__ */ L(Tn, [["render", En]]), On = F({
|
|
|
97
97
|
locale: { type: String, default: null }
|
|
98
98
|
},
|
|
99
99
|
setup(e, { emit: n, expose: a }) {
|
|
100
|
-
const l =
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
const l = P(e, n), { t: u } = Q(() => e.locale), i = Le(), t = E(null), d = E(!0);
|
|
101
|
+
function y() {
|
|
102
|
+
d.value = !0, t.value = `${e.url}${e.url.includes("?") ? "&" : "?"}t=${Date.now()}`, i.timeout(() => {
|
|
103
|
+
d.value = !1;
|
|
104
104
|
}, 500), n("refresh");
|
|
105
105
|
}
|
|
106
|
-
return J(
|
|
106
|
+
return J(y), U(
|
|
107
107
|
() => {
|
|
108
|
-
var
|
|
109
|
-
return (
|
|
108
|
+
var w;
|
|
109
|
+
return (w = l.form.value) == null ? void 0 : w.processing;
|
|
110
110
|
},
|
|
111
|
-
(
|
|
112
|
-
e.refreshOnSubmit &&
|
|
111
|
+
(w, g) => {
|
|
112
|
+
e.refreshOnSubmit && g && !w && (l.model.value = null, y());
|
|
113
113
|
}
|
|
114
|
-
), a({ refresh:
|
|
114
|
+
), a({ refresh: y }), { ...l, t: u, src: t, loading: d, refresh: y };
|
|
115
115
|
}
|
|
116
|
-
}),
|
|
116
|
+
}), Fn = ["name", "id", "placeholder", "required", "readonly", "disabled", "aria-invalid"], Rn = ["src", "alt", "width", "height"], Ln = {
|
|
117
117
|
key: 1,
|
|
118
118
|
class: "placeholder-wave w-100",
|
|
119
119
|
"aria-hidden": "true"
|
|
120
|
-
},
|
|
121
|
-
function
|
|
122
|
-
return m(),
|
|
120
|
+
}, jn = ["disabled", "aria-label"];
|
|
121
|
+
function zn(e, n, a, l, u, i) {
|
|
122
|
+
return m(), v("div", {
|
|
123
123
|
class: q(["input-group captcha", { "is-invalid": e.isInvalid }])
|
|
124
124
|
}, [
|
|
125
|
-
re(
|
|
125
|
+
re(h("input", {
|
|
126
126
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
|
|
127
127
|
name: e.name,
|
|
128
128
|
id: e.inputId,
|
|
@@ -137,14 +137,14 @@ function Fn(e, n, a, l, c, i) {
|
|
|
137
137
|
class: q(["form-control text-start", { "is-invalid": e.isInvalid }]),
|
|
138
138
|
onInput: n[1] || (n[1] = (t) => e.$emit("input", e.model, t)),
|
|
139
139
|
onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t))
|
|
140
|
-
}, null, 42,
|
|
141
|
-
[
|
|
140
|
+
}, null, 42, Fn), [
|
|
141
|
+
[fn, e.model]
|
|
142
142
|
]),
|
|
143
|
-
|
|
143
|
+
h("span", {
|
|
144
144
|
class: "input-group-text p-0 overflow-hidden",
|
|
145
145
|
style: se({ width: e.imageWidth + "px", height: "auto" })
|
|
146
146
|
}, [
|
|
147
|
-
e.src && !e.loading ? (m(),
|
|
147
|
+
e.src && !e.loading ? (m(), v("img", {
|
|
148
148
|
key: 0,
|
|
149
149
|
src: e.src,
|
|
150
150
|
alt: e.t("captcha.alt"),
|
|
@@ -153,21 +153,21 @@ function Fn(e, n, a, l, c, i) {
|
|
|
153
153
|
class: "captcha-holder",
|
|
154
154
|
style: { cursor: "pointer", objectFit: "contain" },
|
|
155
155
|
onClick: n[3] || (n[3] = (...t) => e.refresh && e.refresh(...t))
|
|
156
|
-
}, null, 8,
|
|
157
|
-
|
|
156
|
+
}, null, 8, Rn)) : (m(), v("span", Ln, [
|
|
157
|
+
h("span", {
|
|
158
158
|
class: "placeholder w-100",
|
|
159
159
|
style: se({ height: e.imageHeight + "px" })
|
|
160
160
|
}, null, 4)
|
|
161
161
|
]))
|
|
162
162
|
], 4),
|
|
163
|
-
|
|
163
|
+
h("button", {
|
|
164
164
|
type: "button",
|
|
165
165
|
class: "btn-outline theme-secondary btn-icon",
|
|
166
166
|
disabled: e.isDisabled || e.loading,
|
|
167
167
|
"aria-label": e.t("captcha.refresh"),
|
|
168
168
|
onClick: n[4] || (n[4] = (...t) => e.refresh && e.refresh(...t))
|
|
169
169
|
}, n[5] || (n[5] = [
|
|
170
|
-
|
|
170
|
+
h("svg", {
|
|
171
171
|
width: "16",
|
|
172
172
|
height: "16",
|
|
173
173
|
viewBox: "0 0 16 16",
|
|
@@ -178,15 +178,15 @@ function Fn(e, n, a, l, c, i) {
|
|
|
178
178
|
"stroke-linejoin": "round",
|
|
179
179
|
"aria-hidden": "true"
|
|
180
180
|
}, [
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
h("path", { d: "M13.5 3v3.5H10M2.5 13V9.5H6" }),
|
|
182
|
+
h("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5" })
|
|
183
183
|
], -1)
|
|
184
|
-
]), 8,
|
|
184
|
+
]), 8, jn)
|
|
185
185
|
], 2);
|
|
186
186
|
}
|
|
187
|
-
const
|
|
188
|
-
function
|
|
189
|
-
function
|
|
187
|
+
const Pn = /* @__PURE__ */ R(qn, [["render", zn]]);
|
|
188
|
+
function je(e, n, a, { type: l = () => e.type } = {}) {
|
|
189
|
+
function u() {
|
|
190
190
|
if (!e.checked) return;
|
|
191
191
|
const t = n.model.value;
|
|
192
192
|
l() === "radio" ? (t == null || t === "") && (n.model.value = e.value) : Array.isArray(t) ? t.includes(e.value) || (n.model.value = [...t, e.value]) : t || (n.model.value = e.trueValue !== void 0 ? e.trueValue : !0);
|
|
@@ -195,10 +195,10 @@ function Re(e, n, a, { type: l = () => e.type } = {}) {
|
|
|
195
195
|
a.value && (a.value.indeterminate = !!e.indeterminate);
|
|
196
196
|
}
|
|
197
197
|
return J(() => {
|
|
198
|
-
|
|
199
|
-
}),
|
|
198
|
+
u(), i();
|
|
199
|
+
}), U(() => e.indeterminate, i), { applyInitialChecked: u };
|
|
200
200
|
}
|
|
201
|
-
const
|
|
201
|
+
const Kn = F({
|
|
202
202
|
name: "CheckboxButtonInput",
|
|
203
203
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
204
204
|
props: {
|
|
@@ -213,16 +213,16 @@ const Rn = F({
|
|
|
213
213
|
theme: { type: String, default: "primary" }
|
|
214
214
|
},
|
|
215
215
|
setup(e, { emit: n }) {
|
|
216
|
-
const a = E(null), l =
|
|
217
|
-
return
|
|
216
|
+
const a = E(null), l = P(e, n, { valued: () => e.value });
|
|
217
|
+
return je(e, l, a), { ...l, input: a, onChange: (u) => l.emitChange(l.model.value, u) };
|
|
218
218
|
},
|
|
219
219
|
expose: ["input"]
|
|
220
|
-
}),
|
|
221
|
-
function
|
|
222
|
-
return m(),
|
|
220
|
+
}), Un = ["name", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"];
|
|
221
|
+
function Hn(e, n, a, l, u, i) {
|
|
222
|
+
return m(), v("label", {
|
|
223
223
|
class: q(["btn-check", [`btn-${e.variant}`, `theme-${e.theme}`, { "is-invalid": e.isInvalid, disabled: e.isDisabled }]])
|
|
224
224
|
}, [
|
|
225
|
-
re(
|
|
225
|
+
re(h("input", {
|
|
226
226
|
ref: "input",
|
|
227
227
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
|
|
228
228
|
name: e.name,
|
|
@@ -238,13 +238,13 @@ function Pn(e, n, a, l, c, i) {
|
|
|
238
238
|
onChange: n[1] || (n[1] = (...t) => e.onChange && e.onChange(...t)),
|
|
239
239
|
onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
|
|
240
240
|
onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
|
|
241
|
-
}, null, 42,
|
|
242
|
-
[
|
|
241
|
+
}, null, 42, Un), [
|
|
242
|
+
[Se, e.model]
|
|
243
243
|
]),
|
|
244
|
-
|
|
244
|
+
L(e.$slots, "default")
|
|
245
245
|
], 2);
|
|
246
246
|
}
|
|
247
|
-
const
|
|
247
|
+
const Xn = /* @__PURE__ */ R(Kn, [["render", Hn]]), Gn = F({
|
|
248
248
|
name: "CheckboxInput",
|
|
249
249
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
250
250
|
props: {
|
|
@@ -261,18 +261,18 @@ const zn = /* @__PURE__ */ L(Rn, [["render", Pn]]), Un = F({
|
|
|
261
261
|
label: { type: String, default: null }
|
|
262
262
|
},
|
|
263
263
|
setup(e, { emit: n }) {
|
|
264
|
-
const a = E(null), l =
|
|
265
|
-
|
|
266
|
-
function
|
|
264
|
+
const a = E(null), l = P(e, n, { valued: () => e.value });
|
|
265
|
+
je(e, l, a);
|
|
266
|
+
function u(i) {
|
|
267
267
|
l.emitChange(l.model.value, i);
|
|
268
268
|
}
|
|
269
|
-
return { ...l, input: a, onChange:
|
|
269
|
+
return { ...l, input: a, onChange: u };
|
|
270
270
|
},
|
|
271
271
|
expose: ["input"]
|
|
272
|
-
}),
|
|
273
|
-
function
|
|
274
|
-
return m(),
|
|
275
|
-
re(
|
|
272
|
+
}), Wn = { class: "form-field" }, Qn = ["name", "id", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], Jn = ["for"];
|
|
273
|
+
function Zn(e, n, a, l, u, i) {
|
|
274
|
+
return m(), v("div", Wn, [
|
|
275
|
+
re(h("input", {
|
|
276
276
|
ref: "input",
|
|
277
277
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
|
|
278
278
|
name: e.name,
|
|
@@ -289,17 +289,172 @@ function Gn(e, n, a, l, c, i) {
|
|
|
289
289
|
onChange: n[2] || (n[2] = (...t) => e.onChange && e.onChange(...t)),
|
|
290
290
|
onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
|
|
291
291
|
onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
|
|
292
|
-
}, null, 42,
|
|
293
|
-
[
|
|
292
|
+
}, null, 42, Qn), [
|
|
293
|
+
[Se, e.model]
|
|
294
294
|
]),
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
h("label", { for: e.inputId }, [
|
|
296
|
+
L(e.$slots, "default", {}, () => [
|
|
297
|
+
x(V(e.label), 1)
|
|
298
298
|
])
|
|
299
|
-
], 8,
|
|
299
|
+
], 8, Jn)
|
|
300
300
|
]);
|
|
301
301
|
}
|
|
302
|
-
const
|
|
302
|
+
const Yn = /* @__PURE__ */ R(Gn, [["render", Zn]]), xn = 24;
|
|
303
|
+
function Ue(e) {
|
|
304
|
+
return ke(e).replace(/^\s*ir/i, "").replace(/\D/g, "").slice(0, xn);
|
|
305
|
+
}
|
|
306
|
+
function He(e, n = !0) {
|
|
307
|
+
if (!e) return "";
|
|
308
|
+
const a = [e.slice(0, 2), ...e.slice(2).match(/.{1,4}/g) ?? []];
|
|
309
|
+
return n && (a[0] = `${a[0]}`), a.join(" ");
|
|
310
|
+
}
|
|
311
|
+
const _n = F({
|
|
312
|
+
name: "ShebaInput",
|
|
313
|
+
emits: ["update:modelValue", "change", "input", "focus", "blur"],
|
|
314
|
+
props: {
|
|
315
|
+
...z,
|
|
316
|
+
placeholder: { type: String, default: null },
|
|
317
|
+
/** Show "IR" at the start of the formatted value. */
|
|
318
|
+
prefix: { type: Boolean, default: !0 },
|
|
319
|
+
inputClass: { type: [String, Array, Object], default: null },
|
|
320
|
+
size: { type: String, default: null }
|
|
321
|
+
},
|
|
322
|
+
setup(e, { emit: n }) {
|
|
323
|
+
const a = P(e, n), l = S(() => Ue(a.model.value ?? "")), u = S(() => He(l.value, e.prefix)), i = S(() => e.size ? `form-control-${e.size}` : null), t = S(
|
|
324
|
+
() => e.placeholder ?? He("000000000000000000000000", e.prefix)
|
|
325
|
+
);
|
|
326
|
+
function d(p, $) {
|
|
327
|
+
if ($ === 0) return e.prefix && p ? 2 : 0;
|
|
328
|
+
let k = 0;
|
|
329
|
+
for (let o = 0; o < p.length; o++)
|
|
330
|
+
if (/\d/.test(p[o]) && ++k === $) return o + 1;
|
|
331
|
+
return p.length;
|
|
332
|
+
}
|
|
333
|
+
function y(p) {
|
|
334
|
+
const $ = p.target, k = $.selectionStart ?? $.value.length, o = Ue($.value.slice(0, k)).length, r = Ue($.value), s = He(r, e.prefix);
|
|
335
|
+
if (a.model.value = r, $.value = s, document.activeElement === $) {
|
|
336
|
+
const c = d(s, o);
|
|
337
|
+
X(() => $.setSelectionRange(c, c));
|
|
338
|
+
}
|
|
339
|
+
n("input", r, p);
|
|
340
|
+
}
|
|
341
|
+
function w(p) {
|
|
342
|
+
if (p.key !== "Backspace") return;
|
|
343
|
+
const $ = p.target;
|
|
344
|
+
if ($.selectionStart !== $.selectionEnd) return;
|
|
345
|
+
const k = $.selectionStart ?? 0;
|
|
346
|
+
k > 0 && $.value[k - 1] === " " && $.setSelectionRange(k - 1, k - 1);
|
|
347
|
+
}
|
|
348
|
+
function g(p) {
|
|
349
|
+
a.emitChange(l.value, p);
|
|
350
|
+
}
|
|
351
|
+
return { ...a, displayValue: u, sizeClass: i, placeholderText: t, onInput: y, onKeydown: w, onChange: g };
|
|
352
|
+
}
|
|
353
|
+
}), et = {
|
|
354
|
+
class: "input-group",
|
|
355
|
+
dir: "ltr"
|
|
356
|
+
}, nt = ["id"], tt = ["name", "id", "value", "placeholder", "required", "readonly", "disabled", "aria-invalid"];
|
|
357
|
+
function lt(e, n, a, l, u, i) {
|
|
358
|
+
return m(), v("div", et, [
|
|
359
|
+
h("span", {
|
|
360
|
+
class: "input-group-text",
|
|
361
|
+
id: e.inputId + "prefix"
|
|
362
|
+
}, [
|
|
363
|
+
L(e.$slots, "default", {}, () => [
|
|
364
|
+
n[5] || (n[5] = x(" IR "))
|
|
365
|
+
])
|
|
366
|
+
], 8, nt),
|
|
367
|
+
h("input", {
|
|
368
|
+
name: e.name,
|
|
369
|
+
id: e.inputId,
|
|
370
|
+
value: e.displayValue,
|
|
371
|
+
placeholder: e.placeholderText,
|
|
372
|
+
required: e.required,
|
|
373
|
+
readonly: e.readonly,
|
|
374
|
+
disabled: e.isDisabled,
|
|
375
|
+
"aria-invalid": e.isInvalid || void 0,
|
|
376
|
+
type: "text",
|
|
377
|
+
inputmode: "numeric",
|
|
378
|
+
autocomplete: "off",
|
|
379
|
+
dir: "ltr",
|
|
380
|
+
class: q(["form-control text-start", [e.sizeClass, e.inputClass, { "is-invalid": e.isInvalid }]]),
|
|
381
|
+
onInput: n[0] || (n[0] = (...t) => e.onInput && e.onInput(...t)),
|
|
382
|
+
onKeydown: n[1] || (n[1] = (...t) => e.onKeydown && e.onKeydown(...t)),
|
|
383
|
+
onChange: n[2] || (n[2] = (...t) => e.onChange && e.onChange(...t)),
|
|
384
|
+
onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
|
|
385
|
+
onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
|
|
386
|
+
}, null, 42, tt)
|
|
387
|
+
]);
|
|
388
|
+
}
|
|
389
|
+
const at = /* @__PURE__ */ R(_n, [["render", lt]]), ot = 16;
|
|
390
|
+
function Xe(e) {
|
|
391
|
+
return ke(e).replace(/\D/g, "").slice(0, ot);
|
|
392
|
+
}
|
|
393
|
+
function ln(e) {
|
|
394
|
+
return (e.match(/.{1,4}/g) ?? []).join(" ");
|
|
395
|
+
}
|
|
396
|
+
const rt = F({
|
|
397
|
+
name: "CreditCardInput",
|
|
398
|
+
emits: ["update:modelValue", "change", "input", "focus", "blur"],
|
|
399
|
+
props: {
|
|
400
|
+
...z,
|
|
401
|
+
placeholder: { type: String, default: null },
|
|
402
|
+
inputClass: { type: [String, Array, Object], default: null },
|
|
403
|
+
size: { type: String, default: null }
|
|
404
|
+
},
|
|
405
|
+
setup(e, { emit: n }) {
|
|
406
|
+
const a = P(e, n), l = S(() => Xe(a.model.value ?? "")), u = S(() => ln(l.value)), i = S(() => e.size ? `form-control-${e.size}` : null);
|
|
407
|
+
function t(g, p) {
|
|
408
|
+
if (p === 0) return 0;
|
|
409
|
+
let $ = 0;
|
|
410
|
+
for (let k = 0; k < g.length; k++)
|
|
411
|
+
if (/\d/.test(g[k]) && ++$ === p) return k + 1;
|
|
412
|
+
return g.length;
|
|
413
|
+
}
|
|
414
|
+
function d(g) {
|
|
415
|
+
const p = g.target, $ = p.selectionStart ?? p.value.length, k = Xe(p.value.slice(0, $)).length, o = Xe(p.value), r = ln(o);
|
|
416
|
+
if (a.model.value = o, p.value = r, document.activeElement === p) {
|
|
417
|
+
const s = t(r, k);
|
|
418
|
+
X(() => p.setSelectionRange(s, s));
|
|
419
|
+
}
|
|
420
|
+
n("input", o, g);
|
|
421
|
+
}
|
|
422
|
+
function y(g) {
|
|
423
|
+
if (g.key !== "Backspace") return;
|
|
424
|
+
const p = g.target;
|
|
425
|
+
if (p.selectionStart !== p.selectionEnd) return;
|
|
426
|
+
const $ = p.selectionStart ?? 0;
|
|
427
|
+
$ > 0 && p.value[$ - 1] === " " && p.setSelectionRange($ - 1, $ - 1);
|
|
428
|
+
}
|
|
429
|
+
function w(g) {
|
|
430
|
+
a.emitChange(l.value, g);
|
|
431
|
+
}
|
|
432
|
+
return { ...a, displayValue: u, sizeClass: i, onInput: d, onKeydown: y, onChange: w };
|
|
433
|
+
}
|
|
434
|
+
}), st = ["name", "id", "value", "placeholder", "required", "readonly", "disabled", "aria-invalid"];
|
|
435
|
+
function it(e, n, a, l, u, i) {
|
|
436
|
+
return m(), v("input", {
|
|
437
|
+
name: e.name,
|
|
438
|
+
id: e.inputId,
|
|
439
|
+
value: e.displayValue,
|
|
440
|
+
placeholder: e.placeholder ?? "0000 0000 0000 0000",
|
|
441
|
+
required: e.required,
|
|
442
|
+
readonly: e.readonly,
|
|
443
|
+
disabled: e.isDisabled,
|
|
444
|
+
"aria-invalid": e.isInvalid || void 0,
|
|
445
|
+
type: "text",
|
|
446
|
+
inputmode: "numeric",
|
|
447
|
+
autocomplete: "cc-number",
|
|
448
|
+
dir: "ltr",
|
|
449
|
+
class: q(["form-control text-start", [e.sizeClass, e.inputClass, { "is-invalid": e.isInvalid }]]),
|
|
450
|
+
onInput: n[0] || (n[0] = (...t) => e.onInput && e.onInput(...t)),
|
|
451
|
+
onKeydown: n[1] || (n[1] = (...t) => e.onKeydown && e.onKeydown(...t)),
|
|
452
|
+
onChange: n[2] || (n[2] = (...t) => e.onChange && e.onChange(...t)),
|
|
453
|
+
onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
|
|
454
|
+
onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
|
|
455
|
+
}, null, 42, st);
|
|
456
|
+
}
|
|
457
|
+
const ut = /* @__PURE__ */ R(rt, [["render", it]]), dt = F({
|
|
303
458
|
name: "CheckboxToggle",
|
|
304
459
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
305
460
|
props: {
|
|
@@ -315,13 +470,13 @@ const Wn = /* @__PURE__ */ L(Un, [["render", Gn]]), Qn = F({
|
|
|
315
470
|
formFieldCard: { type: Boolean, default: !0 }
|
|
316
471
|
},
|
|
317
472
|
setup(e, { emit: n }) {
|
|
318
|
-
const a = E(null), l =
|
|
319
|
-
return
|
|
473
|
+
const a = E(null), l = P(e, n, { valued: () => e.value });
|
|
474
|
+
return je(e, l, a), { ...l, input: a, onChange: (u) => l.emitChange(l.model.value, u) };
|
|
320
475
|
},
|
|
321
476
|
expose: ["input"]
|
|
322
|
-
}),
|
|
323
|
-
function
|
|
324
|
-
return m(),
|
|
477
|
+
}), ct = ["name", "id", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], ft = ["for"];
|
|
478
|
+
function pt(e, n, a, l, u, i) {
|
|
479
|
+
return m(), v("div", {
|
|
325
480
|
class: q({
|
|
326
481
|
"form-field": e.formField,
|
|
327
482
|
"form-field-card": e.formFieldCard,
|
|
@@ -329,7 +484,7 @@ function Yn(e, n, a, l, c, i) {
|
|
|
329
484
|
disabled: e.isDisabled || e.readonly
|
|
330
485
|
})
|
|
331
486
|
}, [
|
|
332
|
-
re(
|
|
487
|
+
re(h("input", {
|
|
333
488
|
ref: "input",
|
|
334
489
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
|
|
335
490
|
name: e.name,
|
|
@@ -346,15 +501,15 @@ function Yn(e, n, a, l, c, i) {
|
|
|
346
501
|
onChange: n[2] || (n[2] = (...t) => e.onChange && e.onChange(...t)),
|
|
347
502
|
onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
|
|
348
503
|
onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
|
|
349
|
-
}, null, 42,
|
|
350
|
-
[
|
|
504
|
+
}, null, 42, ct), [
|
|
505
|
+
[Se, e.model]
|
|
351
506
|
]),
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
], 8,
|
|
507
|
+
h("label", { for: e.inputId }, [
|
|
508
|
+
L(e.$slots, "default")
|
|
509
|
+
], 8, ft)
|
|
355
510
|
], 2);
|
|
356
511
|
}
|
|
357
|
-
const
|
|
512
|
+
const mt = /* @__PURE__ */ R(dt, [["render", pt]]), Je = {}, $e = /* @__PURE__ */ new Map(), an = {
|
|
358
513
|
Combobox: () => import("bootstrap/js/dist/combobox.js"),
|
|
359
514
|
Menu: () => import("bootstrap/js/dist/menu.js"),
|
|
360
515
|
Strength: () => import("bootstrap/js/dist/strength.js"),
|
|
@@ -362,56 +517,56 @@ const xn = /* @__PURE__ */ L(Qn, [["render", Yn]]), Xe = {}, $e = /* @__PURE__ *
|
|
|
362
517
|
OtpInput: () => import("bootstrap/js/dist/otp-input.js"),
|
|
363
518
|
Range: () => import("bootstrap/js/dist/range.js")
|
|
364
519
|
};
|
|
365
|
-
function
|
|
366
|
-
Object.assign(
|
|
520
|
+
function ht(e = {}) {
|
|
521
|
+
Object.assign(Je, e), $e.clear();
|
|
367
522
|
}
|
|
368
|
-
function
|
|
369
|
-
return
|
|
523
|
+
function vt(e) {
|
|
524
|
+
return Je[e] ? Promise.resolve(Je[e]) : an[e] ? ($e.has(e) || $e.set(
|
|
370
525
|
e,
|
|
371
|
-
|
|
526
|
+
an[e]().then((n) => n.default ?? n[e]).catch((n) => {
|
|
372
527
|
throw $e.delete(e), n;
|
|
373
528
|
})
|
|
374
529
|
), $e.get(e)) : Promise.reject(new Error(`[inertia-bootstrap-forms] Unknown Bootstrap plugin "${e}"`));
|
|
375
530
|
}
|
|
376
531
|
function he(e, n, a, l = {}) {
|
|
377
|
-
const
|
|
378
|
-
let i = 0, t = !1,
|
|
379
|
-
function
|
|
380
|
-
var
|
|
532
|
+
const u = Sn(null);
|
|
533
|
+
let i = 0, t = !1, d = null;
|
|
534
|
+
function y() {
|
|
535
|
+
var p;
|
|
381
536
|
i++;
|
|
382
|
-
const
|
|
383
|
-
if (
|
|
537
|
+
const g = u.value;
|
|
538
|
+
if (u.value = null, g) {
|
|
384
539
|
try {
|
|
385
|
-
(
|
|
540
|
+
(p = l.onDestroy) == null || p.call(l, g, d);
|
|
386
541
|
} catch {
|
|
387
542
|
}
|
|
388
543
|
try {
|
|
389
|
-
|
|
544
|
+
g.dispose();
|
|
390
545
|
} catch {
|
|
391
546
|
}
|
|
392
547
|
}
|
|
393
|
-
|
|
548
|
+
d = null;
|
|
394
549
|
}
|
|
395
|
-
async function
|
|
550
|
+
async function w() {
|
|
396
551
|
var o, r, s;
|
|
397
|
-
|
|
398
|
-
const
|
|
399
|
-
if (t ||
|
|
400
|
-
const
|
|
401
|
-
if (
|
|
402
|
-
(r = (o =
|
|
403
|
-
const
|
|
404
|
-
return
|
|
552
|
+
y();
|
|
553
|
+
const g = i, p = await vt(e);
|
|
554
|
+
if (t || g !== i) return null;
|
|
555
|
+
const $ = n();
|
|
556
|
+
if (!$) return null;
|
|
557
|
+
(r = (o = p.getInstance) == null ? void 0 : o.call(p, $)) == null || r.dispose(), d = $;
|
|
558
|
+
const k = new p($, a());
|
|
559
|
+
return u.value = k, (s = l.onCreate) == null || s.call(l, k, $), k;
|
|
405
560
|
}
|
|
406
561
|
return J(() => {
|
|
407
|
-
t = !1,
|
|
408
|
-
console.error(`[inertia-bootstrap-forms] Could not start Bootstrap ${e}.`,
|
|
562
|
+
t = !1, w().catch((g) => {
|
|
563
|
+
console.error(`[inertia-bootstrap-forms] Could not start Bootstrap ${e}.`, g);
|
|
409
564
|
});
|
|
410
|
-
}),
|
|
411
|
-
t = !0,
|
|
412
|
-
}), { instance:
|
|
565
|
+
}), pn(() => {
|
|
566
|
+
t = !0, y();
|
|
567
|
+
}), { instance: u, create: w, destroy: y };
|
|
413
568
|
}
|
|
414
|
-
const
|
|
569
|
+
const on = (e, n) => e.length === n.length && e.every((a, l) => a === n[l]), gt = F({
|
|
415
570
|
name: "ChipsInput",
|
|
416
571
|
emits: ["update:modelValue", "change", "add", "remove", "select", "rejected", "focus", "blur"],
|
|
417
572
|
props: {
|
|
@@ -431,24 +586,24 @@ const nn = (e, n) => e.length === n.length && e.every((a, l) => a === n[l]), nt
|
|
|
431
586
|
locale: { type: String, default: null }
|
|
432
587
|
},
|
|
433
588
|
setup(e, { emit: n, expose: a }) {
|
|
434
|
-
const l =
|
|
435
|
-
let
|
|
436
|
-
const
|
|
437
|
-
function
|
|
438
|
-
const o =
|
|
589
|
+
const l = P(e, n), { t: u } = Q(() => e.locale), i = E(null), t = E(null);
|
|
590
|
+
let d = !1, y = [];
|
|
591
|
+
const w = (o) => Array.isArray(o) ? o.map(String) : typeof o == "string" && o !== "" ? e.separator ? o.split(e.separator).map((r) => r.trim()).filter(Boolean) : [o] : [];
|
|
592
|
+
function g() {
|
|
593
|
+
const o = $.value;
|
|
439
594
|
if (!o) return;
|
|
440
|
-
const r =
|
|
441
|
-
if (
|
|
442
|
-
|
|
595
|
+
const r = w(l.model.value);
|
|
596
|
+
if (on(o.getValues(), r)) return;
|
|
597
|
+
d = !0;
|
|
443
598
|
try {
|
|
444
|
-
o.clear(), r.forEach((
|
|
599
|
+
o.clear(), r.forEach((c) => o.add(c));
|
|
445
600
|
} finally {
|
|
446
|
-
|
|
601
|
+
d = !1;
|
|
447
602
|
}
|
|
448
603
|
const s = o.getValues();
|
|
449
|
-
!
|
|
604
|
+
!on(s, r) && Array.isArray(l.model.value) && (l.model.value = s);
|
|
450
605
|
}
|
|
451
|
-
const
|
|
606
|
+
const p = () => e.readonly || l.isDisabled.value, { instance: $, create: k } = he(
|
|
452
607
|
"Chips",
|
|
453
608
|
() => i.value,
|
|
454
609
|
() => {
|
|
@@ -456,66 +611,66 @@ const nn = (e, n) => e.length === n.length && e.every((a, l) => a === n[l]), nt
|
|
|
456
611
|
separator: e.separator,
|
|
457
612
|
allowDuplicates: e.allowDuplicates,
|
|
458
613
|
maxChips: e.maxChips,
|
|
459
|
-
dismissible: e.dismissible && !
|
|
614
|
+
dismissible: e.dismissible && !p(),
|
|
460
615
|
createOnBlur: e.createOnBlur,
|
|
461
|
-
placeholder: e.placeholder ??
|
|
616
|
+
placeholder: e.placeholder ?? u("chips.placeholder")
|
|
462
617
|
};
|
|
463
618
|
return e.dismissIcon && (o.dismissIcon = e.dismissIcon), o;
|
|
464
619
|
},
|
|
465
620
|
{
|
|
466
621
|
onCreate(o, r) {
|
|
467
|
-
const s = (
|
|
468
|
-
r.addEventListener(
|
|
622
|
+
const s = (c, C) => {
|
|
623
|
+
r.addEventListener(c, C), y.push(() => r.removeEventListener(c, C));
|
|
469
624
|
};
|
|
470
|
-
s("add.bs.chips", (
|
|
471
|
-
if (!
|
|
472
|
-
if (e.validator && !e.validator(
|
|
473
|
-
|
|
625
|
+
s("add.bs.chips", (c) => {
|
|
626
|
+
if (!d) {
|
|
627
|
+
if (e.validator && !e.validator(c.value)) {
|
|
628
|
+
c.preventDefault(), n("rejected", c.value);
|
|
474
629
|
return;
|
|
475
630
|
}
|
|
476
|
-
n("add",
|
|
631
|
+
n("add", c.value);
|
|
477
632
|
}
|
|
478
|
-
}), s("remove.bs.chips", (
|
|
479
|
-
|
|
480
|
-
}),
|
|
633
|
+
}), s("remove.bs.chips", (c) => !d && n("remove", c.value)), s("select.bs.chips", (c) => n("select", c.selected)), s("change.bs.chips", (c) => {
|
|
634
|
+
d || (l.model.value = c.values, l.emitChange(c.values, c));
|
|
635
|
+
}), g();
|
|
481
636
|
},
|
|
482
637
|
onDestroy() {
|
|
483
|
-
|
|
638
|
+
y.forEach((o) => o()), y = [];
|
|
484
639
|
}
|
|
485
640
|
}
|
|
486
641
|
);
|
|
487
|
-
return
|
|
642
|
+
return U(() => l.model.value, g, { deep: !0 }), U(
|
|
488
643
|
() => [e.separator, e.allowDuplicates, e.maxChips, e.dismissible, e.createOnBlur, e.dismissIcon, e.readonly, l.isDisabled.value],
|
|
489
644
|
async () => {
|
|
490
|
-
await
|
|
645
|
+
await X(), k();
|
|
491
646
|
}
|
|
492
647
|
), a({
|
|
493
648
|
add: (o) => {
|
|
494
649
|
var r;
|
|
495
|
-
return (r =
|
|
650
|
+
return (r = $.value) == null ? void 0 : r.add(o);
|
|
496
651
|
},
|
|
497
652
|
remove: (o) => {
|
|
498
653
|
var r;
|
|
499
|
-
return (r =
|
|
654
|
+
return (r = $.value) == null ? void 0 : r.remove(o);
|
|
500
655
|
},
|
|
501
656
|
clear: () => {
|
|
502
657
|
var o;
|
|
503
|
-
return (o =
|
|
658
|
+
return (o = $.value) == null ? void 0 : o.clear();
|
|
504
659
|
},
|
|
505
660
|
focus: () => {
|
|
506
661
|
var o;
|
|
507
662
|
return (o = t.value) == null ? void 0 : o.focus();
|
|
508
663
|
}
|
|
509
|
-
}), { ...l, t:
|
|
664
|
+
}), { ...l, t: u, el: i, ghost: t, locked: p };
|
|
510
665
|
}
|
|
511
|
-
}),
|
|
512
|
-
function
|
|
513
|
-
return m(),
|
|
666
|
+
}), yt = ["aria-disabled"], bt = ["id", "placeholder", "disabled", "readonly", "aria-invalid"];
|
|
667
|
+
function $t(e, n, a, l, u, i) {
|
|
668
|
+
return m(), v("div", {
|
|
514
669
|
ref: "el",
|
|
515
670
|
class: "chip-input",
|
|
516
671
|
"aria-disabled": e.isDisabled || void 0
|
|
517
672
|
}, [
|
|
518
|
-
|
|
673
|
+
h("input", {
|
|
519
674
|
ref: "ghost",
|
|
520
675
|
type: "text",
|
|
521
676
|
class: q(["form-ghost", { "is-invalid": e.isInvalid }]),
|
|
@@ -527,16 +682,16 @@ function at(e, n, a, l, c, i) {
|
|
|
527
682
|
autocomplete: "off",
|
|
528
683
|
onFocus: n[0] || (n[0] = (t) => e.$emit("focus", t)),
|
|
529
684
|
onBlur: n[1] || (n[1] = (t) => e.$emit("blur", t))
|
|
530
|
-
}, null, 42,
|
|
531
|
-
], 8,
|
|
685
|
+
}, null, 42, bt)
|
|
686
|
+
], 8, yt);
|
|
532
687
|
}
|
|
533
|
-
const
|
|
534
|
-
function
|
|
688
|
+
const wt = /* @__PURE__ */ R(gt, [["render", $t]]), pe = (e) => e !== null && typeof e == "object", rn = (e) => e == null || e === "";
|
|
689
|
+
function St() {
|
|
535
690
|
if (typeof document > "u") return null;
|
|
536
691
|
const e = document.cookie.match(/(?:^|;\s*)XSRF-TOKEN=([^;]+)/);
|
|
537
692
|
return e ? decodeURIComponent(e[1]) : null;
|
|
538
693
|
}
|
|
539
|
-
const
|
|
694
|
+
const kt = F({
|
|
540
695
|
name: "ComboboxInput",
|
|
541
696
|
emits: [
|
|
542
697
|
"update:modelValue",
|
|
@@ -597,143 +752,143 @@ const st = F({
|
|
|
597
752
|
locale: { type: String, default: null }
|
|
598
753
|
},
|
|
599
754
|
setup(e, { emit: n, expose: a, slots: l }) {
|
|
600
|
-
const
|
|
601
|
-
var
|
|
602
|
-
return ((
|
|
603
|
-
}), s =
|
|
604
|
-
if (!
|
|
605
|
-
const
|
|
606
|
-
return (
|
|
607
|
-
}, j = (
|
|
608
|
-
function
|
|
609
|
-
const
|
|
610
|
-
(
|
|
611
|
-
|
|
612
|
-
}),
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
const ee =
|
|
616
|
-
const
|
|
617
|
-
return e.multiple ? Array.isArray(
|
|
618
|
-
}),
|
|
619
|
-
const
|
|
620
|
-
return
|
|
621
|
-
},
|
|
622
|
-
() =>
|
|
623
|
-
const
|
|
755
|
+
const u = P(e, n), { t: i, locale: t } = Q(() => e.locale), d = Le(), y = E(null), w = E(null), g = E(null), p = E(null), $ = E(null), k = E({}), o = ie({ results: null, loading: !1, error: !1 }), r = S(() => {
|
|
756
|
+
var b;
|
|
757
|
+
return ((b = e.search) == null ? void 0 : b.url) || null;
|
|
758
|
+
}), s = S(() => e.searchEnabled || !!r.value), c = (b) => pe(b) ? e.valueKey ? b[e.valueKey] : b.id ?? b.value ?? b.name ?? b.label : b, C = (b) => {
|
|
759
|
+
if (!pe(b)) return b;
|
|
760
|
+
const I = e.labelKey || e.label;
|
|
761
|
+
return (I ? b[I] : b.name ?? b.label ?? b.title ?? b.value) ?? c(b);
|
|
762
|
+
}, j = (b) => pe(b) ? b[e.descriptionKey] ?? null : null, A = (b) => String(c(b));
|
|
763
|
+
function H(b) {
|
|
764
|
+
const I = { ...k.value };
|
|
765
|
+
(b || []).forEach((N) => {
|
|
766
|
+
I[A(N)] = N;
|
|
767
|
+
}), k.value = I;
|
|
768
|
+
}
|
|
769
|
+
U(() => e.options, (b) => H(b), { immediate: !0, deep: !0 });
|
|
770
|
+
const ee = S(() => {
|
|
771
|
+
const b = u.model.value;
|
|
772
|
+
return e.multiple ? Array.isArray(b) ? b : pe(b) ? Object.values(b) : rn(b) ? [] : [b] : rn(b) ? [] : [b];
|
|
773
|
+
}), K = S(() => ee.value.map((b) => pe(b) ? A(b) : String(b))), Ie = (b) => {
|
|
774
|
+
const I = k.value[b];
|
|
775
|
+
return I !== void 0 ? String(C(I)) : b;
|
|
776
|
+
}, Ce = S(
|
|
777
|
+
() => K.value.map((b) => {
|
|
778
|
+
const I = k.value[b];
|
|
624
779
|
return {
|
|
625
|
-
key:
|
|
626
|
-
raw:
|
|
627
|
-
label:
|
|
628
|
-
description:
|
|
780
|
+
key: b,
|
|
781
|
+
raw: I,
|
|
782
|
+
label: I !== void 0 ? String(C(I)) : b,
|
|
783
|
+
description: I !== void 0 ? j(I) : null
|
|
629
784
|
};
|
|
630
785
|
})
|
|
631
|
-
),
|
|
632
|
-
() => e.multiple && e.showSelected &&
|
|
633
|
-
),
|
|
634
|
-
() => !!l.selection &&
|
|
635
|
-
),
|
|
636
|
-
const
|
|
637
|
-
return
|
|
638
|
-
}), ge =
|
|
639
|
-
let
|
|
786
|
+
), Te = S(() => e.selectedSeparator ?? (t.value === "fa" ? "، " : ", ")), ve = S(
|
|
787
|
+
() => e.multiple && e.showSelected && K.value.length > 1 && (e.maxVisible === null || K.value.length <= e.maxVisible)
|
|
788
|
+
), Me = S(
|
|
789
|
+
() => !!l.selection && K.value.length > 0 && (!e.multiple || K.value.length === 1 || ve.value)
|
|
790
|
+
), Be = S(() => {
|
|
791
|
+
const b = K.value;
|
|
792
|
+
return b.length ? e.multiple && b.length > 1 ? ve.value ? Ce.value.map((I) => I.label).join(Te.value) : (e.selectedText ?? i("select.selectedCount")).replace("{count}", b.length) : Ie(b[0]) : e.placeholder ?? i("select.placeholder");
|
|
793
|
+
}), ge = S(() => Me.value ? "" : Be.value), Ee = S(() => K.value.length === 0), ye = S(() => {
|
|
794
|
+
let b = o.results ?? e.options;
|
|
640
795
|
if (o.results && e.multiple) {
|
|
641
|
-
const
|
|
642
|
-
|
|
796
|
+
const I = new Set(b.map(A));
|
|
797
|
+
b = [...K.value.filter((f) => !I.has(f) && k.value[f] !== void 0).map((f) => k.value[f]), ...b];
|
|
643
798
|
}
|
|
644
|
-
return
|
|
645
|
-
raw:
|
|
646
|
-
key: A(
|
|
647
|
-
label:
|
|
648
|
-
description: j(
|
|
649
|
-
disabled:
|
|
799
|
+
return b.map((I) => ({
|
|
800
|
+
raw: I,
|
|
801
|
+
key: A(I),
|
|
802
|
+
label: C(I),
|
|
803
|
+
description: j(I),
|
|
804
|
+
disabled: pe(I) && !!I.disabled
|
|
650
805
|
}));
|
|
651
806
|
});
|
|
652
807
|
function Z() {
|
|
653
|
-
if (!
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
const
|
|
657
|
-
|
|
808
|
+
if (!g.value) return;
|
|
809
|
+
const b = new Set(K.value);
|
|
810
|
+
g.value.querySelectorAll(".menu-item[data-bs-value]").forEach((I) => {
|
|
811
|
+
const N = b.has(I.dataset.bsValue) && I.dataset.bsValue !== "";
|
|
812
|
+
I.classList.toggle("selected", N), I.setAttribute("aria-selected", N ? "true" : "false");
|
|
658
813
|
});
|
|
659
814
|
}
|
|
660
815
|
function ue() {
|
|
661
|
-
|
|
816
|
+
p.value && (p.value.textContent = ge.value, p.value.classList.toggle("combobox-placeholder", Ee.value));
|
|
662
817
|
}
|
|
663
818
|
function Pe() {
|
|
664
|
-
var
|
|
665
|
-
(
|
|
819
|
+
var b;
|
|
820
|
+
(b = w.value) == null || b.classList.toggle("is-invalid", u.isInvalid.value);
|
|
666
821
|
}
|
|
667
822
|
function ne() {
|
|
668
823
|
Z(), ue(), Pe();
|
|
669
824
|
}
|
|
670
|
-
|
|
671
|
-
function te(
|
|
672
|
-
const
|
|
673
|
-
return
|
|
825
|
+
U([() => u.model.value, ye, ge, u.isInvalid], () => X(ne), { flush: "post" });
|
|
826
|
+
function te(b) {
|
|
827
|
+
const I = k.value[b];
|
|
828
|
+
return I !== void 0 ? c(I) : b;
|
|
674
829
|
}
|
|
675
|
-
function be(
|
|
676
|
-
let
|
|
830
|
+
function be(b) {
|
|
831
|
+
let I, N;
|
|
677
832
|
if (e.multiple) {
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
} else
|
|
681
|
-
|
|
682
|
-
}
|
|
683
|
-
let de = null,
|
|
684
|
-
|
|
685
|
-
clearTimeout(de),
|
|
833
|
+
const f = b.value || [];
|
|
834
|
+
I = f.map(te), N = f.map((O) => k.value[O]);
|
|
835
|
+
} else b.value === "" || b.value === void 0 ? (I = null, N = null) : (I = te(b.value), N = k.value[b.value]);
|
|
836
|
+
u.model.value = I, I === null && n("clear"), n("selected", N), u.emitChange(I, b), X(ne), ue();
|
|
837
|
+
}
|
|
838
|
+
let de = null, G = null;
|
|
839
|
+
d.add(() => {
|
|
840
|
+
clearTimeout(de), G == null || G.abort();
|
|
686
841
|
});
|
|
687
842
|
function ce() {
|
|
688
|
-
var
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}), (
|
|
692
|
-
}
|
|
693
|
-
async function
|
|
694
|
-
const
|
|
695
|
-
if (
|
|
696
|
-
|
|
843
|
+
var b;
|
|
844
|
+
g.value && (g.value.querySelectorAll(".menu-item[data-bs-value]").forEach((I) => {
|
|
845
|
+
I.style.display = "";
|
|
846
|
+
}), (b = g.value.querySelector(".combobox-no-results")) == null || b.classList.toggle("d-none", ye.value.length > 0));
|
|
847
|
+
}
|
|
848
|
+
async function Ke(b) {
|
|
849
|
+
const I = e.search || {};
|
|
850
|
+
if (I.url) {
|
|
851
|
+
G == null || G.abort(), G = new AbortController(), o.loading = !0, o.error = !1;
|
|
697
852
|
try {
|
|
698
|
-
const
|
|
699
|
-
|
|
700
|
-
const
|
|
853
|
+
const N = new URL(I.url, window.location.origin);
|
|
854
|
+
N.searchParams.set(I.param || "query", b);
|
|
855
|
+
const f = {
|
|
701
856
|
Accept: "application/json",
|
|
702
857
|
"X-Requested-With": "XMLHttpRequest",
|
|
703
|
-
...
|
|
704
|
-
}, O =
|
|
705
|
-
O && !
|
|
706
|
-
const
|
|
707
|
-
method: (
|
|
708
|
-
headers:
|
|
858
|
+
...I.headers || {}
|
|
859
|
+
}, O = St();
|
|
860
|
+
O && !f["X-XSRF-TOKEN"] && (f["X-XSRF-TOKEN"] = O);
|
|
861
|
+
const T = await fetch(N, {
|
|
862
|
+
method: (I.method || "POST").toUpperCase(),
|
|
863
|
+
headers: f,
|
|
709
864
|
credentials: "same-origin",
|
|
710
|
-
signal:
|
|
865
|
+
signal: G.signal
|
|
711
866
|
});
|
|
712
|
-
if (!
|
|
713
|
-
const B = await
|
|
714
|
-
|
|
715
|
-
} catch (
|
|
716
|
-
if ((
|
|
717
|
-
o.loading = !1, o.error = !0, o.results = [], n("search-error",
|
|
867
|
+
if (!T.ok) throw new Error(`HTTP ${T.status}`);
|
|
868
|
+
const B = await T.json(), D = Array.isArray(B) ? B : (B == null ? void 0 : B[I.resultsKey || "data"]) ?? (B == null ? void 0 : B.results) ?? [];
|
|
869
|
+
H(D), o.results = D, o.loading = !1, n("search-success", D), await X(), ce(), ne();
|
|
870
|
+
} catch (N) {
|
|
871
|
+
if ((N == null ? void 0 : N.name) === "AbortError") return;
|
|
872
|
+
o.loading = !1, o.error = !0, o.results = [], n("search-error", N), await X(), ce();
|
|
718
873
|
}
|
|
719
874
|
}
|
|
720
875
|
}
|
|
721
|
-
function
|
|
722
|
-
var
|
|
723
|
-
const
|
|
724
|
-
if (n("search",
|
|
876
|
+
function Ae(b) {
|
|
877
|
+
var f, O;
|
|
878
|
+
const I = b.target.value;
|
|
879
|
+
if (n("search", I), !r.value) return;
|
|
725
880
|
clearTimeout(de);
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
728
|
-
|
|
881
|
+
const N = ((f = e.search) == null ? void 0 : f.minChars) ?? 0;
|
|
882
|
+
if (I.length < N) {
|
|
883
|
+
G == null || G.abort(), o.results = null, o.loading = !1;
|
|
729
884
|
return;
|
|
730
885
|
}
|
|
731
|
-
o.loading = !0, de = setTimeout(() =>
|
|
886
|
+
o.loading = !0, de = setTimeout(() => Ke(I), ((O = e.search) == null ? void 0 : O.debounce) ?? 400);
|
|
732
887
|
}
|
|
733
|
-
let
|
|
734
|
-
const { instance: fe, create:
|
|
888
|
+
let _ = [];
|
|
889
|
+
const { instance: fe, create: Oe } = he(
|
|
735
890
|
"Combobox",
|
|
736
|
-
() =>
|
|
891
|
+
() => w.value,
|
|
737
892
|
() => ({
|
|
738
893
|
multiple: e.multiple,
|
|
739
894
|
placeholder: e.placeholder ?? i("select.placeholder"),
|
|
@@ -742,74 +897,74 @@ const st = F({
|
|
|
742
897
|
searchNormalize: e.searchNormalize
|
|
743
898
|
}),
|
|
744
899
|
{
|
|
745
|
-
onCreate(
|
|
746
|
-
const
|
|
747
|
-
|
|
900
|
+
onCreate(b, I) {
|
|
901
|
+
const N = (f, O, T) => {
|
|
902
|
+
f.addEventListener(O, T), _.push(() => f.removeEventListener(O, T));
|
|
748
903
|
};
|
|
749
|
-
|
|
750
|
-
o.results !== null && (o.results = null, o.error = !1,
|
|
904
|
+
N(I, "change.bs.combobox", be), N(I, "show.bs.combobox", (f) => n("show", f)), N(I, "shown.bs.combobox", (f) => n("shown", f)), N(I, "hide.bs.combobox", (f) => n("hide", f)), N(I, "hidden.bs.combobox", (f) => {
|
|
905
|
+
o.results !== null && (o.results = null, o.error = !1, X(() => {
|
|
751
906
|
ce(), ne();
|
|
752
|
-
})), n("hidden",
|
|
753
|
-
}),
|
|
907
|
+
})), n("hidden", f);
|
|
908
|
+
}), $.value && (N($.value, "input", Ae), N($.value, "keydown", (f) => f.key === "Enter" && f.preventDefault())), ne();
|
|
754
909
|
},
|
|
755
910
|
onDestroy() {
|
|
756
|
-
|
|
911
|
+
_.forEach((b) => b()), _ = [];
|
|
757
912
|
}
|
|
758
913
|
}
|
|
759
914
|
);
|
|
760
|
-
return
|
|
915
|
+
return U(
|
|
761
916
|
() => [e.multiple, s.value, e.placement, e.searchNormalize],
|
|
762
917
|
async () => {
|
|
763
|
-
await
|
|
918
|
+
await X(), Oe();
|
|
764
919
|
}
|
|
765
920
|
), a({
|
|
766
921
|
show: () => {
|
|
767
|
-
var
|
|
768
|
-
return (
|
|
922
|
+
var b;
|
|
923
|
+
return (b = fe.value) == null ? void 0 : b.show();
|
|
769
924
|
},
|
|
770
925
|
hide: () => {
|
|
771
|
-
var
|
|
772
|
-
return (
|
|
926
|
+
var b;
|
|
927
|
+
return (b = fe.value) == null ? void 0 : b.hide();
|
|
773
928
|
},
|
|
774
929
|
toggle: () => {
|
|
775
|
-
var
|
|
776
|
-
return (
|
|
930
|
+
var b;
|
|
931
|
+
return (b = fe.value) == null ? void 0 : b.toggle();
|
|
777
932
|
},
|
|
778
933
|
clear: () => {
|
|
779
|
-
|
|
934
|
+
u.model.value = e.multiple ? [] : null, n("clear"), u.emitChange(u.model.value);
|
|
780
935
|
},
|
|
781
936
|
focus: () => {
|
|
782
|
-
var
|
|
783
|
-
return (
|
|
937
|
+
var b;
|
|
938
|
+
return (b = w.value) == null ? void 0 : b.focus();
|
|
784
939
|
}
|
|
785
940
|
}), {
|
|
786
|
-
...
|
|
941
|
+
...u,
|
|
787
942
|
t: i,
|
|
788
|
-
root:
|
|
789
|
-
toggle:
|
|
790
|
-
menu:
|
|
791
|
-
valueEl:
|
|
792
|
-
searchInput:
|
|
943
|
+
root: y,
|
|
944
|
+
toggle: w,
|
|
945
|
+
menu: g,
|
|
946
|
+
valueEl: p,
|
|
947
|
+
searchInput: $,
|
|
793
948
|
remote: o,
|
|
794
949
|
hasSearch: s,
|
|
795
950
|
rendered: ye,
|
|
796
|
-
displayText:
|
|
951
|
+
displayText: Be,
|
|
797
952
|
plainText: ge,
|
|
798
|
-
selectedItems:
|
|
799
|
-
customSelection:
|
|
800
|
-
separator:
|
|
801
|
-
selectedSet:
|
|
802
|
-
showingPlaceholder:
|
|
803
|
-
sizeClass:
|
|
953
|
+
selectedItems: Ce,
|
|
954
|
+
customSelection: Me,
|
|
955
|
+
separator: Te,
|
|
956
|
+
selectedSet: S(() => new Set(K.value)),
|
|
957
|
+
showingPlaceholder: Ee,
|
|
958
|
+
sizeClass: S(() => e.size ? `form-control-${e.size}` : null)
|
|
804
959
|
};
|
|
805
960
|
}
|
|
806
|
-
}),
|
|
961
|
+
}), It = {
|
|
807
962
|
ref: "root",
|
|
808
963
|
class: "combobox"
|
|
809
|
-
},
|
|
964
|
+
}, Ct = ["id", "disabled", "aria-invalid", "aria-required"], Tt = {
|
|
810
965
|
key: 0,
|
|
811
966
|
class: "combobox-selection d-flex align-items-center flex-wrap gap-2 text-start"
|
|
812
|
-
},
|
|
967
|
+
}, Mt = ["textContent"], Bt = {
|
|
813
968
|
key: 1,
|
|
814
969
|
class: "combobox-caret",
|
|
815
970
|
width: "16",
|
|
@@ -821,30 +976,30 @@ const st = F({
|
|
|
821
976
|
"stroke-linecap": "round",
|
|
822
977
|
"stroke-linejoin": "round",
|
|
823
978
|
"aria-hidden": "true"
|
|
824
|
-
},
|
|
979
|
+
}, Et = ["aria-multiselectable"], At = {
|
|
825
980
|
key: 0,
|
|
826
981
|
class: "combobox-search"
|
|
827
|
-
},
|
|
982
|
+
}, Ot = ["placeholder"], Vt = {
|
|
828
983
|
key: 1,
|
|
829
984
|
class: "menu-header",
|
|
830
985
|
role: "status"
|
|
831
|
-
},
|
|
986
|
+
}, Dt = {
|
|
832
987
|
key: 2,
|
|
833
988
|
class: "menu-header",
|
|
834
989
|
role: "alert"
|
|
835
|
-
},
|
|
990
|
+
}, Nt = {
|
|
836
991
|
key: 3,
|
|
837
992
|
type: "button",
|
|
838
993
|
class: "menu-item",
|
|
839
994
|
"data-bs-value": "",
|
|
840
995
|
role: "option"
|
|
841
|
-
},
|
|
996
|
+
}, qt = { class: "menu-item-content" }, Ft = ["data-bs-value", "disabled"], Rt = { class: "menu-item-content" }, Lt = {
|
|
842
997
|
key: 0,
|
|
843
998
|
class: "menu-item-description"
|
|
844
|
-
},
|
|
845
|
-
function
|
|
846
|
-
return m(),
|
|
847
|
-
|
|
999
|
+
}, jt = { class: "combobox-no-results d-none" };
|
|
1000
|
+
function zt(e, n, a, l, u, i) {
|
|
1001
|
+
return m(), v("div", It, [
|
|
1002
|
+
h("button", {
|
|
848
1003
|
ref: "toggle",
|
|
849
1004
|
type: "button",
|
|
850
1005
|
class: q(["combobox-toggle form-control", e.sizeClass]),
|
|
@@ -855,50 +1010,50 @@ function It(e, n, a, l, c, i) {
|
|
|
855
1010
|
"aria-invalid": e.isInvalid || void 0,
|
|
856
1011
|
"aria-required": e.required || void 0
|
|
857
1012
|
}, [
|
|
858
|
-
e.customSelection ? (m(),
|
|
859
|
-
(m(!0),
|
|
1013
|
+
e.customSelection ? (m(), v("span", Tt, [
|
|
1014
|
+
(m(!0), v(W, null, ae(e.selectedItems, (t, d) => L(e.$slots, "selection", {
|
|
860
1015
|
key: t.key,
|
|
861
1016
|
option: t.raw,
|
|
862
1017
|
label: t.label,
|
|
863
1018
|
description: t.description,
|
|
864
1019
|
value: t.key,
|
|
865
|
-
index:
|
|
1020
|
+
index: d,
|
|
866
1021
|
multiple: e.multiple
|
|
867
1022
|
}, () => [
|
|
868
|
-
|
|
1023
|
+
x(V(t.label), 1)
|
|
869
1024
|
])), 128))
|
|
870
1025
|
])) : M("", !0),
|
|
871
|
-
|
|
1026
|
+
h("span", {
|
|
872
1027
|
ref: "valueEl",
|
|
873
1028
|
class: q(["combobox-value", { "combobox-placeholder": e.showingPlaceholder }]),
|
|
874
1029
|
textContent: V(e.plainText)
|
|
875
|
-
}, null, 10,
|
|
876
|
-
e.hideDropdown ? M("", !0) : (m(),
|
|
877
|
-
|
|
1030
|
+
}, null, 10, Mt),
|
|
1031
|
+
e.hideDropdown ? M("", !0) : (m(), v("svg", Bt, n[0] || (n[0] = [
|
|
1032
|
+
h("path", { d: "m3 6 5 5 5-5" }, null, -1)
|
|
878
1033
|
])))
|
|
879
|
-
], 10,
|
|
880
|
-
|
|
1034
|
+
], 10, Ct),
|
|
1035
|
+
h("div", {
|
|
881
1036
|
ref: "menu",
|
|
882
1037
|
class: "menu",
|
|
883
1038
|
role: "listbox",
|
|
884
1039
|
"aria-multiselectable": e.multiple || void 0
|
|
885
1040
|
}, [
|
|
886
|
-
e.hasSearch ? (m(),
|
|
887
|
-
|
|
1041
|
+
e.hasSearch ? (m(), v("div", At, [
|
|
1042
|
+
h("input", {
|
|
888
1043
|
ref: "searchInput",
|
|
889
1044
|
type: "search",
|
|
890
1045
|
class: "form-control combobox-search-input",
|
|
891
1046
|
autocomplete: "off",
|
|
892
1047
|
placeholder: e.searchPlaceholder ?? e.t("select.search")
|
|
893
|
-
}, null, 8,
|
|
1048
|
+
}, null, 8, Ot)
|
|
894
1049
|
])) : M("", !0),
|
|
895
|
-
e.remote.loading ? (m(),
|
|
896
|
-
e.clearable && !e.multiple ? (m(),
|
|
897
|
-
|
|
898
|
-
|
|
1050
|
+
e.remote.loading ? (m(), v("div", Vt, V(e.loadingText ?? e.t("select.loading")), 1)) : e.remote.error ? (m(), v("div", Dt, V(e.t("select.error")), 1)) : M("", !0),
|
|
1051
|
+
e.clearable && !e.multiple ? (m(), v("button", Nt, [
|
|
1052
|
+
h("span", qt, [
|
|
1053
|
+
h("span", null, V(e.clearText ?? e.t("select.clear")), 1)
|
|
899
1054
|
])
|
|
900
1055
|
])) : M("", !0),
|
|
901
|
-
(m(!0),
|
|
1056
|
+
(m(!0), v(W, null, ae(e.rendered, (t) => (m(), v("button", {
|
|
902
1057
|
key: t.key,
|
|
903
1058
|
type: "button",
|
|
904
1059
|
class: "menu-item",
|
|
@@ -906,8 +1061,8 @@ function It(e, n, a, l, c, i) {
|
|
|
906
1061
|
"data-bs-value": t.key,
|
|
907
1062
|
disabled: t.disabled || void 0
|
|
908
1063
|
}, [
|
|
909
|
-
|
|
910
|
-
|
|
1064
|
+
h("span", Rt, [
|
|
1065
|
+
L(e.$slots, "option", {
|
|
911
1066
|
option: t.raw,
|
|
912
1067
|
label: t.label,
|
|
913
1068
|
description: t.description,
|
|
@@ -915,11 +1070,11 @@ function It(e, n, a, l, c, i) {
|
|
|
915
1070
|
selected: e.selectedSet.has(t.key),
|
|
916
1071
|
disabled: t.disabled
|
|
917
1072
|
}, () => [
|
|
918
|
-
|
|
919
|
-
t.description ? (m(),
|
|
1073
|
+
h("span", null, V(t.label), 1),
|
|
1074
|
+
t.description ? (m(), v("span", Lt, V(t.description), 1)) : M("", !0)
|
|
920
1075
|
])
|
|
921
1076
|
]),
|
|
922
|
-
n[1] || (n[1] =
|
|
1077
|
+
n[1] || (n[1] = h("svg", {
|
|
923
1078
|
class: "menu-item-check",
|
|
924
1079
|
width: "16",
|
|
925
1080
|
height: "16",
|
|
@@ -931,14 +1086,14 @@ function It(e, n, a, l, c, i) {
|
|
|
931
1086
|
"stroke-linejoin": "round",
|
|
932
1087
|
"aria-hidden": "true"
|
|
933
1088
|
}, [
|
|
934
|
-
|
|
1089
|
+
h("path", { d: "m3.5 8.5 3 3 6-7" })
|
|
935
1090
|
], -1))
|
|
936
|
-
], 8,
|
|
937
|
-
|
|
938
|
-
], 8,
|
|
1091
|
+
], 8, Ft))), 128)),
|
|
1092
|
+
h("div", jt, V(e.noResultsText ?? e.t("select.noResults")), 1)
|
|
1093
|
+
], 8, Et)
|
|
939
1094
|
], 512);
|
|
940
1095
|
}
|
|
941
|
-
const
|
|
1096
|
+
const hn = /* @__PURE__ */ R(kt, [["render", zt]]), Pt = F({
|
|
942
1097
|
name: "TextInput",
|
|
943
1098
|
emits: ["update:modelValue", "change", "input", "focus", "blur"],
|
|
944
1099
|
props: {
|
|
@@ -949,12 +1104,12 @@ const cn = /* @__PURE__ */ L(st, [["render", It]]), Ct = F({
|
|
|
949
1104
|
size: { type: String, default: null }
|
|
950
1105
|
},
|
|
951
1106
|
setup(e, { emit: n }) {
|
|
952
|
-
const a =
|
|
1107
|
+
const a = P(e, n), l = S(() => e.size ? `form-control-${e.size}` : null);
|
|
953
1108
|
return { ...a, sizeClass: l, emit: n };
|
|
954
1109
|
}
|
|
955
|
-
}),
|
|
956
|
-
function
|
|
957
|
-
return re((m(),
|
|
1110
|
+
}), Kt = ["name", "id", "type", "placeholder", "required", "readonly", "disabled", "aria-invalid"];
|
|
1111
|
+
function Ut(e, n, a, l, u, i) {
|
|
1112
|
+
return re((m(), v("input", {
|
|
958
1113
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
|
|
959
1114
|
name: e.name,
|
|
960
1115
|
id: e.inputId,
|
|
@@ -969,13 +1124,13 @@ function Mt(e, n, a, l, c, i) {
|
|
|
969
1124
|
onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t)),
|
|
970
1125
|
onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
|
|
971
1126
|
onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
|
|
972
|
-
}, null, 42,
|
|
973
|
-
[
|
|
1127
|
+
}, null, 42, Kt)), [
|
|
1128
|
+
[Se, e.model]
|
|
974
1129
|
]);
|
|
975
1130
|
}
|
|
976
|
-
const
|
|
1131
|
+
const ze = /* @__PURE__ */ R(Pt, [["render", Ut]]), Ht = F({
|
|
977
1132
|
name: "EmailInput",
|
|
978
|
-
components: { TextInput:
|
|
1133
|
+
components: { TextInput: ze },
|
|
979
1134
|
props: {
|
|
980
1135
|
name: { type: String, default: "email" },
|
|
981
1136
|
placeholder: { type: String, default: null },
|
|
@@ -986,7 +1141,7 @@ const je = /* @__PURE__ */ L(Ct, [["render", Mt]]), Bt = F({
|
|
|
986
1141
|
return { t: n };
|
|
987
1142
|
}
|
|
988
1143
|
});
|
|
989
|
-
function
|
|
1144
|
+
function Xt(e, n, a, l, u, i) {
|
|
990
1145
|
const t = oe("TextInput");
|
|
991
1146
|
return m(), le(t, {
|
|
992
1147
|
type: "email",
|
|
@@ -995,9 +1150,9 @@ function Et(e, n, a, l, c, i) {
|
|
|
995
1150
|
placeholder: e.placeholder ?? e.t("email.placeholder")
|
|
996
1151
|
}, null, 8, ["name", "placeholder"]);
|
|
997
1152
|
}
|
|
998
|
-
const
|
|
999
|
-
let
|
|
1000
|
-
const
|
|
1153
|
+
const Gt = /* @__PURE__ */ R(Ht, [["render", Xt]]);
|
|
1154
|
+
let Wt = 0;
|
|
1155
|
+
const Qt = F({
|
|
1001
1156
|
name: "FileInput",
|
|
1002
1157
|
emits: ["update:modelValue", "change", "added", "progress", "uploaded", "error", "removed"],
|
|
1003
1158
|
props: {
|
|
@@ -1011,63 +1166,63 @@ const Vt = F({
|
|
|
1011
1166
|
locale: { type: String, default: null }
|
|
1012
1167
|
},
|
|
1013
1168
|
setup(e, { emit: n, expose: a }) {
|
|
1014
|
-
const l =
|
|
1169
|
+
const l = P(e, n), { t: u } = Q(() => e.locale), i = Le(), t = E(null), d = E([]), y = /* @__PURE__ */ new Map();
|
|
1015
1170
|
i.add(() => {
|
|
1016
|
-
|
|
1171
|
+
y.forEach((s) => s.abort()), y.clear(), l.form.value && (l.form.value.uploading = null);
|
|
1017
1172
|
});
|
|
1018
|
-
const
|
|
1019
|
-
function
|
|
1020
|
-
const
|
|
1021
|
-
l.model.value =
|
|
1173
|
+
const w = () => d.value.filter((s) => s.path).map((s) => s.path);
|
|
1174
|
+
function g(s) {
|
|
1175
|
+
const c = e.multiple ? w() : w()[0] ?? null;
|
|
1176
|
+
l.model.value = c, l.emitChange(c, s);
|
|
1022
1177
|
}
|
|
1023
|
-
function
|
|
1178
|
+
function p() {
|
|
1024
1179
|
const s = l.form.value;
|
|
1025
1180
|
if (!s) return;
|
|
1026
|
-
const
|
|
1027
|
-
s.uploading =
|
|
1028
|
-
}
|
|
1029
|
-
function
|
|
1030
|
-
s.error = "", s.percent = 0, s.uploading = !0,
|
|
1031
|
-
const
|
|
1032
|
-
|
|
1033
|
-
const
|
|
1034
|
-
|
|
1035
|
-
A.lengthComputable && (s.percent = Math.round(A.loaded / A.total * 100), n("progress", s, s.percent),
|
|
1181
|
+
const c = d.value.filter((C) => C.uploading);
|
|
1182
|
+
s.uploading = c.length ? Math.min(99, Math.round(c.reduce((C, j) => C + j.percent, 0) / c.length)) : null;
|
|
1183
|
+
}
|
|
1184
|
+
function $(s) {
|
|
1185
|
+
s.error = "", s.percent = 0, s.uploading = !0, p();
|
|
1186
|
+
const c = new FormData();
|
|
1187
|
+
c.append(e.fieldName, s.file);
|
|
1188
|
+
const C = new XMLHttpRequest();
|
|
1189
|
+
y.set(s.id, C), C.open("POST", e.endpoint), Object.entries(qe(e.headers)).forEach(([A, H]) => C.setRequestHeader(A, H)), C.upload.onprogress = (A) => {
|
|
1190
|
+
A.lengthComputable && (s.percent = Math.round(A.loaded / A.total * 100), n("progress", s, s.percent), p());
|
|
1036
1191
|
};
|
|
1037
1192
|
const j = (A) => {
|
|
1038
|
-
s.uploading = !1, s.error = A ||
|
|
1193
|
+
s.uploading = !1, s.error = A || u("upload.failed"), y.delete(s.id), p(), n("error", s, s.error);
|
|
1039
1194
|
};
|
|
1040
|
-
|
|
1195
|
+
C.onerror = () => j(), C.onload = () => {
|
|
1041
1196
|
var ee;
|
|
1042
1197
|
let A = null;
|
|
1043
1198
|
try {
|
|
1044
|
-
A = JSON.parse(
|
|
1199
|
+
A = JSON.parse(C.responseText);
|
|
1045
1200
|
} catch {
|
|
1046
1201
|
}
|
|
1047
|
-
if (
|
|
1048
|
-
const
|
|
1049
|
-
return j((A == null ? void 0 : A.message) || (Array.isArray(
|
|
1202
|
+
if (C.status < 200 || C.status >= 300) {
|
|
1203
|
+
const K = A != null && A.errors ? Object.values(A.errors)[0] : null;
|
|
1204
|
+
return j((A == null ? void 0 : A.message) || (Array.isArray(K) ? K[0] : K));
|
|
1050
1205
|
}
|
|
1051
|
-
const
|
|
1052
|
-
if (!
|
|
1053
|
-
s.path =
|
|
1054
|
-
},
|
|
1206
|
+
const H = ((ee = A == null ? void 0 : A.data) == null ? void 0 : ee.path) ?? (A == null ? void 0 : A.path);
|
|
1207
|
+
if (!H) return j();
|
|
1208
|
+
s.path = H, s.percent = 100, s.uploading = !1, y.delete(s.id), p(), g(), n("uploaded", s);
|
|
1209
|
+
}, C.send(c);
|
|
1055
1210
|
}
|
|
1056
|
-
function
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1211
|
+
function k(s) {
|
|
1212
|
+
const c = ie({ id: `f${++Wt}`, file: s, percent: 0, error: "", path: null, uploading: !1 });
|
|
1213
|
+
d.value = e.multiple ? [...d.value, c] : [c], n("added", c), $(c);
|
|
1059
1214
|
}
|
|
1060
1215
|
function o(s) {
|
|
1061
|
-
Array.from(s.target.files).forEach(
|
|
1216
|
+
Array.from(s.target.files).forEach(k), s.target.value = "";
|
|
1062
1217
|
}
|
|
1063
1218
|
async function r(s) {
|
|
1064
|
-
var
|
|
1065
|
-
if ((
|
|
1066
|
-
|
|
1219
|
+
var c;
|
|
1220
|
+
if ((c = y.get(s.id)) == null || c.abort(), y.delete(s.id), d.value = d.value.filter((C) => C.id !== s.id), p(), s.path) {
|
|
1221
|
+
g();
|
|
1067
1222
|
try {
|
|
1068
1223
|
await fetch(e.endpoint, {
|
|
1069
1224
|
method: "DELETE",
|
|
1070
|
-
headers:
|
|
1225
|
+
headers: qe(e.headers),
|
|
1071
1226
|
credentials: "same-origin",
|
|
1072
1227
|
body: s.path
|
|
1073
1228
|
});
|
|
@@ -1076,27 +1231,27 @@ const Vt = F({
|
|
|
1076
1231
|
}
|
|
1077
1232
|
n("removed", s);
|
|
1078
1233
|
}
|
|
1079
|
-
return
|
|
1234
|
+
return U(
|
|
1080
1235
|
() => l.model.value,
|
|
1081
1236
|
(s) => {
|
|
1082
|
-
(s == null || s === "" || Array.isArray(s) && !s.length) &&
|
|
1237
|
+
(s == null || s === "" || Array.isArray(s) && !s.length) && d.value.some((C) => C.path) && (d.value = d.value.filter((C) => !C.path));
|
|
1083
1238
|
}
|
|
1084
|
-
), a({ clear: () =>
|
|
1239
|
+
), a({ clear: () => d.value.slice().forEach(r) }), { ...l, t: u, input: t, files: d, onSelect: o, remove: r, retry: $, size: (s) => `${Math.round(s / 1024)}KB` };
|
|
1085
1240
|
}
|
|
1086
|
-
}),
|
|
1241
|
+
}), Jt = { class: "file-input-uploader" }, Zt = ["name", "id", "multiple", "accept", "required", "disabled", "aria-invalid"], Yt = {
|
|
1087
1242
|
key: 0,
|
|
1088
1243
|
class: "list-group mt-2"
|
|
1089
|
-
},
|
|
1244
|
+
}, xt = { class: "d-flex align-items-center justify-content-between gap-2" }, _t = { class: "text-truncate" }, el = { class: "d-flex align-items-center gap-2" }, nl = {
|
|
1090
1245
|
class: "fg-secondary fanum",
|
|
1091
1246
|
dir: "ltr"
|
|
1092
|
-
},
|
|
1247
|
+
}, tl = ["aria-label", "onClick"], ll = ["aria-label", "onClick"], al = ["aria-valuenow"], ol = {
|
|
1093
1248
|
key: 1,
|
|
1094
1249
|
class: "fg-danger mt-1",
|
|
1095
1250
|
role: "alert"
|
|
1096
1251
|
};
|
|
1097
|
-
function
|
|
1098
|
-
return m(),
|
|
1099
|
-
|
|
1252
|
+
function rl(e, n, a, l, u, i) {
|
|
1253
|
+
return m(), v("div", Jt, [
|
|
1254
|
+
h("input", {
|
|
1100
1255
|
ref: "input",
|
|
1101
1256
|
type: "file",
|
|
1102
1257
|
class: q(["form-control", { "is-invalid": e.isInvalid }]),
|
|
@@ -1108,24 +1263,24 @@ function Kt(e, n, a, l, c, i) {
|
|
|
1108
1263
|
disabled: e.isDisabled || e.readonly,
|
|
1109
1264
|
"aria-invalid": e.isInvalid || void 0,
|
|
1110
1265
|
onChange: n[0] || (n[0] = (...t) => e.onSelect && e.onSelect(...t))
|
|
1111
|
-
}, null, 42,
|
|
1112
|
-
e.files.length ? (m(),
|
|
1113
|
-
(m(!0),
|
|
1266
|
+
}, null, 42, Zt),
|
|
1267
|
+
e.files.length ? (m(), v("ul", Yt, [
|
|
1268
|
+
(m(!0), v(W, null, ae(e.files, (t) => (m(), v("li", {
|
|
1114
1269
|
key: t.id,
|
|
1115
1270
|
class: "list-group-item"
|
|
1116
1271
|
}, [
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
t.error ? (m(),
|
|
1272
|
+
h("div", xt, [
|
|
1273
|
+
h("span", _t, V(t.file.name), 1),
|
|
1274
|
+
h("span", el, [
|
|
1275
|
+
h("span", nl, V(e.size(t.file.size)), 1),
|
|
1276
|
+
t.error ? (m(), v("button", {
|
|
1122
1277
|
key: 0,
|
|
1123
1278
|
type: "button",
|
|
1124
1279
|
class: "btn-text theme-secondary btn-icon",
|
|
1125
1280
|
"aria-label": e.t("file.retry"),
|
|
1126
|
-
onClick: (
|
|
1281
|
+
onClick: (d) => e.retry(t)
|
|
1127
1282
|
}, n[1] || (n[1] = [
|
|
1128
|
-
|
|
1283
|
+
h("svg", {
|
|
1129
1284
|
width: "16",
|
|
1130
1285
|
height: "16",
|
|
1131
1286
|
viewBox: "0 0 16 16",
|
|
@@ -1136,18 +1291,18 @@ function Kt(e, n, a, l, c, i) {
|
|
|
1136
1291
|
"stroke-linejoin": "round",
|
|
1137
1292
|
"aria-hidden": "true"
|
|
1138
1293
|
}, [
|
|
1139
|
-
|
|
1140
|
-
|
|
1294
|
+
h("path", { d: "M13.5 3v3.5H10" }),
|
|
1295
|
+
h("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5M2.5 13V9.5H6" })
|
|
1141
1296
|
], -1)
|
|
1142
|
-
]), 8,
|
|
1143
|
-
t.path || t.error ? (m(),
|
|
1297
|
+
]), 8, tl)) : M("", !0),
|
|
1298
|
+
t.path || t.error ? (m(), v("button", {
|
|
1144
1299
|
key: 1,
|
|
1145
1300
|
type: "button",
|
|
1146
1301
|
class: "btn-text theme-danger btn-icon",
|
|
1147
1302
|
"aria-label": e.t("file.remove"),
|
|
1148
|
-
onClick: (
|
|
1303
|
+
onClick: (d) => e.remove(t)
|
|
1149
1304
|
}, n[2] || (n[2] = [
|
|
1150
|
-
|
|
1305
|
+
h("svg", {
|
|
1151
1306
|
width: "16",
|
|
1152
1307
|
height: "16",
|
|
1153
1308
|
viewBox: "0 0 16 16",
|
|
@@ -1157,12 +1312,12 @@ function Kt(e, n, a, l, c, i) {
|
|
|
1157
1312
|
"stroke-linecap": "round",
|
|
1158
1313
|
"aria-hidden": "true"
|
|
1159
1314
|
}, [
|
|
1160
|
-
|
|
1315
|
+
h("path", { d: "m4 4 8 8M12 4l-8 8" })
|
|
1161
1316
|
], -1)
|
|
1162
|
-
]), 8,
|
|
1317
|
+
]), 8, ll)) : M("", !0)
|
|
1163
1318
|
])
|
|
1164
1319
|
]),
|
|
1165
|
-
t.uploading ? (m(),
|
|
1320
|
+
t.uploading ? (m(), v("div", {
|
|
1166
1321
|
key: 0,
|
|
1167
1322
|
class: "progress mt-2",
|
|
1168
1323
|
role: "progressbar",
|
|
@@ -1170,17 +1325,17 @@ function Kt(e, n, a, l, c, i) {
|
|
|
1170
1325
|
"aria-valuemin": "0",
|
|
1171
1326
|
"aria-valuemax": "100"
|
|
1172
1327
|
}, [
|
|
1173
|
-
|
|
1328
|
+
h("div", {
|
|
1174
1329
|
class: "progress-bar",
|
|
1175
1330
|
style: se({ width: t.percent + "%" })
|
|
1176
1331
|
}, null, 4)
|
|
1177
|
-
], 8,
|
|
1178
|
-
t.error ? (m(),
|
|
1332
|
+
], 8, al)) : M("", !0),
|
|
1333
|
+
t.error ? (m(), v("div", ol, V(t.error), 1)) : M("", !0)
|
|
1179
1334
|
]))), 128))
|
|
1180
1335
|
])) : M("", !0)
|
|
1181
1336
|
]);
|
|
1182
1337
|
}
|
|
1183
|
-
const
|
|
1338
|
+
const vn = /* @__PURE__ */ R(Qt, [["render", rl]]), sl = F({
|
|
1184
1339
|
name: "FormAdornInput",
|
|
1185
1340
|
inheritAttrs: !1,
|
|
1186
1341
|
emits: ["update:modelValue", "change", "input", "focus", "blur"],
|
|
@@ -1195,34 +1350,34 @@ const fn = /* @__PURE__ */ L(Vt, [["render", Kt]]), Xt = F({
|
|
|
1195
1350
|
size: { type: String, default: null }
|
|
1196
1351
|
},
|
|
1197
1352
|
setup(e, { emit: n }) {
|
|
1198
|
-
const a =
|
|
1353
|
+
const a = P(e, n), l = E(null), u = S(() => e.size ? `form-control-${e.size}` : null);
|
|
1199
1354
|
function i(t) {
|
|
1200
|
-
var
|
|
1201
|
-
(t.target === t.currentTarget || (
|
|
1355
|
+
var d, y, w;
|
|
1356
|
+
(t.target === t.currentTarget || (y = (d = t.target).closest) != null && y.call(d, ".form-adorn-icon, .form-adorn-text")) && ((w = l.value) == null || w.focus());
|
|
1202
1357
|
}
|
|
1203
|
-
return { ...a, input: l, sizeClass:
|
|
1358
|
+
return { ...a, input: l, sizeClass: u, focusInput: i, emit: n, focus: () => {
|
|
1204
1359
|
var t;
|
|
1205
1360
|
return (t = l.value) == null ? void 0 : t.focus();
|
|
1206
1361
|
} };
|
|
1207
1362
|
},
|
|
1208
1363
|
expose: ["focus"]
|
|
1209
|
-
}),
|
|
1364
|
+
}), il = {
|
|
1210
1365
|
key: 0,
|
|
1211
1366
|
class: "form-adorn-text"
|
|
1212
|
-
},
|
|
1367
|
+
}, ul = ["name", "id", "type", "placeholder", "required", "readonly", "disabled", "aria-invalid"], dl = {
|
|
1213
1368
|
key: 0,
|
|
1214
1369
|
class: "form-adorn-text"
|
|
1215
1370
|
};
|
|
1216
|
-
function
|
|
1217
|
-
return m(),
|
|
1371
|
+
function cl(e, n, a, l, u, i) {
|
|
1372
|
+
return m(), v("div", {
|
|
1218
1373
|
class: q(["form-control form-adorn", [e.sizeClass, { "is-invalid": e.isInvalid }, e.$attrs.class]]),
|
|
1219
1374
|
style: se(e.$attrs.style),
|
|
1220
1375
|
onClick: n[5] || (n[5] = (...t) => e.focusInput && e.focusInput(...t))
|
|
1221
1376
|
}, [
|
|
1222
|
-
|
|
1223
|
-
e.startText ? (m(),
|
|
1377
|
+
L(e.$slots, "start", {}, () => [
|
|
1378
|
+
e.startText ? (m(), v("span", il, V(e.startText), 1)) : M("", !0)
|
|
1224
1379
|
]),
|
|
1225
|
-
re(
|
|
1380
|
+
re(h("input", Qe({
|
|
1226
1381
|
ref: "input",
|
|
1227
1382
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t)
|
|
1228
1383
|
}, { ...e.$attrs, class: void 0, style: void 0 }, {
|
|
@@ -1239,26 +1394,26 @@ function Jt(e, n, a, l, c, i) {
|
|
|
1239
1394
|
onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t)),
|
|
1240
1395
|
onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
|
|
1241
1396
|
onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
|
|
1242
|
-
}), null, 16,
|
|
1243
|
-
[
|
|
1397
|
+
}), null, 16, ul), [
|
|
1398
|
+
[Se, e.model]
|
|
1244
1399
|
]),
|
|
1245
|
-
|
|
1246
|
-
e.endText ? (m(),
|
|
1400
|
+
L(e.$slots, "end", {}, () => [
|
|
1401
|
+
e.endText ? (m(), v("span", dl, V(e.endText), 1)) : M("", !0)
|
|
1247
1402
|
])
|
|
1248
1403
|
], 6);
|
|
1249
1404
|
}
|
|
1250
|
-
const
|
|
1251
|
-
function
|
|
1252
|
-
return typeof e == "string" ?
|
|
1405
|
+
const _e = /* @__PURE__ */ R(sl, [["render", cl]]), fl = (e) => e !== null && typeof e == "object" && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null);
|
|
1406
|
+
function Ze(e) {
|
|
1407
|
+
return typeof e == "string" ? ke(e) : Array.isArray(e) ? e.map(Ze) : fl(e) ? Object.keys(e).reduce((n, a) => (n[a] = Ze(e[a]), n), {}) : e;
|
|
1253
1408
|
}
|
|
1254
|
-
function
|
|
1409
|
+
function sn(e, n) {
|
|
1255
1410
|
try {
|
|
1256
1411
|
return JSON.stringify(e) === JSON.stringify(n);
|
|
1257
1412
|
} catch {
|
|
1258
1413
|
return !1;
|
|
1259
1414
|
}
|
|
1260
1415
|
}
|
|
1261
|
-
const
|
|
1416
|
+
const pl = F({
|
|
1262
1417
|
name: "FormContainer",
|
|
1263
1418
|
emits: [
|
|
1264
1419
|
"update:modelValue",
|
|
@@ -1303,7 +1458,7 @@ const Yt = F({
|
|
|
1303
1458
|
hideAlerts: { type: Boolean, default: !1 }
|
|
1304
1459
|
},
|
|
1305
1460
|
setup(e, { emit: n, expose: a }) {
|
|
1306
|
-
const l = E(null),
|
|
1461
|
+
const l = E(null), u = ie({ hasMessage: !1, successMessage: null }), i = Mn({
|
|
1307
1462
|
...e.options,
|
|
1308
1463
|
...e.modelValue
|
|
1309
1464
|
});
|
|
@@ -1312,97 +1467,97 @@ const Yt = F({
|
|
|
1312
1467
|
const r = [];
|
|
1313
1468
|
return (s = l.value) != null && s.id && r.push(l.value.id), typeof o == "string" && r.push(o), o.group && (o.group.name && r.push(o.group.name), o.group.index !== void 0 && o.group.index !== null && r.push(o.group.index)), o.name && r.push(o.name), o.value !== void 0 && o.value !== null && o.value !== "" && r.push(o.value), r.join("-");
|
|
1314
1469
|
};
|
|
1315
|
-
const t = new Set(Object.keys(i)),
|
|
1470
|
+
const t = new Set(Object.keys(i)), d = () => Object.keys(i).filter((o) => !t.has(o) && typeof i[o] != "function" && i[o] !== void 0), y = () => {
|
|
1316
1471
|
const o = typeof i.data == "function" ? { ...i.data() } : Object.keys(i).reduce((r, s) => (t.has(s) && typeof i[s] != "function" && (r[s] = i[s]), r), {});
|
|
1317
|
-
return
|
|
1472
|
+
return d().forEach((r) => {
|
|
1318
1473
|
o[r] = i[r];
|
|
1319
1474
|
}), o;
|
|
1320
|
-
},
|
|
1321
|
-
|
|
1475
|
+
}, w = () => {
|
|
1476
|
+
d().forEach((o) => delete i[o]), i.reset();
|
|
1322
1477
|
};
|
|
1323
|
-
|
|
1324
|
-
() =>
|
|
1478
|
+
U(
|
|
1479
|
+
() => y(),
|
|
1325
1480
|
(o) => {
|
|
1326
1481
|
n("change", o), n("update:modelValue", o);
|
|
1327
1482
|
},
|
|
1328
1483
|
{ deep: !0 }
|
|
1329
|
-
),
|
|
1484
|
+
), U(
|
|
1330
1485
|
() => e.modelValue,
|
|
1331
1486
|
(o) => {
|
|
1332
|
-
!o ||
|
|
1333
|
-
|
|
1487
|
+
!o || sn(o, y()) || Object.keys(o).forEach((r) => {
|
|
1488
|
+
sn(i[r], o[r]) || (i[r] = o[r]);
|
|
1334
1489
|
});
|
|
1335
1490
|
},
|
|
1336
1491
|
{ deep: !0 }
|
|
1337
1492
|
);
|
|
1338
|
-
function
|
|
1493
|
+
function g(o) {
|
|
1339
1494
|
const r = Array.from(l.value.querySelectorAll("input, select, textarea")).filter(
|
|
1340
|
-
(
|
|
1495
|
+
(c) => !c.disabled && c.tabIndex !== -1 && c.type !== "hidden" && c.offsetParent !== null
|
|
1341
1496
|
), s = r[r.indexOf(o) + 1];
|
|
1342
1497
|
s && (s.focus(), s.tagName !== "SELECT" && typeof s.select == "function" && s.select());
|
|
1343
1498
|
}
|
|
1344
|
-
function
|
|
1499
|
+
function p(o) {
|
|
1345
1500
|
const r = o.target;
|
|
1346
1501
|
if (!["INPUT", "TEXTAREA"].includes(r.tagName)) return;
|
|
1347
|
-
e.autoTab && r.maxLength > 0 && r.value.length >= r.maxLength &&
|
|
1502
|
+
e.autoTab && r.maxLength > 0 && r.value.length >= r.maxLength && g(r);
|
|
1348
1503
|
const s = parseInt(r.dataset.autoSubmitLength, 10);
|
|
1349
|
-
!isNaN(s) && r.value.length >= s &&
|
|
1504
|
+
!isNaN(s) && r.value.length >= s && k();
|
|
1350
1505
|
}
|
|
1351
|
-
function
|
|
1352
|
-
|
|
1506
|
+
function $() {
|
|
1507
|
+
w(), i.clearErrors(), u.hasMessage = !1, u.successMessage = null, n("reset");
|
|
1353
1508
|
}
|
|
1354
|
-
async function
|
|
1509
|
+
async function k(o) {
|
|
1355
1510
|
if (e.submitHandler)
|
|
1356
1511
|
return e.submitHandler(o, i);
|
|
1357
1512
|
n("submit", o), i.transform((r) => {
|
|
1358
|
-
const s = { ...e.modelValue, ...r, ...
|
|
1359
|
-
return e.normalizeDigits ?
|
|
1513
|
+
const s = { ...e.modelValue, ...r, ...y() };
|
|
1514
|
+
return e.normalizeDigits ? Ze(s) : s;
|
|
1360
1515
|
}).submit((e.method || "post").toString().toLowerCase(), e.url, {
|
|
1361
1516
|
only: e.only,
|
|
1362
1517
|
...e.visitOptions,
|
|
1363
1518
|
onBefore: (r) => {
|
|
1364
|
-
var s,
|
|
1365
|
-
return n("before", r), (
|
|
1519
|
+
var s, c;
|
|
1520
|
+
return n("before", r), (c = (s = e.visitOptions).onBefore) == null ? void 0 : c.call(s, r);
|
|
1366
1521
|
},
|
|
1367
1522
|
onStart: (r) => {
|
|
1368
|
-
var s,
|
|
1369
|
-
|
|
1523
|
+
var s, c;
|
|
1524
|
+
u.hasMessage = !1, u.successMessage = null, i.clearErrors(), n("start", r), n("onStart", r), (c = (s = e.visitOptions).onStart) == null || c.call(s, r);
|
|
1370
1525
|
},
|
|
1371
1526
|
onProgress: (r) => {
|
|
1372
|
-
var s,
|
|
1373
|
-
n("progress", r), (
|
|
1527
|
+
var s, c;
|
|
1528
|
+
n("progress", r), (c = (s = e.visitOptions).onProgress) == null || c.call(s, r);
|
|
1374
1529
|
},
|
|
1375
1530
|
onCancel: () => {
|
|
1376
1531
|
var r, s;
|
|
1377
1532
|
n("cancel"), (s = (r = e.visitOptions).onCancel) == null || s.call(r);
|
|
1378
1533
|
},
|
|
1379
1534
|
onFinish: (r) => {
|
|
1380
|
-
var s,
|
|
1381
|
-
n("finish", r), n("onFinish", r), (
|
|
1535
|
+
var s, c;
|
|
1536
|
+
n("finish", r), n("onFinish", r), (c = (s = e.visitOptions).onFinish) == null || c.call(s, r);
|
|
1382
1537
|
},
|
|
1383
1538
|
onError: (r) => {
|
|
1384
|
-
var s,
|
|
1385
|
-
n("error", r), n("onError", r), (
|
|
1539
|
+
var s, c;
|
|
1540
|
+
n("error", r), n("onError", r), (c = (s = e.visitOptions).onError) == null || c.call(s, r);
|
|
1386
1541
|
},
|
|
1387
1542
|
onSuccess: (r) => {
|
|
1388
|
-
var s,
|
|
1389
|
-
e.resetOnSuccess &&
|
|
1543
|
+
var s, c, C;
|
|
1544
|
+
e.resetOnSuccess && w(), (s = r == null ? void 0 : r.props) != null && s.message && (u.hasMessage = !0, u.successMessage = r.props.message), n("success", r), n("onSuccess", r), (C = (c = e.visitOptions).onSuccess) == null || C.call(c, r);
|
|
1390
1545
|
}
|
|
1391
1546
|
});
|
|
1392
1547
|
}
|
|
1393
|
-
return
|
|
1548
|
+
return De("form", S(() => i)), De("formApi", { submit: k, reset: $, el: l }), a({ submit: k, reset: $, form: i, el: l }), { form: i, formEl: l, ui: u, handleInput: p, reset: $, submit: k };
|
|
1394
1549
|
}
|
|
1395
|
-
}),
|
|
1550
|
+
}), ml = ["action", "method", "data-bs-validate", "novalidate"], hl = {
|
|
1396
1551
|
key: 0,
|
|
1397
1552
|
class: "alert theme-danger",
|
|
1398
1553
|
role: "alert"
|
|
1399
|
-
},
|
|
1554
|
+
}, vl = { class: "list-unstyled p-0 m-0 fanum" }, gl = ["innerHTML"], yl = {
|
|
1400
1555
|
key: 0,
|
|
1401
1556
|
class: "alert theme-success",
|
|
1402
1557
|
role: "status"
|
|
1403
|
-
},
|
|
1404
|
-
function
|
|
1405
|
-
return m(),
|
|
1558
|
+
}, bl = ["innerHTML"], $l = { key: 1 };
|
|
1559
|
+
function wl(e, n, a, l, u, i) {
|
|
1560
|
+
return m(), v("form", {
|
|
1406
1561
|
ref: "formEl",
|
|
1407
1562
|
action: e.url || void 0,
|
|
1408
1563
|
method: e.method,
|
|
@@ -1410,46 +1565,46 @@ function ol(e, n, a, l, c, i) {
|
|
|
1410
1565
|
novalidate: !e.validate || e.form.hasErrors ? !0 : void 0,
|
|
1411
1566
|
class: q({ "form-processing": e.form.processing }),
|
|
1412
1567
|
onInput: n[0] || (n[0] = (...t) => e.handleInput && e.handleInput(...t)),
|
|
1413
|
-
onSubmit: n[1] || (n[1] =
|
|
1414
|
-
onReset: n[2] || (n[2] =
|
|
1568
|
+
onSubmit: n[1] || (n[1] = tn((...t) => e.submit && e.submit(...t), ["prevent"])),
|
|
1569
|
+
onReset: n[2] || (n[2] = tn((...t) => e.reset && e.reset(...t), ["prevent"]))
|
|
1415
1570
|
}, [
|
|
1416
|
-
e.hideAlerts ? M("", !0) : (m(),
|
|
1417
|
-
|
|
1571
|
+
e.hideAlerts ? M("", !0) : (m(), v(W, { key: 0 }, [
|
|
1572
|
+
L(e.$slots, "errors", {
|
|
1418
1573
|
errors: e.form.errors,
|
|
1419
1574
|
form: e.form
|
|
1420
1575
|
}, () => [
|
|
1421
|
-
e.form.hasErrors ? (m(),
|
|
1422
|
-
|
|
1423
|
-
(m(!0),
|
|
1424
|
-
e.htmlMessages ? (m(),
|
|
1576
|
+
e.form.hasErrors ? (m(), v("div", hl, [
|
|
1577
|
+
h("ul", vl, [
|
|
1578
|
+
(m(!0), v(W, null, ae(e.form.errors, (t, d) => (m(), v("li", { key: d }, [
|
|
1579
|
+
e.htmlMessages ? (m(), v("span", {
|
|
1425
1580
|
key: 0,
|
|
1426
1581
|
innerHTML: t
|
|
1427
|
-
}, null, 8,
|
|
1428
|
-
|
|
1582
|
+
}, null, 8, gl)) : (m(), v(W, { key: 1 }, [
|
|
1583
|
+
x(V(t), 1)
|
|
1429
1584
|
], 64))
|
|
1430
1585
|
]))), 128))
|
|
1431
1586
|
])
|
|
1432
1587
|
])) : M("", !0)
|
|
1433
1588
|
]),
|
|
1434
|
-
|
|
1589
|
+
L(e.$slots, "message", {
|
|
1435
1590
|
message: e.ui.successMessage
|
|
1436
1591
|
}, () => [
|
|
1437
|
-
e.ui.hasMessage && e.ui.successMessage ? (m(),
|
|
1438
|
-
e.htmlMessages ? (m(),
|
|
1592
|
+
e.ui.hasMessage && e.ui.successMessage ? (m(), v("div", yl, [
|
|
1593
|
+
e.htmlMessages ? (m(), v("span", {
|
|
1439
1594
|
key: 0,
|
|
1440
1595
|
innerHTML: e.ui.successMessage
|
|
1441
|
-
}, null, 8,
|
|
1596
|
+
}, null, 8, bl)) : (m(), v("span", $l, V(e.ui.successMessage), 1))
|
|
1442
1597
|
])) : M("", !0)
|
|
1443
1598
|
])
|
|
1444
1599
|
], 64)),
|
|
1445
|
-
|
|
1600
|
+
L(e.$slots, "default", {
|
|
1446
1601
|
form: e.form,
|
|
1447
1602
|
submit: e.submit,
|
|
1448
1603
|
reset: e.reset
|
|
1449
1604
|
})
|
|
1450
|
-
], 42,
|
|
1605
|
+
], 42, ml);
|
|
1451
1606
|
}
|
|
1452
|
-
const
|
|
1607
|
+
const Sl = /* @__PURE__ */ R(pl, [["render", wl]]), kl = F({
|
|
1453
1608
|
name: "FormLabel",
|
|
1454
1609
|
props: {
|
|
1455
1610
|
/** id of the control. Detected automatically inside <FormField> or from the next element. */
|
|
@@ -1457,36 +1612,36 @@ const rl = /* @__PURE__ */ L(Yt, [["render", ol]]), sl = F({
|
|
|
1457
1612
|
required: { type: Boolean, default: !1 }
|
|
1458
1613
|
},
|
|
1459
1614
|
setup(e) {
|
|
1460
|
-
const n =
|
|
1615
|
+
const n = me("formField", null), a = E(null), l = E(null);
|
|
1461
1616
|
J(() => {
|
|
1462
|
-
var t,
|
|
1617
|
+
var t, d;
|
|
1463
1618
|
if (e.for || n != null && n.id) return;
|
|
1464
1619
|
const i = (t = a.value) == null ? void 0 : t.nextElementSibling;
|
|
1465
|
-
i && (l.value = i.id || ((
|
|
1620
|
+
i && (l.value = i.id || ((d = i.querySelector("[id]")) == null ? void 0 : d.id) || null);
|
|
1466
1621
|
});
|
|
1467
|
-
const
|
|
1468
|
-
return { el: a, target:
|
|
1622
|
+
const u = S(() => e.for || (n == null ? void 0 : n.id) || l.value || void 0);
|
|
1623
|
+
return { el: a, target: u };
|
|
1469
1624
|
}
|
|
1470
|
-
}),
|
|
1625
|
+
}), Il = ["for"], Cl = {
|
|
1471
1626
|
key: 0,
|
|
1472
1627
|
class: "fg-danger",
|
|
1473
1628
|
"aria-hidden": "true"
|
|
1474
1629
|
};
|
|
1475
|
-
function
|
|
1476
|
-
return m(),
|
|
1630
|
+
function Tl(e, n, a, l, u, i) {
|
|
1631
|
+
return m(), v("label", {
|
|
1477
1632
|
ref: "el",
|
|
1478
1633
|
class: "form-label",
|
|
1479
1634
|
for: e.target
|
|
1480
1635
|
}, [
|
|
1481
|
-
|
|
1482
|
-
e.required ? (m(),
|
|
1483
|
-
], 8,
|
|
1636
|
+
L(e.$slots, "default"),
|
|
1637
|
+
e.required ? (m(), v("span", Cl, " *")) : M("", !0)
|
|
1638
|
+
], 8, Il);
|
|
1484
1639
|
}
|
|
1485
|
-
const
|
|
1486
|
-
let
|
|
1487
|
-
const
|
|
1640
|
+
const gn = /* @__PURE__ */ R(kl, [["render", Tl]]);
|
|
1641
|
+
let Ml = 0;
|
|
1642
|
+
const Bl = F({
|
|
1488
1643
|
name: "FormField",
|
|
1489
|
-
components: { FormLabel:
|
|
1644
|
+
components: { FormLabel: gn },
|
|
1490
1645
|
props: {
|
|
1491
1646
|
/** Field key. Used to read the server-side error of the field. */
|
|
1492
1647
|
name: { type: String, default: null },
|
|
@@ -1498,8 +1653,8 @@ const fl = F({
|
|
|
1498
1653
|
id: { type: String, default: null }
|
|
1499
1654
|
},
|
|
1500
1655
|
setup(e) {
|
|
1501
|
-
const n =
|
|
1502
|
-
|
|
1656
|
+
const n = me("form", null), a = nn.useId ? nn.useId() : `ff-${++Ml}`, l = S(() => e.id || (e.name ? `${e.name}-${a}` : a));
|
|
1657
|
+
De("formField", {
|
|
1503
1658
|
get id() {
|
|
1504
1659
|
return l.value;
|
|
1505
1660
|
},
|
|
@@ -1507,47 +1662,47 @@ const fl = F({
|
|
|
1507
1662
|
return e.name;
|
|
1508
1663
|
}
|
|
1509
1664
|
});
|
|
1510
|
-
const
|
|
1665
|
+
const u = S(() => {
|
|
1511
1666
|
var i, t;
|
|
1512
1667
|
return e.error ?? (e.name ? (t = (i = n == null ? void 0 : n.value) == null ? void 0 : i.errors) == null ? void 0 : t[e.name] : null) ?? null;
|
|
1513
1668
|
});
|
|
1514
|
-
return { fieldId: l, errorText:
|
|
1669
|
+
return { fieldId: l, errorText: u };
|
|
1515
1670
|
}
|
|
1516
|
-
}),
|
|
1517
|
-
function
|
|
1671
|
+
}), El = { class: "form-field" }, Al = ["id"], Ol = ["id"];
|
|
1672
|
+
function Vl(e, n, a, l, u, i) {
|
|
1518
1673
|
const t = oe("FormLabel");
|
|
1519
|
-
return m(),
|
|
1520
|
-
|
|
1674
|
+
return m(), v("div", El, [
|
|
1675
|
+
L(e.$slots, "label", {}, () => [
|
|
1521
1676
|
e.label ? (m(), le(t, {
|
|
1522
1677
|
key: 0,
|
|
1523
1678
|
for: e.fieldId,
|
|
1524
1679
|
required: e.required
|
|
1525
1680
|
}, {
|
|
1526
|
-
default:
|
|
1527
|
-
|
|
1681
|
+
default: xe(() => [
|
|
1682
|
+
x(V(e.label), 1)
|
|
1528
1683
|
]),
|
|
1529
1684
|
_: 1
|
|
1530
1685
|
}, 8, ["for", "required"])) : M("", !0)
|
|
1531
1686
|
]),
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
e.help ? (m(),
|
|
1687
|
+
L(e.$slots, "default"),
|
|
1688
|
+
L(e.$slots, "help", {}, () => [
|
|
1689
|
+
e.help ? (m(), v("div", {
|
|
1535
1690
|
key: 0,
|
|
1536
1691
|
id: e.fieldId + "-help",
|
|
1537
1692
|
class: "form-text"
|
|
1538
|
-
}, V(e.help), 9,
|
|
1693
|
+
}, V(e.help), 9, Al)) : M("", !0)
|
|
1539
1694
|
]),
|
|
1540
|
-
|
|
1541
|
-
e.errorText ? (m(),
|
|
1695
|
+
L(e.$slots, "error", { error: e.errorText }, () => [
|
|
1696
|
+
e.errorText ? (m(), v("div", {
|
|
1542
1697
|
key: 0,
|
|
1543
1698
|
id: e.fieldId + "-error",
|
|
1544
1699
|
class: "invalid-feedback d-block",
|
|
1545
1700
|
role: "alert"
|
|
1546
|
-
}, V(e.errorText), 9,
|
|
1701
|
+
}, V(e.errorText), 9, Ol)) : M("", !0)
|
|
1547
1702
|
])
|
|
1548
1703
|
]);
|
|
1549
1704
|
}
|
|
1550
|
-
const
|
|
1705
|
+
const Dl = /* @__PURE__ */ R(Bl, [["render", Vl]]), Nl = F({
|
|
1551
1706
|
name: "GroupControl",
|
|
1552
1707
|
props: {
|
|
1553
1708
|
/** Key of the object / array inside the form that holds the grouped values. */
|
|
@@ -1556,13 +1711,13 @@ const gl = /* @__PURE__ */ L(fl, [["render", vl]]), yl = F({
|
|
|
1556
1711
|
index: { type: [Number, String], default: null }
|
|
1557
1712
|
},
|
|
1558
1713
|
setup(e) {
|
|
1559
|
-
const n =
|
|
1714
|
+
const n = me("form", null), a = E(null), l = E("0"), u = S(() => e.index !== null ? String(e.index) : l.value);
|
|
1560
1715
|
J(() => {
|
|
1561
|
-
var
|
|
1716
|
+
var d, y, w;
|
|
1562
1717
|
if (e.index !== null) return;
|
|
1563
|
-
const t = (
|
|
1564
|
-
t == null || t.forEach((
|
|
1565
|
-
|
|
1718
|
+
const t = (w = (y = (d = a.value) == null ? void 0 : d.parentNode) == null ? void 0 : y.parentNode) == null ? void 0 : w.querySelectorAll(".form-control-group");
|
|
1719
|
+
t == null || t.forEach((g, p) => {
|
|
1720
|
+
g === a.value && (l.value = String(p));
|
|
1566
1721
|
});
|
|
1567
1722
|
});
|
|
1568
1723
|
const i = {
|
|
@@ -1570,39 +1725,39 @@ const gl = /* @__PURE__ */ L(fl, [["render", vl]]), yl = F({
|
|
|
1570
1725
|
return e.name;
|
|
1571
1726
|
},
|
|
1572
1727
|
get index() {
|
|
1573
|
-
return
|
|
1728
|
+
return u.value;
|
|
1574
1729
|
},
|
|
1575
1730
|
getData(t) {
|
|
1576
|
-
var
|
|
1577
|
-
const
|
|
1578
|
-
return
|
|
1731
|
+
var y, w;
|
|
1732
|
+
const d = (y = n == null ? void 0 : n.value) == null ? void 0 : y[e.name];
|
|
1733
|
+
return d == null ? null : Array.isArray(d) ? ((w = d[Number(u.value)]) == null ? void 0 : w[t]) ?? null : d[t] ?? null;
|
|
1579
1734
|
},
|
|
1580
|
-
setData(t,
|
|
1581
|
-
const
|
|
1582
|
-
if (
|
|
1583
|
-
if ((
|
|
1584
|
-
const
|
|
1585
|
-
|
|
1735
|
+
setData(t, d) {
|
|
1736
|
+
const y = n == null ? void 0 : n.value;
|
|
1737
|
+
if (y)
|
|
1738
|
+
if ((y[e.name] === null || y[e.name] === void 0) && (y[e.name] = e.index !== null ? [] : {}), Array.isArray(y[e.name])) {
|
|
1739
|
+
const w = Number(u.value);
|
|
1740
|
+
y[e.name][w] || (y[e.name][w] = {}), y[e.name][w][t] = d;
|
|
1586
1741
|
} else
|
|
1587
|
-
|
|
1742
|
+
y[e.name][t] = d;
|
|
1588
1743
|
}
|
|
1589
1744
|
};
|
|
1590
|
-
return
|
|
1745
|
+
return De("group", S(() => i)), { groupEl: a, index: u };
|
|
1591
1746
|
}
|
|
1592
|
-
}),
|
|
1593
|
-
function
|
|
1594
|
-
return m(),
|
|
1747
|
+
}), ql = ["data-name", "data-group-id"];
|
|
1748
|
+
function Fl(e, n, a, l, u, i) {
|
|
1749
|
+
return m(), v("div", {
|
|
1595
1750
|
ref: "groupEl",
|
|
1596
1751
|
class: "form-control-group",
|
|
1597
1752
|
"data-name": e.name,
|
|
1598
1753
|
"data-group-id": e.index
|
|
1599
1754
|
}, [
|
|
1600
|
-
|
|
1601
|
-
], 8,
|
|
1755
|
+
L(e.$slots, "default")
|
|
1756
|
+
], 8, ql);
|
|
1602
1757
|
}
|
|
1603
|
-
const
|
|
1758
|
+
const yn = /* @__PURE__ */ R(Nl, [["render", Fl]]), Rl = F({
|
|
1604
1759
|
name: "MobileInput",
|
|
1605
|
-
components: { TextInput:
|
|
1760
|
+
components: { TextInput: ze },
|
|
1606
1761
|
props: {
|
|
1607
1762
|
name: { type: String, default: "mobile" },
|
|
1608
1763
|
placeholder: { type: String, default: null },
|
|
@@ -1613,7 +1768,7 @@ const pn = /* @__PURE__ */ L(yl, [["render", $l]]), wl = F({
|
|
|
1613
1768
|
return { t: n };
|
|
1614
1769
|
}
|
|
1615
1770
|
});
|
|
1616
|
-
function
|
|
1771
|
+
function Ll(e, n, a, l, u, i) {
|
|
1617
1772
|
const t = oe("TextInput");
|
|
1618
1773
|
return m(), le(t, {
|
|
1619
1774
|
type: "tel",
|
|
@@ -1624,7 +1779,7 @@ function kl(e, n, a, l, c, i) {
|
|
|
1624
1779
|
placeholder: e.placeholder ?? e.t("mobile.placeholder")
|
|
1625
1780
|
}, null, 8, ["name", "placeholder"]);
|
|
1626
1781
|
}
|
|
1627
|
-
const
|
|
1782
|
+
const jl = /* @__PURE__ */ R(Rl, [["render", Ll]]), zl = F({
|
|
1628
1783
|
name: "QuantityInput",
|
|
1629
1784
|
emits: ["update:modelValue", "change", "input", "increment", "decrement", "focus", "blur"],
|
|
1630
1785
|
props: {
|
|
@@ -1637,51 +1792,51 @@ const Sl = /* @__PURE__ */ L(wl, [["render", kl]]), Il = F({
|
|
|
1637
1792
|
locale: { type: String, default: null }
|
|
1638
1793
|
},
|
|
1639
1794
|
setup(e, { emit: n }) {
|
|
1640
|
-
const a =
|
|
1641
|
-
const
|
|
1642
|
-
return Number.isFinite(
|
|
1643
|
-
}), i =
|
|
1644
|
-
function
|
|
1645
|
-
let r =
|
|
1646
|
-
e.max !== null && (r = Math.min(r, e.max)), r = Math.max(r, e.min), a.model.value = r, o && n(o, r), a.emitChange(r,
|
|
1647
|
-
}
|
|
1648
|
-
function
|
|
1649
|
-
const
|
|
1650
|
-
a.model.value =
|
|
1795
|
+
const a = P(e, n), { t: l } = Q(() => e.locale), u = S(() => {
|
|
1796
|
+
const $ = Number(a.model.value);
|
|
1797
|
+
return Number.isFinite($) ? $ : e.min;
|
|
1798
|
+
}), i = S(() => e.unit ?? l("quantity.unit")), t = S(() => Fe(u.value)), d = S(() => e.readonly || a.isDisabled.value), y = S(() => !d.value && (e.max === null || u.value + e.step <= e.max)), w = S(() => !d.value && u.value - e.step >= e.min);
|
|
1799
|
+
function g($, k, o) {
|
|
1800
|
+
let r = $;
|
|
1801
|
+
e.max !== null && (r = Math.min(r, e.max)), r = Math.max(r, e.min), a.model.value = r, o && n(o, r), a.emitChange(r, k);
|
|
1802
|
+
}
|
|
1803
|
+
function p($) {
|
|
1804
|
+
const k = mn($.target.value);
|
|
1805
|
+
a.model.value = k === null ? e.min : k, $.target.value = Fe(a.model.value), n("input", a.model.value, $);
|
|
1651
1806
|
}
|
|
1652
1807
|
return J(() => {
|
|
1653
|
-
const
|
|
1654
|
-
(
|
|
1808
|
+
const $ = a.model.value;
|
|
1809
|
+
($ == null || $ === "") && (a.model.value = e.min);
|
|
1655
1810
|
}), {
|
|
1656
1811
|
...a,
|
|
1657
1812
|
t: l,
|
|
1658
1813
|
unitText: i,
|
|
1659
1814
|
display: t,
|
|
1660
|
-
canIncrement:
|
|
1661
|
-
canDecrement:
|
|
1662
|
-
lock:
|
|
1663
|
-
increment: (
|
|
1664
|
-
decrement: (
|
|
1665
|
-
onInput:
|
|
1666
|
-
clampOnBlur: (
|
|
1815
|
+
canIncrement: y,
|
|
1816
|
+
canDecrement: w,
|
|
1817
|
+
lock: d,
|
|
1818
|
+
increment: ($) => y.value && g(u.value + e.step, $, "increment"),
|
|
1819
|
+
decrement: ($) => w.value && g(u.value - e.step, $, "decrement"),
|
|
1820
|
+
onInput: p,
|
|
1821
|
+
clampOnBlur: ($) => g(u.value, $)
|
|
1667
1822
|
};
|
|
1668
1823
|
}
|
|
1669
|
-
}),
|
|
1824
|
+
}), Pl = ["disabled", "aria-label"], Kl = ["name", "id", "value", "readonly", "disabled", "aria-invalid"], Ul = ["disabled", "aria-label"], Hl = {
|
|
1670
1825
|
key: 0,
|
|
1671
1826
|
class: "input-group-text fanum"
|
|
1672
1827
|
};
|
|
1673
|
-
function
|
|
1674
|
-
return m(),
|
|
1828
|
+
function Xl(e, n, a, l, u, i) {
|
|
1829
|
+
return m(), v("div", {
|
|
1675
1830
|
class: q(["input-group input-group-quantity", { "is-invalid": e.isInvalid }])
|
|
1676
1831
|
}, [
|
|
1677
|
-
|
|
1832
|
+
h("button", {
|
|
1678
1833
|
type: "button",
|
|
1679
1834
|
class: "btn-outline theme-secondary btn-icon",
|
|
1680
1835
|
disabled: !e.canIncrement,
|
|
1681
1836
|
"aria-label": e.t("quantity.increase"),
|
|
1682
1837
|
onClick: n[0] || (n[0] = (...t) => e.increment && e.increment(...t))
|
|
1683
1838
|
}, n[6] || (n[6] = [
|
|
1684
|
-
|
|
1839
|
+
h("svg", {
|
|
1685
1840
|
width: "14",
|
|
1686
1841
|
height: "14",
|
|
1687
1842
|
viewBox: "0 0 16 16",
|
|
@@ -1691,10 +1846,10 @@ function El(e, n, a, l, c, i) {
|
|
|
1691
1846
|
"stroke-linecap": "round",
|
|
1692
1847
|
"aria-hidden": "true"
|
|
1693
1848
|
}, [
|
|
1694
|
-
|
|
1849
|
+
h("path", { d: "M8 3v10M3 8h10" })
|
|
1695
1850
|
], -1)
|
|
1696
|
-
]), 8,
|
|
1697
|
-
|
|
1851
|
+
]), 8, Pl),
|
|
1852
|
+
h("input", {
|
|
1698
1853
|
name: e.name,
|
|
1699
1854
|
id: e.inputId,
|
|
1700
1855
|
value: e.display,
|
|
@@ -1709,15 +1864,15 @@ function El(e, n, a, l, c, i) {
|
|
|
1709
1864
|
onChange: n[2] || (n[2] = (...t) => e.clampOnBlur && e.clampOnBlur(...t)),
|
|
1710
1865
|
onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
|
|
1711
1866
|
onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
|
|
1712
|
-
}, null, 42,
|
|
1713
|
-
|
|
1867
|
+
}, null, 42, Kl),
|
|
1868
|
+
h("button", {
|
|
1714
1869
|
type: "button",
|
|
1715
1870
|
class: "btn-outline theme-secondary btn-icon",
|
|
1716
1871
|
disabled: !e.canDecrement,
|
|
1717
1872
|
"aria-label": e.t("quantity.decrease"),
|
|
1718
1873
|
onClick: n[5] || (n[5] = (...t) => e.decrement && e.decrement(...t))
|
|
1719
1874
|
}, n[7] || (n[7] = [
|
|
1720
|
-
|
|
1875
|
+
h("svg", {
|
|
1721
1876
|
width: "14",
|
|
1722
1877
|
height: "14",
|
|
1723
1878
|
viewBox: "0 0 16 16",
|
|
@@ -1727,16 +1882,16 @@ function El(e, n, a, l, c, i) {
|
|
|
1727
1882
|
"stroke-linecap": "round",
|
|
1728
1883
|
"aria-hidden": "true"
|
|
1729
1884
|
}, [
|
|
1730
|
-
|
|
1885
|
+
h("path", { d: "M3 8h10" })
|
|
1731
1886
|
], -1)
|
|
1732
|
-
]), 8,
|
|
1733
|
-
e.unitText ? (m(),
|
|
1734
|
-
|
|
1887
|
+
]), 8, Ul),
|
|
1888
|
+
e.unitText ? (m(), v("span", Hl, V(e.unitText), 1)) : M("", !0),
|
|
1889
|
+
L(e.$slots, "suffix")
|
|
1735
1890
|
], 2);
|
|
1736
1891
|
}
|
|
1737
|
-
const
|
|
1892
|
+
const bn = /* @__PURE__ */ R(zl, [["render", Xl]]), Gl = F({
|
|
1738
1893
|
name: "MultiQuantityInput",
|
|
1739
|
-
components: { GroupControl:
|
|
1894
|
+
components: { GroupControl: yn, QuantityInput: bn },
|
|
1740
1895
|
emits: ["update:modelValue", "change", "show", "shown", "hide", "hidden"],
|
|
1741
1896
|
props: {
|
|
1742
1897
|
...z,
|
|
@@ -1751,47 +1906,47 @@ const hn = /* @__PURE__ */ L(Il, [["render", El]]), Al = F({
|
|
|
1751
1906
|
locale: { type: String, default: null }
|
|
1752
1907
|
},
|
|
1753
1908
|
setup(e, { emit: n }) {
|
|
1754
|
-
const a =
|
|
1755
|
-
const
|
|
1756
|
-
return
|
|
1757
|
-
}), t =
|
|
1758
|
-
() => e.options.reduce((
|
|
1759
|
-
),
|
|
1760
|
-
() => e.options.map((
|
|
1761
|
-
const
|
|
1909
|
+
const a = P(e, n), { t: l } = Q(() => e.locale), u = E(null), i = S(() => {
|
|
1910
|
+
const w = a.model.value;
|
|
1911
|
+
return w && typeof w == "object" ? w : {};
|
|
1912
|
+
}), t = S(
|
|
1913
|
+
() => e.options.reduce((w, g, p) => w + (Number(i.value[p]) || 0), 0)
|
|
1914
|
+
), d = S(() => e.unit ?? l("quantity.unit")), y = S(
|
|
1915
|
+
() => e.options.map((w, g) => {
|
|
1916
|
+
const p = typeof w == "object" && w !== null ? w : { name: w }, $ = Number(i.value[g]) || 0, k = p.max ?? e.max, o = e.totalMax === null ? 1 / 0 : $ + (e.totalMax - t.value);
|
|
1762
1917
|
return {
|
|
1763
|
-
key:
|
|
1764
|
-
name:
|
|
1765
|
-
description:
|
|
1766
|
-
html: !!
|
|
1767
|
-
min:
|
|
1768
|
-
max: Math.min(
|
|
1918
|
+
key: g,
|
|
1919
|
+
name: p.name ?? p.label ?? String(w),
|
|
1920
|
+
description: p.description ?? null,
|
|
1921
|
+
html: !!p.html,
|
|
1922
|
+
min: p.min ?? e.min,
|
|
1923
|
+
max: Math.min(k ?? 1 / 0, o) === 1 / 0 ? null : Math.min(k ?? 1 / 0, o)
|
|
1769
1924
|
};
|
|
1770
1925
|
})
|
|
1771
1926
|
);
|
|
1772
1927
|
return J(() => {
|
|
1773
|
-
(!a.model.value || typeof a.model.value != "object") && (a.model.value = e.options.reduce((
|
|
1928
|
+
(!a.model.value || typeof a.model.value != "object") && (a.model.value = e.options.reduce((w, g, p) => (w[p] = typeof g == "object" && (g == null ? void 0 : g.min) || e.min, w), {}));
|
|
1774
1929
|
}), he(
|
|
1775
1930
|
"Menu",
|
|
1776
|
-
() =>
|
|
1931
|
+
() => u.value,
|
|
1777
1932
|
() => ({ autoClose: "outside", placement: e.placement }),
|
|
1778
1933
|
{
|
|
1779
|
-
onCreate(
|
|
1934
|
+
onCreate(w, g) {
|
|
1780
1935
|
["show", "shown", "hide", "hidden"].forEach(
|
|
1781
|
-
(
|
|
1936
|
+
(p) => g.addEventListener(`${p}.bs.menu`, ($) => n(p, $))
|
|
1782
1937
|
);
|
|
1783
1938
|
}
|
|
1784
1939
|
}
|
|
1785
|
-
), { ...a, t: l, toggle:
|
|
1940
|
+
), { ...a, t: l, toggle: u, total: t, unitText: d, normalized: y };
|
|
1786
1941
|
}
|
|
1787
|
-
}),
|
|
1942
|
+
}), Wl = { class: "multi-quantity-input fanum" }, Ql = ["disabled"], Jl = { class: "combobox-value" }, Zl = { class: "menu p-3" }, Yl = ["innerHTML"], xl = { key: 1 }, _l = {
|
|
1788
1943
|
key: 2,
|
|
1789
1944
|
class: "form-text mt-0"
|
|
1790
1945
|
};
|
|
1791
|
-
function
|
|
1792
|
-
const t = oe("QuantityInput"),
|
|
1793
|
-
return m(),
|
|
1794
|
-
|
|
1946
|
+
function ea(e, n, a, l, u, i) {
|
|
1947
|
+
const t = oe("QuantityInput"), d = oe("GroupControl");
|
|
1948
|
+
return m(), v("div", Wl, [
|
|
1949
|
+
h("button", {
|
|
1795
1950
|
ref: "toggle",
|
|
1796
1951
|
type: "button",
|
|
1797
1952
|
class: q(["form-control combobox-toggle", { "is-invalid": e.isInvalid }]),
|
|
@@ -1799,26 +1954,26 @@ function Rl(e, n, a, l, c, i) {
|
|
|
1799
1954
|
"aria-haspopup": "true",
|
|
1800
1955
|
disabled: e.isDisabled || e.readonly
|
|
1801
1956
|
}, [
|
|
1802
|
-
|
|
1803
|
-
], 10,
|
|
1804
|
-
|
|
1805
|
-
Ne(
|
|
1806
|
-
default:
|
|
1807
|
-
(m(!0),
|
|
1808
|
-
key:
|
|
1957
|
+
h("span", Jl, V(e.total) + " " + V(e.unitText), 1)
|
|
1958
|
+
], 10, Ql),
|
|
1959
|
+
h("div", Zl, [
|
|
1960
|
+
Ne(d, { name: e.name }, {
|
|
1961
|
+
default: xe(() => [
|
|
1962
|
+
(m(!0), v(W, null, ae(e.normalized, (y) => (m(), v("div", {
|
|
1963
|
+
key: y.key,
|
|
1809
1964
|
class: "d-flex align-items-center justify-content-between gap-3 py-1"
|
|
1810
1965
|
}, [
|
|
1811
|
-
|
|
1812
|
-
|
|
1966
|
+
h("div", null, [
|
|
1967
|
+
y.html ? (m(), v("span", {
|
|
1813
1968
|
key: 0,
|
|
1814
|
-
innerHTML:
|
|
1815
|
-
}, null, 8,
|
|
1816
|
-
|
|
1969
|
+
innerHTML: y.name
|
|
1970
|
+
}, null, 8, Yl)) : (m(), v("span", xl, V(y.name), 1)),
|
|
1971
|
+
y.description ? (m(), v("div", _l, V(y.description), 1)) : M("", !0)
|
|
1817
1972
|
]),
|
|
1818
1973
|
Ne(t, {
|
|
1819
|
-
name: String(
|
|
1820
|
-
min:
|
|
1821
|
-
max:
|
|
1974
|
+
name: String(y.key),
|
|
1975
|
+
min: y.min,
|
|
1976
|
+
max: y.max,
|
|
1822
1977
|
readonly: e.readonly,
|
|
1823
1978
|
unit: ""
|
|
1824
1979
|
}, null, 8, ["name", "min", "max", "readonly"])
|
|
@@ -1829,7 +1984,7 @@ function Rl(e, n, a, l, c, i) {
|
|
|
1829
1984
|
])
|
|
1830
1985
|
]);
|
|
1831
1986
|
}
|
|
1832
|
-
const
|
|
1987
|
+
const na = /* @__PURE__ */ R(Gl, [["render", ea]]), ta = F({
|
|
1833
1988
|
name: "OTPInput",
|
|
1834
1989
|
emits: ["update:modelValue", "change", "input", "complete", "focus", "blur"],
|
|
1835
1990
|
props: {
|
|
@@ -1850,17 +2005,17 @@ const jl = /* @__PURE__ */ L(Al, [["render", Rl]]), Pl = F({
|
|
|
1850
2005
|
autofocus: { type: Boolean, default: !1 }
|
|
1851
2006
|
},
|
|
1852
2007
|
setup(e, { emit: n, expose: a }) {
|
|
1853
|
-
const l =
|
|
1854
|
-
let t = !1,
|
|
1855
|
-
const
|
|
1856
|
-
function
|
|
2008
|
+
const l = P(e, n), u = E(null), i = E(null);
|
|
2009
|
+
let t = !1, d = [];
|
|
2010
|
+
const y = () => e.length ?? e.maxLength ?? 6, w = (o) => o == null ? "" : String(o);
|
|
2011
|
+
function g() {
|
|
1857
2012
|
var o;
|
|
1858
2013
|
(o = i.value) == null || o.classList.toggle("is-invalid", l.isInvalid.value);
|
|
1859
2014
|
}
|
|
1860
|
-
function
|
|
1861
|
-
const o =
|
|
2015
|
+
function p() {
|
|
2016
|
+
const o = $.value;
|
|
1862
2017
|
if (!o) return;
|
|
1863
|
-
const r =
|
|
2018
|
+
const r = w(l.model.value);
|
|
1864
2019
|
if (o.getValue() !== r) {
|
|
1865
2020
|
t = !0;
|
|
1866
2021
|
try {
|
|
@@ -1870,11 +2025,11 @@ const jl = /* @__PURE__ */ L(Al, [["render", Rl]]), Pl = F({
|
|
|
1870
2025
|
}
|
|
1871
2026
|
}
|
|
1872
2027
|
}
|
|
1873
|
-
const { instance:
|
|
2028
|
+
const { instance: $, create: k } = he(
|
|
1874
2029
|
"OtpInput",
|
|
1875
|
-
() =>
|
|
2030
|
+
() => u.value,
|
|
1876
2031
|
() => ({
|
|
1877
|
-
length:
|
|
2032
|
+
length: y(),
|
|
1878
2033
|
type: e.type,
|
|
1879
2034
|
mask: e.mask,
|
|
1880
2035
|
groups: e.groups,
|
|
@@ -1882,47 +2037,47 @@ const jl = /* @__PURE__ */ L(Al, [["render", Rl]]), Pl = F({
|
|
|
1882
2037
|
}),
|
|
1883
2038
|
{
|
|
1884
2039
|
onCreate(o, r) {
|
|
1885
|
-
const s = (
|
|
1886
|
-
r.addEventListener(
|
|
2040
|
+
const s = (c, C) => {
|
|
2041
|
+
r.addEventListener(c, C), d.push(() => r.removeEventListener(c, C));
|
|
1887
2042
|
};
|
|
1888
|
-
s("input.bs.otpInput", (
|
|
1889
|
-
t || (l.model.value =
|
|
1890
|
-
}), s("complete.bs.otpInput", (
|
|
1891
|
-
var
|
|
1892
|
-
t || (n("complete",
|
|
1893
|
-
}),
|
|
2043
|
+
s("input.bs.otpInput", (c) => {
|
|
2044
|
+
t || (l.model.value = c.value, n("input", c.value, c), l.emitChange(c.value, c));
|
|
2045
|
+
}), s("complete.bs.otpInput", (c) => {
|
|
2046
|
+
var C, j;
|
|
2047
|
+
t || (n("complete", c.value), e.autoSubmit && ((j = (C = l.formApi) == null ? void 0 : C.submit) == null || j.call(C)));
|
|
2048
|
+
}), p(), g(), e.autofocus && o.focus();
|
|
1894
2049
|
},
|
|
1895
2050
|
onDestroy() {
|
|
1896
|
-
|
|
2051
|
+
d.forEach((o) => o()), d = [];
|
|
1897
2052
|
}
|
|
1898
2053
|
}
|
|
1899
2054
|
);
|
|
1900
2055
|
return J(() => {
|
|
1901
|
-
i.value && (i.value.value =
|
|
1902
|
-
}),
|
|
1903
|
-
() => [
|
|
2056
|
+
i.value && (i.value.value = w(l.model.value));
|
|
2057
|
+
}), U(() => l.model.value, p), U(l.isInvalid, g, { flush: "post" }), U(
|
|
2058
|
+
() => [y(), e.type, e.mask, e.groups, e.separator],
|
|
1904
2059
|
async () => {
|
|
1905
|
-
await
|
|
2060
|
+
await X(), k();
|
|
1906
2061
|
},
|
|
1907
2062
|
{ deep: !0 }
|
|
1908
2063
|
), a({
|
|
1909
2064
|
focus: () => {
|
|
1910
2065
|
var o;
|
|
1911
|
-
return (o =
|
|
2066
|
+
return (o = $.value) == null ? void 0 : o.focus();
|
|
1912
2067
|
},
|
|
1913
2068
|
clear: () => {
|
|
1914
2069
|
var o;
|
|
1915
|
-
(o =
|
|
2070
|
+
(o = $.value) == null || o.clear(), l.model.value = "";
|
|
1916
2071
|
}
|
|
1917
|
-
}), { ...l, el:
|
|
2072
|
+
}), { ...l, el: u, input: i };
|
|
1918
2073
|
}
|
|
1919
|
-
}),
|
|
2074
|
+
}), la = {
|
|
1920
2075
|
ref: "el",
|
|
1921
2076
|
class: "otp fanum"
|
|
1922
|
-
},
|
|
1923
|
-
function
|
|
1924
|
-
return m(),
|
|
1925
|
-
|
|
2077
|
+
}, aa = ["name", "id", "disabled", "readonly", "required", "aria-invalid"];
|
|
2078
|
+
function oa(e, n, a, l, u, i) {
|
|
2079
|
+
return m(), v("div", la, [
|
|
2080
|
+
h("input", {
|
|
1926
2081
|
ref: "input",
|
|
1927
2082
|
type: "text",
|
|
1928
2083
|
name: e.name,
|
|
@@ -1933,15 +2088,15 @@ function Hl(e, n, a, l, c, i) {
|
|
|
1933
2088
|
"aria-invalid": e.isInvalid || void 0,
|
|
1934
2089
|
onFocus: n[0] || (n[0] = (t) => e.$emit("focus", t)),
|
|
1935
2090
|
onBlur: n[1] || (n[1] = (t) => e.$emit("blur", t))
|
|
1936
|
-
}, null, 40,
|
|
2091
|
+
}, null, 40, aa)
|
|
1937
2092
|
], 512);
|
|
1938
2093
|
}
|
|
1939
|
-
const
|
|
2094
|
+
const ra = /* @__PURE__ */ R(ta, [["render", oa]]), un = {
|
|
1940
2095
|
en: { weak: "Weak", fair: "Fair", good: "Good", strong: "Strong" },
|
|
1941
2096
|
fa: { weak: "ضعیف", fair: "متوسط", good: "خوب", strong: "قوی" }
|
|
1942
|
-
},
|
|
2097
|
+
}, sa = F({
|
|
1943
2098
|
name: "PasswordInput",
|
|
1944
|
-
components: { TextInput:
|
|
2099
|
+
components: { TextInput: ze, FormAdornInput: _e },
|
|
1945
2100
|
inheritAttrs: !1,
|
|
1946
2101
|
emits: ["toggle", "strength"],
|
|
1947
2102
|
props: {
|
|
@@ -1962,53 +2117,53 @@ const Kl = /* @__PURE__ */ L(Pl, [["render", Hl]]), an = {
|
|
|
1962
2117
|
locale: { type: String, default: null }
|
|
1963
2118
|
},
|
|
1964
2119
|
setup(e, { emit: n, expose: a }) {
|
|
1965
|
-
const { t: l, locale:
|
|
1966
|
-
}), t = E(null),
|
|
1967
|
-
...
|
|
2120
|
+
const { t: l, locale: u } = Q(() => e.locale), i = P(e, () => {
|
|
2121
|
+
}), t = E(null), d = E(null), y = E(!1), w = S(() => ({
|
|
2122
|
+
...un[u.value] || un.en,
|
|
1968
2123
|
...e.strengthMessages || {}
|
|
1969
2124
|
}));
|
|
1970
|
-
function
|
|
1971
|
-
|
|
2125
|
+
function g() {
|
|
2126
|
+
y.value = !y.value, n("toggle", y.value);
|
|
1972
2127
|
}
|
|
1973
|
-
let
|
|
1974
|
-
const { instance:
|
|
2128
|
+
let p = [];
|
|
2129
|
+
const { instance: $, create: k } = he(
|
|
1975
2130
|
"Strength",
|
|
1976
|
-
() => e.strength ?
|
|
2131
|
+
() => e.strength ? d.value : null,
|
|
1977
2132
|
() => {
|
|
1978
2133
|
var r;
|
|
1979
2134
|
return {
|
|
1980
2135
|
...e.strengthOptions,
|
|
1981
2136
|
input: (r = t.value) == null ? void 0 : r.querySelector("input"),
|
|
1982
|
-
messages:
|
|
2137
|
+
messages: w.value
|
|
1983
2138
|
};
|
|
1984
2139
|
},
|
|
1985
2140
|
{
|
|
1986
2141
|
onCreate(r, s) {
|
|
1987
|
-
const
|
|
1988
|
-
s.addEventListener("strengthChange.bs.strength",
|
|
2142
|
+
const c = (C) => n("strength", C.strength ?? null, C.score ?? 0);
|
|
2143
|
+
s.addEventListener("strengthChange.bs.strength", c), p.push(() => s.removeEventListener("strengthChange.bs.strength", c));
|
|
1989
2144
|
},
|
|
1990
2145
|
onDestroy() {
|
|
1991
|
-
|
|
2146
|
+
p.forEach((r) => r()), p = [];
|
|
1992
2147
|
}
|
|
1993
2148
|
}
|
|
1994
2149
|
);
|
|
1995
|
-
|
|
2150
|
+
U(
|
|
1996
2151
|
() => i.model.value,
|
|
1997
|
-
() =>
|
|
2152
|
+
() => X(() => {
|
|
1998
2153
|
var r;
|
|
1999
|
-
return (r =
|
|
2154
|
+
return (r = $.value) == null ? void 0 : r.evaluate();
|
|
2000
2155
|
})
|
|
2001
|
-
),
|
|
2002
|
-
() => [e.strength, e.toggle, e.strengthText,
|
|
2156
|
+
), U(
|
|
2157
|
+
() => [e.strength, e.toggle, e.strengthText, w.value, e.strengthOptions],
|
|
2003
2158
|
async () => {
|
|
2004
|
-
await
|
|
2159
|
+
await X(), e.strength && k();
|
|
2005
2160
|
},
|
|
2006
2161
|
{ deep: !0 }
|
|
2007
2162
|
), a({ strength: () => {
|
|
2008
2163
|
var r, s;
|
|
2009
|
-
return ((s = (r =
|
|
2164
|
+
return ((s = (r = $.value) == null ? void 0 : r.getStrength) == null ? void 0 : s.call(r)) ?? null;
|
|
2010
2165
|
} });
|
|
2011
|
-
const o =
|
|
2166
|
+
const o = S(() => ({
|
|
2012
2167
|
name: e.name,
|
|
2013
2168
|
modelValue: e.modelValue,
|
|
2014
2169
|
id: e.id,
|
|
@@ -2019,12 +2174,12 @@ const Kl = /* @__PURE__ */ L(Pl, [["render", Hl]]), an = {
|
|
|
2019
2174
|
size: e.size,
|
|
2020
2175
|
placeholder: e.placeholder ?? l("password.placeholder")
|
|
2021
2176
|
}));
|
|
2022
|
-
return { t: l, root: t, meter:
|
|
2177
|
+
return { t: l, root: t, meter: d, visible: y, toggleVisible: g, forwarded: o };
|
|
2023
2178
|
}
|
|
2024
|
-
}),
|
|
2179
|
+
}), ia = {
|
|
2025
2180
|
ref: "root",
|
|
2026
2181
|
class: "password-input"
|
|
2027
|
-
},
|
|
2182
|
+
}, ua = ["aria-label", "aria-pressed"], da = {
|
|
2028
2183
|
key: 0,
|
|
2029
2184
|
width: "16",
|
|
2030
2185
|
height: "16",
|
|
@@ -2035,7 +2190,7 @@ const Kl = /* @__PURE__ */ L(Pl, [["render", Hl]]), an = {
|
|
|
2035
2190
|
"stroke-linecap": "round",
|
|
2036
2191
|
"stroke-linejoin": "round",
|
|
2037
2192
|
"aria-hidden": "true"
|
|
2038
|
-
},
|
|
2193
|
+
}, ca = {
|
|
2039
2194
|
key: 1,
|
|
2040
2195
|
width: "16",
|
|
2041
2196
|
height: "16",
|
|
@@ -2046,59 +2201,59 @@ const Kl = /* @__PURE__ */ L(Pl, [["render", Hl]]), an = {
|
|
|
2046
2201
|
"stroke-linecap": "round",
|
|
2047
2202
|
"stroke-linejoin": "round",
|
|
2048
2203
|
"aria-hidden": "true"
|
|
2049
|
-
},
|
|
2204
|
+
}, fa = {
|
|
2050
2205
|
ref: "meter",
|
|
2051
2206
|
class: "strength",
|
|
2052
2207
|
"aria-hidden": "true"
|
|
2053
|
-
},
|
|
2208
|
+
}, pa = {
|
|
2054
2209
|
key: 0,
|
|
2055
2210
|
class: "strength-text",
|
|
2056
2211
|
"aria-live": "polite"
|
|
2057
2212
|
};
|
|
2058
|
-
function
|
|
2059
|
-
const t = oe("FormAdornInput"),
|
|
2060
|
-
return m(),
|
|
2061
|
-
e.toggle ? (m(), le(t,
|
|
2213
|
+
function ma(e, n, a, l, u, i) {
|
|
2214
|
+
const t = oe("FormAdornInput"), d = oe("TextInput");
|
|
2215
|
+
return m(), v("div", ia, [
|
|
2216
|
+
e.toggle ? (m(), le(t, Qe({ key: 0 }, { ...e.$attrs, ...e.forwarded }, {
|
|
2062
2217
|
type: e.visible ? "text" : "password",
|
|
2063
2218
|
autocomplete: "current-password"
|
|
2064
2219
|
}), {
|
|
2065
|
-
end:
|
|
2066
|
-
|
|
2220
|
+
end: xe(() => [
|
|
2221
|
+
h("button", {
|
|
2067
2222
|
type: "button",
|
|
2068
2223
|
class: "btn-text theme-secondary btn-icon",
|
|
2069
2224
|
"aria-label": e.visible ? e.t("password.hide") : e.t("password.show"),
|
|
2070
2225
|
"aria-pressed": e.visible,
|
|
2071
|
-
onClick: n[0] || (n[0] = (...
|
|
2226
|
+
onClick: n[0] || (n[0] = (...y) => e.toggleVisible && e.toggleVisible(...y))
|
|
2072
2227
|
}, [
|
|
2073
|
-
e.visible ? (m(),
|
|
2074
|
-
|
|
2075
|
-
]))) : (m(),
|
|
2076
|
-
|
|
2077
|
-
|
|
2228
|
+
e.visible ? (m(), v("svg", ca, n[2] || (n[2] = [
|
|
2229
|
+
h("path", { d: "M2 2l12 12M6.6 3.7A7 7 0 0 1 8 3.5C12.5 3.5 15 8 15 8a11 11 0 0 1-2.2 2.6M4 5.4A11 11 0 0 0 1 8s2.5 4.5 7 4.5c1 0 1.9-.2 2.7-.6" }, null, -1)
|
|
2230
|
+
]))) : (m(), v("svg", da, n[1] || (n[1] = [
|
|
2231
|
+
h("path", { d: "M1 8s2.5-4.5 7-4.5S15 8 15 8s-2.5 4.5-7 4.5S1 8 1 8Z" }, null, -1),
|
|
2232
|
+
h("circle", {
|
|
2078
2233
|
cx: "8",
|
|
2079
2234
|
cy: "8",
|
|
2080
2235
|
r: "2"
|
|
2081
2236
|
}, null, -1)
|
|
2082
2237
|
])))
|
|
2083
|
-
], 8,
|
|
2238
|
+
], 8, ua)
|
|
2084
2239
|
]),
|
|
2085
2240
|
_: 1
|
|
2086
|
-
}, 16, ["type"])) : (m(), le(
|
|
2241
|
+
}, 16, ["type"])) : (m(), le(d, Qe({ key: 1 }, { ...e.$attrs, ...e.forwarded }, {
|
|
2087
2242
|
type: "password",
|
|
2088
2243
|
autocomplete: "current-password"
|
|
2089
2244
|
}), null, 16)),
|
|
2090
|
-
e.strength ? (m(),
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2245
|
+
e.strength ? (m(), v(W, { key: 2 }, [
|
|
2246
|
+
h("div", fa, n[3] || (n[3] = [
|
|
2247
|
+
h("div", { class: "strength-segment" }, null, -1),
|
|
2248
|
+
h("div", { class: "strength-segment" }, null, -1),
|
|
2249
|
+
h("div", { class: "strength-segment" }, null, -1),
|
|
2250
|
+
h("div", { class: "strength-segment" }, null, -1)
|
|
2096
2251
|
]), 512),
|
|
2097
|
-
e.strengthText ? (m(),
|
|
2252
|
+
e.strengthText ? (m(), v("div", pa)) : M("", !0)
|
|
2098
2253
|
], 64)) : M("", !0)
|
|
2099
2254
|
], 512);
|
|
2100
2255
|
}
|
|
2101
|
-
const
|
|
2256
|
+
const ha = /* @__PURE__ */ R(sa, [["render", ma]]), va = F({
|
|
2102
2257
|
name: "RangeInput",
|
|
2103
2258
|
emits: ["update:modelValue", "change", "input", "focus", "blur"],
|
|
2104
2259
|
props: {
|
|
@@ -2114,43 +2269,43 @@ const _l = /* @__PURE__ */ L(Xl, [["render", xl]]), ea = F({
|
|
|
2114
2269
|
ticks: { type: Array, default: () => [] }
|
|
2115
2270
|
},
|
|
2116
2271
|
setup(e, { emit: n }) {
|
|
2117
|
-
const a =
|
|
2118
|
-
const
|
|
2119
|
-
return a.model.value === null || a.model.value === void 0 || Number.isNaN(
|
|
2120
|
-
}), t =
|
|
2121
|
-
() => e.ticks.map((
|
|
2272
|
+
const a = P(e, n), l = E(null), u = E(null), i = S(() => {
|
|
2273
|
+
const p = Number(a.model.value);
|
|
2274
|
+
return a.model.value === null || a.model.value === void 0 || Number.isNaN(p) ? e.min : p;
|
|
2275
|
+
}), t = S(() => e.ticks.length ? `${a.inputId.value}-ticks` : void 0), d = S(
|
|
2276
|
+
() => e.ticks.map((p) => typeof p == "object" && p !== null ? p : { value: p, label: e.formatter ? e.formatter(p) : String(p) })
|
|
2122
2277
|
);
|
|
2123
|
-
function
|
|
2124
|
-
const
|
|
2125
|
-
a.model.value =
|
|
2278
|
+
function y(p) {
|
|
2279
|
+
const $ = Number(p.target.value);
|
|
2280
|
+
a.model.value = $, n("input", $, p);
|
|
2126
2281
|
}
|
|
2127
|
-
const { instance:
|
|
2282
|
+
const { instance: w, create: g } = he(
|
|
2128
2283
|
"Range",
|
|
2129
2284
|
() => l.value,
|
|
2130
2285
|
() => ({ bubble: e.bubble, formatter: e.formatter })
|
|
2131
2286
|
);
|
|
2132
|
-
return
|
|
2287
|
+
return U(
|
|
2133
2288
|
() => [a.model.value, e.min, e.max],
|
|
2134
|
-
() =>
|
|
2135
|
-
var
|
|
2136
|
-
return (
|
|
2289
|
+
() => X(() => {
|
|
2290
|
+
var p;
|
|
2291
|
+
return (p = w.value) == null ? void 0 : p.update();
|
|
2137
2292
|
}),
|
|
2138
2293
|
{ flush: "post" }
|
|
2139
|
-
),
|
|
2294
|
+
), U(
|
|
2140
2295
|
() => [e.bubble, e.formatter, e.ticks, e.min, e.max],
|
|
2141
2296
|
async () => {
|
|
2142
|
-
await
|
|
2297
|
+
await X(), g();
|
|
2143
2298
|
},
|
|
2144
2299
|
{ deep: !0 }
|
|
2145
|
-
), { ...a, el: l, input:
|
|
2300
|
+
), { ...a, el: l, input: u, current: i, listId: t, tickItems: d, onInput: y };
|
|
2146
2301
|
}
|
|
2147
|
-
}),
|
|
2302
|
+
}), ga = {
|
|
2148
2303
|
ref: "el",
|
|
2149
2304
|
class: "form-range"
|
|
2150
|
-
},
|
|
2151
|
-
function
|
|
2152
|
-
return m(),
|
|
2153
|
-
|
|
2305
|
+
}, ya = ["name", "id", "min", "max", "step", "list", "disabled", "aria-invalid", "value"], ba = ["id"], $a = ["value", "label"];
|
|
2306
|
+
function wa(e, n, a, l, u, i) {
|
|
2307
|
+
return m(), v("div", ga, [
|
|
2308
|
+
h("input", {
|
|
2154
2309
|
ref: "input",
|
|
2155
2310
|
type: "range",
|
|
2156
2311
|
class: q(["form-range-input", { "is-invalid": e.isInvalid }]),
|
|
@@ -2167,26 +2322,26 @@ function oa(e, n, a, l, c, i) {
|
|
|
2167
2322
|
onChange: n[1] || (n[1] = (t) => e.emitChange(Number(t.target.value), t)),
|
|
2168
2323
|
onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
|
|
2169
2324
|
onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
|
|
2170
|
-
}, null, 42,
|
|
2171
|
-
e.listId ? (m(),
|
|
2325
|
+
}, null, 42, ya),
|
|
2326
|
+
e.listId ? (m(), v("datalist", {
|
|
2172
2327
|
key: 0,
|
|
2173
2328
|
id: e.listId
|
|
2174
2329
|
}, [
|
|
2175
|
-
(m(!0),
|
|
2330
|
+
(m(!0), v(W, null, ae(e.tickItems, (t) => (m(), v("option", {
|
|
2176
2331
|
key: t.value,
|
|
2177
2332
|
value: t.value,
|
|
2178
2333
|
label: t.label
|
|
2179
|
-
}, null, 8,
|
|
2180
|
-
], 8,
|
|
2334
|
+
}, null, 8, $a))), 128))
|
|
2335
|
+
], 8, ba)) : M("", !0)
|
|
2181
2336
|
], 512);
|
|
2182
2337
|
}
|
|
2183
|
-
const
|
|
2338
|
+
const $n = /* @__PURE__ */ R(va, [["render", wa]]), Sa = F({
|
|
2184
2339
|
name: "SimpleUploader",
|
|
2185
2340
|
inheritAttrs: !0,
|
|
2186
2341
|
setup(e, { attrs: n, slots: a }) {
|
|
2187
|
-
return () =>
|
|
2342
|
+
return () => kn(vn, n, a);
|
|
2188
2343
|
}
|
|
2189
|
-
}),
|
|
2344
|
+
}), ka = F({
|
|
2190
2345
|
name: "StarRatingInput",
|
|
2191
2346
|
emits: ["update:modelValue", "change", "hover"],
|
|
2192
2347
|
props: {
|
|
@@ -2201,61 +2356,61 @@ const vn = /* @__PURE__ */ L(ea, [["render", oa]]), ra = F({
|
|
|
2201
2356
|
clearable: { type: Boolean, default: !1 }
|
|
2202
2357
|
},
|
|
2203
2358
|
setup(e, { emit: n }) {
|
|
2204
|
-
const a =
|
|
2359
|
+
const a = P(e, n), l = E(null), u = E(null), i = E(!1);
|
|
2205
2360
|
J(() => {
|
|
2206
2361
|
l.value && (i.value = getComputedStyle(l.value).direction === "rtl");
|
|
2207
2362
|
});
|
|
2208
|
-
const t =
|
|
2209
|
-
const
|
|
2210
|
-
return a.model.value === null || a.model.value === void 0 || Number.isNaN(
|
|
2211
|
-
}),
|
|
2212
|
-
function
|
|
2213
|
-
const
|
|
2214
|
-
return Math.min(e.maxStars, Math.max(
|
|
2363
|
+
const t = S(() => e.readonly || a.isDisabled.value), d = S(() => {
|
|
2364
|
+
const c = Number(a.model.value);
|
|
2365
|
+
return a.model.value === null || a.model.value === void 0 || Number.isNaN(c) ? e.value : c;
|
|
2366
|
+
}), y = S(() => u.value ?? d.value), w = S(() => 1 / e.precision), g = (c) => Math.max(0, Math.min(1, y.value - (c - 1))) * 100;
|
|
2367
|
+
function p(c) {
|
|
2368
|
+
const C = l.value.getBoundingClientRect(), j = i.value ? C.right - c.clientX : c.clientX - C.left, A = C.width / e.maxStars, H = Math.ceil(j / A * e.precision) / e.precision;
|
|
2369
|
+
return Math.min(e.maxStars, Math.max(w.value, H));
|
|
2215
2370
|
}
|
|
2216
|
-
function
|
|
2217
|
-
t.value || (
|
|
2371
|
+
function $(c) {
|
|
2372
|
+
t.value || (u.value = p(c), n("hover", u.value));
|
|
2218
2373
|
}
|
|
2219
|
-
function
|
|
2220
|
-
|
|
2374
|
+
function k() {
|
|
2375
|
+
u.value = null;
|
|
2221
2376
|
}
|
|
2222
|
-
function o(
|
|
2377
|
+
function o(c, C) {
|
|
2223
2378
|
if (t.value) return;
|
|
2224
|
-
const j = e.clearable &&
|
|
2225
|
-
a.model.value = j, a.emitChange(j,
|
|
2379
|
+
const j = e.clearable && c === d.value ? 0 : c;
|
|
2380
|
+
a.model.value = j, a.emitChange(j, C);
|
|
2226
2381
|
}
|
|
2227
|
-
function r(
|
|
2228
|
-
t.value || o(
|
|
2382
|
+
function r(c) {
|
|
2383
|
+
t.value || o(p(c), c);
|
|
2229
2384
|
}
|
|
2230
|
-
function s(
|
|
2385
|
+
function s(c) {
|
|
2231
2386
|
if (t.value) return;
|
|
2232
|
-
const
|
|
2387
|
+
const C = i.value ? "ArrowLeft" : "ArrowRight", j = i.value ? "ArrowRight" : "ArrowLeft";
|
|
2233
2388
|
let A = null;
|
|
2234
|
-
|
|
2389
|
+
c.key === C || c.key === "ArrowUp" ? A = d.value + w.value : c.key === j || c.key === "ArrowDown" ? A = d.value - w.value : c.key === "Home" ? A = 0 : c.key === "End" && (A = e.maxStars), A !== null && (c.preventDefault(), o(Math.min(e.maxStars, Math.max(0, Number(A.toFixed(4)))), c));
|
|
2235
2390
|
}
|
|
2236
2391
|
return {
|
|
2237
2392
|
...a,
|
|
2238
2393
|
container: l,
|
|
2239
|
-
rating:
|
|
2240
|
-
stored:
|
|
2241
|
-
fillOf:
|
|
2242
|
-
onMove:
|
|
2243
|
-
leave:
|
|
2394
|
+
rating: y,
|
|
2395
|
+
stored: d,
|
|
2396
|
+
fillOf: g,
|
|
2397
|
+
onMove: $,
|
|
2398
|
+
leave: k,
|
|
2244
2399
|
onClick: r,
|
|
2245
2400
|
onKeydown: s,
|
|
2246
2401
|
locked: t,
|
|
2247
|
-
display:
|
|
2402
|
+
display: S(() => y.value.toFixed(1))
|
|
2248
2403
|
};
|
|
2249
2404
|
}
|
|
2250
|
-
}),
|
|
2405
|
+
}), Ia = ["tabindex", "aria-valuemax", "aria-valuenow", "aria-readonly", "aria-invalid"], Ca = ["name", "value"], Ta = {
|
|
2251
2406
|
key: 1,
|
|
2252
2407
|
class: "rating-value fanum"
|
|
2253
2408
|
};
|
|
2254
|
-
function
|
|
2255
|
-
return m(),
|
|
2409
|
+
function Ma(e, n, a, l, u, i) {
|
|
2410
|
+
return m(), v("div", {
|
|
2256
2411
|
class: q(["star-rating d-flex align-items-center gap-2", { "is-invalid": e.isInvalid }])
|
|
2257
2412
|
}, [
|
|
2258
|
-
|
|
2413
|
+
h("div", {
|
|
2259
2414
|
ref: "container",
|
|
2260
2415
|
class: "star-rating-container d-flex position-relative",
|
|
2261
2416
|
role: "slider",
|
|
@@ -2271,31 +2426,31 @@ function ca(e, n, a, l, c, i) {
|
|
|
2271
2426
|
onClick: n[2] || (n[2] = (...t) => e.onClick && e.onClick(...t)),
|
|
2272
2427
|
onKeydown: n[3] || (n[3] = (...t) => e.onKeydown && e.onKeydown(...t))
|
|
2273
2428
|
}, [
|
|
2274
|
-
(m(!0),
|
|
2429
|
+
(m(!0), v(W, null, ae(e.maxStars, (t) => (m(), v("span", {
|
|
2275
2430
|
key: t,
|
|
2276
2431
|
class: "star-wrapper position-relative d-inline-block fs-2xl lh-1"
|
|
2277
2432
|
}, [
|
|
2278
|
-
n[4] || (n[4] =
|
|
2433
|
+
n[4] || (n[4] = h("span", {
|
|
2279
2434
|
class: "star-bg fg-secondary opacity-50",
|
|
2280
2435
|
"aria-hidden": "true"
|
|
2281
2436
|
}, "★", -1)),
|
|
2282
|
-
|
|
2437
|
+
h("span", {
|
|
2283
2438
|
class: "star-overlay fg-warning",
|
|
2284
2439
|
"aria-hidden": "true",
|
|
2285
2440
|
style: se({ position: "absolute", top: 0, insetInlineStart: 0, overflow: "hidden", whiteSpace: "nowrap", width: e.fillOf(t) + "%" })
|
|
2286
2441
|
}, "★", 4)
|
|
2287
2442
|
]))), 128))
|
|
2288
|
-
], 44,
|
|
2289
|
-
e.name ? (m(),
|
|
2443
|
+
], 44, Ia),
|
|
2444
|
+
e.name ? (m(), v("input", {
|
|
2290
2445
|
key: 0,
|
|
2291
2446
|
type: "hidden",
|
|
2292
2447
|
name: e.name,
|
|
2293
2448
|
value: e.stored
|
|
2294
|
-
}, null, 8,
|
|
2295
|
-
e.showValue && e.rating > 0 ? (m(),
|
|
2449
|
+
}, null, 8, Ca)) : M("", !0),
|
|
2450
|
+
e.showValue && e.rating > 0 ? (m(), v("span", Ta, V(e.display), 1)) : M("", !0)
|
|
2296
2451
|
], 2);
|
|
2297
2452
|
}
|
|
2298
|
-
const
|
|
2453
|
+
const Ba = /* @__PURE__ */ R(ka, [["render", Ma]]), Ea = F({
|
|
2299
2454
|
name: "SubmitButton",
|
|
2300
2455
|
emits: ["click"],
|
|
2301
2456
|
props: {
|
|
@@ -2309,53 +2464,53 @@ const fa = /* @__PURE__ */ L(sa, [["render", ca]]), ma = F({
|
|
|
2309
2464
|
locale: { type: String, default: null }
|
|
2310
2465
|
},
|
|
2311
2466
|
setup(e, { emit: n }) {
|
|
2312
|
-
const a =
|
|
2467
|
+
const a = me("form", null), l = S(() => (a == null ? void 0 : a.value) ?? null), { t: u } = Q(() => e.locale), i = S(
|
|
2313
2468
|
() => {
|
|
2314
|
-
var
|
|
2315
|
-
return e.loading !== null ? e.loading : !!((
|
|
2469
|
+
var d, y;
|
|
2470
|
+
return e.loading !== null ? e.loading : !!((d = l.value) != null && d.processing || (y = l.value) != null && y.uploading);
|
|
2316
2471
|
}
|
|
2317
|
-
), t =
|
|
2472
|
+
), t = S(() => [
|
|
2318
2473
|
e.variant ? `btn-${e.variant}` : null,
|
|
2319
2474
|
e.theme && e.variant ? `theme-${e.theme}` : null
|
|
2320
2475
|
]);
|
|
2321
|
-
return { form: l, busy: i, classes: t, t:
|
|
2476
|
+
return { form: l, busy: i, classes: t, t: u, onClick: (d) => n("click", d) };
|
|
2322
2477
|
}
|
|
2323
|
-
}),
|
|
2478
|
+
}), Aa = ["disabled", "aria-busy"], Oa = {
|
|
2324
2479
|
key: 0,
|
|
2325
2480
|
class: "spinner-border spinner-sm me-2",
|
|
2326
2481
|
role: "status",
|
|
2327
2482
|
"aria-hidden": "true"
|
|
2328
|
-
},
|
|
2483
|
+
}, Va = {
|
|
2329
2484
|
key: 0,
|
|
2330
2485
|
class: "fanum"
|
|
2331
2486
|
};
|
|
2332
|
-
function
|
|
2487
|
+
function Da(e, n, a, l, u, i) {
|
|
2333
2488
|
var t;
|
|
2334
|
-
return m(),
|
|
2489
|
+
return m(), v("button", {
|
|
2335
2490
|
type: "submit",
|
|
2336
2491
|
class: q(e.classes),
|
|
2337
2492
|
disabled: e.disabled || e.busy,
|
|
2338
2493
|
"aria-busy": e.busy || void 0,
|
|
2339
|
-
onClick: n[0] || (n[0] = (...
|
|
2494
|
+
onClick: n[0] || (n[0] = (...d) => e.onClick && e.onClick(...d))
|
|
2340
2495
|
}, [
|
|
2341
|
-
e.busy ? (m(),
|
|
2342
|
-
|
|
2496
|
+
e.busy ? (m(), v("span", Oa)) : M("", !0),
|
|
2497
|
+
L(e.$slots, "default", {
|
|
2343
2498
|
form: e.form,
|
|
2344
2499
|
loading: e.busy
|
|
2345
2500
|
}, () => [
|
|
2346
|
-
|
|
2501
|
+
x(V(e.t("submit.default")), 1)
|
|
2347
2502
|
]),
|
|
2348
|
-
|
|
2503
|
+
L(e.$slots, "progress", {
|
|
2349
2504
|
progress: (t = e.form) == null ? void 0 : t.uploading
|
|
2350
2505
|
}, () => {
|
|
2351
|
-
var
|
|
2506
|
+
var d;
|
|
2352
2507
|
return [
|
|
2353
|
-
(
|
|
2508
|
+
(d = e.form) != null && d.uploading ? (m(), v("span", Va, V(e.form.uploading) + "%", 1)) : M("", !0)
|
|
2354
2509
|
];
|
|
2355
2510
|
})
|
|
2356
|
-
], 10,
|
|
2511
|
+
], 10, Aa);
|
|
2357
2512
|
}
|
|
2358
|
-
const
|
|
2513
|
+
const Na = /* @__PURE__ */ R(Ea, [["render", Da]]), qa = F({
|
|
2359
2514
|
name: "SwitchInput",
|
|
2360
2515
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2361
2516
|
props: {
|
|
@@ -2367,19 +2522,19 @@ const ya = /* @__PURE__ */ L(ma, [["render", ga]]), ba = F({
|
|
|
2367
2522
|
label: { type: String, default: null }
|
|
2368
2523
|
},
|
|
2369
2524
|
setup(e, { emit: n }) {
|
|
2370
|
-
const a = E(null), l =
|
|
2371
|
-
return
|
|
2525
|
+
const a = E(null), l = P(e, n, { valued: () => e.value });
|
|
2526
|
+
return je(e, l, a, { type: () => "checkbox" }), {
|
|
2372
2527
|
...l,
|
|
2373
2528
|
input: a,
|
|
2374
|
-
onChange: (
|
|
2529
|
+
onChange: (u) => l.emitChange(l.model.value, u)
|
|
2375
2530
|
};
|
|
2376
2531
|
},
|
|
2377
2532
|
expose: ["input"]
|
|
2378
|
-
}),
|
|
2379
|
-
function
|
|
2380
|
-
return m(),
|
|
2381
|
-
|
|
2382
|
-
re(
|
|
2533
|
+
}), Fa = { class: "form-field" }, Ra = { class: "switch" }, La = ["name", "id", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], ja = ["for"];
|
|
2534
|
+
function za(e, n, a, l, u, i) {
|
|
2535
|
+
return m(), v("div", Fa, [
|
|
2536
|
+
h("div", Ra, [
|
|
2537
|
+
re(h("input", {
|
|
2383
2538
|
ref: "input",
|
|
2384
2539
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
|
|
2385
2540
|
name: e.name,
|
|
@@ -2397,18 +2552,18 @@ function Ia(e, n, a, l, c, i) {
|
|
|
2397
2552
|
onChange: n[1] || (n[1] = (...t) => e.onChange && e.onChange(...t)),
|
|
2398
2553
|
onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
|
|
2399
2554
|
onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
|
|
2400
|
-
}, null, 42,
|
|
2401
|
-
[
|
|
2555
|
+
}, null, 42, La), [
|
|
2556
|
+
[In, e.model]
|
|
2402
2557
|
])
|
|
2403
2558
|
]),
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2559
|
+
h("label", { for: e.inputId }, [
|
|
2560
|
+
L(e.$slots, "default", {}, () => [
|
|
2561
|
+
x(V(e.label), 1)
|
|
2407
2562
|
])
|
|
2408
|
-
], 8,
|
|
2563
|
+
], 8, ja)
|
|
2409
2564
|
]);
|
|
2410
2565
|
}
|
|
2411
|
-
const
|
|
2566
|
+
const Pa = /* @__PURE__ */ R(qa, [["render", za]]), Ka = F({
|
|
2412
2567
|
name: "TextAreaInput",
|
|
2413
2568
|
emits: ["update:modelValue", "change", "input", "focus", "blur"],
|
|
2414
2569
|
props: {
|
|
@@ -2418,12 +2573,12 @@ const Ca = /* @__PURE__ */ L(ba, [["render", Ia]]), Ta = F({
|
|
|
2418
2573
|
size: { type: String, default: null }
|
|
2419
2574
|
},
|
|
2420
2575
|
setup(e, { emit: n }) {
|
|
2421
|
-
const a =
|
|
2576
|
+
const a = P(e, n), l = S(() => e.size ? `form-control-${e.size}` : null);
|
|
2422
2577
|
return { ...a, sizeClass: l, emit: n };
|
|
2423
2578
|
}
|
|
2424
|
-
}),
|
|
2425
|
-
function
|
|
2426
|
-
return re((m(),
|
|
2579
|
+
}), Ua = ["name", "id", "rows", "placeholder", "required", "readonly", "disabled", "aria-invalid"];
|
|
2580
|
+
function Ha(e, n, a, l, u, i) {
|
|
2581
|
+
return re((m(), v("textarea", {
|
|
2427
2582
|
"onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
|
|
2428
2583
|
name: e.name,
|
|
2429
2584
|
id: e.inputId,
|
|
@@ -2438,24 +2593,24 @@ function Ba(e, n, a, l, c, i) {
|
|
|
2438
2593
|
onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t)),
|
|
2439
2594
|
onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
|
|
2440
2595
|
onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
|
|
2441
|
-
}, null, 42,
|
|
2442
|
-
[
|
|
2596
|
+
}, null, 42, Ua)), [
|
|
2597
|
+
[fn, e.model]
|
|
2443
2598
|
]);
|
|
2444
2599
|
}
|
|
2445
|
-
const
|
|
2446
|
-
function
|
|
2447
|
-
|
|
2600
|
+
const Xa = /* @__PURE__ */ R(Ka, [["render", Ha]]), Re = ie({}), we = ie({});
|
|
2601
|
+
function Ga(e, n) {
|
|
2602
|
+
Re[e] = n;
|
|
2448
2603
|
}
|
|
2449
|
-
function
|
|
2604
|
+
function Wa(e, n) {
|
|
2450
2605
|
var a;
|
|
2451
|
-
((a =
|
|
2606
|
+
((a = Re[e]) == null ? void 0 : a.owner) === n && delete Re[e];
|
|
2452
2607
|
}
|
|
2453
|
-
function
|
|
2608
|
+
function Qa(e) {
|
|
2454
2609
|
return we[e] = (we[e] || 0) + 1, () => {
|
|
2455
2610
|
we[e] = Math.max(0, (we[e] || 1) - 1);
|
|
2456
2611
|
};
|
|
2457
2612
|
}
|
|
2458
|
-
const
|
|
2613
|
+
const dn = (e) => String(Math.floor(e)).padStart(2, "0"), Ye = (e) => `${dn(e / 60)}:${dn(e % 60)}`, Ja = F({
|
|
2459
2614
|
name: "VoiceRecorderResultArea",
|
|
2460
2615
|
props: {
|
|
2461
2616
|
/** channel / name of the recorder to display. */
|
|
@@ -2470,80 +2625,80 @@ const on = (e) => String(Math.floor(e)).padStart(2, "0"), We = (e) => `${on(e /
|
|
|
2470
2625
|
internal: { type: Boolean, default: !1 }
|
|
2471
2626
|
},
|
|
2472
2627
|
setup(e) {
|
|
2473
|
-
const n = E(null), a =
|
|
2628
|
+
const n = E(null), a = S(() => Re[e.for] ?? null);
|
|
2474
2629
|
let l = null;
|
|
2475
2630
|
J(() => {
|
|
2476
|
-
e.internal || (l =
|
|
2477
|
-
}),
|
|
2478
|
-
const
|
|
2479
|
-
var
|
|
2480
|
-
return ((
|
|
2631
|
+
e.internal || (l = Qa(e.for));
|
|
2632
|
+
}), pn(() => l == null ? void 0 : l());
|
|
2633
|
+
const u = (t) => {
|
|
2634
|
+
var d, y;
|
|
2635
|
+
return ((y = (d = a.value) == null ? void 0 : d.t) == null ? void 0 : y.call(d, t)) ?? t;
|
|
2481
2636
|
};
|
|
2482
2637
|
function i(t) {
|
|
2483
|
-
var
|
|
2484
|
-
(
|
|
2485
|
-
|
|
2638
|
+
var d;
|
|
2639
|
+
(d = n.value) == null || d.querySelectorAll("audio").forEach((y) => {
|
|
2640
|
+
y !== t.target && y.pause();
|
|
2486
2641
|
});
|
|
2487
2642
|
}
|
|
2488
|
-
return { root: n, channel: a, t:
|
|
2643
|
+
return { root: n, channel: a, t: u, onPlay: i, formatTime: Ye };
|
|
2489
2644
|
}
|
|
2490
|
-
}),
|
|
2645
|
+
}), Za = {
|
|
2491
2646
|
key: 0,
|
|
2492
2647
|
ref: "root",
|
|
2493
2648
|
class: "voice-recorder-results"
|
|
2494
|
-
},
|
|
2649
|
+
}, Ya = ["data-code"], xa = { class: "row gx-3 align-items-center" }, _a = { class: "col-12 sm:col-4" }, eo = ["src"], no = {
|
|
2495
2650
|
key: 0,
|
|
2496
2651
|
class: "col-auto"
|
|
2497
|
-
},
|
|
2652
|
+
}, to = {
|
|
2498
2653
|
class: "fg-secondary fanum",
|
|
2499
2654
|
dir: "ltr"
|
|
2500
|
-
},
|
|
2655
|
+
}, lo = { class: "col" }, ao = ["aria-valuenow"], oo = {
|
|
2501
2656
|
key: 1,
|
|
2502
2657
|
class: "fg-danger",
|
|
2503
2658
|
role: "alert"
|
|
2504
|
-
},
|
|
2659
|
+
}, ro = {
|
|
2505
2660
|
key: 1,
|
|
2506
2661
|
class: "col-auto"
|
|
2507
|
-
},
|
|
2508
|
-
function
|
|
2509
|
-
return e.channel && (e.showProblem && e.channel.problem || e.showList && e.channel.items.length) ? (m(),
|
|
2510
|
-
|
|
2511
|
-
e.showProblem && e.channel.problem ? (m(),
|
|
2662
|
+
}, so = ["aria-label", "onClick"], io = { class: "col-auto" }, uo = ["aria-label", "onClick"];
|
|
2663
|
+
function co(e, n, a, l, u, i) {
|
|
2664
|
+
return e.channel && (e.showProblem && e.channel.problem || e.showList && e.channel.items.length) ? (m(), v("div", Za, [
|
|
2665
|
+
L(e.$slots, "default"),
|
|
2666
|
+
e.showProblem && e.channel.problem ? (m(), v("div", {
|
|
2512
2667
|
key: 0,
|
|
2513
2668
|
class: q(e.alertClass),
|
|
2514
2669
|
role: "alert",
|
|
2515
2670
|
"data-code": e.channel.problem.code
|
|
2516
|
-
}, V(e.channel.problem.message), 11,
|
|
2517
|
-
e.showList && e.channel.items.length ? (m(),
|
|
2671
|
+
}, V(e.channel.problem.message), 11, Ya)) : M("", !0),
|
|
2672
|
+
e.showList && e.channel.items.length ? (m(), v("ul", {
|
|
2518
2673
|
key: 1,
|
|
2519
2674
|
class: q(["list-group", e.listClass])
|
|
2520
2675
|
}, [
|
|
2521
|
-
(m(!0),
|
|
2676
|
+
(m(!0), v(W, null, ae(e.channel.items, (t) => (m(), v("li", {
|
|
2522
2677
|
key: t.id,
|
|
2523
2678
|
class: "list-group-item"
|
|
2524
2679
|
}, [
|
|
2525
|
-
|
|
2680
|
+
L(e.$slots, "item", {
|
|
2526
2681
|
item: t,
|
|
2527
2682
|
time: t.seconds !== null ? e.formatTime(t.seconds) : null,
|
|
2528
2683
|
locked: e.channel.locked,
|
|
2529
2684
|
remove: () => e.channel.remove(t),
|
|
2530
2685
|
retry: () => e.channel.retry(t)
|
|
2531
2686
|
}, () => [
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2687
|
+
h("div", xa, [
|
|
2688
|
+
h("div", _a, [
|
|
2689
|
+
h("audio", {
|
|
2535
2690
|
class: "flex-grow-1 w-100",
|
|
2536
2691
|
controls: "",
|
|
2537
2692
|
preload: "metadata",
|
|
2538
2693
|
src: t.src,
|
|
2539
|
-
onPlay: n[0] || (n[0] = (...
|
|
2540
|
-
}, null, 40,
|
|
2694
|
+
onPlay: n[0] || (n[0] = (...d) => e.onPlay && e.onPlay(...d))
|
|
2695
|
+
}, null, 40, eo)
|
|
2541
2696
|
]),
|
|
2542
|
-
t.seconds !== null ? (m(),
|
|
2543
|
-
|
|
2697
|
+
t.seconds !== null ? (m(), v("div", no, [
|
|
2698
|
+
h("span", to, V(e.formatTime(t.seconds)), 1)
|
|
2544
2699
|
])) : M("", !0),
|
|
2545
|
-
|
|
2546
|
-
t.status === "uploading" ? (m(),
|
|
2700
|
+
h("div", lo, [
|
|
2701
|
+
t.status === "uploading" ? (m(), v("div", {
|
|
2547
2702
|
key: 0,
|
|
2548
2703
|
class: "progress",
|
|
2549
2704
|
role: "progressbar",
|
|
@@ -2551,21 +2706,21 @@ function Qa(e, n, a, l, c, i) {
|
|
|
2551
2706
|
"aria-valuemin": "0",
|
|
2552
2707
|
"aria-valuemax": "100"
|
|
2553
2708
|
}, [
|
|
2554
|
-
|
|
2709
|
+
h("div", {
|
|
2555
2710
|
class: "progress-bar",
|
|
2556
2711
|
style: se({ width: t.percent + "%" })
|
|
2557
2712
|
}, null, 4)
|
|
2558
|
-
], 8,
|
|
2559
|
-
t.status === "error" ? (m(),
|
|
2713
|
+
], 8, ao)) : M("", !0),
|
|
2714
|
+
t.status === "error" ? (m(), v("div", oo, V(t.error), 1)) : M("", !0)
|
|
2560
2715
|
]),
|
|
2561
|
-
t.status === "error" ? (m(),
|
|
2562
|
-
|
|
2716
|
+
t.status === "error" ? (m(), v("div", ro, [
|
|
2717
|
+
h("button", {
|
|
2563
2718
|
type: "button",
|
|
2564
2719
|
class: "btn-text theme-secondary btn-icon",
|
|
2565
2720
|
"aria-label": e.t("retry"),
|
|
2566
|
-
onClick: (
|
|
2721
|
+
onClick: (d) => e.channel.retry(t)
|
|
2567
2722
|
}, n[1] || (n[1] = [
|
|
2568
|
-
|
|
2723
|
+
h("svg", {
|
|
2569
2724
|
width: "16",
|
|
2570
2725
|
height: "16",
|
|
2571
2726
|
viewBox: "0 0 16 16",
|
|
@@ -2576,20 +2731,20 @@ function Qa(e, n, a, l, c, i) {
|
|
|
2576
2731
|
"stroke-linejoin": "round",
|
|
2577
2732
|
"aria-hidden": "true"
|
|
2578
2733
|
}, [
|
|
2579
|
-
|
|
2580
|
-
|
|
2734
|
+
h("path", { d: "M13.5 3v3.5H10" }),
|
|
2735
|
+
h("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5M2.5 13V9.5H6" })
|
|
2581
2736
|
], -1)
|
|
2582
|
-
]), 8,
|
|
2737
|
+
]), 8, so)
|
|
2583
2738
|
])) : M("", !0),
|
|
2584
|
-
|
|
2585
|
-
e.channel.locked ? M("", !0) : (m(),
|
|
2739
|
+
h("div", io, [
|
|
2740
|
+
e.channel.locked ? M("", !0) : (m(), v("button", {
|
|
2586
2741
|
key: 0,
|
|
2587
2742
|
type: "button",
|
|
2588
2743
|
class: "btn-text theme-danger btn-icon",
|
|
2589
2744
|
"aria-label": e.t("remove"),
|
|
2590
|
-
onClick: (
|
|
2745
|
+
onClick: (d) => e.channel.remove(t)
|
|
2591
2746
|
}, n[2] || (n[2] = [
|
|
2592
|
-
|
|
2747
|
+
h("svg", {
|
|
2593
2748
|
width: "16",
|
|
2594
2749
|
height: "16",
|
|
2595
2750
|
viewBox: "0 0 16 16",
|
|
@@ -2600,9 +2755,9 @@ function Qa(e, n, a, l, c, i) {
|
|
|
2600
2755
|
"stroke-linejoin": "round",
|
|
2601
2756
|
"aria-hidden": "true"
|
|
2602
2757
|
}, [
|
|
2603
|
-
|
|
2758
|
+
h("path", { d: "M2.5 4.5h11M6 4.5V3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1.5M4 4.5l.6 8.1a1 1 0 0 0 1 .9h4.8a1 1 0 0 0 1-.9l.6-8.1" })
|
|
2604
2759
|
], -1)
|
|
2605
|
-
]), 8,
|
|
2760
|
+
]), 8, uo))
|
|
2606
2761
|
])
|
|
2607
2762
|
])
|
|
2608
2763
|
])
|
|
@@ -2610,7 +2765,7 @@ function Qa(e, n, a, l, c, i) {
|
|
|
2610
2765
|
], 2)) : M("", !0)
|
|
2611
2766
|
], 512)) : M("", !0);
|
|
2612
2767
|
}
|
|
2613
|
-
const
|
|
2768
|
+
const wn = /* @__PURE__ */ R(Ja, [["render", co]]), Ge = {
|
|
2614
2769
|
en: {
|
|
2615
2770
|
start: "Record voice",
|
|
2616
2771
|
stop: "Stop recording",
|
|
@@ -2651,15 +2806,15 @@ const gn = /* @__PURE__ */ L(Na, [["render", Qa]]), Ue = {
|
|
|
2651
2806
|
unknown: "شروع ضبط ممکن نشد.",
|
|
2652
2807
|
uploadFailed: "خطا در ارسال"
|
|
2653
2808
|
}
|
|
2654
|
-
},
|
|
2655
|
-
let
|
|
2656
|
-
function
|
|
2657
|
-
return typeof MediaRecorder > "u" || !MediaRecorder.isTypeSupported ? "" :
|
|
2809
|
+
}, fo = ["audio/ogg;codecs=opus", "audio/webm;codecs=opus", "audio/mp4", "audio/webm", "audio/ogg"];
|
|
2810
|
+
let We = 0;
|
|
2811
|
+
function cn() {
|
|
2812
|
+
return typeof MediaRecorder > "u" || !MediaRecorder.isTypeSupported ? "" : fo.find((e) => MediaRecorder.isTypeSupported(e)) || "";
|
|
2658
2813
|
}
|
|
2659
|
-
function
|
|
2814
|
+
function po(e = "") {
|
|
2660
2815
|
return /ogg/.test(e) ? "ogg" : /webm/.test(e) ? "webm" : /mp4|aac|m4a/.test(e) ? "m4a" : /mpeg|mp3/.test(e) ? "mp3" : /wav/.test(e) ? "wav" : "audio";
|
|
2661
2816
|
}
|
|
2662
|
-
function
|
|
2817
|
+
function mo(e) {
|
|
2663
2818
|
switch (e == null ? void 0 : e.name) {
|
|
2664
2819
|
case "NotAllowedError":
|
|
2665
2820
|
case "PermissionDeniedError":
|
|
@@ -2679,9 +2834,9 @@ function Ya(e) {
|
|
|
2679
2834
|
return "unknown";
|
|
2680
2835
|
}
|
|
2681
2836
|
}
|
|
2682
|
-
const
|
|
2837
|
+
const ho = F({
|
|
2683
2838
|
name: "VoiceRecorderInput",
|
|
2684
|
-
components: { VoiceRecorderResultArea:
|
|
2839
|
+
components: { VoiceRecorderResultArea: wn },
|
|
2685
2840
|
emits: ["update:modelValue", "change", "start", "stop", "recorded", "progress", "uploaded", "removed", "error"],
|
|
2686
2841
|
props: {
|
|
2687
2842
|
...z,
|
|
@@ -2723,132 +2878,132 @@ const xa = F({
|
|
|
2723
2878
|
locale: { type: String, default: null }
|
|
2724
2879
|
},
|
|
2725
2880
|
setup(e, { emit: n, expose: a }) {
|
|
2726
|
-
const l =
|
|
2727
|
-
let
|
|
2728
|
-
const
|
|
2729
|
-
() =>
|
|
2730
|
-
),
|
|
2731
|
-
() =>
|
|
2881
|
+
const l = P(e, n), { locale: u } = Q(() => e.locale), i = Le(), t = (f) => (Ge[u.value] || Ge.en)[f] ?? Ge.en[f] ?? f, d = `voice-${++We}`, y = e.channel ?? e.name ?? d, w = E(null), g = E([]), p = E(!1), $ = E(!1), k = E(0), o = E(null), r = E(!0), s = E(!1), c = /* @__PURE__ */ new Map();
|
|
2882
|
+
let C = null, j = null, A = [], H = null, ee = 0, K = !1;
|
|
2883
|
+
const Ie = S(() => e.readonly || l.isDisabled.value), Ce = S(() => Ye(k.value)), Te = S(() => g.value.some((f) => f.status === "uploading")), ve = S(() => !r.value || Ie.value), Me = S(() => (we[y] || 0) > 0), Be = S(() => !e.resultTarget && (e.inlineResults ?? !Me.value)), ge = S(
|
|
2884
|
+
() => p.value ? e.recordingClass : o.value ? e.problemClass : e.buttonClass
|
|
2885
|
+
), Ee = S(() => $.value ? t("starting") : p.value ? t("recording") : Te.value ? t("uploading") : t("idle")), ye = S(
|
|
2886
|
+
() => p.value ? e.stopText ?? t("stop") : e.startText ?? t("start")
|
|
2732
2887
|
);
|
|
2733
|
-
function Z(
|
|
2734
|
-
o.value = { code:
|
|
2888
|
+
function Z(f, O, T = null) {
|
|
2889
|
+
o.value = { code: f, message: t(f) }, n("error", { code: f, message: o.value.message, error: O ?? null, item: T });
|
|
2735
2890
|
}
|
|
2736
2891
|
const ue = () => {
|
|
2737
2892
|
o.value = null;
|
|
2738
2893
|
}, Pe = () => {
|
|
2739
|
-
const
|
|
2740
|
-
return e.multiple ? Array.isArray(
|
|
2894
|
+
const f = l.model.value;
|
|
2895
|
+
return e.multiple ? Array.isArray(f) ? f : f ? [f] : [] : f ? [f] : [];
|
|
2741
2896
|
};
|
|
2742
|
-
function ne(
|
|
2743
|
-
const O =
|
|
2744
|
-
l.model.value =
|
|
2897
|
+
function ne(f) {
|
|
2898
|
+
const O = g.value.filter((B) => B.path).map((B) => B.path), T = e.multiple ? O : O[0] ?? null;
|
|
2899
|
+
l.model.value = T, l.emitChange(T, f);
|
|
2745
2900
|
}
|
|
2746
2901
|
function te() {
|
|
2747
|
-
const
|
|
2748
|
-
if (!
|
|
2749
|
-
const O =
|
|
2750
|
-
|
|
2902
|
+
const f = l.form.value;
|
|
2903
|
+
if (!f) return;
|
|
2904
|
+
const O = g.value.filter((T) => T.status === "uploading");
|
|
2905
|
+
f.uploading = O.length ? Math.min(99, Math.round(O.reduce((T, B) => T + B.percent, 0) / O.length)) : null;
|
|
2751
2906
|
}
|
|
2752
|
-
function be(
|
|
2753
|
-
|
|
2907
|
+
function be(f) {
|
|
2908
|
+
f.local && f.src && URL.revokeObjectURL(f.src);
|
|
2754
2909
|
}
|
|
2755
2910
|
function de() {
|
|
2756
|
-
const
|
|
2757
|
-
!
|
|
2758
|
-
const O = new Set(
|
|
2759
|
-
|
|
2760
|
-
O.has(
|
|
2761
|
-
ie({ id: `v${++
|
|
2911
|
+
const f = Pe();
|
|
2912
|
+
!f.length && g.value.some((T) => T.path) && (g.value.filter((T) => T.path).forEach(be), g.value = g.value.filter((T) => !T.path));
|
|
2913
|
+
const O = new Set(g.value.map((T) => T.path).filter(Boolean));
|
|
2914
|
+
f.forEach((T) => {
|
|
2915
|
+
O.has(T) || g.value.push(
|
|
2916
|
+
ie({ id: `v${++We}`, path: T, src: e.playbackUrl(T), status: "done", percent: 100, seconds: null, error: "", local: !1, file: null })
|
|
2762
2917
|
);
|
|
2763
2918
|
});
|
|
2764
2919
|
}
|
|
2765
2920
|
J(() => {
|
|
2766
|
-
var
|
|
2767
|
-
s.value = !0,
|
|
2768
|
-
}),
|
|
2769
|
-
async function
|
|
2770
|
-
var
|
|
2921
|
+
var f;
|
|
2922
|
+
s.value = !0, Ga(y, { owner: d, items: g, problem: o, locked: Ie, t, remove: N, retry: I }), i.add(() => Wa(y, d)), r.value = typeof navigator < "u" && !!((f = navigator.mediaDevices) != null && f.getUserMedia) && typeof MediaRecorder < "u", r.value ? G() : Z(typeof window < "u" && window.isSecureContext === !1 ? "insecure" : "unsupported"), de();
|
|
2923
|
+
}), U(() => l.model.value, de, { deep: !0 });
|
|
2924
|
+
async function G() {
|
|
2925
|
+
var f;
|
|
2771
2926
|
try {
|
|
2772
|
-
const O = await ((
|
|
2927
|
+
const O = await ((f = navigator.permissions) == null ? void 0 : f.query({ name: "microphone" }));
|
|
2773
2928
|
if (!O || i.isDisposed()) return;
|
|
2774
|
-
const
|
|
2929
|
+
const T = () => {
|
|
2775
2930
|
var B;
|
|
2776
2931
|
O.state === "denied" ? Z("denied") : ((B = o.value) == null ? void 0 : B.code) === "denied" && ue();
|
|
2777
2932
|
};
|
|
2778
|
-
|
|
2933
|
+
T(), O.addEventListener("change", T), i.add(() => O.removeEventListener("change", T));
|
|
2779
2934
|
} catch {
|
|
2780
2935
|
}
|
|
2781
2936
|
}
|
|
2782
2937
|
function ce() {
|
|
2783
|
-
j == null || j.getTracks().forEach((
|
|
2938
|
+
j == null || j.getTracks().forEach((f) => f.stop()), j = null;
|
|
2784
2939
|
}
|
|
2785
|
-
function
|
|
2786
|
-
|
|
2940
|
+
function Ke() {
|
|
2941
|
+
k.value = (Date.now() - ee) / 1e3, e.maxDuration && k.value >= e.maxDuration && _();
|
|
2787
2942
|
}
|
|
2788
|
-
async function
|
|
2789
|
-
if (
|
|
2790
|
-
ue(),
|
|
2791
|
-
let
|
|
2943
|
+
async function Ae() {
|
|
2944
|
+
if (p.value || $.value || ve.value) return;
|
|
2945
|
+
ue(), $.value = !0;
|
|
2946
|
+
let f;
|
|
2792
2947
|
try {
|
|
2793
|
-
|
|
2948
|
+
f = await navigator.mediaDevices.getUserMedia({
|
|
2794
2949
|
audio: Object.keys(e.audioConstraints || {}).length ? e.audioConstraints : !0
|
|
2795
2950
|
});
|
|
2796
2951
|
} catch (B) {
|
|
2797
|
-
return
|
|
2952
|
+
return $.value = !1, Z(mo(B), B);
|
|
2798
2953
|
}
|
|
2799
|
-
if (
|
|
2800
|
-
|
|
2954
|
+
if ($.value = !1, i.isDisposed()) {
|
|
2955
|
+
f.getTracks().forEach((B) => B.stop());
|
|
2801
2956
|
return;
|
|
2802
2957
|
}
|
|
2803
|
-
const O =
|
|
2804
|
-
let
|
|
2958
|
+
const O = cn();
|
|
2959
|
+
let T;
|
|
2805
2960
|
try {
|
|
2806
|
-
|
|
2961
|
+
T = new MediaRecorder(f, { ...O ? { mimeType: O } : {}, audioBitsPerSecond: e.audioBitsPerSecond });
|
|
2807
2962
|
} catch {
|
|
2808
2963
|
try {
|
|
2809
|
-
|
|
2810
|
-
} catch (
|
|
2811
|
-
return
|
|
2964
|
+
T = new MediaRecorder(f);
|
|
2965
|
+
} catch (D) {
|
|
2966
|
+
return f.getTracks().forEach((Y) => Y.stop()), Z("recorder", D);
|
|
2812
2967
|
}
|
|
2813
2968
|
}
|
|
2814
|
-
j =
|
|
2815
|
-
var
|
|
2816
|
-
(
|
|
2817
|
-
},
|
|
2818
|
-
|
|
2819
|
-
},
|
|
2969
|
+
j = f, C = T, A = [], K = !1, T.ondataavailable = (B) => {
|
|
2970
|
+
var D;
|
|
2971
|
+
(D = B.data) != null && D.size && A.push(B.data);
|
|
2972
|
+
}, T.onerror = (B) => {
|
|
2973
|
+
K = !0, Z("recorder", B.error), _();
|
|
2974
|
+
}, T.onstop = () => fe(T), f.getAudioTracks().forEach(
|
|
2820
2975
|
(B) => B.addEventListener("ended", () => {
|
|
2821
|
-
|
|
2976
|
+
p.value && (Z("disconnected"), _());
|
|
2822
2977
|
})
|
|
2823
|
-
),
|
|
2978
|
+
), T.start(500), ee = Date.now(), k.value = 0, p.value = !0, H = setInterval(Ke, 250), n("start");
|
|
2824
2979
|
}
|
|
2825
|
-
function
|
|
2826
|
-
if (clearInterval(
|
|
2980
|
+
function _() {
|
|
2981
|
+
if (clearInterval(H), H = null, C && C.state !== "inactive")
|
|
2827
2982
|
try {
|
|
2828
|
-
|
|
2983
|
+
C.stop();
|
|
2829
2984
|
} catch {
|
|
2830
|
-
fe(
|
|
2985
|
+
fe(C);
|
|
2831
2986
|
}
|
|
2832
|
-
|
|
2987
|
+
p.value = !1;
|
|
2833
2988
|
}
|
|
2834
|
-
function fe(
|
|
2835
|
-
clearInterval(
|
|
2836
|
-
const O = (Date.now() - ee) / 1e3,
|
|
2837
|
-
if (A = [], ce(),
|
|
2989
|
+
function fe(f) {
|
|
2990
|
+
clearInterval(H), H = null, p.value = !1;
|
|
2991
|
+
const O = (Date.now() - ee) / 1e3, T = A;
|
|
2992
|
+
if (A = [], ce(), C = null, K) return;
|
|
2838
2993
|
n("stop", O);
|
|
2839
|
-
const B =
|
|
2840
|
-
if (!
|
|
2841
|
-
|
|
2842
|
-
}
|
|
2843
|
-
function
|
|
2844
|
-
return
|
|
2845
|
-
}
|
|
2846
|
-
function
|
|
2847
|
-
e.multiple ||
|
|
2848
|
-
const
|
|
2849
|
-
id: `v${++
|
|
2850
|
-
file:
|
|
2851
|
-
src: URL.createObjectURL(
|
|
2994
|
+
const B = f.mimeType || cn() || "audio/webm", D = new Blob(T, { type: B });
|
|
2995
|
+
if (!D.size || O < 0.4) return Z("tooShort");
|
|
2996
|
+
b(D, O);
|
|
2997
|
+
}
|
|
2998
|
+
function Oe() {
|
|
2999
|
+
return p.value ? _() : Ae();
|
|
3000
|
+
}
|
|
3001
|
+
function b(f, O) {
|
|
3002
|
+
e.multiple || g.value.slice().forEach((D) => N(D, !1));
|
|
3003
|
+
const T = new File([f], `voice-${Date.now()}.${po(f.type)}`, { type: f.type }), B = ie({
|
|
3004
|
+
id: `v${++We}`,
|
|
3005
|
+
file: T,
|
|
3006
|
+
src: URL.createObjectURL(T),
|
|
2852
3007
|
seconds: Math.round(O),
|
|
2853
3008
|
status: "uploading",
|
|
2854
3009
|
percent: 0,
|
|
@@ -2856,96 +3011,96 @@ const xa = F({
|
|
|
2856
3011
|
error: "",
|
|
2857
3012
|
local: !0
|
|
2858
3013
|
});
|
|
2859
|
-
|
|
3014
|
+
g.value = [...g.value, B], n("recorded", B), I(B);
|
|
2860
3015
|
}
|
|
2861
|
-
function
|
|
2862
|
-
|
|
3016
|
+
function I(f) {
|
|
3017
|
+
f.status = "uploading", f.percent = 0, f.error = "", te();
|
|
2863
3018
|
const O = new FormData();
|
|
2864
|
-
O.append(e.fieldName,
|
|
2865
|
-
const
|
|
2866
|
-
|
|
2867
|
-
|
|
3019
|
+
O.append(e.fieldName, f.file, f.file.name);
|
|
3020
|
+
const T = new XMLHttpRequest();
|
|
3021
|
+
c.set(f.id, T), T.open("POST", e.url), Object.entries(qe(e.headers)).forEach(([D, Y]) => T.setRequestHeader(D, Y)), T.upload.onprogress = (D) => {
|
|
3022
|
+
D.lengthComputable && (f.percent = Math.round(D.loaded / D.total * 100), n("progress", f, f.percent), te());
|
|
2868
3023
|
};
|
|
2869
|
-
const B = (
|
|
2870
|
-
|
|
3024
|
+
const B = (D) => {
|
|
3025
|
+
c.delete(f.id), f.status = "error", f.error = D || t("uploadFailed"), te(), Z("uploadFailed", null, f), o.value = { code: "uploadFailed", message: f.error };
|
|
2871
3026
|
};
|
|
2872
|
-
|
|
2873
|
-
let
|
|
3027
|
+
T.onerror = () => B(), T.onload = () => {
|
|
3028
|
+
let D = null;
|
|
2874
3029
|
try {
|
|
2875
|
-
|
|
3030
|
+
D = JSON.parse(T.responseText);
|
|
2876
3031
|
} catch {
|
|
2877
3032
|
}
|
|
2878
|
-
if (
|
|
2879
|
-
const
|
|
2880
|
-
return B((
|
|
3033
|
+
if (T.status < 200 || T.status >= 300) {
|
|
3034
|
+
const Ve = D != null && D.errors ? Object.values(D.errors)[0] : null;
|
|
3035
|
+
return B((D == null ? void 0 : D.message) || (Array.isArray(Ve) ? Ve[0] : Ve));
|
|
2881
3036
|
}
|
|
2882
|
-
const Y = (
|
|
2883
|
-
if (!
|
|
2884
|
-
|
|
2885
|
-
},
|
|
2886
|
-
}
|
|
2887
|
-
async function
|
|
2888
|
-
var
|
|
2889
|
-
if ((
|
|
3037
|
+
const Y = (D == null ? void 0 : D.data) ?? D, en = (Y == null ? void 0 : Y.path) ?? (Y == null ? void 0 : Y.url);
|
|
3038
|
+
if (!en) return B();
|
|
3039
|
+
c.delete(f.id), f.path = en, f.status = "done", f.percent = 100, te(), ue(), ne(), n("uploaded", f, D);
|
|
3040
|
+
}, T.send(O);
|
|
3041
|
+
}
|
|
3042
|
+
async function N(f, O = !0) {
|
|
3043
|
+
var T;
|
|
3044
|
+
if ((T = c.get(f.id)) == null || T.abort(), c.delete(f.id), be(f), g.value = g.value.filter((B) => B.id !== f.id), te(), f.path && (ne(), e.deleteOnRemove))
|
|
2890
3045
|
try {
|
|
2891
3046
|
await fetch(e.url, {
|
|
2892
3047
|
method: "DELETE",
|
|
2893
|
-
headers:
|
|
3048
|
+
headers: qe(e.headers),
|
|
2894
3049
|
credentials: "same-origin",
|
|
2895
|
-
body:
|
|
3050
|
+
body: f.path
|
|
2896
3051
|
});
|
|
2897
3052
|
} catch {
|
|
2898
3053
|
}
|
|
2899
|
-
O && n("removed",
|
|
3054
|
+
O && n("removed", f);
|
|
2900
3055
|
}
|
|
2901
3056
|
return i.add(() => {
|
|
2902
|
-
if (
|
|
3057
|
+
if (K = !0, clearInterval(H), C && C.state !== "inactive")
|
|
2903
3058
|
try {
|
|
2904
|
-
|
|
3059
|
+
C.stop();
|
|
2905
3060
|
} catch {
|
|
2906
3061
|
}
|
|
2907
|
-
ce(),
|
|
2908
|
-
}), a({ start:
|
|
3062
|
+
ce(), c.forEach((f) => f.abort()), c.clear(), g.value.forEach(be), l.form.value && (l.form.value.uploading = null);
|
|
3063
|
+
}), a({ start: Ae, stop: _, toggle: Oe, channel: y }), {
|
|
2909
3064
|
...l,
|
|
2910
3065
|
t,
|
|
2911
|
-
root:
|
|
2912
|
-
items:
|
|
2913
|
-
recording:
|
|
2914
|
-
starting:
|
|
2915
|
-
seconds:
|
|
2916
|
-
time:
|
|
3066
|
+
root: w,
|
|
3067
|
+
items: g,
|
|
3068
|
+
recording: p,
|
|
3069
|
+
starting: $,
|
|
3070
|
+
seconds: k,
|
|
3071
|
+
time: Ce,
|
|
2917
3072
|
problem: o,
|
|
2918
3073
|
supported: r,
|
|
2919
3074
|
blocked: ve,
|
|
2920
3075
|
mounted: s,
|
|
2921
|
-
channelKey:
|
|
2922
|
-
showInline:
|
|
3076
|
+
channelKey: y,
|
|
3077
|
+
showInline: Be,
|
|
2923
3078
|
stateClass: ge,
|
|
2924
|
-
statusText:
|
|
3079
|
+
statusText: Ee,
|
|
2925
3080
|
buttonLabel: ye,
|
|
2926
|
-
toggle:
|
|
2927
|
-
formatTime:
|
|
3081
|
+
toggle: Oe,
|
|
3082
|
+
formatTime: Ye
|
|
2928
3083
|
};
|
|
2929
3084
|
}
|
|
2930
|
-
}),
|
|
3085
|
+
}), vo = ["id"], go = {
|
|
2931
3086
|
key: 0,
|
|
2932
3087
|
class: "voice-recorder-box p-5"
|
|
2933
|
-
},
|
|
3088
|
+
}, yo = { class: "card-body" }, bo = { class: "row gx-5" }, $o = {
|
|
2934
3089
|
key: 0,
|
|
2935
3090
|
class: "col-auto mx-auto"
|
|
2936
|
-
},
|
|
3091
|
+
}, wo = { class: "col-12 text-center" }, So = { class: "row gx-5 align-items-center" }, ko = { class: "col-auto" }, Io = ["disabled", "aria-label", "aria-pressed"], Co = {
|
|
2937
3092
|
key: 0,
|
|
2938
3093
|
class: "spinner-border spinner-sm",
|
|
2939
3094
|
role: "status",
|
|
2940
3095
|
"aria-hidden": "true"
|
|
2941
|
-
},
|
|
3096
|
+
}, To = {
|
|
2942
3097
|
key: 1,
|
|
2943
3098
|
width: "18",
|
|
2944
3099
|
height: "18",
|
|
2945
3100
|
viewBox: "0 0 16 16",
|
|
2946
3101
|
fill: "currentColor",
|
|
2947
3102
|
"aria-hidden": "true"
|
|
2948
|
-
},
|
|
3103
|
+
}, Mo = {
|
|
2949
3104
|
key: 2,
|
|
2950
3105
|
width: "18",
|
|
2951
3106
|
height: "18",
|
|
@@ -2956,22 +3111,22 @@ const xa = F({
|
|
|
2956
3111
|
"stroke-linecap": "round",
|
|
2957
3112
|
"stroke-linejoin": "round",
|
|
2958
3113
|
"aria-hidden": "true"
|
|
2959
|
-
},
|
|
3114
|
+
}, Bo = { class: "col" }, Eo = { class: "flex-grow-1 text-center" }, Ao = {
|
|
2960
3115
|
class: "fw-semibold",
|
|
2961
3116
|
role: "status",
|
|
2962
3117
|
"aria-live": "polite"
|
|
2963
|
-
},
|
|
3118
|
+
}, Oo = {
|
|
2964
3119
|
class: "fg-secondary fanum",
|
|
2965
3120
|
dir: "ltr"
|
|
2966
|
-
},
|
|
3121
|
+
}, Vo = {
|
|
2967
3122
|
key: 0,
|
|
2968
3123
|
class: "col-auto"
|
|
2969
|
-
},
|
|
3124
|
+
}, Do = ["disabled", "aria-pressed"], No = {
|
|
2970
3125
|
key: 0,
|
|
2971
3126
|
class: "spinner-border spinner-sm me-2",
|
|
2972
3127
|
role: "status",
|
|
2973
3128
|
"aria-hidden": "true"
|
|
2974
|
-
},
|
|
3129
|
+
}, qo = {
|
|
2975
3130
|
key: 1,
|
|
2976
3131
|
class: "me-2",
|
|
2977
3132
|
width: "16",
|
|
@@ -2979,7 +3134,7 @@ const xa = F({
|
|
|
2979
3134
|
viewBox: "0 0 16 16",
|
|
2980
3135
|
fill: "currentColor",
|
|
2981
3136
|
"aria-hidden": "true"
|
|
2982
|
-
},
|
|
3137
|
+
}, Fo = {
|
|
2983
3138
|
key: 2,
|
|
2984
3139
|
class: "me-2",
|
|
2985
3140
|
width: "16",
|
|
@@ -2991,22 +3146,22 @@ const xa = F({
|
|
|
2991
3146
|
"stroke-linecap": "round",
|
|
2992
3147
|
"stroke-linejoin": "round",
|
|
2993
3148
|
"aria-hidden": "true"
|
|
2994
|
-
},
|
|
3149
|
+
}, Ro = {
|
|
2995
3150
|
key: 3,
|
|
2996
3151
|
class: "ms-2 fanum",
|
|
2997
3152
|
dir: "ltr"
|
|
2998
3153
|
};
|
|
2999
|
-
function
|
|
3154
|
+
function Lo(e, n, a, l, u, i) {
|
|
3000
3155
|
const t = oe("VoiceRecorderResultArea");
|
|
3001
|
-
return m(),
|
|
3156
|
+
return m(), v("div", {
|
|
3002
3157
|
ref: "root",
|
|
3003
3158
|
class: q(["voice-recorder", { "is-invalid": e.isInvalid }]),
|
|
3004
3159
|
id: e.inputId
|
|
3005
3160
|
}, [
|
|
3006
|
-
e.variant === "box" ? (m(),
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
e.showInline && e.problem ? (m(),
|
|
3161
|
+
e.variant === "box" ? (m(), v("div", go, [
|
|
3162
|
+
h("div", yo, [
|
|
3163
|
+
h("div", bo, [
|
|
3164
|
+
e.showInline && e.problem ? (m(), v("div", $o, [
|
|
3010
3165
|
Ne(t, {
|
|
3011
3166
|
for: e.channelKey,
|
|
3012
3167
|
internal: "",
|
|
@@ -3014,53 +3169,53 @@ function ko(e, n, a, l, c, i) {
|
|
|
3014
3169
|
"alert-class": "alert theme-danger p-1 text-center mb-4"
|
|
3015
3170
|
}, null, 8, ["for"])
|
|
3016
3171
|
])) : M("", !0),
|
|
3017
|
-
|
|
3018
|
-
|
|
3172
|
+
h("div", wo, [
|
|
3173
|
+
h("div", {
|
|
3019
3174
|
class: "btn btn-subtle mx-auto p-3",
|
|
3020
|
-
onClick: n[0] || (n[0] = (...
|
|
3175
|
+
onClick: n[0] || (n[0] = (...d) => e.toggle && e.toggle(...d))
|
|
3021
3176
|
}, [
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3177
|
+
h("div", So, [
|
|
3178
|
+
h("div", ko, [
|
|
3179
|
+
h("button", {
|
|
3025
3180
|
type: "button",
|
|
3026
3181
|
class: q(["btn", e.stateClass]),
|
|
3027
3182
|
disabled: e.blocked || e.starting,
|
|
3028
3183
|
"aria-label": e.buttonLabel,
|
|
3029
3184
|
"aria-pressed": e.recording
|
|
3030
3185
|
}, [
|
|
3031
|
-
e.starting ? (m(),
|
|
3032
|
-
|
|
3186
|
+
e.starting ? (m(), v("span", Co)) : e.recording ? (m(), v("svg", To, n[2] || (n[2] = [
|
|
3187
|
+
h("rect", {
|
|
3033
3188
|
x: "3.5",
|
|
3034
3189
|
y: "3.5",
|
|
3035
3190
|
width: "9",
|
|
3036
3191
|
height: "9",
|
|
3037
3192
|
rx: "1.5"
|
|
3038
3193
|
}, null, -1)
|
|
3039
|
-
]))) : (m(),
|
|
3040
|
-
|
|
3194
|
+
]))) : (m(), v("svg", Mo, n[3] || (n[3] = [
|
|
3195
|
+
h("rect", {
|
|
3041
3196
|
x: "5.5",
|
|
3042
3197
|
y: "1.5",
|
|
3043
3198
|
width: "5",
|
|
3044
3199
|
height: "8",
|
|
3045
3200
|
rx: "2.5"
|
|
3046
3201
|
}, null, -1),
|
|
3047
|
-
|
|
3202
|
+
h("path", { d: "M3 7.5a5 5 0 0 0 10 0M8 12.5v2" }, null, -1)
|
|
3048
3203
|
])))
|
|
3049
|
-
], 10,
|
|
3204
|
+
], 10, Io)
|
|
3050
3205
|
]),
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
e.maxDuration ? (m(),
|
|
3057
|
-
|
|
3206
|
+
h("div", Bo, [
|
|
3207
|
+
h("div", Eo, [
|
|
3208
|
+
h("div", Ao, V(e.statusText), 1),
|
|
3209
|
+
h("div", Oo, [
|
|
3210
|
+
x(V(e.time) + " ", 1),
|
|
3211
|
+
e.maxDuration ? (m(), v(W, { key: 0 }, [
|
|
3212
|
+
x(" / " + V(e.formatTime(e.maxDuration)), 1)
|
|
3058
3213
|
], 64)) : M("", !0)
|
|
3059
3214
|
])
|
|
3060
3215
|
])
|
|
3061
3216
|
]),
|
|
3062
|
-
e.recording ? (m(),
|
|
3063
|
-
|
|
3217
|
+
e.recording ? (m(), v("div", Vo, n[4] || (n[4] = [
|
|
3218
|
+
h("span", {
|
|
3064
3219
|
class: "spinner-grow spinner-sm fg-danger",
|
|
3065
3220
|
role: "status",
|
|
3066
3221
|
"aria-hidden": "true"
|
|
@@ -3078,42 +3233,42 @@ function ko(e, n, a, l, c, i) {
|
|
|
3078
3233
|
"show-problem": !1
|
|
3079
3234
|
}, null, 8, ["for"])) : M("", !0)
|
|
3080
3235
|
])
|
|
3081
|
-
])) : (m(),
|
|
3082
|
-
|
|
3236
|
+
])) : (m(), v(W, { key: 1 }, [
|
|
3237
|
+
h("button", {
|
|
3083
3238
|
type: "button",
|
|
3084
3239
|
disabled: e.blocked || e.starting,
|
|
3085
3240
|
"aria-pressed": e.recording,
|
|
3086
3241
|
class: q(e.stateClass),
|
|
3087
|
-
onClick: n[1] || (n[1] = (...
|
|
3242
|
+
onClick: n[1] || (n[1] = (...d) => e.toggle && e.toggle(...d))
|
|
3088
3243
|
}, [
|
|
3089
|
-
|
|
3244
|
+
L(e.$slots, "default", {
|
|
3090
3245
|
recording: e.recording,
|
|
3091
3246
|
starting: e.starting,
|
|
3092
3247
|
seconds: e.seconds,
|
|
3093
3248
|
time: e.time
|
|
3094
3249
|
}, () => [
|
|
3095
|
-
e.starting ? (m(),
|
|
3096
|
-
|
|
3250
|
+
e.starting ? (m(), v("span", No)) : e.recording ? (m(), v("svg", qo, n[5] || (n[5] = [
|
|
3251
|
+
h("rect", {
|
|
3097
3252
|
x: "3.5",
|
|
3098
3253
|
y: "3.5",
|
|
3099
3254
|
width: "9",
|
|
3100
3255
|
height: "9",
|
|
3101
3256
|
rx: "1.5"
|
|
3102
3257
|
}, null, -1)
|
|
3103
|
-
]))) : (m(),
|
|
3104
|
-
|
|
3258
|
+
]))) : (m(), v("svg", Fo, n[6] || (n[6] = [
|
|
3259
|
+
h("rect", {
|
|
3105
3260
|
x: "5.5",
|
|
3106
3261
|
y: "1.5",
|
|
3107
3262
|
width: "5",
|
|
3108
3263
|
height: "8",
|
|
3109
3264
|
rx: "2.5"
|
|
3110
3265
|
}, null, -1),
|
|
3111
|
-
|
|
3266
|
+
h("path", { d: "M3 7.5a5 5 0 0 0 10 0M8 12.5v2" }, null, -1)
|
|
3112
3267
|
]))),
|
|
3113
|
-
|
|
3114
|
-
e.recording ? (m(),
|
|
3268
|
+
x(" " + V(e.buttonLabel) + " ", 1),
|
|
3269
|
+
e.recording ? (m(), v("span", Ro, V(e.time), 1)) : M("", !0)
|
|
3115
3270
|
])
|
|
3116
|
-
], 10,
|
|
3271
|
+
], 10, Do),
|
|
3117
3272
|
e.showInline ? (m(), le(t, {
|
|
3118
3273
|
key: 0,
|
|
3119
3274
|
class: "d-block mt-2",
|
|
@@ -3122,7 +3277,7 @@ function ko(e, n, a, l, c, i) {
|
|
|
3122
3277
|
"show-list": e.showList
|
|
3123
3278
|
}, null, 8, ["for", "show-list"])) : M("", !0)
|
|
3124
3279
|
], 64)),
|
|
3125
|
-
e.resultTarget && e.mounted ? (m(), le(
|
|
3280
|
+
e.resultTarget && e.mounted ? (m(), le(Cn, {
|
|
3126
3281
|
key: 2,
|
|
3127
3282
|
to: e.resultTarget
|
|
3128
3283
|
}, [
|
|
@@ -3132,11 +3287,11 @@ function ko(e, n, a, l, c, i) {
|
|
|
3132
3287
|
"show-list": e.showList
|
|
3133
3288
|
}, null, 8, ["for", "show-list"])
|
|
3134
3289
|
], 8, ["to"])) : M("", !0)
|
|
3135
|
-
], 10,
|
|
3290
|
+
], 10, vo);
|
|
3136
3291
|
}
|
|
3137
|
-
const
|
|
3138
|
-
function
|
|
3139
|
-
const e =
|
|
3292
|
+
const jo = /* @__PURE__ */ R(ho, [["render", Lo]]);
|
|
3293
|
+
function Qo() {
|
|
3294
|
+
const e = me("form", null), n = me("formApi", null);
|
|
3140
3295
|
return {
|
|
3141
3296
|
form: e,
|
|
3142
3297
|
submit: (...a) => {
|
|
@@ -3149,83 +3304,87 @@ function Vo() {
|
|
|
3149
3304
|
}
|
|
3150
3305
|
};
|
|
3151
3306
|
}
|
|
3152
|
-
const
|
|
3153
|
-
AmountInput:
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3307
|
+
const zo = hn, Po = $n, Ko = _e, Uo = {
|
|
3308
|
+
AmountInput: Nn,
|
|
3309
|
+
ShebaInput: at,
|
|
3310
|
+
CreditCardInput: ut,
|
|
3311
|
+
CaptchaInput: Pn,
|
|
3312
|
+
VoiceRecorderInput: jo,
|
|
3313
|
+
VoiceRecorderResultArea: wn,
|
|
3314
|
+
CheckboxButtonInput: Xn,
|
|
3315
|
+
CheckboxInput: Yn,
|
|
3316
|
+
CheckboxToggle: mt,
|
|
3317
|
+
ChipsInput: wt,
|
|
3318
|
+
ComboboxInput: hn,
|
|
3319
|
+
EmailInput: Gt,
|
|
3320
|
+
FileInput: vn,
|
|
3321
|
+
FormAdornInput: _e,
|
|
3322
|
+
FormContainer: Sl,
|
|
3323
|
+
FormField: Dl,
|
|
3324
|
+
FormLabel: gn,
|
|
3325
|
+
GroupControl: yn,
|
|
3326
|
+
MobileInput: jl,
|
|
3327
|
+
MultiQuantityInput: na,
|
|
3328
|
+
OTPInput: ra,
|
|
3329
|
+
PasswordInput: ha,
|
|
3330
|
+
QuantityInput: bn,
|
|
3331
|
+
RangeInput: $n,
|
|
3332
|
+
SimpleUploader: Sa,
|
|
3333
|
+
StarRatingInput: Ba,
|
|
3334
|
+
SubmitButton: Na,
|
|
3335
|
+
SwitchInput: Pa,
|
|
3336
|
+
TextAreaInput: Xa,
|
|
3337
|
+
TextInput: ze,
|
|
3181
3338
|
// aliases
|
|
3182
|
-
Select2Input:
|
|
3183
|
-
RangeSliderInput:
|
|
3184
|
-
FormAdorn:
|
|
3185
|
-
},
|
|
3339
|
+
Select2Input: zo,
|
|
3340
|
+
RangeSliderInput: Po,
|
|
3341
|
+
FormAdorn: Ko
|
|
3342
|
+
}, Jo = {
|
|
3186
3343
|
install(e, n = {}) {
|
|
3187
|
-
(n.locale || n.messages) &&
|
|
3344
|
+
(n.locale || n.messages) && Tn(n), n.bootstrap && ht(n.bootstrap), Object.entries(Uo).forEach(([a, l]) => e.component(a, l));
|
|
3188
3345
|
}
|
|
3189
3346
|
};
|
|
3190
3347
|
export {
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
jl as
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3348
|
+
Nn as AmountInput,
|
|
3349
|
+
Pn as CaptchaInput,
|
|
3350
|
+
Xn as CheckboxButtonInput,
|
|
3351
|
+
Yn as CheckboxInput,
|
|
3352
|
+
mt as CheckboxToggle,
|
|
3353
|
+
wt as ChipsInput,
|
|
3354
|
+
hn as ComboboxInput,
|
|
3355
|
+
ut as CreditCardInput,
|
|
3356
|
+
Gt as EmailInput,
|
|
3357
|
+
vn as FileInput,
|
|
3358
|
+
Ko as FormAdorn,
|
|
3359
|
+
_e as FormAdornInput,
|
|
3360
|
+
Sl as FormContainer,
|
|
3361
|
+
Dl as FormField,
|
|
3362
|
+
gn as FormLabel,
|
|
3363
|
+
yn as GroupControl,
|
|
3364
|
+
jl as MobileInput,
|
|
3365
|
+
na as MultiQuantityInput,
|
|
3366
|
+
ra as OTPInput,
|
|
3367
|
+
ha as PasswordInput,
|
|
3368
|
+
bn as QuantityInput,
|
|
3369
|
+
$n as RangeInput,
|
|
3370
|
+
Po as RangeSliderInput,
|
|
3371
|
+
zo as Select2Input,
|
|
3372
|
+
at as ShebaInput,
|
|
3373
|
+
Sa as SimpleUploader,
|
|
3374
|
+
Ba as StarRatingInput,
|
|
3375
|
+
Na as SubmitButton,
|
|
3376
|
+
Pa as SwitchInput,
|
|
3377
|
+
Xa as TextAreaInput,
|
|
3378
|
+
ze as TextInput,
|
|
3379
|
+
jo as VoiceRecorderInput,
|
|
3380
|
+
wn as VoiceRecorderResultArea,
|
|
3381
|
+
ht as configureBootstrap,
|
|
3382
|
+
Tn as configureI18n,
|
|
3383
|
+
Jo as default,
|
|
3225
3384
|
z as fieldProps,
|
|
3226
|
-
|
|
3385
|
+
ke as toEnglishDigits,
|
|
3227
3386
|
he as useBsInstance,
|
|
3228
3387
|
Le as useDisposables,
|
|
3229
|
-
|
|
3230
|
-
|
|
3388
|
+
P as useField,
|
|
3389
|
+
Qo as useFormApi
|
|
3231
3390
|
};
|