@verdnatura/vn-front-lib 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{components-C8Wdf_CB.js → components-BsRg43XQ.js} +464 -463
- package/dist/{components-DmGc4N0k.cjs → components-DPBYRZqp.cjs} +2 -2
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/vn-front-lib.cjs +1 -1
- package/dist/vn-front-lib.css +1 -1
- package/dist/vn-front-lib.js +1 -1
- package/lib/components/models/VnForm.vue +5 -1
- package/lib/components/selects/VnSelect.vue +11 -0
- package/package.json +1 -1
|
@@ -2,14 +2,14 @@ import { n as e } from "./rolldown-runtime-B0aSnxlc.js";
|
|
|
2
2
|
import { _ as t, g as n, h as r, m as i, p as a, t as o, u as s } from "./composables-CWY0-8uj.js";
|
|
3
3
|
import { useStateStore as c } from "./stores.js";
|
|
4
4
|
import { onBeforeSave as l } from "./filters.js";
|
|
5
|
-
import { Fragment as u, Teleport as d, Transition as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as y, createVNode as b, guardReactiveProps as x, mergeModels as S, mergeProps as ee, nextTick as C, normalizeClass as w, normalizeProps as T, normalizeStyle as
|
|
6
|
-
import * as
|
|
7
|
-
import { QAvatar as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import
|
|
10
|
-
import { onBeforeRouteLeave as
|
|
5
|
+
import { Fragment as u, Teleport as d, Transition as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as y, createVNode as b, guardReactiveProps as x, mergeModels as S, mergeProps as ee, nextTick as C, normalizeClass as w, normalizeProps as T, normalizeStyle as te, onMounted as ne, onUnmounted as re, openBlock as E, ref as D, renderList as ie, renderSlot as O, toDisplayString as k, toRefs as A, unref as j, useAttrs as M, useModel as ae, vShow as N, watch as P, withCtx as F, withDirectives as oe, withKeys as I, withModifiers as se } from "vue";
|
|
6
|
+
import * as ce from "quasar";
|
|
7
|
+
import { QAvatar as le, QBtn as L, QBtnGroup as R, QCard as ue, QCardActions as z, QCardSection as B, QCheckbox as V, QChip as de, QDate as H, QDialog as U, QForm as fe, QIcon as W, QInnerLoading as pe, QInput as G, QItem as me, QItemLabel as he, QItemSection as K, QMenu as q, QSelect as ge, QSkeleton as J, QSpace as Y, QTooltip as X, date as Z, getCssVar as _e } from "quasar";
|
|
8
|
+
import { useI18n as ve } from "vue-i18n";
|
|
9
|
+
import Q from "axios";
|
|
10
|
+
import { onBeforeRouteLeave as ye, useRoute as be, useRouter as xe } from "vue-router";
|
|
11
11
|
//#region lib/components/dialogs/VnConfirm.vue?vue&type=i18n&index=0&lang.i18n
|
|
12
|
-
function
|
|
12
|
+
function Se(e) {
|
|
13
13
|
let t = e;
|
|
14
14
|
t.__i18n = t.__i18n || [], t.__i18n.push({
|
|
15
15
|
locale: "",
|
|
@@ -39,7 +39,7 @@ var $ = (e, t) => {
|
|
|
39
39
|
let n = e.__vccOpts || e;
|
|
40
40
|
for (let [e, r] of t) n[e] = r;
|
|
41
41
|
return n;
|
|
42
|
-
},
|
|
42
|
+
}, Ce = { class: "text-h6" }, we = ["innerHTML"], Te = {
|
|
43
43
|
__name: "VnConfirm",
|
|
44
44
|
props: {
|
|
45
45
|
icon: {
|
|
@@ -80,15 +80,15 @@ var $ = (e, t) => {
|
|
|
80
80
|
emits: [
|
|
81
81
|
"confirm",
|
|
82
82
|
"cancel",
|
|
83
|
-
...
|
|
83
|
+
...ce.useDialogPluginComponent.emits
|
|
84
84
|
],
|
|
85
85
|
setup(e, { expose: t, emit: n }) {
|
|
86
|
-
let { t: r } =
|
|
86
|
+
let { t: r } = ve(), i = e, a = n;
|
|
87
87
|
t({
|
|
88
88
|
show: () => o.value.show(),
|
|
89
89
|
hide: () => o.value.hide()
|
|
90
90
|
});
|
|
91
|
-
let { dialogRef: o, onDialogHide: s, onDialogOK: c, onDialogCancel: l } =
|
|
91
|
+
let { dialogRef: o, onDialogHide: s, onDialogOK: c, onDialogCancel: l } = ce.useDialogPluginComponent(), u = i.title || r("Confirm"), d = i.message || i.message !== !1 && r("Are you sure you want to continue?"), f = D(!1);
|
|
92
92
|
async function p() {
|
|
93
93
|
if (f.value = !0, i.promise) try {
|
|
94
94
|
await i.promise(i.data);
|
|
@@ -100,26 +100,26 @@ var $ = (e, t) => {
|
|
|
100
100
|
function v() {
|
|
101
101
|
a("cancel"), l();
|
|
102
102
|
}
|
|
103
|
-
return (t, n) => (
|
|
103
|
+
return (t, n) => (E(), m(j(U), {
|
|
104
104
|
ref_key: "dialogRef",
|
|
105
105
|
ref: o,
|
|
106
106
|
persistent: e.persistent,
|
|
107
|
-
onHide:
|
|
107
|
+
onHide: j(s)
|
|
108
108
|
}, {
|
|
109
|
-
default:
|
|
110
|
-
default:
|
|
111
|
-
b(
|
|
112
|
-
default:
|
|
113
|
-
e.icon ? (
|
|
109
|
+
default: F(() => [b(j(ue), { class: w(["q-pa-sm", e.cardClass]) }, {
|
|
110
|
+
default: F(() => [
|
|
111
|
+
b(j(B), { class: "row items-center q-pb-none" }, {
|
|
112
|
+
default: F(() => [
|
|
113
|
+
e.icon ? (E(), m(j(le), {
|
|
114
114
|
key: 0,
|
|
115
115
|
icon: e.icon,
|
|
116
116
|
color: "primary",
|
|
117
117
|
"text-color": "white",
|
|
118
118
|
size: "xl"
|
|
119
119
|
}, null, 8, ["icon"])) : h("", !0),
|
|
120
|
-
_("span",
|
|
121
|
-
b(
|
|
122
|
-
e.closable ? (
|
|
120
|
+
_("span", Ce, k(j(u)), 1),
|
|
121
|
+
b(j(Y)),
|
|
122
|
+
e.closable ? (E(), m(j(L), {
|
|
123
123
|
key: 1,
|
|
124
124
|
icon: "close",
|
|
125
125
|
disable: f.value,
|
|
@@ -131,43 +131,43 @@ var $ = (e, t) => {
|
|
|
131
131
|
]),
|
|
132
132
|
_: 1
|
|
133
133
|
}),
|
|
134
|
-
b(
|
|
134
|
+
b(j(B), {
|
|
135
135
|
class: "q-pb-none",
|
|
136
136
|
"data-cy": "VnConfirm_message"
|
|
137
137
|
}, {
|
|
138
|
-
default:
|
|
138
|
+
default: F(() => [j(d) === !1 ? h("", !0) : (E(), g("span", {
|
|
139
139
|
key: 0,
|
|
140
|
-
innerHTML:
|
|
141
|
-
}, null, 8,
|
|
140
|
+
innerHTML: j(d)
|
|
141
|
+
}, null, 8, we))]),
|
|
142
142
|
_: 1
|
|
143
143
|
}),
|
|
144
|
-
b(
|
|
145
|
-
default:
|
|
144
|
+
b(j(B), { class: "row items-center q-pt-none" }, {
|
|
145
|
+
default: F(() => [O(t.$slots, "custom-html", {}, void 0, !0)]),
|
|
146
146
|
_: 3
|
|
147
147
|
}),
|
|
148
|
-
t.$slots.actions ? (
|
|
148
|
+
t.$slots.actions ? (E(), m(j(z), {
|
|
149
149
|
key: 0,
|
|
150
150
|
align: "right"
|
|
151
151
|
}, {
|
|
152
|
-
default:
|
|
152
|
+
default: F(() => [O(t.$slots, "actions", { actions: {
|
|
153
153
|
confirm: p,
|
|
154
154
|
cancel: v
|
|
155
155
|
} }, void 0, !0)]),
|
|
156
156
|
_: 3
|
|
157
|
-
})) : (
|
|
157
|
+
})) : (E(), m(j(z), {
|
|
158
158
|
key: 1,
|
|
159
159
|
align: "right"
|
|
160
160
|
}, {
|
|
161
|
-
default:
|
|
162
|
-
label:
|
|
161
|
+
default: F(() => [b(j(L), {
|
|
162
|
+
label: j(r)("globals.cancel"),
|
|
163
163
|
color: "primary",
|
|
164
164
|
disable: f.value,
|
|
165
165
|
flat: "",
|
|
166
166
|
onClick: n[1] ||= (e) => v(),
|
|
167
167
|
"data-cy": "VnConfirm_cancel"
|
|
168
|
-
}, null, 8, ["label", "disable"]), b(
|
|
169
|
-
label:
|
|
170
|
-
title:
|
|
168
|
+
}, null, 8, ["label", "disable"]), b(j(L), {
|
|
169
|
+
label: j(r)("globals.confirm"),
|
|
170
|
+
title: j(r)("globals.confirm"),
|
|
171
171
|
color: "primary",
|
|
172
172
|
loading: f.value,
|
|
173
173
|
onClick: n[2] ||= (e) => p(),
|
|
@@ -188,41 +188,41 @@ var $ = (e, t) => {
|
|
|
188
188
|
}, 8, ["persistent", "onHide"]));
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
|
-
typeof
|
|
192
|
-
var
|
|
191
|
+
typeof Se == "function" && Se(Te);
|
|
192
|
+
var Ee = /*#__PURE__*/ $(Te, [["__scopeId", "data-v-087d2dc1"]]), De = { class: "row q-gutter-md q-mb-md" }, Oe = { class: "row q-gutter-md q-mb-md" }, ke = { class: "row q-gutter-md q-mb-md" }, Ae = {
|
|
193
193
|
__name: "VnSkeletonForm",
|
|
194
194
|
setup(e) {
|
|
195
|
-
return (e, t) => (
|
|
196
|
-
_("div",
|
|
195
|
+
return (e, t) => (E(), g(u, null, [
|
|
196
|
+
_("div", De, [b(j(J), {
|
|
197
197
|
type: "QInput",
|
|
198
198
|
class: "col",
|
|
199
199
|
square: ""
|
|
200
|
-
}), b(
|
|
200
|
+
}), b(j(J), {
|
|
201
201
|
type: "QInput",
|
|
202
202
|
class: "col",
|
|
203
203
|
square: ""
|
|
204
204
|
})]),
|
|
205
|
-
_("div",
|
|
205
|
+
_("div", Oe, [b(j(J), {
|
|
206
206
|
type: "QInput",
|
|
207
207
|
class: "col",
|
|
208
208
|
square: ""
|
|
209
|
-
}), b(
|
|
209
|
+
}), b(j(J), {
|
|
210
210
|
type: "QInput",
|
|
211
211
|
class: "col",
|
|
212
212
|
square: ""
|
|
213
213
|
})]),
|
|
214
|
-
_("div",
|
|
214
|
+
_("div", ke, [b(j(J), {
|
|
215
215
|
type: "QInput",
|
|
216
216
|
class: "col",
|
|
217
217
|
square: ""
|
|
218
|
-
}), b(
|
|
218
|
+
}), b(j(J), {
|
|
219
219
|
type: "QInput",
|
|
220
220
|
class: "col",
|
|
221
221
|
square: ""
|
|
222
222
|
})])
|
|
223
223
|
], 64));
|
|
224
224
|
}
|
|
225
|
-
},
|
|
225
|
+
}, je = /*#__PURE__*/ $({
|
|
226
226
|
__name: "VnSpinner",
|
|
227
227
|
props: {
|
|
228
228
|
size: {
|
|
@@ -242,21 +242,21 @@ var xe = /*#__PURE__*/ $(be, [["__scopeId", "data-v-087d2dc1"]]), Se = { class:
|
|
|
242
242
|
lg: "56px",
|
|
243
243
|
xl: "72px"
|
|
244
244
|
};
|
|
245
|
-
return (n, r) => e.noTransition ? (
|
|
245
|
+
return (n, r) => e.noTransition ? (E(), g("div", {
|
|
246
246
|
key: 1,
|
|
247
247
|
class: "vn-spinner",
|
|
248
|
-
style:
|
|
248
|
+
style: te({
|
|
249
249
|
width: t[e.size] || e.size,
|
|
250
250
|
height: t[e.size] || e.size
|
|
251
251
|
})
|
|
252
|
-
}, null, 4)) : (
|
|
252
|
+
}, null, 4)) : (E(), m(f, {
|
|
253
253
|
key: 0,
|
|
254
254
|
name: "vn-spinner-fade",
|
|
255
255
|
appear: ""
|
|
256
256
|
}, {
|
|
257
|
-
default:
|
|
257
|
+
default: F(() => [_("div", {
|
|
258
258
|
class: "vn-spinner",
|
|
259
|
-
style:
|
|
259
|
+
style: te({
|
|
260
260
|
width: t[e.size] || e.size,
|
|
261
261
|
height: t[e.size] || e.size
|
|
262
262
|
})
|
|
@@ -264,7 +264,7 @@ var xe = /*#__PURE__*/ $(be, [["__scopeId", "data-v-087d2dc1"]]), Se = { class:
|
|
|
264
264
|
_: 1
|
|
265
265
|
}));
|
|
266
266
|
}
|
|
267
|
-
}, [["__scopeId", "data-v-e5edebae"]]),
|
|
267
|
+
}, [["__scopeId", "data-v-e5edebae"]]), Me = /*#__PURE__*/ $({
|
|
268
268
|
__name: "VnDate",
|
|
269
269
|
props: {
|
|
270
270
|
modelValue: {
|
|
@@ -275,8 +275,8 @@ var xe = /*#__PURE__*/ $(be, [["__scopeId", "data-v-087d2dc1"]]), Se = { class:
|
|
|
275
275
|
},
|
|
276
276
|
emits: ["update:modelValue"],
|
|
277
277
|
setup(e) {
|
|
278
|
-
let t =
|
|
279
|
-
return (e, n) => (
|
|
278
|
+
let t = ae(e, "modelValue");
|
|
279
|
+
return (e, n) => (E(), m(j(H), {
|
|
280
280
|
modelValue: t.value,
|
|
281
281
|
"onUpdate:modelValue": n[0] ||= (e) => t.value = e,
|
|
282
282
|
"today-btn": !0,
|
|
@@ -287,7 +287,7 @@ var xe = /*#__PURE__*/ $(be, [["__scopeId", "data-v-087d2dc1"]]), Se = { class:
|
|
|
287
287
|
}, [["__scopeId", "data-v-8338d4d1"]]);
|
|
288
288
|
//#endregion
|
|
289
289
|
//#region lib/components/inputs/VnInput.vue?vue&type=i18n&index=0&lang.i18n
|
|
290
|
-
function
|
|
290
|
+
function Ne(e) {
|
|
291
291
|
let t = e;
|
|
292
292
|
t.__i18n = t.__i18n || [], t.__i18n.push({
|
|
293
293
|
locale: "",
|
|
@@ -409,7 +409,7 @@ function Oe(e) {
|
|
|
409
409
|
}
|
|
410
410
|
//#endregion
|
|
411
411
|
//#region lib/components/inputs/VnInput.vue
|
|
412
|
-
var
|
|
412
|
+
var Pe = {
|
|
413
413
|
__name: "VnInput",
|
|
414
414
|
props: /*@__PURE__*/ S({
|
|
415
415
|
isOutlined: {
|
|
@@ -450,7 +450,7 @@ var ke = {
|
|
|
450
450
|
}),
|
|
451
451
|
emits: /*@__PURE__*/ S(["remove"], ["update:modelValue"]),
|
|
452
452
|
setup(e, { expose: t, emit: r }) {
|
|
453
|
-
let i =
|
|
453
|
+
let i = M(), { isRequired: a, requiredFieldRule: o } = n(i), { t: s } = ve(), c = r, l = e, u = ae(e, "modelValue"), d = [
|
|
454
454
|
"number",
|
|
455
455
|
"search",
|
|
456
456
|
"tel",
|
|
@@ -459,7 +459,7 @@ var ke = {
|
|
|
459
459
|
], f = (e) => {
|
|
460
460
|
let t = e;
|
|
461
461
|
l.emptyToNull && t === "" && (t = null), u.value = t;
|
|
462
|
-
}, _ =
|
|
462
|
+
}, _ = D(null), x = D(!1), S = p(() => l.isOutlined ? {
|
|
463
463
|
dense: !0,
|
|
464
464
|
outlined: !0,
|
|
465
465
|
rounded: !0
|
|
@@ -484,7 +484,7 @@ var ke = {
|
|
|
484
484
|
focus: w,
|
|
485
485
|
vnInputRef: _
|
|
486
486
|
});
|
|
487
|
-
let
|
|
487
|
+
let re = p(() => [
|
|
488
488
|
o,
|
|
489
489
|
...i.rules ?? [],
|
|
490
490
|
(e) => {
|
|
@@ -493,9 +493,9 @@ var ke = {
|
|
|
493
493
|
let { min: n, max: r } = i, a = n === void 0 ? void 0 : Number(n), o = r === void 0 ? void 0 : Number(r);
|
|
494
494
|
return a !== void 0 && a >= 0 && Math.floor(e) < a ? s("inputMin", { value: a }) : o !== void 0 && o > 0 && Math.floor(e) > o ? s("inputMax", { value: o }) : !0;
|
|
495
495
|
}
|
|
496
|
-
]),
|
|
497
|
-
e.key !== "Backspace" && l.insertable && e.key.match(/[0-9]/) &&
|
|
498
|
-
},
|
|
496
|
+
]), ie = (e) => {
|
|
497
|
+
e.key !== "Backspace" && l.insertable && e.key.match(/[0-9]/) && A(e);
|
|
498
|
+
}, A = (e) => {
|
|
499
499
|
e.preventDefault();
|
|
500
500
|
let t = e.target, n = t.selectionStart, r = l.maxlength, i = u.value;
|
|
501
501
|
i ||= e.key;
|
|
@@ -503,69 +503,69 @@ var ke = {
|
|
|
503
503
|
a && !isNaN(a) && n < r && f(i.substring(0, n) + a + i.substring(n + 1)), C(() => {
|
|
504
504
|
t.setSelectionRange(n + 1, n + 1);
|
|
505
505
|
});
|
|
506
|
-
},
|
|
506
|
+
}, P = () => {
|
|
507
507
|
u.value = u.value?.toUpperCase() || "";
|
|
508
508
|
};
|
|
509
|
-
return
|
|
509
|
+
return ne(() => {
|
|
510
510
|
i.autofocus && w();
|
|
511
|
-
}), (t, n) => (
|
|
511
|
+
}), (t, n) => (E(), g("div", {
|
|
512
512
|
onMouseover: n[1] ||= (e) => x.value = !0,
|
|
513
513
|
onMouseleave: n[2] ||= (e) => x.value = !1
|
|
514
|
-
}, [b(
|
|
514
|
+
}, [b(j(G), ee({
|
|
515
515
|
ref_key: "vnInputRef",
|
|
516
516
|
ref: _,
|
|
517
|
-
"model-value":
|
|
517
|
+
"model-value": j(u),
|
|
518
518
|
"onUpdate:modelValue": f
|
|
519
519
|
}, {
|
|
520
|
-
...
|
|
520
|
+
...j(i),
|
|
521
521
|
...S.value
|
|
522
522
|
}, {
|
|
523
|
-
class: { required:
|
|
524
|
-
onKeydown:
|
|
523
|
+
class: { required: j(a) },
|
|
524
|
+
onKeydown: ie,
|
|
525
525
|
onFocus: T,
|
|
526
526
|
clearable: !1,
|
|
527
|
-
rules:
|
|
527
|
+
rules: re.value,
|
|
528
528
|
"lazy-rules": !0,
|
|
529
529
|
"hide-bottom-space": "",
|
|
530
|
-
"data-cy": (
|
|
530
|
+
"data-cy": (j(i)["data-cy"] ?? j(i).label) + "_input",
|
|
531
531
|
dense: ""
|
|
532
532
|
}), v({
|
|
533
|
-
append:
|
|
534
|
-
|
|
533
|
+
append: F(() => [
|
|
534
|
+
oe(b(j(W), {
|
|
535
535
|
name: "close",
|
|
536
536
|
size: "xs",
|
|
537
537
|
class: "cursor-pointer",
|
|
538
|
-
style:
|
|
538
|
+
style: te({ visibility: x.value && j(u) && !j(i).disabled && !j(i).readonly && l.clearable ? "visible" : "hidden" }),
|
|
539
539
|
onClick: n[0] ||= () => {
|
|
540
540
|
f(null), _.value?.focus(), c("remove");
|
|
541
541
|
}
|
|
542
542
|
}, {
|
|
543
|
-
default:
|
|
544
|
-
default:
|
|
543
|
+
default: F(() => [b(j(X), null, {
|
|
544
|
+
default: F(() => [y(k(j(s)("Remove")), 1)]),
|
|
545
545
|
_: 1
|
|
546
546
|
})]),
|
|
547
547
|
_: 1
|
|
548
|
-
}, 8, ["style"]), [[
|
|
549
|
-
!
|
|
548
|
+
}, 8, ["style"]), [[N, !e.clearOnHover || x.value]]),
|
|
549
|
+
!j(i).disabled && !j(i).readonly && l.uppercase ? (E(), m(j(W), {
|
|
550
550
|
key: 0,
|
|
551
551
|
name: "match_case",
|
|
552
552
|
size: "xs",
|
|
553
|
-
onClick:
|
|
553
|
+
onClick: P,
|
|
554
554
|
class: "uppercase-icon"
|
|
555
555
|
}, {
|
|
556
|
-
default:
|
|
557
|
-
default:
|
|
556
|
+
default: F(() => [b(j(X), null, {
|
|
557
|
+
default: F(() => [y(k(j(s)("Convert to uppercase")), 1)]),
|
|
558
558
|
_: 1
|
|
559
559
|
})]),
|
|
560
560
|
_: 1
|
|
561
561
|
})) : h("", !0),
|
|
562
|
-
t.$slots.append && !
|
|
563
|
-
e.info ? (
|
|
562
|
+
t.$slots.append && !j(i).disabled ? O(t.$slots, "append", {}, void 0, void 0, 1) : h("", !0),
|
|
563
|
+
e.info ? (E(), m(j(W), {
|
|
564
564
|
key: 2,
|
|
565
565
|
name: "info"
|
|
566
566
|
}, {
|
|
567
|
-
default:
|
|
568
|
-
default:
|
|
567
|
+
default: F(() => [b(j(X), { "max-width": "350px" }, {
|
|
568
|
+
default: F(() => [y(k(e.info), 1)]),
|
|
569
569
|
_: 1
|
|
570
570
|
})]),
|
|
571
571
|
_: 1
|
|
@@ -574,11 +574,11 @@ var ke = {
|
|
|
574
574
|
_: 2
|
|
575
575
|
}, [t.$slots.hint ? {
|
|
576
576
|
name: "hint",
|
|
577
|
-
fn:
|
|
577
|
+
fn: F(() => [O(t.$slots, "hint")]),
|
|
578
578
|
key: "0"
|
|
579
579
|
} : void 0, t.$slots.prepend ? {
|
|
580
580
|
name: "prepend",
|
|
581
|
-
fn:
|
|
581
|
+
fn: F(() => [O(t.$slots, "prepend")]),
|
|
582
582
|
key: "1"
|
|
583
583
|
} : void 0]), 1040, [
|
|
584
584
|
"model-value",
|
|
@@ -588,10 +588,10 @@ var ke = {
|
|
|
588
588
|
])], 32));
|
|
589
589
|
}
|
|
590
590
|
};
|
|
591
|
-
typeof
|
|
591
|
+
typeof Ne == "function" && Ne(Pe);
|
|
592
592
|
//#endregion
|
|
593
593
|
//#region lib/components/inputs/VnInputDate.vue?vue&type=i18n&index=0&lang.i18n
|
|
594
|
-
function
|
|
594
|
+
function Fe(e) {
|
|
595
595
|
let t = e;
|
|
596
596
|
t.__i18n = t.__i18n || [], t.__i18n.push({
|
|
597
597
|
locale: "",
|
|
@@ -617,7 +617,7 @@ function Ae(e) {
|
|
|
617
617
|
}
|
|
618
618
|
//#endregion
|
|
619
619
|
//#region lib/components/inputs/VnInputDate.vue
|
|
620
|
-
var
|
|
620
|
+
var Ie = "DD/MM/YYYY", Le = {
|
|
621
621
|
__name: "VnInputDate",
|
|
622
622
|
props: /*@__PURE__*/ S({
|
|
623
623
|
isOutlined: {
|
|
@@ -646,8 +646,8 @@ var je = "DD/MM/YYYY", Me = {
|
|
|
646
646
|
}),
|
|
647
647
|
emits: ["update:modelValue"],
|
|
648
648
|
setup(e) {
|
|
649
|
-
let t =
|
|
650
|
-
if (v.value) return Array.isArray(v.value) ? v.value.map((e) => Z.formatDate(new Date(e),
|
|
649
|
+
let t = M(), { t: r } = ve(), { isRequired: i, requiredFieldRule: a } = n(t), o = ae(e, "modelValue"), s = e, c = D(null), l = _e("negative"), u = D(""), d = D(), f = D(), _ = [a, ...t.rules ?? []], v = p(() => o.value?.neq || o.value?.nin || o.value), x = p(() => {
|
|
650
|
+
if (v.value) return Array.isArray(v.value) ? v.value.map((e) => Z.formatDate(new Date(e), Ie)).join(", ") : Z.formatDate(new Date(v.value), Ie);
|
|
651
651
|
}), S = p(() => {
|
|
652
652
|
let e = Array.isArray(v.value) ? v.value[0] : v.value;
|
|
653
653
|
return e && Z.formatDate(new Date(e), "YYYY/MM/DD");
|
|
@@ -655,19 +655,19 @@ var je = "DD/MM/YYYY", Me = {
|
|
|
655
655
|
dense: !0,
|
|
656
656
|
outlined: !0,
|
|
657
657
|
rounded: !0
|
|
658
|
-
} : {}), T =
|
|
658
|
+
} : {}), T = D(""), te = t["data-cy"] ?? t.label, ne = te + "_menu", re = te + "_inputDate", ie = (e) => {
|
|
659
659
|
if (!e && t.clearable) {
|
|
660
660
|
T.value = null, o.value = null;
|
|
661
661
|
return;
|
|
662
662
|
}
|
|
663
663
|
T.value = e.replace(/[^0-9./-]/g, "");
|
|
664
|
-
},
|
|
665
|
-
e && (T.value = e.split("/").reverse().join("/"),
|
|
664
|
+
}, O = (e) => {
|
|
665
|
+
e && (T.value = e.split("/").reverse().join("/"), A(), d.value = !1);
|
|
666
666
|
};
|
|
667
|
-
|
|
667
|
+
P(() => o.value, () => {
|
|
668
668
|
let e = Array.isArray(v.value) ? v.value[0] : v.value;
|
|
669
|
-
T.value = e ? Z.formatDate(new Date(e),
|
|
670
|
-
}, { immediate: !0 }),
|
|
669
|
+
T.value = e ? Z.formatDate(new Date(e), Ie) : "";
|
|
670
|
+
}, { immediate: !0 }), P(d, (e) => {
|
|
671
671
|
e && s.hideYearNavigation && C(() => {
|
|
672
672
|
let e = [
|
|
673
673
|
"back",
|
|
@@ -679,7 +679,7 @@ var je = "DD/MM/YYYY", Me = {
|
|
|
679
679
|
});
|
|
680
680
|
});
|
|
681
681
|
});
|
|
682
|
-
let
|
|
682
|
+
let A = () => {
|
|
683
683
|
let e = T.value;
|
|
684
684
|
if (!e || e === o.value) {
|
|
685
685
|
u.value = "";
|
|
@@ -723,7 +723,7 @@ var je = "DD/MM/YYYY", Me = {
|
|
|
723
723
|
let h = m.toISOString();
|
|
724
724
|
o.value?.neq ? o.value = { neq: h } : o.value?.nin ? o.value = { nin: [...o.value.nin, h] } : o.value = h, u.value = "";
|
|
725
725
|
}, N = (e) => {
|
|
726
|
-
|
|
726
|
+
A(), C(() => {
|
|
727
727
|
let e = new KeyboardEvent("keydown", {
|
|
728
728
|
key: "Enter",
|
|
729
729
|
code: "Enter",
|
|
@@ -733,10 +733,10 @@ var je = "DD/MM/YYYY", Me = {
|
|
|
733
733
|
c.value?.$el?.dispatchEvent(e);
|
|
734
734
|
});
|
|
735
735
|
};
|
|
736
|
-
return (n, a) => (
|
|
736
|
+
return (n, a) => (E(), g("div", {
|
|
737
737
|
onMouseover: a[8] ||= (e) => f.value = !0,
|
|
738
738
|
onMouseleave: a[9] ||= (e) => f.value = !1
|
|
739
|
-
}, [b(
|
|
739
|
+
}, [b(j(G), ee({
|
|
740
740
|
ref_key: "vnInputDateRef",
|
|
741
741
|
ref: c,
|
|
742
742
|
modelValue: T.value,
|
|
@@ -744,24 +744,24 @@ var je = "DD/MM/YYYY", Me = {
|
|
|
744
744
|
class: "vn-input-date",
|
|
745
745
|
placeholder: "dd/mm/aaaa"
|
|
746
746
|
}, {
|
|
747
|
-
...
|
|
747
|
+
...j(t),
|
|
748
748
|
...w.value
|
|
749
749
|
}, {
|
|
750
|
-
class: { required:
|
|
750
|
+
class: { required: j(i) },
|
|
751
751
|
rules: _,
|
|
752
752
|
clearable: !1,
|
|
753
753
|
"input-style": { color: u.value },
|
|
754
754
|
"input-class": { "text-strike": !!(o.value?.neq || o.value?.nin) },
|
|
755
755
|
title: x.value,
|
|
756
756
|
onClick: a[6] ||= (e) => d.value = !d.value,
|
|
757
|
-
onKeydown: [a[7] ||= (e) => d.value = !1,
|
|
758
|
-
onFocusout:
|
|
757
|
+
onKeydown: [a[7] ||= (e) => d.value = !1, I(se(N, ["prevent"]), ["enter"])],
|
|
758
|
+
onFocusout: A,
|
|
759
759
|
"hide-bottom-space": "",
|
|
760
|
-
"data-cy":
|
|
761
|
-
"onUpdate:modelValue":
|
|
760
|
+
"data-cy": re,
|
|
761
|
+
"onUpdate:modelValue": ie,
|
|
762
762
|
autocomplete: "off"
|
|
763
763
|
}), {
|
|
764
|
-
append:
|
|
764
|
+
append: F(() => [(j(t).clearable == null || j(t).clearable) && (!e.clearOnHover || f.value) && T.value && !j(t).disable ? (E(), m(j(W), {
|
|
765
765
|
key: 0,
|
|
766
766
|
name: "close",
|
|
767
767
|
size: "xs",
|
|
@@ -770,13 +770,13 @@ var je = "DD/MM/YYYY", Me = {
|
|
|
770
770
|
c.value.focus(), T.value = null, o.value = null, d.value = !1;
|
|
771
771
|
}
|
|
772
772
|
}, {
|
|
773
|
-
default:
|
|
774
|
-
default:
|
|
773
|
+
default: F(() => [b(j(X), null, {
|
|
774
|
+
default: F(() => [y(k(j(r)("Remove")), 1)]),
|
|
775
775
|
_: 1
|
|
776
776
|
})]),
|
|
777
777
|
_: 1
|
|
778
778
|
})) : h("", !0)]),
|
|
779
|
-
default:
|
|
779
|
+
default: F(() => [n.$q.screen.gt.xs ? (E(), m(j(q), {
|
|
780
780
|
key: 0,
|
|
781
781
|
"transition-show": "scale",
|
|
782
782
|
"transition-hide": "scale",
|
|
@@ -786,21 +786,21 @@ var je = "DD/MM/YYYY", Me = {
|
|
|
786
786
|
self: "top start",
|
|
787
787
|
"no-focus": !0,
|
|
788
788
|
"no-parent-event": !0,
|
|
789
|
-
"data-cy":
|
|
789
|
+
"data-cy": ne
|
|
790
790
|
}, {
|
|
791
|
-
default:
|
|
791
|
+
default: F(() => [b(Me, {
|
|
792
792
|
modelValue: S.value,
|
|
793
|
-
"onUpdate:modelValue": [a[1] ||= (e) => S.value = e,
|
|
793
|
+
"onUpdate:modelValue": [a[1] ||= (e) => S.value = e, O]
|
|
794
794
|
}, null, 8, ["modelValue"])]),
|
|
795
795
|
_: 1
|
|
796
|
-
}, 8, ["modelValue"])) : (
|
|
796
|
+
}, 8, ["modelValue"])) : (E(), m(j(U), {
|
|
797
797
|
key: 1,
|
|
798
798
|
modelValue: d.value,
|
|
799
799
|
"onUpdate:modelValue": a[4] ||= (e) => d.value = e
|
|
800
800
|
}, {
|
|
801
|
-
default:
|
|
801
|
+
default: F(() => [b(Me, {
|
|
802
802
|
modelValue: S.value,
|
|
803
|
-
"onUpdate:modelValue": [a[3] ||= (e) => S.value = e,
|
|
803
|
+
"onUpdate:modelValue": [a[3] ||= (e) => S.value = e, O]
|
|
804
804
|
}, null, 8, ["modelValue"])]),
|
|
805
805
|
_: 1
|
|
806
806
|
}, 8, ["modelValue"]))]),
|
|
@@ -815,10 +815,10 @@ var je = "DD/MM/YYYY", Me = {
|
|
|
815
815
|
])], 32));
|
|
816
816
|
}
|
|
817
817
|
};
|
|
818
|
-
typeof
|
|
818
|
+
typeof Fe == "function" && Fe(Le);
|
|
819
819
|
//#endregion
|
|
820
820
|
//#region lib/components/models/VnFetch.vue
|
|
821
|
-
var
|
|
821
|
+
var Re = {
|
|
822
822
|
__name: "VnFetch",
|
|
823
823
|
props: {
|
|
824
824
|
autoLoad: {
|
|
@@ -853,7 +853,7 @@ var Ne = {
|
|
|
853
853
|
emits: ["onFetch"],
|
|
854
854
|
setup(e, { expose: t, emit: n }) {
|
|
855
855
|
let r = e, i = n;
|
|
856
|
-
t({ fetch: a }),
|
|
856
|
+
t({ fetch: a }), ne(async () => {
|
|
857
857
|
r.autoLoad && await a();
|
|
858
858
|
});
|
|
859
859
|
async function a(e = {}) {
|
|
@@ -863,19 +863,19 @@ var Ne = {
|
|
|
863
863
|
...r.filter
|
|
864
864
|
};
|
|
865
865
|
r.where && !e.where && (t.where = r.where), r.sortBy && (t.order = r.sortBy), r.limit && (t.limit = r.limit);
|
|
866
|
-
let { data: n } = await
|
|
866
|
+
let { data: n } = await Q.get(r.url, { params: {
|
|
867
867
|
filter: JSON.stringify(t),
|
|
868
868
|
...r.params
|
|
869
869
|
} });
|
|
870
870
|
return i("onFetch", n), n;
|
|
871
871
|
} catch {}
|
|
872
872
|
}
|
|
873
|
-
return (e, t) => (
|
|
873
|
+
return (e, t) => (E(), g("template"));
|
|
874
874
|
}
|
|
875
875
|
};
|
|
876
876
|
//#endregion
|
|
877
877
|
//#region lib/utils/dataByOrder.js
|
|
878
|
-
function
|
|
878
|
+
function ze(e, t) {
|
|
879
879
|
if (typeof t == "function") return e.sort(e);
|
|
880
880
|
if (typeof t == "string" && (t = [t]), !Array.isArray(e)) return [];
|
|
881
881
|
if (Array.isArray(t)) {
|
|
@@ -887,18 +887,18 @@ function Pe(e, t) {
|
|
|
887
887
|
way: t[1] === "DESC" ? -1 : 1
|
|
888
888
|
});
|
|
889
889
|
}
|
|
890
|
-
return e.sort((e, t) =>
|
|
890
|
+
return e.sort((e, t) => Be(e, t, n));
|
|
891
891
|
}
|
|
892
892
|
return e;
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function Be(e, t, n) {
|
|
895
895
|
for (let { field: r, way: i } of n) {
|
|
896
|
-
let n =
|
|
896
|
+
let n = Ve(e[r], t[r]) * i;
|
|
897
897
|
if (n !== 0) return n;
|
|
898
898
|
}
|
|
899
899
|
return 0;
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function Ve(e, t) {
|
|
902
902
|
if (e === t) return 0;
|
|
903
903
|
let n = typeof e;
|
|
904
904
|
if (n === typeof t) switch (n) {
|
|
@@ -911,10 +911,10 @@ function Ie(e, t) {
|
|
|
911
911
|
}
|
|
912
912
|
//#endregion
|
|
913
913
|
//#region lib/components/models/VnForm.vue
|
|
914
|
-
var
|
|
914
|
+
var He = {
|
|
915
915
|
class: "column items-center full-width",
|
|
916
916
|
style: { position: "relative" }
|
|
917
|
-
},
|
|
917
|
+
}, Ue = ["textContent"], We = /*#__PURE__*/ $({
|
|
918
918
|
__name: "VnForm",
|
|
919
919
|
props: {
|
|
920
920
|
url: {
|
|
@@ -1014,6 +1014,10 @@ var Le = {
|
|
|
1014
1014
|
title: {
|
|
1015
1015
|
type: String,
|
|
1016
1016
|
default: null
|
|
1017
|
+
},
|
|
1018
|
+
responseType: {
|
|
1019
|
+
type: String,
|
|
1020
|
+
default: void 0
|
|
1017
1021
|
}
|
|
1018
1022
|
},
|
|
1019
1023
|
emits: [
|
|
@@ -1023,13 +1027,13 @@ var Le = {
|
|
|
1023
1027
|
"submit"
|
|
1024
1028
|
],
|
|
1025
1029
|
setup(e, { expose: n, emit: l }) {
|
|
1026
|
-
let { push: f } =
|
|
1030
|
+
let { push: f } = xe(), v = ce.useQuasar(), y = o(), x = c(), { t: S } = ve(), { validate: w, validations: T } = t(), { notify: te } = s(), ie = be(), A = D(null), M = e, ae = l, N = p(() => M.model ?? `formModel_${ie?.meta?.title ?? ie.name}`).value, oe = D(!1), I = i(N), le = D(!1), z = D(!1), V = D(!M.observeFormChanges), de = {}, H = p(() => y.get(N)), U = D(), W = p(() => A.value?.$el), G = p(() => ({
|
|
1027
1031
|
save: {
|
|
1028
1032
|
dataCy: "saveDefaultBtn",
|
|
1029
1033
|
color: "primary",
|
|
1030
1034
|
icon: "save",
|
|
1031
1035
|
label: "globals.save",
|
|
1032
|
-
click: async (e) =>
|
|
1036
|
+
click: async (e) => me(e),
|
|
1033
1037
|
type: "submit"
|
|
1034
1038
|
},
|
|
1035
1039
|
reset: {
|
|
@@ -1037,80 +1041,80 @@ var Le = {
|
|
|
1037
1041
|
color: "primary",
|
|
1038
1042
|
icon: "restart_alt",
|
|
1039
1043
|
label: "globals.reset",
|
|
1040
|
-
click: () =>
|
|
1044
|
+
click: () => J()
|
|
1041
1045
|
},
|
|
1042
|
-
...
|
|
1043
|
-
})),
|
|
1044
|
-
await
|
|
1046
|
+
...M.defaultButtons
|
|
1047
|
+
})), me = async (e) => {
|
|
1048
|
+
await A.value.validate() && await q(e);
|
|
1045
1049
|
};
|
|
1046
|
-
function
|
|
1047
|
-
|
|
1050
|
+
function he() {
|
|
1051
|
+
de = M.formUrl ? JSON.parse(ie?.query[M.formUrl] ?? "{}") : void 0;
|
|
1048
1052
|
}
|
|
1049
|
-
|
|
1050
|
-
!
|
|
1051
|
-
url:
|
|
1052
|
-
filter:
|
|
1053
|
-
}),
|
|
1054
|
-
...
|
|
1055
|
-
...
|
|
1056
|
-
}),
|
|
1057
|
-
t && (V.value = !
|
|
1053
|
+
ne(async () => {
|
|
1054
|
+
!I.store.url && M.url && I.setOptions({
|
|
1055
|
+
url: M.url,
|
|
1056
|
+
filter: M.filter
|
|
1057
|
+
}), he(), C(() => oe.value = !0), M.formInitialData && de && y.set(N, {
|
|
1058
|
+
...M.formInitialData,
|
|
1059
|
+
...de
|
|
1060
|
+
}), M.formInitialData || (M.autoLoad && M.url ? await K() : I.store.data && X("onFetch", { val: I.store.data })), M.observeFormChanges && P(() => U.value, (e, t) => {
|
|
1061
|
+
t && (V.value = !z.value && JSON.stringify(e) !== JSON.stringify(H.value), z.value = !1);
|
|
1058
1062
|
}, { deep: !0 });
|
|
1059
|
-
}),
|
|
1060
|
-
e && (
|
|
1061
|
-
}, { immediate: !0 }),
|
|
1062
|
-
y.set(
|
|
1063
|
-
}),
|
|
1064
|
-
e && y.set(
|
|
1063
|
+
}), M.url || P(() => I.store.data, (e) => X("onFetch", { val: e })), P(H, async (e) => {
|
|
1064
|
+
e && (U.value = JSON.parse(JSON.stringify(e))), await C(), W.value && a(W.value);
|
|
1065
|
+
}, { immediate: !0 }), P(() => [M.url, M.filter], async () => {
|
|
1066
|
+
y.set(N, null), J(), await K();
|
|
1067
|
+
}), M.formInitialData && P(() => M.formInitialData, (e) => {
|
|
1068
|
+
e && y.set(N, {
|
|
1065
1069
|
...e,
|
|
1066
|
-
...
|
|
1070
|
+
...de
|
|
1067
1071
|
});
|
|
1068
|
-
}),
|
|
1069
|
-
V.value &&
|
|
1070
|
-
component:
|
|
1072
|
+
}), ye((e, t, n) => {
|
|
1073
|
+
V.value && M.observeFormChanges ? v.dialog({
|
|
1074
|
+
component: Ee,
|
|
1071
1075
|
componentProps: {
|
|
1072
1076
|
title: S("globals.unsavedPopup.title"),
|
|
1073
1077
|
message: S("globals.unsavedPopup.subtitle"),
|
|
1074
1078
|
promise: () => n()
|
|
1075
1079
|
}
|
|
1076
1080
|
}) : n();
|
|
1077
|
-
}),
|
|
1078
|
-
if (V.value) return y.set(
|
|
1079
|
-
|
|
1081
|
+
}), re(() => {
|
|
1082
|
+
if (V.value) return y.set(N, H.value);
|
|
1083
|
+
M.clearStoreOnUnmount && y.unset(N);
|
|
1080
1084
|
});
|
|
1081
|
-
async function
|
|
1085
|
+
async function K() {
|
|
1082
1086
|
try {
|
|
1083
1087
|
let e;
|
|
1084
|
-
e =
|
|
1088
|
+
e = M.model ? (await I.addFilter({ filter: M.filter })).response?.data : (await Q.get(M.url, { params: { filter: JSON.stringify(M.filter) } })).data, Array.isArray(e) && (e = e[0] ?? {}), X("onFetch", { val: e });
|
|
1085
1089
|
} catch (e) {
|
|
1086
|
-
throw y.set(
|
|
1090
|
+
throw y.set(N, {}), e;
|
|
1087
1091
|
}
|
|
1088
1092
|
}
|
|
1089
|
-
async function
|
|
1090
|
-
if (
|
|
1091
|
-
|
|
1093
|
+
async function q() {
|
|
1094
|
+
if (M.observeFormChanges && !V.value) return te("globals.noChanges", "negative");
|
|
1095
|
+
le.value = !0;
|
|
1092
1096
|
try {
|
|
1093
|
-
|
|
1094
|
-
let e =
|
|
1095
|
-
|
|
1096
|
-
val:
|
|
1097
|
+
U.value = Z(U.value);
|
|
1098
|
+
let e = M.urlCreate ? "post" : "patch", t = e === "post" ? M.mapper(U.value) : M.mapper(U.value, H.value), n = M.urlCreate || M.urlUpdate || M.url || I.store.url, r = await Promise.resolve(M.saveFn ? M.saveFn(t) : Q[M.customMethod ?? e](n, t, { responseType: M.responseType }));
|
|
1099
|
+
M.urlCreate && te("globals.dataCreated", "positive"), V.value = !1, X("onDataSaved", {
|
|
1100
|
+
val: U.value,
|
|
1097
1101
|
res: r?.data,
|
|
1098
|
-
old:
|
|
1102
|
+
old: H.value,
|
|
1099
1103
|
rawRes: r
|
|
1100
|
-
}),
|
|
1104
|
+
}), M.reload && await I.fetch({});
|
|
1101
1105
|
} catch (e) {
|
|
1102
|
-
throw
|
|
1106
|
+
throw ae("onDataSaveFail", U.value), e;
|
|
1103
1107
|
} finally {
|
|
1104
|
-
|
|
1108
|
+
le.value = !1;
|
|
1105
1109
|
}
|
|
1106
1110
|
}
|
|
1107
|
-
async function
|
|
1108
|
-
await
|
|
1111
|
+
async function ge() {
|
|
1112
|
+
await q(!0), f({ path: M.goTo });
|
|
1109
1113
|
}
|
|
1110
|
-
function
|
|
1111
|
-
|
|
1114
|
+
function J() {
|
|
1115
|
+
U.value = JSON.parse(JSON.stringify(H.value)), X("onFetch", { val: H.value }), M.observeFormChanges && (V.value = !1, z.value = !0);
|
|
1112
1116
|
}
|
|
1113
|
-
function
|
|
1117
|
+
function Y(e, t, n) {
|
|
1114
1118
|
t(() => {
|
|
1115
1119
|
let { options: t, filterFn: r } = n;
|
|
1116
1120
|
t.value = r(t, e);
|
|
@@ -1118,98 +1122,98 @@ var Le = {
|
|
|
1118
1122
|
e.setOptionIndex(-1), e.moveOptionSelection(1, !0);
|
|
1119
1123
|
});
|
|
1120
1124
|
}
|
|
1121
|
-
async function
|
|
1125
|
+
async function X(e, { val: t, res: n, old: r, rawRes: i } = {
|
|
1122
1126
|
val: null,
|
|
1123
1127
|
res: null,
|
|
1124
1128
|
old: null,
|
|
1125
1129
|
rawRes: null
|
|
1126
1130
|
}) {
|
|
1127
|
-
y.set(
|
|
1131
|
+
y.set(N, t), M.url || (I.store.data = t), ae(e, y.get(N), n, r, U, i), W.value && a(W.value);
|
|
1128
1132
|
}
|
|
1129
|
-
function
|
|
1130
|
-
if (!
|
|
1133
|
+
function Z(e) {
|
|
1134
|
+
if (!M.defaultTrim) return e;
|
|
1131
1135
|
for (let t in e) typeof e[t] == "string" && (e[t] = e[t].trim());
|
|
1132
1136
|
return e;
|
|
1133
1137
|
}
|
|
1134
|
-
async function
|
|
1135
|
-
if (e.key === "Enter" && !
|
|
1138
|
+
async function _e(e) {
|
|
1139
|
+
if (e.key === "Enter" && !M.preventSubmit && V.value) {
|
|
1136
1140
|
let t = e.target;
|
|
1137
1141
|
if (t.type == "textarea" && e.shiftKey) {
|
|
1138
1142
|
let { selectionStart: e, selectionEnd: n } = t;
|
|
1139
1143
|
t.value = t.value.substring(0, e) + "\n" + t.value.substring(n), e = n = e + 1;
|
|
1140
1144
|
return;
|
|
1141
1145
|
}
|
|
1142
|
-
await
|
|
1146
|
+
await A.value.submit(e);
|
|
1143
1147
|
}
|
|
1144
1148
|
}
|
|
1145
1149
|
return n({
|
|
1146
|
-
submitForm:
|
|
1147
|
-
myForm:
|
|
1148
|
-
save:
|
|
1149
|
-
isLoading:
|
|
1150
|
+
submitForm: me,
|
|
1151
|
+
myForm: A,
|
|
1152
|
+
save: q,
|
|
1153
|
+
isLoading: le,
|
|
1150
1154
|
hasChanges: V,
|
|
1151
|
-
reset:
|
|
1152
|
-
fetch:
|
|
1153
|
-
formData:
|
|
1154
|
-
}), (t, n) => (
|
|
1155
|
-
showing:
|
|
1156
|
-
label:
|
|
1155
|
+
reset: J,
|
|
1156
|
+
fetch: K,
|
|
1157
|
+
formData: U
|
|
1158
|
+
}), (t, n) => (E(), g(u, null, [_("div", He, [b(j(pe), {
|
|
1159
|
+
showing: le.value,
|
|
1160
|
+
label: j(S)("globals.pleaseWait"),
|
|
1157
1161
|
color: "primary",
|
|
1158
1162
|
style: { "min-width": "100%" }
|
|
1159
1163
|
}, {
|
|
1160
|
-
default:
|
|
1164
|
+
default: F(() => [b(j(je), { size: "md" })]),
|
|
1161
1165
|
_: 1
|
|
1162
|
-
}, 8, ["showing", "label"]),
|
|
1166
|
+
}, 8, ["showing", "label"]), U.value ? (E(), m(j(fe), ee({
|
|
1163
1167
|
key: 0,
|
|
1164
1168
|
id: "vnForm"
|
|
1165
1169
|
}, t.$attrs, {
|
|
1166
1170
|
ref_key: "myForm",
|
|
1167
|
-
ref:
|
|
1168
|
-
onSubmit:
|
|
1169
|
-
onKeyup:
|
|
1170
|
-
onReset:
|
|
1171
|
+
ref: A,
|
|
1172
|
+
onSubmit: se(q, ["prevent"]),
|
|
1173
|
+
onKeyup: se(_e, ["prevent"]),
|
|
1174
|
+
onReset: J,
|
|
1171
1175
|
class: ["full-width", [e.paddingClass]],
|
|
1172
1176
|
style: {
|
|
1173
1177
|
maxWidth: e.maxWidth || "none",
|
|
1174
1178
|
width: "100%"
|
|
1175
1179
|
}
|
|
1176
1180
|
}), {
|
|
1177
|
-
default:
|
|
1178
|
-
default:
|
|
1181
|
+
default: F(() => [b(j(ue), { class: "q-pa-none" }, {
|
|
1182
|
+
default: F(() => [e.showTitle ? (E(), m(j(B), {
|
|
1179
1183
|
key: 0,
|
|
1180
1184
|
class: "vn-basic-data__header q-px-none q-pb-none"
|
|
1181
1185
|
}, {
|
|
1182
|
-
default:
|
|
1186
|
+
default: F(() => [_("span", {
|
|
1183
1187
|
class: "text-h6",
|
|
1184
|
-
textContent:
|
|
1185
|
-
}, null, 8,
|
|
1188
|
+
textContent: k(e.title || t.$t("globals.pageTitles.basicData"))
|
|
1189
|
+
}, null, 8, Ue)]),
|
|
1186
1190
|
_: 1
|
|
1187
|
-
})) : h("", !0),
|
|
1188
|
-
data:
|
|
1189
|
-
validate:
|
|
1190
|
-
validations:
|
|
1191
|
-
filter:
|
|
1192
|
-
}, void 0, !0, 1) : (
|
|
1191
|
+
})) : h("", !0), U.value ? O(t.$slots, "form", {
|
|
1192
|
+
data: U.value,
|
|
1193
|
+
validate: j(w),
|
|
1194
|
+
validations: j(T)(),
|
|
1195
|
+
filter: Y
|
|
1196
|
+
}, void 0, !0, 1) : (E(), m(j(Ae), { key: 2 }))]),
|
|
1193
1197
|
_: 3
|
|
1194
1198
|
})]),
|
|
1195
1199
|
_: 3
|
|
1196
|
-
}, 16, ["class", "style"])) : h("", !0)]),
|
|
1200
|
+
}, 16, ["class", "style"])) : h("", !0)]), M.defaultActions && j(x)?.isSubToolbarShown() && oe.value ? (E(), m(d, {
|
|
1197
1201
|
key: 0,
|
|
1198
1202
|
to: "#st-actions"
|
|
1199
|
-
}, [b(
|
|
1203
|
+
}, [b(j(R), {
|
|
1200
1204
|
push: "",
|
|
1201
1205
|
class: "q-gutter-x-sm"
|
|
1202
1206
|
}, {
|
|
1203
|
-
default:
|
|
1204
|
-
|
|
1205
|
-
b(
|
|
1206
|
-
label:
|
|
1207
|
-
color:
|
|
1208
|
-
icon:
|
|
1207
|
+
default: F(() => [
|
|
1208
|
+
O(t.$slots, "moreActions", {}, void 0, !0),
|
|
1209
|
+
b(j(L), {
|
|
1210
|
+
label: j(r)(G.value.reset.label),
|
|
1211
|
+
color: G.value.reset.color,
|
|
1212
|
+
icon: G.value.reset.icon,
|
|
1209
1213
|
flat: "",
|
|
1210
|
-
onClick:
|
|
1214
|
+
onClick: G.value.reset.click,
|
|
1211
1215
|
disable: !V.value,
|
|
1212
|
-
title:
|
|
1216
|
+
title: j(S)(G.value.reset.label),
|
|
1213
1217
|
"data-cy": "resetDefaultBtn"
|
|
1214
1218
|
}, null, 8, [
|
|
1215
1219
|
"label",
|
|
@@ -1219,15 +1223,15 @@ var Le = {
|
|
|
1219
1223
|
"disable",
|
|
1220
1224
|
"title"
|
|
1221
1225
|
]),
|
|
1222
|
-
b(
|
|
1226
|
+
b(j(L), {
|
|
1223
1227
|
"data-cy": "saveDefaultBtn",
|
|
1224
|
-
label:
|
|
1228
|
+
label: j(r)("globals.save"),
|
|
1225
1229
|
color: "primary",
|
|
1226
1230
|
icon: "save",
|
|
1227
|
-
onClick:
|
|
1231
|
+
onClick: G.value.save.click,
|
|
1228
1232
|
disable: !V.value,
|
|
1229
|
-
title:
|
|
1230
|
-
flat: !!
|
|
1233
|
+
title: j(S)(G.value.save.label),
|
|
1234
|
+
flat: !!M.goTo
|
|
1231
1235
|
}, null, 8, [
|
|
1232
1236
|
"label",
|
|
1233
1237
|
"onClick",
|
|
@@ -1235,12 +1239,12 @@ var Le = {
|
|
|
1235
1239
|
"title",
|
|
1236
1240
|
"flat"
|
|
1237
1241
|
]),
|
|
1238
|
-
|
|
1242
|
+
M.goTo ? (E(), m(j(L), {
|
|
1239
1243
|
key: 0,
|
|
1240
1244
|
"data-cy": "saveAndContinueDefaultBtn",
|
|
1241
|
-
onClick:
|
|
1242
|
-
label:
|
|
1243
|
-
title:
|
|
1245
|
+
onClick: ge,
|
|
1246
|
+
label: j(r)("globals.saveAndContinue") + " " + j(S)("globals." + M.goTo.split("/").pop()),
|
|
1247
|
+
title: j(S)("globals.saveAndContinue") + " " + j(S)("globals." + M.goTo.split("/").pop()),
|
|
1244
1248
|
disable: !V.value,
|
|
1245
1249
|
color: "primary",
|
|
1246
1250
|
icon: "save"
|
|
@@ -1253,10 +1257,10 @@ var Le = {
|
|
|
1253
1257
|
_: 3
|
|
1254
1258
|
})])) : h("", !0)], 64));
|
|
1255
1259
|
}
|
|
1256
|
-
}, [["__scopeId", "data-v-
|
|
1260
|
+
}, [["__scopeId", "data-v-cb1e841f"]]);
|
|
1257
1261
|
//#endregion
|
|
1258
1262
|
//#region lib/components/selects/VnSelect.vue?vue&type=i18n&index=0&lang.i18n
|
|
1259
|
-
function
|
|
1263
|
+
function Ge(e) {
|
|
1260
1264
|
let t = e;
|
|
1261
1265
|
t.__i18n = t.__i18n || [], t.__i18n.push({
|
|
1262
1266
|
locale: "",
|
|
@@ -1272,10 +1276,10 @@ function Be(e) {
|
|
|
1272
1276
|
}
|
|
1273
1277
|
//#endregion
|
|
1274
1278
|
//#region lib/components/selects/VnSelect.vue
|
|
1275
|
-
var
|
|
1279
|
+
var Ke = { key: 0 }, qe = ["title", "textContent"], Je = {
|
|
1276
1280
|
key: 1,
|
|
1277
1281
|
class: "no-wrap chip-scroll"
|
|
1278
|
-
},
|
|
1282
|
+
}, Ye = ["textContent"], Xe = ["textContent"], Ze = {
|
|
1279
1283
|
__name: "VnSelect",
|
|
1280
1284
|
props: {
|
|
1281
1285
|
modelValue: {
|
|
@@ -1398,46 +1402,46 @@ var Ve = { key: 0 }, He = ["title", "textContent"], Ue = {
|
|
|
1398
1402
|
"remove"
|
|
1399
1403
|
],
|
|
1400
1404
|
setup(e, { expose: t, emit: r }) {
|
|
1401
|
-
let a = r, o =
|
|
1405
|
+
let a = r, o = M(), { t: s } = ve(), c = p(() => n(o).isRequired), l = p(() => n(o).requiredFieldRule), d = e, f = [l, ...o.rules ?? []], { optionLabel: S, optionValue: w, optionCaption: re, optionFilter: ae, optionFilterValue: ce, options: le, modelValue: L } = A(d), R = D([]), ue = D([]), z = D(/* @__PURE__ */ new Map()), B = D(), H = D(), U = s("globals.noOne"), fe = D({
|
|
1402
1406
|
[w.value]: !1,
|
|
1403
1407
|
[S.value]: U
|
|
1404
|
-
}),
|
|
1408
|
+
}), pe = p(() => d.isOutlined ? {
|
|
1405
1409
|
dense: !0,
|
|
1406
1410
|
outlined: !0,
|
|
1407
1411
|
rounded: !0
|
|
1408
|
-
} : {}), G =
|
|
1412
|
+
} : {}), G = D(!1), q = D(!1), J = p(() => d.url), Y = p({
|
|
1409
1413
|
get() {
|
|
1410
1414
|
return d.modelValue;
|
|
1411
1415
|
},
|
|
1412
1416
|
set(e) {
|
|
1413
|
-
|
|
1417
|
+
$(ue.value), a("update:modelValue", e);
|
|
1414
1418
|
}
|
|
1415
|
-
}),
|
|
1419
|
+
}), Z = p(() => Array.isArray(d.modelValue) || "multiple" in o || o.isAdvanced), _e = d.dataKey ?? (d.url?.length > 0 ? d.url : o.name ?? o.label), Q = i(_e, {
|
|
1416
1420
|
url: d.url,
|
|
1417
1421
|
searchUrl: !1,
|
|
1418
1422
|
mapKey: o["map-key"]
|
|
1419
|
-
}),
|
|
1420
|
-
function
|
|
1423
|
+
}), ye = D(!1), be = p(() => d.sortBy ? d.sortBy : typeof d.optionLabel == "string" ? d.optionLabel + " ASC" : "");
|
|
1424
|
+
function xe(e) {
|
|
1421
1425
|
return typeof d.filterBuilder == "function" ? d.filterBuilder(e) : d.useLike ? { like: `%${e}%` } : e;
|
|
1422
1426
|
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
}),
|
|
1427
|
+
P(le, (e) => {
|
|
1428
|
+
$(e);
|
|
1429
|
+
}), P(L, async (e) => {
|
|
1426
1430
|
e = (e?.neq || e?.nin || e) ?? [], Array.isArray(e) || (e = [e]);
|
|
1427
|
-
for (let t of e)
|
|
1428
|
-
d.noOne &&
|
|
1429
|
-
}),
|
|
1430
|
-
for (let t of e)
|
|
1431
|
-
}),
|
|
1432
|
-
|
|
1431
|
+
for (let t of e) z.value.get(t) || await we(t, !0);
|
|
1432
|
+
d.noOne && R.value.unshift(fe.value);
|
|
1433
|
+
}), P(() => ue.value, (e) => {
|
|
1434
|
+
for (let t of e) z.value.set(t[w.value], t);
|
|
1435
|
+
}), ne(() => {
|
|
1436
|
+
$(le.value), J.value && d.modelValue && !Se() && we(d.modelValue), (d.focusOnMount || d.openOnMount) && setTimeout(() => Me(!0, d.openOnMount), 300);
|
|
1433
1437
|
});
|
|
1434
|
-
function
|
|
1435
|
-
if (d.options) return
|
|
1438
|
+
function Se() {
|
|
1439
|
+
if (d.options) return Ce(d.modelValue, d.options)?.length;
|
|
1436
1440
|
}
|
|
1437
|
-
function
|
|
1438
|
-
d.sortOptions && (e =
|
|
1441
|
+
function $(e) {
|
|
1442
|
+
d.sortOptions && (e = ze(e, be.value)), R.value = JSON.parse(JSON.stringify(e)), ue.value = JSON.parse(JSON.stringify(e)), a("update:options", e);
|
|
1439
1443
|
}
|
|
1440
|
-
function
|
|
1444
|
+
function Ce(e, t) {
|
|
1441
1445
|
let n = e?.toString()?.toLowerCase();
|
|
1442
1446
|
return n ? t.filter((e) => {
|
|
1443
1447
|
if (d.filterOptions.length) return d.filterOptions.some((t) => String(e[t]).toLowerCase().includes(n));
|
|
@@ -1446,11 +1450,11 @@ var Ve = { key: 0 }, He = ["title", "textContent"], Ue = {
|
|
|
1446
1450
|
return t.includes(n) || r.includes(n);
|
|
1447
1451
|
}) : t;
|
|
1448
1452
|
}
|
|
1449
|
-
async function
|
|
1453
|
+
async function we(e, t = !1) {
|
|
1450
1454
|
if (!d.url) return;
|
|
1451
1455
|
e && typeof e == "object" && (e = e.neq);
|
|
1452
|
-
let { fields: n, include: r, limit: i } = d, a =
|
|
1453
|
-
s = d.filterOptions.length ? d.filterOptions.reduce((t, n) => (t.or ||= [], t.or.push({ [n]:
|
|
1456
|
+
let { fields: n, include: r, limit: i } = d, a = be.value, o = ce.value ?? (t || (/* @__PURE__ */ new RegExp(/^\d+$/)).test(e) ? w.value : ae.value ?? S.value), s = {};
|
|
1457
|
+
s = d.filterOptions.length ? d.filterOptions.reduce((t, n) => (t.or ||= [], t.or.push({ [n]: xe(e) }), t), {}) : { [o]: xe(e) };
|
|
1454
1458
|
let c = d.noWhere ? {} : {
|
|
1455
1459
|
...e ? s : {},
|
|
1456
1460
|
...d.where
|
|
@@ -1461,245 +1465,242 @@ var Ve = { key: 0 }, He = ["title", "textContent"], Ue = {
|
|
|
1461
1465
|
include: r,
|
|
1462
1466
|
limit: i
|
|
1463
1467
|
};
|
|
1464
|
-
n && (l.fields = n), a && (
|
|
1468
|
+
n && (l.fields = n), a && (Q.store.order = a), q.value = !0, Q.resetPagination();
|
|
1465
1469
|
let u;
|
|
1466
1470
|
try {
|
|
1467
|
-
u = (await
|
|
1471
|
+
u = (await Q.applyFilter({
|
|
1468
1472
|
filter: l,
|
|
1469
1473
|
params: d.params ?? d.paramsBuilder?.(e)
|
|
1470
1474
|
}, { updateRouter: !1 }))?.data;
|
|
1471
1475
|
} finally {
|
|
1472
|
-
|
|
1476
|
+
q.value = !1;
|
|
1473
1477
|
}
|
|
1474
|
-
return
|
|
1478
|
+
return $(u), u;
|
|
1475
1479
|
}
|
|
1476
|
-
async function
|
|
1480
|
+
async function Te(e, t) {
|
|
1477
1481
|
let n;
|
|
1478
|
-
|
|
1479
|
-
d.noOne && U.toLowerCase().includes(e.toLowerCase()) && n.unshift(
|
|
1482
|
+
Ne(e) && (e = null), !e && H.value === e ? t() : (n = d.url && d.limit || !d.limit && Object.keys(R.value).length === 0 ? await we(e) : Ce(e, ue.value), t(() => {
|
|
1483
|
+
d.noOne && U.toLowerCase().includes(e.toLowerCase()) && n.unshift(fe.value), R.value = n;
|
|
1480
1484
|
}, (t) => {
|
|
1481
1485
|
e !== "" && t.options.length > 0 && (t.setOptionIndex(-1), t.moveOptionSelection(1, !0));
|
|
1482
|
-
})),
|
|
1486
|
+
})), H.value = e;
|
|
1483
1487
|
}
|
|
1484
|
-
function
|
|
1488
|
+
function Ee(e) {
|
|
1485
1489
|
return e ?? !0;
|
|
1486
1490
|
}
|
|
1487
|
-
async function
|
|
1488
|
-
let i =
|
|
1489
|
-
(n !== 0 || r !== 0) && (
|
|
1491
|
+
async function De({ to: e, direction: t, from: n, index: r }) {
|
|
1492
|
+
let i = R.value.length - 1;
|
|
1493
|
+
(n !== 0 || r !== 0) && (J.value || d.fetchRef) && t !== "decrease" && e === i && Q.store.hasMoreData && (await Q.loadMore(), $(Q.store.data), B.value.scrollTo(i), await C());
|
|
1490
1494
|
}
|
|
1491
1495
|
t({
|
|
1492
|
-
opts:
|
|
1493
|
-
vnSelectRef:
|
|
1494
|
-
myOptionsMap:
|
|
1496
|
+
opts: R,
|
|
1497
|
+
vnSelectRef: B,
|
|
1498
|
+
myOptionsMap: z
|
|
1495
1499
|
});
|
|
1496
|
-
function
|
|
1497
|
-
if (
|
|
1500
|
+
function Oe(e) {
|
|
1501
|
+
if (re.value !== !1) return e[re.value] || e[w.value];
|
|
1498
1502
|
}
|
|
1499
|
-
function
|
|
1503
|
+
function ke(e) {
|
|
1500
1504
|
Array.isArray(e) && (e = e[0]), e && typeof e == "object" && (e = e[w.value]);
|
|
1501
|
-
let t =
|
|
1505
|
+
let t = z.value.get(e);
|
|
1502
1506
|
return typeof S.value == "function" ? S.value(t ?? {}) : t?.[S.value] ?? e;
|
|
1503
1507
|
}
|
|
1504
|
-
function
|
|
1505
|
-
e?.code === "Enter" && (e.type === "keydown" && e.ctrlKey &&
|
|
1508
|
+
function Ae(e) {
|
|
1509
|
+
e?.code === "Enter" && (e.type === "keydown" && e.ctrlKey && Z.value ? e.stopPropagation() : e.type === "keyup" && !e.ctrlKey && (e.preventDefault(), e.stopPropagation()));
|
|
1506
1510
|
}
|
|
1507
|
-
async function
|
|
1508
|
-
(G.value || e) && (G.value = !1, await C(),
|
|
1511
|
+
async function Me(e, t) {
|
|
1512
|
+
(G.value || e) && (G.value = !1, await C(), B.value?.focus(), !ye.value && t && B.value?.showPopup());
|
|
1509
1513
|
}
|
|
1510
|
-
function
|
|
1511
|
-
return
|
|
1514
|
+
function Ne(e) {
|
|
1515
|
+
return Z.value && Array.isArray(e) && !e.length;
|
|
1512
1516
|
}
|
|
1513
|
-
return (t, n) => {
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1517
|
+
return (t, n) => (E(), m(j(ge), ee({
|
|
1518
|
+
ref_key: "vnSelectRef",
|
|
1519
|
+
ref: B,
|
|
1520
|
+
modelValue: Y.value,
|
|
1521
|
+
"onUpdate:modelValue": n[3] ||= (e) => Y.value = e,
|
|
1522
|
+
for: "vnSelectFor",
|
|
1523
|
+
options: R.value,
|
|
1524
|
+
"option-label": j(S),
|
|
1525
|
+
"option-value": j(w)
|
|
1526
|
+
}, {
|
|
1527
|
+
...j(o),
|
|
1528
|
+
...pe.value,
|
|
1529
|
+
hideSelected: G.value,
|
|
1530
|
+
useInput: G.value || !Y.value
|
|
1531
|
+
}, {
|
|
1532
|
+
onFilter: Te,
|
|
1533
|
+
"emit-value": Ee(j(o)["emit-value"]),
|
|
1534
|
+
"map-options": Ee(j(o)["map-options"]),
|
|
1535
|
+
"no-option-prefetch": "",
|
|
1536
|
+
"use-input": G.value || !Y.value,
|
|
1537
|
+
"fill-input": !1,
|
|
1538
|
+
"lazy-rules": "",
|
|
1539
|
+
class: [{ required: c.value }, "nowrap"],
|
|
1540
|
+
rules: f,
|
|
1541
|
+
"virtual-scroll-slice-size": "options.length",
|
|
1542
|
+
"hide-bottom-space": "",
|
|
1543
|
+
"input-debounce": J.value ? "300" : "0",
|
|
1544
|
+
loading: q.value,
|
|
1545
|
+
onVirtualScroll: De,
|
|
1546
|
+
onPopupHide: n[4] ||= async () => {
|
|
1547
|
+
ye.value = !1, q.value || await Me();
|
|
1548
|
+
},
|
|
1549
|
+
onPopupShow: n[5] ||= async () => {
|
|
1550
|
+
ye.value = !0, G.value = !0, await t.$nextTick(), B.value?.$el?.querySelector("input")?.focus();
|
|
1551
|
+
},
|
|
1552
|
+
onKeyup: I(Ae, ["enter"]),
|
|
1553
|
+
"data-cy": j(o).dataCy ?? j(o).label + "_select",
|
|
1554
|
+
"data-url": e.url,
|
|
1555
|
+
onBlur: n[6] ||= async () => {
|
|
1556
|
+
G.value = !1, await C();
|
|
1557
|
+
},
|
|
1558
|
+
"onUpdate:modelValue": n[7] ||= async (e) => {
|
|
1559
|
+
await Me(), Ne(e) && (Y.value = null, a("remove"));
|
|
1560
|
+
},
|
|
1561
|
+
"is-required": !1,
|
|
1562
|
+
autocomplete: "off",
|
|
1563
|
+
multiple: Z.value,
|
|
1564
|
+
onKeydownCapture: Ae
|
|
1565
|
+
}), v({
|
|
1566
|
+
append: F(() => [oe(b(j(W), {
|
|
1567
|
+
name: "close",
|
|
1568
|
+
onClick: n[0] ||= () => {
|
|
1569
|
+
Y.value = null, a("remove");
|
|
1558
1570
|
},
|
|
1559
|
-
"
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
name: "close",
|
|
1566
|
-
onClick: n[0] ||= () => {
|
|
1567
|
-
J.value = null, a("remove");
|
|
1568
|
-
},
|
|
1569
|
-
class: "cursor-pointer",
|
|
1570
|
-
size: "xs",
|
|
1571
|
-
"data-cy": P(o).dataCy ?? P(o).label + "_select_clear"
|
|
1572
|
-
}, {
|
|
1573
|
-
default: L(() => [b(r, null, {
|
|
1574
|
-
default: L(() => [y(M(P(s)("Remove")), 1)]),
|
|
1575
|
-
_: 1
|
|
1576
|
-
})]),
|
|
1571
|
+
class: "cursor-pointer",
|
|
1572
|
+
size: "xs",
|
|
1573
|
+
"data-cy": j(o).dataCy ?? j(o).label + "_select_clear"
|
|
1574
|
+
}, {
|
|
1575
|
+
default: F(() => [b(j(X), null, {
|
|
1576
|
+
default: F(() => [y(k(j(s)("Remove")), 1)]),
|
|
1577
1577
|
_: 1
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
_: 2
|
|
1589
|
-
}, 1024)) : (D(), m(l, { key: 3 }, {
|
|
1590
|
-
default: L(() => [b(d, null, {
|
|
1591
|
-
default: L(() => [y(M(t[P(S)]), 1)]),
|
|
1592
|
-
_: 2
|
|
1593
|
-
}, 1024), xe(t) === !1 ? h("", !0) : (D(), m(d, {
|
|
1594
|
-
key: 0,
|
|
1595
|
-
caption: ""
|
|
1596
|
-
}, {
|
|
1597
|
-
default: L(() => [y(M(`#${xe(t)}`), 1)]),
|
|
1598
|
-
_: 2
|
|
1599
|
-
}, 1024))]),
|
|
1578
|
+
})]),
|
|
1579
|
+
_: 1
|
|
1580
|
+
}, 8, ["data-cy"]), [[N, e.isClearable && Y.value != null && Y.value !== ""]])]),
|
|
1581
|
+
option: F(({ itemProps: e, opt: t, selected: n, toggleOption: r }) => [b(j(me), T(x(e)), {
|
|
1582
|
+
default: F(() => [typeof j(S) == "function" ? (E(), m(j(K), { key: 0 }, {
|
|
1583
|
+
default: F(() => [y(k(j(S)(t)), 1)]),
|
|
1584
|
+
_: 2
|
|
1585
|
+
}, 1024)) : typeof t == "object" ? t[j(w)] == t[j(S)] ? (E(), m(j(K), { key: 2 }, {
|
|
1586
|
+
default: F(() => [b(j(he), null, {
|
|
1587
|
+
default: F(() => [y(k(t[j(S)]), 1)]),
|
|
1600
1588
|
_: 2
|
|
1601
|
-
}, 1024))
|
|
1602
|
-
|
|
1589
|
+
}, 1024)]),
|
|
1590
|
+
_: 2
|
|
1591
|
+
}, 1024)) : (E(), m(j(K), { key: 3 }, {
|
|
1592
|
+
default: F(() => [b(j(he), null, {
|
|
1593
|
+
default: F(() => [y(k(t[j(S)]), 1)]),
|
|
1603
1594
|
_: 2
|
|
1604
|
-
}, 1024)
|
|
1605
|
-
key:
|
|
1606
|
-
|
|
1595
|
+
}, 1024), Oe(t) === !1 ? h("", !0) : (E(), m(j(he), {
|
|
1596
|
+
key: 0,
|
|
1597
|
+
caption: ""
|
|
1607
1598
|
}, {
|
|
1608
|
-
default:
|
|
1609
|
-
dense: "",
|
|
1610
|
-
"model-value": n,
|
|
1611
|
-
"onUpdate:modelValue": (e) => r(t)
|
|
1612
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"])]),
|
|
1599
|
+
default: F(() => [y(k(`#${Oe(t)}`), 1)]),
|
|
1613
1600
|
_: 2
|
|
1614
|
-
}, 1024))
|
|
1601
|
+
}, 1024))]),
|
|
1615
1602
|
_: 2
|
|
1616
|
-
},
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
}, null, 8, He)) : P(z)?.length ? (D(), g("div", Ue, [b(ne, {
|
|
1623
|
-
removable: "",
|
|
1624
|
-
dense: "",
|
|
1625
|
-
class: "vn-chip",
|
|
1626
|
-
style: E({ maxWidth: P(z).length > 1 ? "100px" : "120px" }),
|
|
1627
|
-
onRemove: n[2] ||= () => {
|
|
1628
|
-
P(z).shift(), P(z).length || (J.value = null), a("remove");
|
|
1629
|
-
},
|
|
1630
|
-
title: Se(P(z)[0]),
|
|
1631
|
-
"data-cy": "vn-select_chip"
|
|
1632
|
-
}, {
|
|
1633
|
-
default: L(() => [_("span", {
|
|
1634
|
-
class: "ellipsis",
|
|
1635
|
-
textContent: M(Se(P(z)[0]))
|
|
1636
|
-
}, null, 8, We)]),
|
|
1637
|
-
_: 1
|
|
1638
|
-
}, 8, ["style", "title"]), P(z).length > 1 ? (D(), m(ne, {
|
|
1639
|
-
key: 0,
|
|
1640
|
-
dense: "",
|
|
1641
|
-
"data-cy": "vn-select_chip-counter",
|
|
1642
|
-
class: "vn-chip q-mx-none"
|
|
1603
|
+
}, 1024)) : (E(), m(j(K), { key: 1 }, {
|
|
1604
|
+
default: F(() => [y(k(t), 1)]),
|
|
1605
|
+
_: 2
|
|
1606
|
+
}, 1024)), Z.value ? (E(), m(j(K), {
|
|
1607
|
+
key: 4,
|
|
1608
|
+
side: ""
|
|
1643
1609
|
}, {
|
|
1644
|
-
default:
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1610
|
+
default: F(() => [b(j(V), {
|
|
1611
|
+
dense: "",
|
|
1612
|
+
"model-value": n,
|
|
1613
|
+
"onUpdate:modelValue": (e) => r(t)
|
|
1614
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])]),
|
|
1615
|
+
_: 2
|
|
1616
|
+
}, 1024)) : h("", !0)]),
|
|
1617
|
+
_: 2
|
|
1618
|
+
}, 1040)]),
|
|
1619
|
+
selected: F(() => [!Z.value && j(L) != null ? (E(), g("span", {
|
|
1620
|
+
key: 0,
|
|
1621
|
+
class: "nowrap",
|
|
1622
|
+
title: ke(j(L)),
|
|
1623
|
+
textContent: k(ke(j(L)))
|
|
1624
|
+
}, null, 8, qe)) : j(L)?.length ? (E(), g("div", Je, [b(j(de), {
|
|
1625
|
+
removable: "",
|
|
1626
|
+
dense: "",
|
|
1627
|
+
class: "vn-chip",
|
|
1628
|
+
style: te({ maxWidth: j(L).length > 1 ? "100px" : "120px" }),
|
|
1629
|
+
onRemove: n[2] ||= () => {
|
|
1630
|
+
j(L).shift(), j(L).length || (Y.value = null), a("remove");
|
|
1631
|
+
},
|
|
1632
|
+
title: ke(j(L)[0]),
|
|
1633
|
+
"data-cy": "vn-select_chip"
|
|
1634
|
+
}, {
|
|
1635
|
+
default: F(() => [_("span", {
|
|
1636
|
+
class: "ellipsis",
|
|
1637
|
+
textContent: k(ke(j(L)[0]))
|
|
1638
|
+
}, null, 8, Ye)]),
|
|
1639
|
+
_: 1
|
|
1640
|
+
}, 8, ["style", "title"]), j(L).length > 1 ? (E(), m(j(de), {
|
|
1641
|
+
key: 0,
|
|
1642
|
+
dense: "",
|
|
1643
|
+
"data-cy": "vn-select_chip-counter",
|
|
1644
|
+
class: "vn-chip q-mx-none"
|
|
1645
|
+
}, {
|
|
1646
|
+
default: F(() => [y(" +" + k(j(L).length - 1) + " ", 1), b(j(X), null, {
|
|
1647
|
+
default: F(() => [(E(!0), g(u, null, ie(j(L).slice(1), (e, t) => (E(), g("div", {
|
|
1648
|
+
key: t,
|
|
1649
|
+
textContent: k(ke(e))
|
|
1650
|
+
}, null, 8, Xe))), 128))]),
|
|
1651
1651
|
_: 1
|
|
1652
|
-
})) : h("", !0)])) : h("", !0)]),
|
|
1653
|
-
loading: L(() => [b(O, {
|
|
1654
|
-
size: "xs",
|
|
1655
|
-
"data-cy": "vnSelectSpinner"
|
|
1656
1652
|
})]),
|
|
1657
|
-
_:
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1653
|
+
_: 1
|
|
1654
|
+
})) : h("", !0)])) : h("", !0)]),
|
|
1655
|
+
loading: F(() => [b(je, {
|
|
1656
|
+
size: "xs",
|
|
1657
|
+
"data-cy": "vnSelectSpinner"
|
|
1658
|
+
})]),
|
|
1659
|
+
_: 2
|
|
1660
|
+
}, [ie(t.$slots, (r, i) => ({
|
|
1661
|
+
name: i,
|
|
1662
|
+
fn: F((r) => [i == "append" ? (E(), g("div", Ke, [oe(b(j(W), {
|
|
1663
|
+
name: "close",
|
|
1664
|
+
onClick: n[1] ||= se(() => {
|
|
1665
|
+
Y.value = null, a("remove");
|
|
1666
|
+
}, ["stop"]),
|
|
1667
|
+
class: "cursor-pointer",
|
|
1668
|
+
size: "xs"
|
|
1669
|
+
}, {
|
|
1670
|
+
default: F(() => [b(j(X), null, {
|
|
1671
|
+
default: F(() => [y(k(j(s)("Remove")), 1)]),
|
|
1672
1672
|
_: 1
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1673
|
+
})]),
|
|
1674
|
+
_: 1
|
|
1675
|
+
}, 512), [[N, e.isClearable && Y.value != null && Y.value !== ""]]), t.$slots.append ? O(t.$slots, "append", T(x(r ?? {})), void 0, !0, 0) : h("", !0)])) : O(t.$slots, i, ee(r ?? {}, { key: i }), void 0, !0, 1)])
|
|
1676
|
+
}))]), 1040, [
|
|
1677
|
+
"modelValue",
|
|
1678
|
+
"options",
|
|
1679
|
+
"option-label",
|
|
1680
|
+
"option-value",
|
|
1681
|
+
"emit-value",
|
|
1682
|
+
"map-options",
|
|
1683
|
+
"use-input",
|
|
1684
|
+
"class",
|
|
1685
|
+
"input-debounce",
|
|
1686
|
+
"loading",
|
|
1687
|
+
"data-cy",
|
|
1688
|
+
"data-url",
|
|
1689
|
+
"multiple"
|
|
1690
|
+
]));
|
|
1690
1691
|
}
|
|
1691
1692
|
};
|
|
1692
|
-
typeof
|
|
1693
|
-
var
|
|
1694
|
-
VnConfirm: () =>
|
|
1695
|
-
VnDate: () =>
|
|
1696
|
-
VnFetch: () =>
|
|
1697
|
-
VnForm: () =>
|
|
1698
|
-
VnInput: () =>
|
|
1699
|
-
VnInputDate: () =>
|
|
1700
|
-
VnSelect: () =>
|
|
1701
|
-
VnSkeletonForm: () =>
|
|
1702
|
-
VnSpinner: () =>
|
|
1693
|
+
typeof Ge == "function" && Ge(Ze);
|
|
1694
|
+
var Qe = /*#__PURE__*/ $(Ze, [["__scopeId", "data-v-f1cc83a8"]]), $e = /* @__PURE__ */ e({
|
|
1695
|
+
VnConfirm: () => Ee,
|
|
1696
|
+
VnDate: () => Me,
|
|
1697
|
+
VnFetch: () => Re,
|
|
1698
|
+
VnForm: () => We,
|
|
1699
|
+
VnInput: () => Pe,
|
|
1700
|
+
VnInputDate: () => Le,
|
|
1701
|
+
VnSelect: () => Qe,
|
|
1702
|
+
VnSkeletonForm: () => Ae,
|
|
1703
|
+
VnSpinner: () => je
|
|
1703
1704
|
});
|
|
1704
1705
|
//#endregion
|
|
1705
|
-
export {
|
|
1706
|
+
export { Le as a, je as c, Re as i, Ae as l, Qe as n, Pe as o, We as r, Me as s, $e as t, Ee as u };
|