@wgalleti/primevue-components 0.24.0 → 0.26.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/crud/WCrudSubview.vue.d.ts +11 -9
- package/dist/components/crud/WEditableTable.vue.d.ts +11 -8
- package/dist/components/ui/WMapSelect.vue.d.ts +11 -1
- package/dist/{components-Cq58gFKG.js → components-B2qPV7fZ.js} +986 -968
- package/dist/components-B2qPV7fZ.js.map +1 -0
- package/dist/components-C20vwrj8.cjs +25 -0
- package/dist/components-C20vwrj8.cjs.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/primevue-components.css +1 -1
- package/package.json +1 -1
- package/dist/components-Cq58gFKG.js.map +0 -1
- package/dist/components-DfzS276S.cjs +0 -25
- package/dist/components-DfzS276S.cjs.map +0 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { a as e, f as t, l as n, n as r, o as i, r as a, t as o } from "./useFormKeyboardNav-DGbCVk4F.js";
|
|
2
2
|
import { a as s, n as c, t as l } from "./routeTabs-D6m8PuP6.js";
|
|
3
|
-
import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createSlots as g, createStaticVNode as _, createTextVNode as v, createVNode as y, defineComponent as b, guardReactiveProps as x, h as S, inject as C, isRef as w, mergeModels as T, mergeProps as E, nextTick as D, normalizeClass as O, normalizeProps as k, normalizeStyle as A, onBeforeUnmount as ee, onMounted as te, onScopeDispose as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import { routeLocationKey as
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
3
|
+
import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createSlots as g, createStaticVNode as _, createTextVNode as v, createVNode as y, defineComponent as b, guardReactiveProps as x, h as S, inject as C, isRef as w, mergeModels as T, mergeProps as E, nextTick as D, normalizeClass as O, normalizeProps as k, normalizeStyle as A, onBeforeUnmount as ee, onMounted as te, onScopeDispose as ne, openBlock as j, provide as M, reactive as N, readonly as re, ref as P, renderList as F, renderSlot as I, resolveDirective as ie, shallowRef as ae, toDisplayString as L, toRef as oe, unref as R, useModel as se, useSlots as ce, vModelText as le, vShow as ue, watch as z, withCtx as B, withDirectives as V, withKeys as H, withModifiers as U } from "vue";
|
|
4
|
+
import de from "primevue/datatable";
|
|
5
|
+
import W from "primevue/column";
|
|
6
|
+
import G from "primevue/button";
|
|
7
|
+
import K from "primevue/inputtext";
|
|
8
|
+
import fe from "primevue/inputnumber";
|
|
9
|
+
import pe from "primevue/select";
|
|
10
|
+
import q from "primevue/popover";
|
|
11
|
+
import me from "primevue/checkbox";
|
|
12
|
+
import he from "primevue/iconfield";
|
|
13
|
+
import ge from "primevue/inputicon";
|
|
14
|
+
import _e from "primevue/paginator";
|
|
15
|
+
import ve from "primevue/contextmenu";
|
|
16
|
+
import ye from "primevue/dialog";
|
|
17
|
+
import be from "primevue/tag";
|
|
18
|
+
import xe from "primevue/textarea";
|
|
19
|
+
import J from "primevue/autocomplete";
|
|
20
|
+
import Se from "primevue/toggleswitch";
|
|
21
|
+
import Ce from "primevue/colorpicker";
|
|
22
|
+
import we from "primevue/password";
|
|
23
|
+
import Te from "primevue/chip";
|
|
24
|
+
import Ee from "primevue/datepicker";
|
|
25
|
+
import De from "primevue/inputgroup";
|
|
26
|
+
import Oe from "primevue/inputgroupaddon";
|
|
27
|
+
import ke from "primevue/slider";
|
|
28
|
+
import Ae from "primevue/tree";
|
|
29
|
+
import { routeLocationKey as je, useRouter as Y } from "vue-router";
|
|
30
|
+
import X from "primevue/skeleton";
|
|
31
|
+
import Z from "markdown-it";
|
|
32
|
+
import Me from "dompurify";
|
|
33
|
+
import Ne from "markdown-it-anchor";
|
|
34
|
+
import Pe from "markdown-it-container";
|
|
35
|
+
import Fe from "markdown-it-abbr";
|
|
36
|
+
import Q from "markdown-it-deflist";
|
|
37
|
+
import Ie from "markdown-it-footnote";
|
|
38
|
+
import Le from "markdown-it-ins";
|
|
39
|
+
import Re from "markdown-it-mark";
|
|
40
|
+
import ze from "markdown-it-sub";
|
|
41
|
+
import $ from "markdown-it-sup";
|
|
42
42
|
//#region src/components/crud/WCrudColumnRenderer.vue?vue&type=script&setup=true&lang.ts
|
|
43
43
|
var Be = {
|
|
44
44
|
key: 0,
|
|
@@ -67,17 +67,17 @@ var Be = {
|
|
|
67
67
|
},
|
|
68
68
|
setup(e) {
|
|
69
69
|
let { formatDate: n, formatDateTime: r, formatCurrency: i, formatNumber: a } = t();
|
|
70
|
-
return (t, o) => e.value == null ? (
|
|
70
|
+
return (t, o) => e.value == null ? (j(), m("span", Be, "—")) : e.column.type === "image" ? (j(), m("img", {
|
|
71
71
|
key: 1,
|
|
72
72
|
src: String(e.value),
|
|
73
73
|
alt: e.column.header,
|
|
74
74
|
class: "size-9 rounded-lg object-cover ring-1 ring-surface-200 dark:ring-surface-700"
|
|
75
|
-
}, null, 8, Ve)) : e.column.type === "boolean" ? (
|
|
75
|
+
}, null, 8, Ve)) : e.column.type === "boolean" ? (j(), f(R(be), {
|
|
76
76
|
key: 2,
|
|
77
77
|
value: e.column.tagValue ? e.column.tagValue(e.value, e.rowData) : e.value ? "Ativo" : "Inativo",
|
|
78
78
|
severity: e.column.tagSeverity ? e.column.tagSeverity(e.value, e.rowData) : e.value ? "success" : "danger",
|
|
79
79
|
class: "text-xs"
|
|
80
|
-
}, null, 8, ["value", "severity"])) : e.column.type === "date" ? (
|
|
80
|
+
}, null, 8, ["value", "severity"])) : e.column.type === "date" ? (j(), m("span", He, L(R(n)(e.value)), 1)) : e.column.type === "datetime" ? (j(), m("span", Ue, L(R(r)(e.value)), 1)) : e.column.type === "currency" ? (j(), m("span", We, L(R(i)(e.value)), 1)) : e.column.type === "number" ? (j(), m("span", Ge, L(e.column.format ? e.column.format(e.value, e.rowData) : R(a)(e.value, e.column.decimals ?? 0)), 1)) : (j(), m("span", Ke, L(e.column.format ? e.column.format(e.value, e.rowData) : e.value), 1));
|
|
81
81
|
}
|
|
82
82
|
}), Je = Object.defineProperty, Ye = (e, t, n) => t in e ? Je(e, t, {
|
|
83
83
|
enumerable: !0,
|
|
@@ -385,35 +385,35 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
385
385
|
setup(t, { emit: n }) {
|
|
386
386
|
let r = c(), o = t, l = n, _ = C(s);
|
|
387
387
|
if (!_) throw Error("[wPrimeVueComponents] dataProvider não encontrado. Registre o WPrimeVuePlugin.");
|
|
388
|
-
let b = _, x = i(), { confirmDelete: S } = e(), w =
|
|
389
|
-
function
|
|
388
|
+
let b = _, x = i(), { confirmDelete: S } = e(), w = P(null), T = P([]), O = P([]), k = P(!1), ee = d(() => o.multiple ? T.value : w.value);
|
|
389
|
+
function ne(e) {
|
|
390
390
|
return e && typeof e == "object" ? e[o.optionValue] : e;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function M(e) {
|
|
393
393
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
394
394
|
for (let r of e) {
|
|
395
|
-
let e =
|
|
395
|
+
let e = ne(r);
|
|
396
396
|
t.has(e) || (t.add(e), n.push(r));
|
|
397
397
|
}
|
|
398
398
|
return n;
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function re() {
|
|
401
401
|
l("update:modelValue", o.multiple ? [...T.value] : w.value);
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function I(e) {
|
|
404
404
|
let t = e?.[o.optionLabel];
|
|
405
405
|
return t == null ? "" : String(t);
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function ae(e) {
|
|
408
408
|
if (!o.optionDescription) return "";
|
|
409
409
|
let t = e?.[o.optionDescription];
|
|
410
410
|
return t == null ? "" : String(t);
|
|
411
411
|
}
|
|
412
|
-
let
|
|
413
|
-
function
|
|
412
|
+
let oe = d(() => o.maxChips > 0 ? Math.max(0, T.value.length - o.maxChips) : 0), se = d(() => T.value.slice(o.maxChips).map(I).join(", "));
|
|
413
|
+
function ce(e, t) {
|
|
414
414
|
e?.stopPropagation?.(), t(e);
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function le() {
|
|
417
417
|
if (!o.disabled) {
|
|
418
418
|
if (o.multiple) {
|
|
419
419
|
if (!T.value.length) return;
|
|
@@ -422,62 +422,62 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
422
422
|
if (!w.value) return;
|
|
423
423
|
w.value = null;
|
|
424
424
|
}
|
|
425
|
-
|
|
425
|
+
re();
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
|
-
let
|
|
428
|
+
let ue = d(() => o.multiple && o.maxChips > 0 ? { "--w-fk-chip-max": `max(6rem, calc((100% - 6rem) / ${o.maxChips}))` } : void 0), H = d(() => !o.showClear || o.disabled ? !1 : o.multiple ? T.value.length > 0 : w.value !== null), U = null, fe = P(null);
|
|
429
429
|
te(() => {
|
|
430
430
|
o.autofocus && D(() => {
|
|
431
|
-
let e =
|
|
431
|
+
let e = fe.value?.$el?.querySelector?.("input");
|
|
432
432
|
e && (e.setAttribute("autofocus", ""), e.focus(), e.select?.());
|
|
433
433
|
});
|
|
434
434
|
});
|
|
435
|
-
function
|
|
435
|
+
function pe(e) {
|
|
436
436
|
return e == null || e === "";
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function q(e) {
|
|
439
439
|
if (e && typeof e == "object") {
|
|
440
440
|
let t = e;
|
|
441
441
|
return t.id ?? t.value ?? t;
|
|
442
442
|
}
|
|
443
443
|
return e;
|
|
444
444
|
}
|
|
445
|
-
let
|
|
445
|
+
let me = d(() => {
|
|
446
446
|
let e = o.drilldown;
|
|
447
447
|
return e ? Array.isArray(e) ? e : [e] : [];
|
|
448
|
-
}),
|
|
449
|
-
function
|
|
448
|
+
}), _e = d(() => me.value.some((e) => (e.required ?? !0) && pe(q(e.value))));
|
|
449
|
+
function ve() {
|
|
450
450
|
let e = {};
|
|
451
|
-
for (let t of
|
|
452
|
-
let n =
|
|
453
|
-
|
|
451
|
+
for (let t of me.value) {
|
|
452
|
+
let n = q(t.value);
|
|
453
|
+
pe(n) || (e[t.field] = n);
|
|
454
454
|
}
|
|
455
455
|
return e;
|
|
456
456
|
}
|
|
457
|
-
let
|
|
458
|
-
async function
|
|
457
|
+
let be = d(() => _e.value && o.blockedPlaceholder ? o.blockedPlaceholder : o.placeholder), xe = d(() => o.multiple && T.value.length ? void 0 : be.value);
|
|
458
|
+
async function Se(e) {
|
|
459
459
|
try {
|
|
460
460
|
return (await b.get(o.endpoint, e)).data;
|
|
461
461
|
} catch {
|
|
462
462
|
return null;
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
async function
|
|
466
|
-
w.value = await
|
|
465
|
+
async function Ce(e) {
|
|
466
|
+
w.value = await Se(e);
|
|
467
467
|
}
|
|
468
|
-
async function
|
|
468
|
+
async function we(e) {
|
|
469
469
|
return (await Promise.all(e.map(async (e) => {
|
|
470
470
|
if (e && typeof e == "object") {
|
|
471
471
|
let t = e;
|
|
472
472
|
if (o.optionLabel in t) return t;
|
|
473
473
|
let n = t[o.optionValue];
|
|
474
|
-
return n == null ? null : await
|
|
474
|
+
return n == null ? null : await Se(n);
|
|
475
475
|
}
|
|
476
|
-
return T.value.find((t) => t[o.optionValue] === e) ?? await
|
|
476
|
+
return T.value.find((t) => t[o.optionValue] === e) ?? await Se(e);
|
|
477
477
|
}))).filter((e) => e !== null);
|
|
478
478
|
}
|
|
479
|
-
async function
|
|
480
|
-
if (
|
|
479
|
+
async function Ee(e) {
|
|
480
|
+
if (_e.value) {
|
|
481
481
|
O.value = [];
|
|
482
482
|
return;
|
|
483
483
|
}
|
|
@@ -486,7 +486,7 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
486
486
|
let t = {
|
|
487
487
|
page_size: 20,
|
|
488
488
|
...o.endpointParams,
|
|
489
|
-
...
|
|
489
|
+
...ve()
|
|
490
490
|
};
|
|
491
491
|
e && (t.search = e);
|
|
492
492
|
let n = await b.list(o.endpoint, t);
|
|
@@ -497,28 +497,28 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
497
497
|
k.value = !1;
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function De(e) {
|
|
501
501
|
let t = e.query || "";
|
|
502
502
|
if (t.length < o.minLength) {
|
|
503
503
|
O.value = [];
|
|
504
504
|
return;
|
|
505
505
|
}
|
|
506
|
-
|
|
506
|
+
U && clearTimeout(U), U = setTimeout(() => Ee(t), 300);
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function Oe(e) {
|
|
509
509
|
o.multiple || (w.value = e.value, l("update:modelValue", e.value));
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
o.multiple && (T.value =
|
|
511
|
+
function ke(e) {
|
|
512
|
+
o.multiple && (T.value = M(Array.isArray(e) ? e : []), re());
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
o.multiple || (w.value = null,
|
|
514
|
+
function Ae() {
|
|
515
|
+
o.multiple || (w.value = null, re());
|
|
516
516
|
}
|
|
517
|
-
|
|
517
|
+
z(() => o.modelValue, async (e) => {
|
|
518
518
|
if (o.multiple) {
|
|
519
|
-
let t = e == null ? [] : Array.isArray(e) ? e : [e], n = t.map(
|
|
519
|
+
let t = e == null ? [] : Array.isArray(e) ? e : [e], n = t.map(ne), r = T.value.map((e) => e[o.optionValue]);
|
|
520
520
|
if (n.length === r.length && n.every((e, t) => e === r[t])) return;
|
|
521
|
-
T.value = await
|
|
521
|
+
T.value = await we(t);
|
|
522
522
|
return;
|
|
523
523
|
}
|
|
524
524
|
if (e != null) {
|
|
@@ -526,31 +526,31 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
526
526
|
w.value = e;
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
(!w.value || w.value[o.optionValue] !== e) && await
|
|
529
|
+
(!w.value || w.value[o.optionValue] !== e) && await Ce(e);
|
|
530
530
|
} else w.value = null;
|
|
531
531
|
}, { immediate: !0 });
|
|
532
|
-
let
|
|
533
|
-
let e =
|
|
532
|
+
let je = P(!1), Y = P([]), X = P(!1), Z = P(""), Me = P(1), Ne = P(15), Pe = P(0), Fe = P(null), Q = d(() => {
|
|
533
|
+
let e = Fe.value;
|
|
534
534
|
return e ? Array.isArray(e) ? e : [e] : [];
|
|
535
|
-
}),
|
|
535
|
+
}), Ie = P(null), Le = P(0), Re = null, ze = P({}), $ = P([]), Be = P({});
|
|
536
536
|
async function Ve() {
|
|
537
537
|
if (o.subRows) try {
|
|
538
|
-
let { map: e, columns: t } = await o.subRows(
|
|
539
|
-
|
|
538
|
+
let { map: e, columns: t } = await o.subRows(Y.value);
|
|
539
|
+
ze.value = e || {}, $.value = t || [];
|
|
540
540
|
let n = {};
|
|
541
|
-
for (let e of
|
|
541
|
+
for (let e of Y.value) {
|
|
542
542
|
let t = String(e[o.optionValue]);
|
|
543
|
-
|
|
543
|
+
ze.value[t]?.length && (n[t] = !0);
|
|
544
544
|
}
|
|
545
545
|
Be.value = n;
|
|
546
546
|
} catch {
|
|
547
|
-
|
|
547
|
+
ze.value = {}, $.value = [], Be.value = {};
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
function He(e) {
|
|
551
|
-
return
|
|
551
|
+
return ze.value[String(e[o.optionValue])] || [];
|
|
552
552
|
}
|
|
553
|
-
let Ue =
|
|
553
|
+
let Ue = P([]), We = d(() => o.crudFields?.length ? !0 : Ue.value.length > 0), Ge = d(() => o.canCreate ?? We.value), Ke = d(() => o.canEdit ?? We.value), Je = d(() => o.canDelete ?? We.value), Ye = d(() => Ke.value || Je.value), Xe = d(() => o.crudFields?.length ? o.crudFields : mt(Ue.value)), Ze = d(() => o.crudColumns?.length ? o.crudColumns : o.columns?.length ? o.columns.map((e) => ({
|
|
554
554
|
field: e.field,
|
|
555
555
|
header: e.header,
|
|
556
556
|
sortable: !0
|
|
@@ -560,55 +560,55 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
560
560
|
sortable: !0
|
|
561
561
|
}]);
|
|
562
562
|
async function Qe() {
|
|
563
|
-
if (
|
|
564
|
-
|
|
563
|
+
if (_e.value) {
|
|
564
|
+
Y.value = [], Pe.value = 0;
|
|
565
565
|
return;
|
|
566
566
|
}
|
|
567
|
-
|
|
567
|
+
X.value = !0;
|
|
568
568
|
try {
|
|
569
569
|
let e = {
|
|
570
|
-
page:
|
|
571
|
-
page_size:
|
|
570
|
+
page: Me.value,
|
|
571
|
+
page_size: Ne.value,
|
|
572
572
|
...o.endpointParams,
|
|
573
|
-
...
|
|
573
|
+
...ve()
|
|
574
574
|
};
|
|
575
|
-
|
|
575
|
+
Z.value && (e.search = Z.value), Ie.value && Le.value !== 0 && (e.ordering = Le.value === -1 ? `-${Ie.value}` : Ie.value);
|
|
576
576
|
let t = await b.list(o.endpoint, e);
|
|
577
|
-
|
|
577
|
+
Y.value = t.data, Pe.value = t.rows, Ve(), t.extras?.fields && !o.columns?.length && !o.crudFields?.length && (Ue.value = t.extras.fields);
|
|
578
578
|
} catch {
|
|
579
|
-
|
|
579
|
+
Y.value = [], Pe.value = 0;
|
|
580
580
|
} finally {
|
|
581
|
-
|
|
581
|
+
X.value = !1;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
function $e(e) {
|
|
585
585
|
e.key === "F2" && !o.disabled && (e.preventDefault(), et());
|
|
586
586
|
}
|
|
587
587
|
function et() {
|
|
588
|
-
o.disabled || (
|
|
588
|
+
o.disabled || (Z.value = "", Me.value = 1, Ie.value = null, Le.value = 0, Fe.value = o.multiple ? [...T.value] : null, je.value = !0, Qe());
|
|
589
589
|
}
|
|
590
590
|
function tt(e) {
|
|
591
|
-
|
|
591
|
+
Me.value = e.page + 1, Ne.value = e.rows, Qe();
|
|
592
592
|
}
|
|
593
593
|
function nt(e) {
|
|
594
|
-
|
|
594
|
+
Ie.value = e.sortField ?? null, Le.value = e.sortOrder ?? 0, Me.value = 1, Qe();
|
|
595
595
|
}
|
|
596
596
|
function rt() {
|
|
597
597
|
if (o.multiple) {
|
|
598
|
-
T.value =
|
|
598
|
+
T.value = M(Q.value), re(), je.value = !1;
|
|
599
599
|
return;
|
|
600
600
|
}
|
|
601
|
-
let e =
|
|
602
|
-
e && (w.value = e, l("update:modelValue", e),
|
|
601
|
+
let e = Q.value[0];
|
|
602
|
+
e && (w.value = e, l("update:modelValue", e), je.value = !1);
|
|
603
603
|
}
|
|
604
604
|
function it(e) {
|
|
605
605
|
if (o.multiple) {
|
|
606
|
-
|
|
606
|
+
Fe.value = M([...Q.value, e.data]);
|
|
607
607
|
return;
|
|
608
608
|
}
|
|
609
|
-
w.value = e.data, l("update:modelValue", e.data),
|
|
609
|
+
w.value = e.data, l("update:modelValue", e.data), je.value = !1;
|
|
610
610
|
}
|
|
611
|
-
let at =
|
|
611
|
+
let at = P(null), ot = P(null), st = "";
|
|
612
612
|
function ct() {
|
|
613
613
|
st = "", D(() => {
|
|
614
614
|
let e = at.value?.$el;
|
|
@@ -623,33 +623,33 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
623
623
|
function ut(e) {
|
|
624
624
|
if (e.key !== "Enter" || e.isComposing) return;
|
|
625
625
|
e.preventDefault();
|
|
626
|
-
let t =
|
|
626
|
+
let t = Z.value.trim();
|
|
627
627
|
if (t === "" || t === st) {
|
|
628
628
|
lt();
|
|
629
629
|
return;
|
|
630
630
|
}
|
|
631
|
-
|
|
631
|
+
Re && clearTimeout(Re), st = t, Me.value = 1, Qe();
|
|
632
632
|
}
|
|
633
633
|
function dt(e) {
|
|
634
|
-
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), (o.multiple ||
|
|
634
|
+
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), (o.multiple || Q.value.length) && rt());
|
|
635
635
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
636
|
+
z(Z, () => {
|
|
637
|
+
Re && clearTimeout(Re), Re = setTimeout(() => {
|
|
638
|
+
Me.value = 1, st = Z.value.trim(), Qe();
|
|
639
639
|
}, 300);
|
|
640
|
-
}),
|
|
641
|
-
if (
|
|
642
|
-
let n = e.some((e, n) => e !== t[n]), r = t.some((e) => !
|
|
640
|
+
}), z(() => me.value.map((e) => q(e.value)), (e, t) => {
|
|
641
|
+
if (je.value && (Me.value = 1, Qe()), !t) return;
|
|
642
|
+
let n = e.some((e, n) => e !== t[n]), r = t.some((e) => !pe(e));
|
|
643
643
|
if (!(!n || !r)) {
|
|
644
644
|
if (o.multiple) {
|
|
645
645
|
if (!T.value.length) return;
|
|
646
|
-
T.value = [],
|
|
646
|
+
T.value = [], re();
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
649
|
w.value && (w.value = null, l("update:modelValue", null));
|
|
650
650
|
}
|
|
651
651
|
});
|
|
652
|
-
let ft =
|
|
652
|
+
let ft = P(!1), pt = P(!1), ht = P(null), gt = N({}), Ot = d(() => ht.value !== null), kt = d(() => Ot.value ? "Editar Registro" : "Novo Registro");
|
|
653
653
|
function At() {
|
|
654
654
|
let e = {};
|
|
655
655
|
for (let t of Xe.value) e[t.field] = t.defaultValue === void 0 ? null : typeof t.defaultValue == "function" ? t.defaultValue() : t.defaultValue;
|
|
@@ -686,17 +686,17 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
686
686
|
if (Ot.value && ht.value) {
|
|
687
687
|
let n = ht.value[o.optionValue];
|
|
688
688
|
t = await b.update(o.endpoint, n, e);
|
|
689
|
-
let r =
|
|
690
|
-
r !== -1 && (
|
|
689
|
+
let r = Y.value.findIndex((e) => e[o.optionValue] === n);
|
|
690
|
+
r !== -1 && (Y.value[r] = t.data), x.success("Registro atualizado com sucesso");
|
|
691
691
|
} else {
|
|
692
|
-
let n =
|
|
692
|
+
let n = ve();
|
|
693
693
|
for (let [t, r] of Object.entries(n)) {
|
|
694
694
|
let n = e[t];
|
|
695
695
|
(n == null || n === "") && (e[t] = r);
|
|
696
696
|
}
|
|
697
|
-
t = await b.create(o.endpoint, e),
|
|
697
|
+
t = await b.create(o.endpoint, e), Y.value.unshift(t.data), Pe.value++, x.success("Registro criado com sucesso");
|
|
698
698
|
}
|
|
699
|
-
ft.value = !1, ht.value = null,
|
|
699
|
+
ft.value = !1, ht.value = null, Fe.value = o.multiple ? M([...Q.value, t.data]) : t.data;
|
|
700
700
|
} catch (e) {
|
|
701
701
|
x.error(a(e, "Erro ao salvar registro"));
|
|
702
702
|
} finally {
|
|
@@ -708,67 +708,67 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
708
708
|
try {
|
|
709
709
|
let t = e[o.optionValue];
|
|
710
710
|
await b.delete(o.endpoint, t);
|
|
711
|
-
let n =
|
|
712
|
-
n !== -1 && (
|
|
711
|
+
let n = Y.value.findIndex((e) => e[o.optionValue] === t);
|
|
712
|
+
n !== -1 && (Y.value.splice(n, 1), Pe.value--), o.multiple ? (T.value.some((e) => e[o.optionValue] === t) && (T.value = T.value.filter((e) => e[o.optionValue] !== t), re()), Fe.value = Q.value.filter((e) => e[o.optionValue] !== t)) : (w.value && w.value[o.optionValue] === t && (w.value = null, l("update:modelValue", null)), Q.value[0]?.[o.optionValue] === t && (Fe.value = null)), x.success("Registro excluído com sucesso");
|
|
713
713
|
} catch (e) {
|
|
714
714
|
x.error(a(e, "Erro ao excluir registro"));
|
|
715
715
|
}
|
|
716
716
|
});
|
|
717
717
|
}
|
|
718
718
|
return (e, n) => {
|
|
719
|
-
let i =
|
|
720
|
-
return
|
|
719
|
+
let i = ie("tooltip");
|
|
720
|
+
return j(), m(u, null, [
|
|
721
721
|
h("div", E({
|
|
722
|
-
class: ["w-autocompletefk", { "w-autocompletefk-has-clear":
|
|
723
|
-
style:
|
|
722
|
+
class: ["w-autocompletefk", { "w-autocompletefk-has-clear": H.value }],
|
|
723
|
+
style: ue.value
|
|
724
724
|
}, e.$attrs), [
|
|
725
|
-
y(R(
|
|
725
|
+
y(R(J), {
|
|
726
726
|
ref_key: "acRef",
|
|
727
|
-
ref:
|
|
727
|
+
ref: fe,
|
|
728
728
|
"model-value": ee.value,
|
|
729
729
|
suggestions: O.value,
|
|
730
730
|
multiple: t.multiple,
|
|
731
731
|
"option-label": t.optionLabel,
|
|
732
|
-
placeholder:
|
|
732
|
+
placeholder: xe.value,
|
|
733
733
|
disabled: t.disabled,
|
|
734
734
|
"force-selection": t.forceSelection,
|
|
735
735
|
loading: k.value,
|
|
736
736
|
"show-clear": !1,
|
|
737
737
|
fluid: "",
|
|
738
|
-
onComplete:
|
|
739
|
-
onItemSelect:
|
|
740
|
-
"onUpdate:modelValue":
|
|
741
|
-
onClear:
|
|
738
|
+
onComplete: De,
|
|
739
|
+
onItemSelect: Oe,
|
|
740
|
+
"onUpdate:modelValue": ke,
|
|
741
|
+
onClear: Ae,
|
|
742
742
|
onKeydown: $e
|
|
743
743
|
}, g({ _: 2 }, [t.optionDescription ? {
|
|
744
744
|
name: "option",
|
|
745
|
-
fn:
|
|
745
|
+
fn: B(({ option: e }) => [h("span", vt, [h("span", yt, L(I(e)), 1), ae(e) ? (j(), m("span", bt, L(ae(e)), 1)) : p("", !0)])]),
|
|
746
746
|
key: "0"
|
|
747
747
|
} : void 0, t.multiple ? {
|
|
748
748
|
name: "chip",
|
|
749
|
-
fn:
|
|
749
|
+
fn: B(({ value: e, index: n, removeCallback: r }) => [!t.maxChips || n < t.maxChips ? V((j(), f(R(Te), {
|
|
750
750
|
key: 0,
|
|
751
751
|
class: "p-autocomplete-chip w-autocompletefk-chip",
|
|
752
|
-
label:
|
|
752
|
+
label: I(e),
|
|
753
753
|
removable: "",
|
|
754
754
|
onClick: et,
|
|
755
|
-
onRemove: (e) =>
|
|
755
|
+
onRemove: (e) => ce(e, r)
|
|
756
756
|
}, null, 8, ["label", "onRemove"])), [[
|
|
757
757
|
i,
|
|
758
|
-
|
|
758
|
+
I(e),
|
|
759
759
|
void 0,
|
|
760
760
|
{ top: !0 }
|
|
761
|
-
]]) : n === t.maxChips ?
|
|
761
|
+
]]) : n === t.maxChips ? V((j(), f(R(Te), {
|
|
762
762
|
key: 1,
|
|
763
763
|
class: "p-autocomplete-chip w-autocompletefk-chip w-autocompletefk-chip-more",
|
|
764
|
-
label: `+${
|
|
764
|
+
label: `+${oe.value}`,
|
|
765
765
|
onClick: et
|
|
766
766
|
}, null, 8, ["label"])), [[
|
|
767
767
|
i,
|
|
768
|
-
|
|
768
|
+
se.value,
|
|
769
769
|
void 0,
|
|
770
770
|
{ top: !0 }
|
|
771
|
-
]]) : (
|
|
771
|
+
]]) : (j(), m("span", xt))]),
|
|
772
772
|
key: "1"
|
|
773
773
|
} : void 0]), 1032, [
|
|
774
774
|
"model-value",
|
|
@@ -780,20 +780,20 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
780
780
|
"force-selection",
|
|
781
781
|
"loading"
|
|
782
782
|
]),
|
|
783
|
-
|
|
783
|
+
H.value ? V((j(), m("button", {
|
|
784
784
|
key: 0,
|
|
785
785
|
type: "button",
|
|
786
786
|
"data-kbd-skip": "",
|
|
787
787
|
tabindex: "-1",
|
|
788
788
|
class: "w-autocompletefk-clear",
|
|
789
|
-
onClick:
|
|
789
|
+
onClick: le
|
|
790
790
|
}, [...n[7] ||= [h("i", { class: "pi pi-times" }, null, -1)]])), [[
|
|
791
791
|
i,
|
|
792
792
|
"Limpar",
|
|
793
793
|
void 0,
|
|
794
794
|
{ top: !0 }
|
|
795
795
|
]]) : p("", !0),
|
|
796
|
-
|
|
796
|
+
V((j(), m("button", {
|
|
797
797
|
type: "button",
|
|
798
798
|
disabled: t.disabled,
|
|
799
799
|
"data-kbd-skip": "",
|
|
@@ -807,9 +807,9 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
807
807
|
{ top: !0 }
|
|
808
808
|
]])
|
|
809
809
|
], 16),
|
|
810
|
-
y(R(
|
|
811
|
-
visible:
|
|
812
|
-
"onUpdate:visible": n[5] ||= (e) =>
|
|
810
|
+
y(R(ye), {
|
|
811
|
+
visible: je.value,
|
|
812
|
+
"onUpdate:visible": n[5] ||= (e) => je.value = e,
|
|
813
813
|
"append-to": R(r)?.hostEl.value ?? "body",
|
|
814
814
|
header: t.dialogHeader || "Pesquisar",
|
|
815
815
|
style: { width: "80vw" },
|
|
@@ -818,30 +818,30 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
818
818
|
class: "w-autocompletefk-dialog",
|
|
819
819
|
onShow: ct
|
|
820
820
|
}, {
|
|
821
|
-
footer:
|
|
821
|
+
footer: B(() => [h("div", Dt, [y(R(G), {
|
|
822
822
|
label: "Cancelar",
|
|
823
823
|
severity: "secondary",
|
|
824
824
|
text: "",
|
|
825
|
-
onClick: n[4] ||= (e) =>
|
|
826
|
-
}), y(R(
|
|
827
|
-
label: t.multiple &&
|
|
825
|
+
onClick: n[4] ||= (e) => je.value = !1
|
|
826
|
+
}), y(R(G), {
|
|
827
|
+
label: t.multiple && Q.value.length ? `Selecionar (${Q.value.length})` : "Selecionar",
|
|
828
828
|
icon: "pi pi-check",
|
|
829
|
-
disabled: !t.multiple && !
|
|
829
|
+
disabled: !t.multiple && !Q.value.length,
|
|
830
830
|
onClick: rt
|
|
831
831
|
}, null, 8, ["label", "disabled"])])]),
|
|
832
|
-
default:
|
|
833
|
-
default:
|
|
832
|
+
default: B(() => [h("div", Ct, [y(R(he), { class: "w-autocompletefk-toolbar-search" }, {
|
|
833
|
+
default: B(() => [y(R(ge), { class: "pi pi-search" }), y(R(K), {
|
|
834
834
|
ref_key: "modalSearchInput",
|
|
835
835
|
ref: at,
|
|
836
|
-
modelValue:
|
|
837
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
836
|
+
modelValue: Z.value,
|
|
837
|
+
"onUpdate:modelValue": n[0] ||= (e) => Z.value = e,
|
|
838
838
|
placeholder: "Pesquisar...",
|
|
839
839
|
class: "w-full",
|
|
840
840
|
autofocus: "",
|
|
841
841
|
onKeydown: ut
|
|
842
842
|
}, null, 8, ["modelValue"])]),
|
|
843
843
|
_: 1
|
|
844
|
-
}), h("div", wt, [Ge.value ? (
|
|
844
|
+
}), h("div", wt, [Ge.value ? (j(), f(R(G), {
|
|
845
845
|
key: 0,
|
|
846
846
|
label: "Novo",
|
|
847
847
|
icon: "pi pi-plus",
|
|
@@ -851,23 +851,23 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
851
851
|
ref_key: "modalTableWrap",
|
|
852
852
|
ref: ot,
|
|
853
853
|
onKeydownCapture: dt
|
|
854
|
-
}, [y(R(
|
|
855
|
-
selection:
|
|
856
|
-
"onUpdate:selection": n[1] ||= (e) =>
|
|
854
|
+
}, [y(R(de), {
|
|
855
|
+
selection: Fe.value,
|
|
856
|
+
"onUpdate:selection": n[1] ||= (e) => Fe.value = e,
|
|
857
857
|
"expanded-rows": Be.value,
|
|
858
858
|
"onUpdate:expandedRows": n[2] ||= (e) => Be.value = e,
|
|
859
859
|
"meta-key-selection": !1,
|
|
860
|
-
value:
|
|
861
|
-
loading:
|
|
860
|
+
value: Y.value,
|
|
861
|
+
loading: X.value,
|
|
862
862
|
paginator: "",
|
|
863
863
|
lazy: "",
|
|
864
864
|
"striped-rows": "",
|
|
865
865
|
"removable-sort": "",
|
|
866
866
|
size: "small",
|
|
867
|
-
rows:
|
|
868
|
-
"total-records":
|
|
869
|
-
"sort-field":
|
|
870
|
-
"sort-order":
|
|
867
|
+
rows: Ne.value,
|
|
868
|
+
"total-records": Pe.value,
|
|
869
|
+
"sort-field": Ie.value ?? void 0,
|
|
870
|
+
"sort-order": Le.value,
|
|
871
871
|
"selection-mode": t.multiple ? "multiple" : "single",
|
|
872
872
|
"data-key": t.optionValue,
|
|
873
873
|
onPage: tt,
|
|
@@ -877,20 +877,20 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
877
877
|
}),
|
|
878
878
|
onRowDblclick: it
|
|
879
879
|
}, g({
|
|
880
|
-
empty:
|
|
881
|
-
default:
|
|
882
|
-
y(R(
|
|
880
|
+
empty: B(() => [n[9] ||= h("div", { class: "w-autocompletefk-empty" }, "Nenhum registro encontrado", -1)]),
|
|
881
|
+
default: B(() => [
|
|
882
|
+
y(R(W), {
|
|
883
883
|
"selection-mode": t.multiple ? "multiple" : "single",
|
|
884
884
|
"header-style": "width: 3rem"
|
|
885
885
|
}, null, 8, ["selection-mode"]),
|
|
886
|
-
(
|
|
886
|
+
(j(!0), m(u, null, F(Ze.value, (e) => (j(), f(R(W), {
|
|
887
887
|
key: e.field,
|
|
888
888
|
field: e.field,
|
|
889
889
|
header: e.header,
|
|
890
890
|
sortable: e.sortable ?? !0,
|
|
891
891
|
style: A(e.style)
|
|
892
892
|
}, {
|
|
893
|
-
body:
|
|
893
|
+
body: B(({ data: t }) => [e.type ? (j(), f(qe, {
|
|
894
894
|
key: 0,
|
|
895
895
|
column: e,
|
|
896
896
|
value: t[e.field],
|
|
@@ -899,7 +899,7 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
899
899
|
"column",
|
|
900
900
|
"value",
|
|
901
901
|
"row-data"
|
|
902
|
-
])) : (
|
|
902
|
+
])) : (j(), m(u, { key: 1 }, [v(L(t[e.field]), 1)], 64))]),
|
|
903
903
|
_: 2
|
|
904
904
|
}, 1032, [
|
|
905
905
|
"field",
|
|
@@ -907,12 +907,12 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
907
907
|
"sortable",
|
|
908
908
|
"style"
|
|
909
909
|
]))), 128)),
|
|
910
|
-
Ye.value ? (
|
|
910
|
+
Ye.value ? (j(), f(R(W), {
|
|
911
911
|
key: 0,
|
|
912
912
|
header: "",
|
|
913
913
|
style: { width: "6rem" }
|
|
914
914
|
}, {
|
|
915
|
-
body:
|
|
915
|
+
body: B(({ data: e }) => [h("div", Tt, [Ke.value ? V((j(), f(R(G), {
|
|
916
916
|
key: 0,
|
|
917
917
|
icon: "pi pi-pencil",
|
|
918
918
|
text: "",
|
|
@@ -924,7 +924,7 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
924
924
|
"Editar",
|
|
925
925
|
void 0,
|
|
926
926
|
{ top: !0 }
|
|
927
|
-
]]) : p("", !0), Je.value ?
|
|
927
|
+
]]) : p("", !0), Je.value ? V((j(), f(R(G), {
|
|
928
928
|
key: 1,
|
|
929
929
|
icon: "pi pi-trash",
|
|
930
930
|
text: "",
|
|
@@ -944,7 +944,7 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
944
944
|
_: 2
|
|
945
945
|
}, [t.subRows ? {
|
|
946
946
|
name: "expansion",
|
|
947
|
-
fn:
|
|
947
|
+
fn: B(({ data: e }) => [h("table", Et, [h("thead", null, [h("tr", null, [(j(!0), m(u, null, F($.value, (e) => (j(), m("th", { key: e.field }, L(e.header), 1))), 128))])]), h("tbody", null, [(j(!0), m(u, null, F(He(e), (e, t) => (j(), m("tr", { key: t }, [(j(!0), m(u, null, F($.value, (t) => (j(), m("td", { key: t.field }, L(e[t.field] ?? "—"), 1))), 128))]))), 128))])])]),
|
|
948
948
|
key: "0"
|
|
949
949
|
} : void 0]), 1032, [
|
|
950
950
|
"selection",
|
|
@@ -964,7 +964,7 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
964
964
|
"append-to",
|
|
965
965
|
"header"
|
|
966
966
|
]),
|
|
967
|
-
We.value ? (
|
|
967
|
+
We.value ? (j(), f(Pn, {
|
|
968
968
|
key: 0,
|
|
969
969
|
visible: ft.value,
|
|
970
970
|
title: kt.value,
|
|
@@ -1025,8 +1025,8 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1025
1025
|
let n = e, i = t, a = r({
|
|
1026
1026
|
showTime: () => n.showTime,
|
|
1027
1027
|
valueFormat: () => n.valueFormat
|
|
1028
|
-
}), o =
|
|
1029
|
-
|
|
1028
|
+
}), o = P(""), s = P(null), c = P(null), l = d(() => ({ mask: a.mask() })), u = d(() => a.toDate(n.minDate) ?? void 0), g = d(() => a.toDate(n.maxDate) ?? void 0);
|
|
1029
|
+
z(() => n.modelValue, (e) => {
|
|
1030
1030
|
let t = a.toDate(e);
|
|
1031
1031
|
s.value = t, o.value = a.toDisplay(t);
|
|
1032
1032
|
}, { immediate: !0 });
|
|
@@ -1061,8 +1061,8 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
return te(() => {
|
|
1063
1063
|
n.autonow && n.modelValue == null && C();
|
|
1064
|
-
}), (t, n) => (
|
|
1065
|
-
default:
|
|
1064
|
+
}), (t, n) => (j(), m("div", kt, [y(R(he), null, {
|
|
1065
|
+
default: B(() => [V(y(R(K), {
|
|
1066
1066
|
id: e.inputId,
|
|
1067
1067
|
modelValue: o.value,
|
|
1068
1068
|
"onUpdate:modelValue": n[0] ||= (e) => o.value = e,
|
|
@@ -1081,7 +1081,7 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1081
1081
|
"placeholder",
|
|
1082
1082
|
"disabled",
|
|
1083
1083
|
"invalid"
|
|
1084
|
-
]), [[R(dt), l.value]]), y(R(
|
|
1084
|
+
]), [[R(dt), l.value]]), y(R(ge), {
|
|
1085
1085
|
class: O(["pi pi-calendar w-datepicker-icon", { "w-datepicker-icon-disabled": e.disabled }]),
|
|
1086
1086
|
role: "button",
|
|
1087
1087
|
tabindex: "-1",
|
|
@@ -1089,11 +1089,11 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1089
1089
|
onClick: T
|
|
1090
1090
|
}, null, 8, ["class"])]),
|
|
1091
1091
|
_: 1
|
|
1092
|
-
}), y(R(
|
|
1092
|
+
}), y(R(q), {
|
|
1093
1093
|
ref_key: "op",
|
|
1094
1094
|
ref: c
|
|
1095
1095
|
}, {
|
|
1096
|
-
default:
|
|
1096
|
+
default: B(() => [h("div", At, [y(R(Ee), {
|
|
1097
1097
|
"model-value": s.value ?? void 0,
|
|
1098
1098
|
inline: "",
|
|
1099
1099
|
"show-time": e.showTime,
|
|
@@ -1106,12 +1106,12 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1106
1106
|
"show-time",
|
|
1107
1107
|
"min-date",
|
|
1108
1108
|
"max-date"
|
|
1109
|
-
]), h("div", jt, [y(R(
|
|
1109
|
+
]), h("div", jt, [y(R(G), {
|
|
1110
1110
|
label: "Hoje",
|
|
1111
1111
|
text: "",
|
|
1112
1112
|
size: "small",
|
|
1113
1113
|
onClick: C
|
|
1114
|
-
}), e.showClear ? (
|
|
1114
|
+
}), e.showClear ? (j(), f(R(G), {
|
|
1115
1115
|
key: 0,
|
|
1116
1116
|
label: "Limpar",
|
|
1117
1117
|
text: "",
|
|
@@ -1159,16 +1159,16 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1159
1159
|
let i = Number(t) / 10 ** n.decimals;
|
|
1160
1160
|
r("update:modelValue", i);
|
|
1161
1161
|
}
|
|
1162
|
-
return (t, n) => a.value ? (
|
|
1162
|
+
return (t, n) => a.value ? (j(), f(R(De), {
|
|
1163
1163
|
key: 0,
|
|
1164
1164
|
class: "w-money-input"
|
|
1165
1165
|
}, {
|
|
1166
|
-
default:
|
|
1167
|
-
i.value ? (
|
|
1168
|
-
default:
|
|
1166
|
+
default: B(() => [
|
|
1167
|
+
i.value ? (j(), f(R(Oe), { key: 0 }, {
|
|
1168
|
+
default: B(() => [v(L(i.value), 1)]),
|
|
1169
1169
|
_: 1
|
|
1170
1170
|
})) : p("", !0),
|
|
1171
|
-
y(R(
|
|
1171
|
+
y(R(K), {
|
|
1172
1172
|
"model-value": o.value,
|
|
1173
1173
|
inputmode: "numeric",
|
|
1174
1174
|
class: "w-money-input__field",
|
|
@@ -1182,13 +1182,13 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1182
1182
|
"disabled",
|
|
1183
1183
|
"invalid"
|
|
1184
1184
|
]),
|
|
1185
|
-
e.suffix ? (
|
|
1186
|
-
default:
|
|
1185
|
+
e.suffix ? (j(), f(R(Oe), { key: 1 }, {
|
|
1186
|
+
default: B(() => [v(L(e.suffix), 1)]),
|
|
1187
1187
|
_: 1
|
|
1188
1188
|
})) : p("", !0)
|
|
1189
1189
|
]),
|
|
1190
1190
|
_: 1
|
|
1191
|
-
})) : (
|
|
1191
|
+
})) : (j(), f(R(K), {
|
|
1192
1192
|
key: 1,
|
|
1193
1193
|
"model-value": o.value,
|
|
1194
1194
|
inputmode: "numeric",
|
|
@@ -1221,13 +1221,13 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1221
1221
|
},
|
|
1222
1222
|
emits: ["update:modelValue", "error"],
|
|
1223
1223
|
setup(e, { emit: t }) {
|
|
1224
|
-
let n = c(), r = e, i = t, a =
|
|
1225
|
-
|
|
1224
|
+
let n = c(), r = e, i = t, a = P(null);
|
|
1225
|
+
z(() => r.modelValue, (e) => {
|
|
1226
1226
|
a.value &&= (URL.revokeObjectURL(a.value), null), e instanceof File && (a.value = URL.createObjectURL(e));
|
|
1227
1227
|
}, { immediate: !0 }), ee(() => {
|
|
1228
1228
|
a.value && URL.revokeObjectURL(a.value);
|
|
1229
1229
|
});
|
|
1230
|
-
let o = d(() => r.modelValue instanceof File ? a.value : typeof r.modelValue == "string" && r.modelValue ? r.modelValue : null), s =
|
|
1230
|
+
let o = d(() => r.modelValue instanceof File ? a.value : typeof r.modelValue == "string" && r.modelValue ? r.modelValue : null), s = P(null);
|
|
1231
1231
|
function l() {
|
|
1232
1232
|
s.value?.click();
|
|
1233
1233
|
}
|
|
@@ -1252,55 +1252,55 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1252
1252
|
a.onload = () => {
|
|
1253
1253
|
let e = new Image();
|
|
1254
1254
|
e.onload = () => {
|
|
1255
|
-
v = e, w.value = e.naturalWidth, T.value = e.naturalHeight, E.value = 1, C.value = e.src, D.x = (te.value -
|
|
1255
|
+
v = e, w.value = e.naturalWidth, T.value = e.naturalHeight, E.value = 1, C.value = e.src, D.x = (te.value - F.value) / 2, D.y = (ne.value - ie.value) / 2, S.value = !0;
|
|
1256
1256
|
}, e.onerror = () => i("error", "Não foi possível carregar a imagem."), e.src = String(a.result);
|
|
1257
1257
|
}, a.onerror = () => i("error", "Falha ao ler o arquivo."), a.readAsDataURL(n);
|
|
1258
1258
|
}
|
|
1259
1259
|
function x() {
|
|
1260
1260
|
i("update:modelValue", null);
|
|
1261
1261
|
}
|
|
1262
|
-
let S =
|
|
1262
|
+
let S = P(!1), C = P(""), w = P(0), T = P(0), E = P(1), D = N({
|
|
1263
1263
|
x: 0,
|
|
1264
1264
|
y: 0
|
|
1265
|
-
}), k = d(() => r.circular ? 1 : r.aspectRatio || 1), te = d(() => k.value >= 1 ? Vt : Math.round(Vt * k.value)),
|
|
1266
|
-
function
|
|
1267
|
-
D.x = Math.min(0, Math.max(te.value -
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
let
|
|
1271
|
-
width: `${
|
|
1272
|
-
height: `${
|
|
1265
|
+
}), k = d(() => r.circular ? 1 : r.aspectRatio || 1), te = d(() => k.value >= 1 ? Vt : Math.round(Vt * k.value)), ne = d(() => k.value >= 1 ? Math.round(Vt / k.value) : Vt), M = d(() => w.value && T.value ? Math.max(te.value / w.value, ne.value / T.value) : 1), re = d(() => M.value * E.value), F = d(() => w.value * re.value), ie = d(() => T.value * re.value);
|
|
1266
|
+
function ae() {
|
|
1267
|
+
D.x = Math.min(0, Math.max(te.value - F.value, D.x)), D.y = Math.min(0, Math.max(ne.value - ie.value, D.y));
|
|
1268
|
+
}
|
|
1269
|
+
z(E, ae);
|
|
1270
|
+
let L = d(() => ({
|
|
1271
|
+
width: `${F.value}px`,
|
|
1272
|
+
height: `${ie.value}px`,
|
|
1273
1273
|
transform: `translate(${D.x}px, ${D.y}px)`
|
|
1274
|
-
})),
|
|
1274
|
+
})), oe = P(!1), se = {
|
|
1275
1275
|
x: 0,
|
|
1276
1276
|
y: 0,
|
|
1277
1277
|
ox: 0,
|
|
1278
1278
|
oy: 0
|
|
1279
1279
|
};
|
|
1280
|
-
function
|
|
1281
|
-
|
|
1280
|
+
function ce(e) {
|
|
1281
|
+
oe.value = !0, e.currentTarget.setPointerCapture?.(e.pointerId), se = {
|
|
1282
1282
|
x: e.clientX,
|
|
1283
1283
|
y: e.clientY,
|
|
1284
1284
|
ox: D.x,
|
|
1285
1285
|
oy: D.y
|
|
1286
1286
|
};
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1289
|
-
|
|
1288
|
+
function le(e) {
|
|
1289
|
+
oe.value && (D.x = se.ox + (e.clientX - se.x), D.y = se.oy + (e.clientY - se.y), ae());
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1292
|
-
|
|
1291
|
+
function ue() {
|
|
1292
|
+
oe.value = !1;
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function V() {
|
|
1295
1295
|
return r.circular ? "image/png" : _ === "image/jpeg" || _ === "image/png" || _ === "image/webp" ? _ : "image/png";
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function H(e) {
|
|
1298
1298
|
let t = e === "image/png" ? "png" : e === "image/webp" ? "webp" : "jpg";
|
|
1299
1299
|
return `${g.replace(/\.[^.]+$/, "") || "image"}.${t}`;
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1301
|
+
function U() {
|
|
1302
1302
|
if (!v) return;
|
|
1303
|
-
let e =
|
|
1303
|
+
let e = re.value, t = -D.x / e, n = -D.y / e, a = te.value / e, o = ne.value / e, s = document.createElement("canvas");
|
|
1304
1304
|
s.width = Math.max(1, Math.round(a)), s.height = Math.max(1, Math.round(o));
|
|
1305
1305
|
let c = s.getContext("2d");
|
|
1306
1306
|
if (!c) {
|
|
@@ -1308,16 +1308,16 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1308
1308
|
return;
|
|
1309
1309
|
}
|
|
1310
1310
|
r.circular && (c.beginPath(), c.ellipse(s.width / 2, s.height / 2, s.width / 2, s.height / 2, 0, 0, Math.PI * 2), c.clip()), c.drawImage(v, t, n, a, o, 0, 0, s.width, s.height);
|
|
1311
|
-
let l =
|
|
1311
|
+
let l = V();
|
|
1312
1312
|
s.toBlob((e) => {
|
|
1313
1313
|
if (!e) {
|
|
1314
1314
|
i("error", "Falha ao processar a imagem.");
|
|
1315
1315
|
return;
|
|
1316
1316
|
}
|
|
1317
|
-
i("update:modelValue", new File([e],
|
|
1317
|
+
i("update:modelValue", new File([e], H(l), { type: l })), S.value = !1;
|
|
1318
1318
|
}, l, .92);
|
|
1319
1319
|
}
|
|
1320
|
-
return (t, r) => (
|
|
1320
|
+
return (t, r) => (j(), m("div", Pt, [
|
|
1321
1321
|
h("div", {
|
|
1322
1322
|
class: O(["w-imgcropper-preview", {
|
|
1323
1323
|
"is-circular": e.circular,
|
|
@@ -1327,18 +1327,18 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1327
1327
|
width: `${e.width}px`,
|
|
1328
1328
|
height: `${e.height}px`
|
|
1329
1329
|
})
|
|
1330
|
-
}, [o.value ? (
|
|
1330
|
+
}, [o.value ? (j(), m(u, { key: 0 }, [h("img", {
|
|
1331
1331
|
src: o.value,
|
|
1332
1332
|
alt: "",
|
|
1333
1333
|
class: "w-imgcropper-img"
|
|
1334
|
-
}, null, 8, Ft), h("div", It, [y(R(
|
|
1334
|
+
}, null, 8, Ft), h("div", It, [y(R(G), {
|
|
1335
1335
|
type: "button",
|
|
1336
1336
|
icon: "pi pi-pencil",
|
|
1337
1337
|
rounded: "",
|
|
1338
1338
|
text: "",
|
|
1339
1339
|
"aria-label": "Trocar imagem",
|
|
1340
1340
|
onClick: l
|
|
1341
|
-
}), y(R(
|
|
1341
|
+
}), y(R(G), {
|
|
1342
1342
|
type: "button",
|
|
1343
1343
|
icon: "pi pi-trash",
|
|
1344
1344
|
rounded: "",
|
|
@@ -1346,7 +1346,7 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1346
1346
|
severity: "danger",
|
|
1347
1347
|
"aria-label": "Remover imagem",
|
|
1348
1348
|
onClick: x
|
|
1349
|
-
})])], 64)) :
|
|
1349
|
+
})])], 64)) : I(t.$slots, "placeholder", { open: l }, () => [h("button", {
|
|
1350
1350
|
type: "button",
|
|
1351
1351
|
class: "w-imgcropper-empty",
|
|
1352
1352
|
onClick: l
|
|
@@ -1359,7 +1359,7 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1359
1359
|
class: "w-imgcropper-file",
|
|
1360
1360
|
onChange: b
|
|
1361
1361
|
}, null, 40, Lt),
|
|
1362
|
-
y(R(
|
|
1362
|
+
y(R(ye), {
|
|
1363
1363
|
visible: S.value,
|
|
1364
1364
|
"onUpdate:visible": r[2] ||= (e) => S.value = e,
|
|
1365
1365
|
"append-to": R(n)?.hostEl.value ?? "body",
|
|
@@ -1368,36 +1368,36 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1368
1368
|
"dismissable-mask": !1,
|
|
1369
1369
|
style: { width: "auto" }
|
|
1370
1370
|
}, {
|
|
1371
|
-
footer:
|
|
1371
|
+
footer: B(() => [y(R(G), {
|
|
1372
1372
|
type: "button",
|
|
1373
1373
|
label: "Cancelar",
|
|
1374
1374
|
text: "",
|
|
1375
1375
|
onClick: r[1] ||= (e) => S.value = !1
|
|
1376
|
-
}), y(R(
|
|
1376
|
+
}), y(R(G), {
|
|
1377
1377
|
type: "button",
|
|
1378
1378
|
label: "Confirmar",
|
|
1379
|
-
onClick:
|
|
1379
|
+
onClick: U
|
|
1380
1380
|
})]),
|
|
1381
|
-
default:
|
|
1381
|
+
default: B(() => [h("div", Rt, [h("div", {
|
|
1382
1382
|
class: O(["w-imgcropper-viewport", { "is-circular": e.circular }]),
|
|
1383
1383
|
style: A({
|
|
1384
1384
|
width: `${te.value}px`,
|
|
1385
|
-
height: `${
|
|
1385
|
+
height: `${ne.value}px`
|
|
1386
1386
|
}),
|
|
1387
|
-
onPointerdown:
|
|
1388
|
-
onPointermove:
|
|
1389
|
-
onPointerup:
|
|
1390
|
-
onPointerleave:
|
|
1391
|
-
}, [C.value ? (
|
|
1387
|
+
onPointerdown: ce,
|
|
1388
|
+
onPointermove: le,
|
|
1389
|
+
onPointerup: ue,
|
|
1390
|
+
onPointerleave: ue
|
|
1391
|
+
}, [C.value ? (j(), m("img", {
|
|
1392
1392
|
key: 0,
|
|
1393
1393
|
src: C.value,
|
|
1394
1394
|
alt: "",
|
|
1395
1395
|
class: "w-imgcropper-cropimg",
|
|
1396
|
-
style: A(
|
|
1396
|
+
style: A(L.value),
|
|
1397
1397
|
draggable: "false"
|
|
1398
1398
|
}, null, 12, zt)) : p("", !0), h("div", { class: O(["w-imgcropper-stencil", { "is-circular": e.circular }]) }, null, 2)], 38), h("div", Bt, [
|
|
1399
1399
|
r[4] ||= h("i", { class: "pi pi-search-minus" }, null, -1),
|
|
1400
|
-
y(R(
|
|
1400
|
+
y(R(ke), {
|
|
1401
1401
|
modelValue: E.value,
|
|
1402
1402
|
"onUpdate:modelValue": r[0] ||= (e) => E.value = e,
|
|
1403
1403
|
min: 1,
|
|
@@ -1433,7 +1433,7 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1433
1433
|
},
|
|
1434
1434
|
emits: ["update:selected"],
|
|
1435
1435
|
setup(e, { emit: t }) {
|
|
1436
|
-
let n = e, r = t, i =
|
|
1436
|
+
let n = e, r = t, i = P(""), a = P(""), o = d(() => new Set(n.selected)), s = d(() => n.searchFields ?? [n.optionLabel]);
|
|
1437
1437
|
function c(e) {
|
|
1438
1438
|
return e[n.trackBy];
|
|
1439
1439
|
}
|
|
@@ -1460,11 +1460,11 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1460
1460
|
function S() {
|
|
1461
1461
|
n.disabled || r("update:selected", []);
|
|
1462
1462
|
}
|
|
1463
|
-
return (t, n) => (
|
|
1463
|
+
return (t, n) => (j(), m("div", { class: O(["w-transfer", { "w-transfer--disabled": e.disabled }]) }, [
|
|
1464
1464
|
h("div", Gt, [
|
|
1465
|
-
h("div", Kt, [n[2] ||= h("span", { class: "w-transfer__title" }, "Disponíveis", -1), h("span", qt,
|
|
1466
|
-
y(R(
|
|
1467
|
-
default:
|
|
1465
|
+
h("div", Kt, [n[2] ||= h("span", { class: "w-transfer__title" }, "Disponíveis", -1), h("span", qt, L(g.value.length), 1)]),
|
|
1466
|
+
y(R(he), { class: "w-transfer__search" }, {
|
|
1467
|
+
default: B(() => [y(R(ge), { class: "pi pi-search" }), y(R(K), {
|
|
1468
1468
|
modelValue: i.value,
|
|
1469
1469
|
"onUpdate:modelValue": n[0] ||= (e) => i.value = e,
|
|
1470
1470
|
placeholder: "Buscar...",
|
|
@@ -1472,20 +1472,20 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1472
1472
|
}, null, 8, ["modelValue"])]),
|
|
1473
1473
|
_: 1
|
|
1474
1474
|
}),
|
|
1475
|
-
h("ul", Jt, [(
|
|
1475
|
+
h("ul", Jt, [(j(!0), m(u, null, F(g.value, (e) => (j(), m("li", {
|
|
1476
1476
|
key: `a-${c(e)}`,
|
|
1477
1477
|
class: "w-transfer__item",
|
|
1478
1478
|
onClick: (t) => v(e)
|
|
1479
|
-
}, [h("span", null,
|
|
1479
|
+
}, [h("span", null, L(l(e)), 1), n[3] ||= h("i", { class: "pi pi-angle-right" }, null, -1)], 8, Yt))), 128)), g.value.length ? p("", !0) : (j(), m("li", Xt, "Nenhum item"))])
|
|
1480
1480
|
]),
|
|
1481
|
-
h("div", Zt, [y(R(
|
|
1481
|
+
h("div", Zt, [y(R(G), {
|
|
1482
1482
|
type: "button",
|
|
1483
1483
|
icon: "pi pi-angle-double-right",
|
|
1484
1484
|
text: "",
|
|
1485
1485
|
rounded: "",
|
|
1486
1486
|
disabled: e.disabled || !g.value.length,
|
|
1487
1487
|
onClick: x
|
|
1488
|
-
}, null, 8, ["disabled"]), y(R(
|
|
1488
|
+
}, null, 8, ["disabled"]), y(R(G), {
|
|
1489
1489
|
type: "button",
|
|
1490
1490
|
icon: "pi pi-angle-double-left",
|
|
1491
1491
|
text: "",
|
|
@@ -1494,9 +1494,9 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1494
1494
|
onClick: S
|
|
1495
1495
|
}, null, 8, ["disabled"])]),
|
|
1496
1496
|
h("div", Qt, [
|
|
1497
|
-
h("div", $t, [n[4] ||= h("span", { class: "w-transfer__title" }, "Selecionados", -1), h("span", en,
|
|
1498
|
-
y(R(
|
|
1499
|
-
default:
|
|
1497
|
+
h("div", $t, [n[4] ||= h("span", { class: "w-transfer__title" }, "Selecionados", -1), h("span", en, L(_.value.length), 1)]),
|
|
1498
|
+
y(R(he), { class: "w-transfer__search" }, {
|
|
1499
|
+
default: B(() => [y(R(ge), { class: "pi pi-search" }), y(R(K), {
|
|
1500
1500
|
modelValue: a.value,
|
|
1501
1501
|
"onUpdate:modelValue": n[1] ||= (e) => a.value = e,
|
|
1502
1502
|
placeholder: "Buscar...",
|
|
@@ -1504,11 +1504,11 @@ var vt = { class: "w-fk-option" }, yt = { class: "w-fk-option__label" }, bt = {
|
|
|
1504
1504
|
}, null, 8, ["modelValue"])]),
|
|
1505
1505
|
_: 1
|
|
1506
1506
|
}),
|
|
1507
|
-
h("ul", tn, [(
|
|
1507
|
+
h("ul", tn, [(j(!0), m(u, null, F(_.value, (e) => (j(), m("li", {
|
|
1508
1508
|
key: `s-${c(e)}`,
|
|
1509
1509
|
class: "w-transfer__item",
|
|
1510
1510
|
onClick: (t) => b(e)
|
|
1511
|
-
}, [n[5] ||= h("i", { class: "pi pi-angle-left" }, null, -1), h("span", null,
|
|
1511
|
+
}, [n[5] ||= h("i", { class: "pi pi-angle-left" }, null, -1), h("span", null, L(l(e)), 1)], 8, nn))), 128)), _.value.length ? p("", !0) : (j(), m("li", rn, "Nenhum item"))])
|
|
1512
1512
|
])
|
|
1513
1513
|
], 2));
|
|
1514
1514
|
}
|
|
@@ -1595,7 +1595,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1595
1595
|
},
|
|
1596
1596
|
emits: ["update:field"],
|
|
1597
1597
|
setup(e, { expose: t, emit: r }) {
|
|
1598
|
-
let i = e, a = r, o =
|
|
1598
|
+
let i = e, a = r, o = N({}), s = N({}), c = N({}), l = N({});
|
|
1599
1599
|
function g(e, t) {
|
|
1600
1600
|
let n = t.target.value, r = n.replace(/\D/g, "");
|
|
1601
1601
|
a("update:field", e.field, n), c[e.field] = null, l[e.field] && (clearTimeout(l[e.field]), l[e.field] = null), r.length === 8 && (l[e.field] = setTimeout(async () => {
|
|
@@ -1629,7 +1629,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1629
1629
|
return typeof t == "function" ? t() : t;
|
|
1630
1630
|
}
|
|
1631
1631
|
let C = d(() => i.fields.filter((e) => typeof e.calculate == "function"));
|
|
1632
|
-
|
|
1632
|
+
z(() => C.value.map((e) => e.calculate(i.formData, i.isEditing)), (e) => {
|
|
1633
1633
|
C.value.forEach((t, n) => {
|
|
1634
1634
|
i.formData[t.field] !== e[n] && a("update:field", t.field, e[n]);
|
|
1635
1635
|
});
|
|
@@ -1653,31 +1653,34 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1653
1653
|
function D(e) {
|
|
1654
1654
|
return e.field === E.value;
|
|
1655
1655
|
}
|
|
1656
|
-
|
|
1656
|
+
let k = { mounted(e, t) {
|
|
1657
|
+
t.value && e.querySelector("input, textarea")?.setAttribute("autofocus", "");
|
|
1658
|
+
} };
|
|
1659
|
+
function ee(e) {
|
|
1657
1660
|
if (e) return e.replace(/9/g, "#").replace(/a/g, "S").replace(/\*/g, "X");
|
|
1658
1661
|
}
|
|
1659
|
-
function
|
|
1662
|
+
function te(e) {
|
|
1660
1663
|
if (!e) return "";
|
|
1661
1664
|
let t = String(e).replace(/\D/g, "").slice(0, 14);
|
|
1662
1665
|
return t.length <= 11 ? t.replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d{1,2})$/, "$1-$2") : t.replace(/(\d{2})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1/$2").replace(/(\d{4})(\d{1,2})$/, "$1-$2");
|
|
1663
1666
|
}
|
|
1664
|
-
function
|
|
1667
|
+
function ne(e, t) {
|
|
1665
1668
|
let n = t.target.value.replace(/\D/g, "").slice(0, 14);
|
|
1666
1669
|
a("update:field", e, n);
|
|
1667
1670
|
}
|
|
1668
|
-
let
|
|
1669
|
-
function
|
|
1671
|
+
let M = N({});
|
|
1672
|
+
function re(e) {
|
|
1670
1673
|
let t = i.formData[e.field];
|
|
1671
1674
|
if (t == null) return null;
|
|
1672
1675
|
let n = e.optionValue || "value";
|
|
1673
1676
|
return (T(e.options) || []).find((e) => e[n] === t) ?? null;
|
|
1674
1677
|
}
|
|
1675
|
-
function
|
|
1676
|
-
return
|
|
1678
|
+
function P(e) {
|
|
1679
|
+
return M[e.field] || [];
|
|
1677
1680
|
}
|
|
1678
|
-
function
|
|
1681
|
+
function ie(e, t) {
|
|
1679
1682
|
let n = (t.query || "").toLowerCase(), r = T(e.options) || [], i = e.optionLabel || "label";
|
|
1680
|
-
|
|
1683
|
+
M[e.field] = r.filter((e) => String(e[i] || "").toLowerCase().includes(n));
|
|
1681
1684
|
}
|
|
1682
1685
|
function ae(e, t) {
|
|
1683
1686
|
let n = e.optionValue || "value";
|
|
@@ -1686,17 +1689,17 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1686
1689
|
function oe(e) {
|
|
1687
1690
|
return T(e.options) || [];
|
|
1688
1691
|
}
|
|
1689
|
-
function
|
|
1692
|
+
function se(e, t) {
|
|
1690
1693
|
return String(t[e.optionLabel || "label"] ?? "");
|
|
1691
1694
|
}
|
|
1692
|
-
function
|
|
1695
|
+
function ce(e, t) {
|
|
1693
1696
|
return t[e.optionValue || "value"];
|
|
1694
1697
|
}
|
|
1695
|
-
function
|
|
1696
|
-
return i.formData[e.field] ===
|
|
1698
|
+
function le(e, t) {
|
|
1699
|
+
return i.formData[e.field] === ce(e, t);
|
|
1697
1700
|
}
|
|
1698
|
-
function
|
|
1699
|
-
b(e) || a("update:field", e.field,
|
|
1701
|
+
function ue(e, t) {
|
|
1702
|
+
b(e) || a("update:field", e.field, ce(e, t));
|
|
1700
1703
|
}
|
|
1701
1704
|
function B(e) {
|
|
1702
1705
|
let t = i.formData[e.field];
|
|
@@ -1722,14 +1725,14 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1722
1725
|
let n = i.formData[e.field];
|
|
1723
1726
|
Array.isArray(n) && a("update:field", e.field, n.filter((e, n) => n !== t));
|
|
1724
1727
|
}
|
|
1725
|
-
function
|
|
1728
|
+
function U(e) {
|
|
1726
1729
|
let t = i.formData[e.field];
|
|
1727
1730
|
return t ? String(t).replace("#", "") : "FFFFFF";
|
|
1728
1731
|
}
|
|
1729
|
-
function
|
|
1732
|
+
function de(e, t) {
|
|
1730
1733
|
a("update:field", e.field, `#${t}`);
|
|
1731
1734
|
}
|
|
1732
|
-
function
|
|
1735
|
+
function W(e) {
|
|
1733
1736
|
let t = e.dependsOn;
|
|
1734
1737
|
if (t) return (Array.isArray(t) ? t : [t]).map((e) => ({
|
|
1735
1738
|
field: e.param || e.field,
|
|
@@ -1737,7 +1740,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1737
1740
|
required: e.required
|
|
1738
1741
|
}));
|
|
1739
1742
|
}
|
|
1740
|
-
function
|
|
1743
|
+
function G(e) {
|
|
1741
1744
|
if (typeof e.validate == "function") {
|
|
1742
1745
|
let t = e.validate(i.formData[e.field]);
|
|
1743
1746
|
o[e.field] = t || null;
|
|
@@ -1757,23 +1760,23 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1757
1760
|
}
|
|
1758
1761
|
return e;
|
|
1759
1762
|
}
|
|
1760
|
-
function
|
|
1763
|
+
function me() {
|
|
1761
1764
|
Object.keys(o).forEach((e) => delete o[e]);
|
|
1762
1765
|
}
|
|
1763
|
-
function
|
|
1766
|
+
function he(e) {
|
|
1764
1767
|
return Math.max(1, Math.floor(e.columns ?? i.columns));
|
|
1765
1768
|
}
|
|
1766
|
-
function
|
|
1769
|
+
function ge(e, t) {
|
|
1767
1770
|
let n = e.colSpan;
|
|
1768
1771
|
return n == null || n === "full" ? t : n === .5 ? Math.max(1, Math.round(t / 2)) : Math.min(Math.max(1, Math.floor(n)), t);
|
|
1769
1772
|
}
|
|
1770
|
-
function
|
|
1771
|
-
return { "--w-col-span":
|
|
1773
|
+
function _e(e, t) {
|
|
1774
|
+
return { "--w-col-span": ge(e, he(t)) };
|
|
1772
1775
|
}
|
|
1773
|
-
function
|
|
1774
|
-
return
|
|
1776
|
+
function ve(e, t) {
|
|
1777
|
+
return ge(e, he(t)) === he(t) ? "w-crud-form-col-full" : "w-crud-form-col-half";
|
|
1775
1778
|
}
|
|
1776
|
-
let
|
|
1779
|
+
let ye = d(() => {
|
|
1777
1780
|
let e = /* @__PURE__ */ new Map(), t = [], n = /* @__PURE__ */ new Map();
|
|
1778
1781
|
for (let r of _.value) {
|
|
1779
1782
|
let i = r.fieldGroup?.id ?? "__default__";
|
|
@@ -1792,23 +1795,23 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1792
1795
|
});
|
|
1793
1796
|
return t({
|
|
1794
1797
|
validateAll: q,
|
|
1795
|
-
clearErrors:
|
|
1796
|
-
}), (t, n) => (
|
|
1798
|
+
clearErrors: me
|
|
1799
|
+
}), (t, n) => (j(), m("div", sn, [(j(!0), m(u, null, F(ye.value, (r) => (j(), m("div", {
|
|
1797
1800
|
key: r.id,
|
|
1798
1801
|
class: "w-crud-form-group"
|
|
1799
|
-
}, [r.title ? (
|
|
1802
|
+
}, [r.title ? (j(), m("div", cn, [h("h3", ln, L(r.title), 1), r.description ? (j(), m("p", un, L(r.description), 1)) : p("", !0)])) : p("", !0), h("div", {
|
|
1800
1803
|
class: "w-crud-form-fields",
|
|
1801
|
-
style: A({ "--w-form-cols":
|
|
1802
|
-
}, [(
|
|
1804
|
+
style: A({ "--w-form-cols": he(r) })
|
|
1805
|
+
}, [(j(!0), m(u, null, F(r.fields, (i) => I(t.$slots, `field-${i.field}`, {
|
|
1803
1806
|
field: i,
|
|
1804
1807
|
formData: e.formData,
|
|
1805
1808
|
isEditing: e.isEditing,
|
|
1806
1809
|
setFormField: (e, t) => a("update:field", e, t)
|
|
1807
|
-
}, () => [i.type === "switch" ? (
|
|
1810
|
+
}, () => [i.type === "switch" ? (j(), m("div", {
|
|
1808
1811
|
key: 0,
|
|
1809
1812
|
class: "w-crud-form-switch",
|
|
1810
|
-
style: A(
|
|
1811
|
-
}, [y(R(
|
|
1813
|
+
style: A(_e(i, r))
|
|
1814
|
+
}, [y(R(Se), {
|
|
1812
1815
|
"model-value": e.formData[i.field],
|
|
1813
1816
|
disabled: b(i),
|
|
1814
1817
|
"onUpdate:modelValue": (e) => a("update:field", i.field, e)
|
|
@@ -1816,19 +1819,19 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1816
1819
|
"model-value",
|
|
1817
1820
|
"disabled",
|
|
1818
1821
|
"onUpdate:modelValue"
|
|
1819
|
-
]), h("label", dn,
|
|
1822
|
+
]), h("label", dn, L(i.switchLabel || i.label), 1)], 4)) : i.type === "color" ? (j(), m("div", {
|
|
1820
1823
|
key: 1,
|
|
1821
|
-
class: O(
|
|
1822
|
-
style: A(
|
|
1823
|
-
}, [h("label", fn, [v(
|
|
1824
|
-
"model-value":
|
|
1824
|
+
class: O(ve(i, r)),
|
|
1825
|
+
style: A(_e(i, r))
|
|
1826
|
+
}, [h("label", fn, [v(L(i.label) + " ", 1), i.required ? (j(), m("span", pn, "*")) : p("", !0)]), h("div", mn, [y(R(Ce), {
|
|
1827
|
+
"model-value": U(i),
|
|
1825
1828
|
disabled: b(i),
|
|
1826
|
-
"onUpdate:modelValue": (e) =>
|
|
1829
|
+
"onUpdate:modelValue": (e) => de(i, e)
|
|
1827
1830
|
}, null, 8, [
|
|
1828
1831
|
"model-value",
|
|
1829
1832
|
"disabled",
|
|
1830
1833
|
"onUpdate:modelValue"
|
|
1831
|
-
]), y(R(
|
|
1834
|
+
]), y(R(K), {
|
|
1832
1835
|
"model-value": e.formData[i.field],
|
|
1833
1836
|
class: "w-28",
|
|
1834
1837
|
maxlength: "7",
|
|
@@ -1839,13 +1842,13 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1839
1842
|
"model-value",
|
|
1840
1843
|
"disabled",
|
|
1841
1844
|
"onUpdate:modelValue"
|
|
1842
|
-
])])], 6)) : i.type === "image" ? (
|
|
1845
|
+
])])], 6)) : i.type === "image" ? (j(), m("div", {
|
|
1843
1846
|
key: 2,
|
|
1844
|
-
class: O(
|
|
1845
|
-
style: A(
|
|
1847
|
+
class: O(ve(i, r)),
|
|
1848
|
+
style: A(_e(i, r))
|
|
1846
1849
|
}, [
|
|
1847
|
-
h("label", hn,
|
|
1848
|
-
|
|
1850
|
+
h("label", hn, L(i.label), 1),
|
|
1851
|
+
I(t.$slots, `image-${i.field}`, {
|
|
1849
1852
|
field: i,
|
|
1850
1853
|
formData: e.formData
|
|
1851
1854
|
}, () => [y(Wt, {
|
|
@@ -1861,12 +1864,12 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1861
1864
|
"onUpdate:modelValue",
|
|
1862
1865
|
"onError"
|
|
1863
1866
|
])]),
|
|
1864
|
-
o[i.field] ? (
|
|
1865
|
-
], 6)) : i.type === "transfer" ? (
|
|
1867
|
+
o[i.field] ? (j(), m("small", gn, L(o[i.field]), 1)) : p("", !0)
|
|
1868
|
+
], 6)) : i.type === "transfer" ? (j(), m("div", {
|
|
1866
1869
|
key: 3,
|
|
1867
|
-
class: O(
|
|
1868
|
-
style: A(
|
|
1869
|
-
}, [h("label", _n, [v(
|
|
1870
|
+
class: O(ve(i, r)),
|
|
1871
|
+
style: A(_e(i, r))
|
|
1872
|
+
}, [h("label", _n, [v(L(i.label) + " ", 1), i.required ? (j(), m("span", vn, "*")) : p("", !0)]), y(an, {
|
|
1870
1873
|
source: T(i.options) || [],
|
|
1871
1874
|
selected: e.formData[i.field] || [],
|
|
1872
1875
|
"track-by": i.optionValue || "id",
|
|
@@ -1882,17 +1885,17 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1882
1885
|
"search-fields",
|
|
1883
1886
|
"disabled",
|
|
1884
1887
|
"onUpdate:selected"
|
|
1885
|
-
])], 6)) : (
|
|
1888
|
+
])], 6)) : V((j(), m("div", {
|
|
1886
1889
|
key: 4,
|
|
1887
|
-
class: O(
|
|
1888
|
-
style: A(
|
|
1890
|
+
class: O(ve(i, r)),
|
|
1891
|
+
style: A(_e(i, r))
|
|
1889
1892
|
}, [
|
|
1890
1893
|
h("label", yn, [
|
|
1891
|
-
v(
|
|
1892
|
-
i.required ? (
|
|
1893
|
-
s[i.field] ? (
|
|
1894
|
+
v(L(i.label) + " ", 1),
|
|
1895
|
+
i.required ? (j(), m("span", bn, "*")) : p("", !0),
|
|
1896
|
+
s[i.field] ? (j(), m("i", xn)) : p("", !0)
|
|
1894
1897
|
]),
|
|
1895
|
-
(!i.type || i.type === "text") && i.mask ?
|
|
1898
|
+
(!i.type || i.type === "text") && i.mask ? V((j(), f(R(K), {
|
|
1896
1899
|
key: 0,
|
|
1897
1900
|
"model-value": e.formData[i.field],
|
|
1898
1901
|
fluid: "",
|
|
@@ -1906,7 +1909,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1906
1909
|
"placeholder",
|
|
1907
1910
|
"disabled",
|
|
1908
1911
|
"onUpdate:modelValue"
|
|
1909
|
-
])), [[R(dt), { mask:
|
|
1912
|
+
])), [[R(dt), { mask: ee(i.mask) }]]) : !i.type || i.type === "text" ? (j(), f(R(K), {
|
|
1910
1913
|
key: 1,
|
|
1911
1914
|
"model-value": e.formData[i.field],
|
|
1912
1915
|
fluid: "",
|
|
@@ -1920,7 +1923,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1920
1923
|
"placeholder",
|
|
1921
1924
|
"disabled",
|
|
1922
1925
|
"onUpdate:modelValue"
|
|
1923
|
-
])) : i.type === "email" ? (
|
|
1926
|
+
])) : i.type === "email" ? (j(), f(R(K), {
|
|
1924
1927
|
key: 2,
|
|
1925
1928
|
"model-value": e.formData[i.field],
|
|
1926
1929
|
type: "email",
|
|
@@ -1935,7 +1938,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1935
1938
|
"placeholder",
|
|
1936
1939
|
"disabled",
|
|
1937
1940
|
"onUpdate:modelValue"
|
|
1938
|
-
])) : i.type === "password" ? (
|
|
1941
|
+
])) : i.type === "password" ? (j(), f(R(we), {
|
|
1939
1942
|
key: 3,
|
|
1940
1943
|
"model-value": e.formData[i.field],
|
|
1941
1944
|
fluid: "",
|
|
@@ -1950,7 +1953,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1950
1953
|
"placeholder",
|
|
1951
1954
|
"disabled",
|
|
1952
1955
|
"onUpdate:modelValue"
|
|
1953
|
-
])) : i.type === "number" ? (
|
|
1956
|
+
])) : i.type === "number" ? (j(), f(R(fe), {
|
|
1954
1957
|
key: 4,
|
|
1955
1958
|
"model-value": e.formData[i.field],
|
|
1956
1959
|
fluid: "",
|
|
@@ -1975,7 +1978,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1975
1978
|
"placeholder",
|
|
1976
1979
|
"disabled",
|
|
1977
1980
|
"onUpdate:modelValue"
|
|
1978
|
-
])) : i.type === "currency" && i.fillFromRight ? (
|
|
1981
|
+
])) : i.type === "currency" && i.fillFromRight ? (j(), f(Nt, {
|
|
1979
1982
|
key: 5,
|
|
1980
1983
|
"model-value": e.formData[i.field],
|
|
1981
1984
|
decimals: i.decimals ?? 2,
|
|
@@ -1993,7 +1996,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
1993
1996
|
"placeholder",
|
|
1994
1997
|
"disabled",
|
|
1995
1998
|
"onUpdate:modelValue"
|
|
1996
|
-
])) : i.type === "currency" ? (
|
|
1999
|
+
])) : i.type === "currency" ? (j(), f(R(fe), {
|
|
1997
2000
|
key: 6,
|
|
1998
2001
|
"model-value": e.formData[i.field],
|
|
1999
2002
|
fluid: "",
|
|
@@ -2012,7 +2015,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2012
2015
|
"placeholder",
|
|
2013
2016
|
"disabled",
|
|
2014
2017
|
"onUpdate:modelValue"
|
|
2015
|
-
])) : i.type === "select" ? (
|
|
2018
|
+
])) : i.type === "select" ? (j(), f(R(pe), {
|
|
2016
2019
|
key: 7,
|
|
2017
2020
|
"model-value": e.formData[i.field],
|
|
2018
2021
|
fluid: "",
|
|
@@ -2032,15 +2035,15 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2032
2035
|
"placeholder",
|
|
2033
2036
|
"disabled",
|
|
2034
2037
|
"onUpdate:modelValue"
|
|
2035
|
-
])) : i.type === "autocomplete" ? (
|
|
2038
|
+
])) : i.type === "autocomplete" ? (j(), f(R(J), {
|
|
2036
2039
|
key: 8,
|
|
2037
|
-
"model-value":
|
|
2040
|
+
"model-value": re(i),
|
|
2038
2041
|
fluid: "",
|
|
2039
|
-
suggestions:
|
|
2042
|
+
suggestions: P(i),
|
|
2040
2043
|
"option-label": i.optionLabel || "label",
|
|
2041
2044
|
placeholder: i.placeholder,
|
|
2042
2045
|
disabled: b(i),
|
|
2043
|
-
onComplete: (e) =>
|
|
2046
|
+
onComplete: (e) => ie(i, e),
|
|
2044
2047
|
onItemSelect: (e) => ae(i, e),
|
|
2045
2048
|
onClear: (e) => a("update:field", i.field, null)
|
|
2046
2049
|
}, null, 8, [
|
|
@@ -2052,13 +2055,13 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2052
2055
|
"onComplete",
|
|
2053
2056
|
"onItemSelect",
|
|
2054
2057
|
"onClear"
|
|
2055
|
-
])) : i.type === "fk" ? (
|
|
2058
|
+
])) : i.type === "fk" ? (j(), f(Ot, {
|
|
2056
2059
|
key: 9,
|
|
2057
2060
|
"model-value": e.formData[i.field],
|
|
2058
2061
|
autofocus: D(i) || void 0,
|
|
2059
2062
|
endpoint: i.endpoint,
|
|
2060
2063
|
"endpoint-params": S(i),
|
|
2061
|
-
drilldown:
|
|
2064
|
+
drilldown: W(i),
|
|
2062
2065
|
"blocked-placeholder": i.blockedPlaceholder,
|
|
2063
2066
|
"option-label": i.optionLabel || "nome",
|
|
2064
2067
|
"option-description": i.optionDescription,
|
|
@@ -2095,7 +2098,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2095
2098
|
"can-edit",
|
|
2096
2099
|
"can-delete",
|
|
2097
2100
|
"onUpdate:modelValue"
|
|
2098
|
-
])) : i.type === "date" ? (
|
|
2101
|
+
])) : i.type === "date" ? (j(), f(Mt, {
|
|
2099
2102
|
key: 10,
|
|
2100
2103
|
"model-value": e.formData[i.field],
|
|
2101
2104
|
"value-format": "date",
|
|
@@ -2113,7 +2116,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2113
2116
|
"placeholder",
|
|
2114
2117
|
"disabled",
|
|
2115
2118
|
"onUpdate:modelValue"
|
|
2116
|
-
])) : i.type === "datetime" ? (
|
|
2119
|
+
])) : i.type === "datetime" ? (j(), f(Mt, {
|
|
2117
2120
|
key: 11,
|
|
2118
2121
|
"model-value": e.formData[i.field],
|
|
2119
2122
|
"value-format": "date",
|
|
@@ -2132,16 +2135,16 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2132
2135
|
"placeholder",
|
|
2133
2136
|
"disabled",
|
|
2134
2137
|
"onUpdate:modelValue"
|
|
2135
|
-
])) : i.type === "cpf_cnpj" ? (
|
|
2138
|
+
])) : i.type === "cpf_cnpj" ? (j(), f(R(K), {
|
|
2136
2139
|
key: 12,
|
|
2137
|
-
"model-value":
|
|
2140
|
+
"model-value": te(e.formData[i.field]),
|
|
2138
2141
|
fluid: "",
|
|
2139
2142
|
maxlength: "18",
|
|
2140
2143
|
placeholder: i.placeholder || "000.000.000-00",
|
|
2141
2144
|
disabled: b(i),
|
|
2142
2145
|
invalid: !!o[i.field],
|
|
2143
|
-
onInput: (e) =>
|
|
2144
|
-
onBlur: (e) =>
|
|
2146
|
+
onInput: (e) => ne(i.field, e),
|
|
2147
|
+
onBlur: (e) => G(i)
|
|
2145
2148
|
}, null, 8, [
|
|
2146
2149
|
"model-value",
|
|
2147
2150
|
"placeholder",
|
|
@@ -2149,7 +2152,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2149
2152
|
"invalid",
|
|
2150
2153
|
"onInput",
|
|
2151
2154
|
"onBlur"
|
|
2152
|
-
])) : i.type === "mask" ?
|
|
2155
|
+
])) : i.type === "mask" ? V((j(), f(R(K), {
|
|
2153
2156
|
key: 13,
|
|
2154
2157
|
"model-value": e.formData[i.field],
|
|
2155
2158
|
fluid: "",
|
|
@@ -2157,7 +2160,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2157
2160
|
disabled: b(i),
|
|
2158
2161
|
invalid: !!o[i.field],
|
|
2159
2162
|
"onUpdate:modelValue": (e) => a("update:field", i.field, e),
|
|
2160
|
-
onBlur: (e) =>
|
|
2163
|
+
onBlur: (e) => G(i)
|
|
2161
2164
|
}, null, 8, [
|
|
2162
2165
|
"model-value",
|
|
2163
2166
|
"placeholder",
|
|
@@ -2165,7 +2168,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2165
2168
|
"invalid",
|
|
2166
2169
|
"onUpdate:modelValue",
|
|
2167
2170
|
"onBlur"
|
|
2168
|
-
])), [[R(dt), { mask:
|
|
2171
|
+
])), [[R(dt), { mask: ee(i.mask) }]]) : i.type === "cep" ? V((j(), f(R(K), {
|
|
2169
2172
|
key: 14,
|
|
2170
2173
|
"model-value": e.formData[i.field],
|
|
2171
2174
|
fluid: "",
|
|
@@ -2179,7 +2182,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2179
2182
|
"disabled",
|
|
2180
2183
|
"invalid",
|
|
2181
2184
|
"onInput"
|
|
2182
|
-
])), [[R(dt), { mask: "#####-###" }]]) : i.type === "textarea" ? (
|
|
2185
|
+
])), [[R(dt), { mask: "#####-###" }]]) : i.type === "textarea" ? (j(), f(R(xe), {
|
|
2183
2186
|
key: 15,
|
|
2184
2187
|
"model-value": e.formData[i.field],
|
|
2185
2188
|
fluid: "",
|
|
@@ -2195,28 +2198,28 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2195
2198
|
"placeholder",
|
|
2196
2199
|
"disabled",
|
|
2197
2200
|
"onUpdate:modelValue"
|
|
2198
|
-
])) : i.type === "segmented" ? (
|
|
2199
|
-
key: String(
|
|
2201
|
+
])) : i.type === "segmented" ? (j(), m("div", Sn, [(j(!0), m(u, null, F(oe(i), (e) => (j(), m("button", {
|
|
2202
|
+
key: String(ce(i, e)),
|
|
2200
2203
|
type: "button",
|
|
2201
|
-
class: O(["w-segmented__option", { "w-segmented__option--on":
|
|
2202
|
-
"aria-pressed":
|
|
2204
|
+
class: O(["w-segmented__option", { "w-segmented__option--on": le(i, e) }]),
|
|
2205
|
+
"aria-pressed": le(i, e),
|
|
2203
2206
|
disabled: b(i),
|
|
2204
|
-
onClick: (t) =>
|
|
2205
|
-
},
|
|
2206
|
-
key: String(
|
|
2207
|
+
onClick: (t) => ue(i, e)
|
|
2208
|
+
}, L(se(i, e)), 11, Cn))), 128))])) : i.type === "choice" ? (j(), m("div", wn, [(j(!0), m(u, null, F(oe(i), (e) => (j(), m("button", {
|
|
2209
|
+
key: String(ce(i, e)),
|
|
2207
2210
|
type: "button",
|
|
2208
|
-
class: O(["w-choice__option", { "w-choice__option--on":
|
|
2209
|
-
"aria-pressed":
|
|
2211
|
+
class: O(["w-choice__option", { "w-choice__option--on": le(i, e) }]),
|
|
2212
|
+
"aria-pressed": le(i, e),
|
|
2210
2213
|
disabled: b(i),
|
|
2211
|
-
onClick: (t) =>
|
|
2212
|
-
}, [
|
|
2214
|
+
onClick: (t) => ue(i, e)
|
|
2215
|
+
}, [le(i, e) && i.choiceIcon !== "" ? (j(), m("i", {
|
|
2213
2216
|
key: 0,
|
|
2214
2217
|
class: O(i.choiceIcon || "pi pi-check-circle")
|
|
2215
|
-
}, null, 2)) : p("", !0), v(" " +
|
|
2216
|
-
(
|
|
2218
|
+
}, null, 2)) : p("", !0), v(" " + L(se(i, e)), 1)], 10, Tn))), 128))])) : i.type === "chips" ? (j(), m("div", En, [
|
|
2219
|
+
(j(!0), m(u, null, F(B(i), (e, t) => (j(), m("span", {
|
|
2217
2220
|
key: e.key,
|
|
2218
2221
|
class: "w-chips__chip"
|
|
2219
|
-
}, [v(
|
|
2222
|
+
}, [v(L(e.label) + " ", 1), h("button", {
|
|
2220
2223
|
type: "button",
|
|
2221
2224
|
class: "w-chips__remove",
|
|
2222
2225
|
title: i.chipsRemoveLabel || "Remover",
|
|
@@ -2224,21 +2227,21 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2224
2227
|
disabled: b(i),
|
|
2225
2228
|
onClick: (e) => H(i, t)
|
|
2226
2229
|
}, [...n[0] ||= [h("i", { class: "pi pi-times" }, null, -1)]], 8, Dn)]))), 128)),
|
|
2227
|
-
!B(i).length && i.chipsEmptyLabel ? (
|
|
2228
|
-
|
|
2230
|
+
!B(i).length && i.chipsEmptyLabel ? (j(), m("span", On, L(i.chipsEmptyLabel), 1)) : p("", !0),
|
|
2231
|
+
I(t.$slots, `chips-trigger-${i.field}`, {
|
|
2229
2232
|
field: i,
|
|
2230
2233
|
formData: e.formData,
|
|
2231
2234
|
disabled: b(i),
|
|
2232
2235
|
setFormField: (e, t) => a("update:field", e, t)
|
|
2233
2236
|
}),
|
|
2234
|
-
h("span", kn, [
|
|
2237
|
+
h("span", kn, [I(t.$slots, `chips-summary-${i.field}`, {
|
|
2235
2238
|
field: i,
|
|
2236
2239
|
formData: e.formData,
|
|
2237
2240
|
items: B(i)
|
|
2238
2241
|
})])
|
|
2239
2242
|
])) : p("", !0),
|
|
2240
|
-
c[i.field] ? (
|
|
2241
|
-
], 6))], void 0, i.field)), 128))], 4)]))), 128))]));
|
|
2243
|
+
c[i.field] ? (j(), m("small", An, L(c[i.field]), 1)) : o[i.field] ? (j(), m("small", jn, L(o[i.field]), 1)) : p("", !0)
|
|
2244
|
+
], 6)), [[k, D(i)]])], void 0, i.field)), 128))], 4)]))), 128))]));
|
|
2242
2245
|
}
|
|
2243
2246
|
}), Nn = { class: "w-crud-form-footer" }, Pn = /* @__PURE__ */ b({
|
|
2244
2247
|
__name: "WCrudFormDialog",
|
|
@@ -2263,7 +2266,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2263
2266
|
"save"
|
|
2264
2267
|
],
|
|
2265
2268
|
setup(e, { emit: t }) {
|
|
2266
|
-
let n = c(), r = e, i = t, a =
|
|
2269
|
+
let n = c(), r = e, i = t, a = P(null), s = P(null);
|
|
2267
2270
|
function l() {
|
|
2268
2271
|
a.value ? a.value.validateAll().length === 0 && i("save") : i("save");
|
|
2269
2272
|
}
|
|
@@ -2271,9 +2274,9 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2271
2274
|
enabled: () => r.keyboardNav === !0,
|
|
2272
2275
|
onSubmit: l
|
|
2273
2276
|
});
|
|
2274
|
-
return
|
|
2277
|
+
return z(() => r.visible, (e) => {
|
|
2275
2278
|
e && a.value && a.value.clearErrors();
|
|
2276
|
-
}), (t, r) => (
|
|
2279
|
+
}), (t, r) => (j(), f(R(ye), {
|
|
2277
2280
|
"append-to": R(n)?.hostEl.value ?? "body",
|
|
2278
2281
|
visible: e.visible,
|
|
2279
2282
|
header: e.title,
|
|
@@ -2284,11 +2287,11 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2284
2287
|
"onUpdate:visible": r[3] ||= (e) => i("update:visible", e),
|
|
2285
2288
|
onShow: R(u)
|
|
2286
2289
|
}, {
|
|
2287
|
-
default:
|
|
2290
|
+
default: B(() => [h("form", {
|
|
2288
2291
|
ref_key: "formRef",
|
|
2289
2292
|
ref: s,
|
|
2290
2293
|
class: "w-crud-form",
|
|
2291
|
-
onSubmit:
|
|
2294
|
+
onSubmit: U(l, ["prevent"]),
|
|
2292
2295
|
onKeydown: r[2] ||= (...e) => R(d) && R(d)(...e)
|
|
2293
2296
|
}, [
|
|
2294
2297
|
y(Mn, {
|
|
@@ -2300,12 +2303,12 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2300
2303
|
disabled: e.disabled,
|
|
2301
2304
|
columns: e.formColumns,
|
|
2302
2305
|
"onUpdate:field": r[0] ||= (e, t) => i("update:field", e, t)
|
|
2303
|
-
}, g({ _: 2 }, [
|
|
2306
|
+
}, g({ _: 2 }, [F(e.fields, (e) => ({
|
|
2304
2307
|
name: `field-${e.field}`,
|
|
2305
|
-
fn:
|
|
2306
|
-
})),
|
|
2308
|
+
fn: B((n) => [I(t.$slots, `field-${e.field}`, k(x(n)))])
|
|
2309
|
+
})), F(e.fields.filter((e) => e.type === "image"), (e) => ({
|
|
2307
2310
|
name: `image-${e.field}`,
|
|
2308
|
-
fn:
|
|
2311
|
+
fn: B((n) => [I(t.$slots, `image-${e.field}`, k(x(n)))])
|
|
2309
2312
|
}))]), 1032, [
|
|
2310
2313
|
"fields",
|
|
2311
2314
|
"form-data",
|
|
@@ -2313,14 +2316,14 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2313
2316
|
"disabled",
|
|
2314
2317
|
"columns"
|
|
2315
2318
|
]),
|
|
2316
|
-
|
|
2319
|
+
I(t.$slots, "after-fields", {
|
|
2317
2320
|
formData: e.formData,
|
|
2318
2321
|
isEditing: e.isEditing
|
|
2319
2322
|
}),
|
|
2320
|
-
h("div", Nn, [
|
|
2323
|
+
h("div", Nn, [I(t.$slots, "footer", {
|
|
2321
2324
|
saving: e.saving,
|
|
2322
2325
|
disabled: e.disabled
|
|
2323
|
-
}, () => [y(R(
|
|
2326
|
+
}, () => [y(R(G), {
|
|
2324
2327
|
type: "button",
|
|
2325
2328
|
label: e.disabled ? "Fechar" : "Cancelar",
|
|
2326
2329
|
severity: "secondary",
|
|
@@ -2328,7 +2331,7 @@ var sn = { class: "w-crud-form" }, cn = {
|
|
|
2328
2331
|
disabled: e.saving,
|
|
2329
2332
|
"data-kbd-skip": "",
|
|
2330
2333
|
onClick: r[1] ||= (e) => i("update:visible", !1)
|
|
2331
|
-
}, null, 8, ["label", "disabled"]), e.disabled ? p("", !0) : (
|
|
2334
|
+
}, null, 8, ["label", "disabled"]), e.disabled ? p("", !0) : (j(), f(R(G), {
|
|
2332
2335
|
key: 0,
|
|
2333
2336
|
type: "submit",
|
|
2334
2337
|
label: e.isEditing ? "Atualizar" : "Salvar",
|
|
@@ -2508,7 +2511,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2508
2511
|
"print"
|
|
2509
2512
|
], ["update:selectedRow"]),
|
|
2510
2513
|
setup(e, { expose: n, emit: r }) {
|
|
2511
|
-
let i = c(), a = e, o = r, s =
|
|
2514
|
+
let i = c(), a = e, o = r, s = ce(), { formatNumber: l } = t(), v = P({});
|
|
2512
2515
|
function b() {
|
|
2513
2516
|
return a.persistState ? `wcrud:view:${a.persistState}` : null;
|
|
2514
2517
|
}
|
|
@@ -2520,7 +2523,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2520
2523
|
}
|
|
2521
2524
|
return a.defaultView;
|
|
2522
2525
|
}
|
|
2523
|
-
let C =
|
|
2526
|
+
let C = P(S());
|
|
2524
2527
|
function w(e) {
|
|
2525
2528
|
return C.value === e;
|
|
2526
2529
|
}
|
|
@@ -2529,53 +2532,53 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2529
2532
|
let t = b();
|
|
2530
2533
|
t && localStorage.setItem(t, e);
|
|
2531
2534
|
}
|
|
2532
|
-
let E = d(() => (a.crud.pagination.page - 1) * a.crud.pagination.pageSize), D =
|
|
2533
|
-
function
|
|
2535
|
+
let E = d(() => (a.crud.pagination.page - 1) * a.crud.pagination.pageSize), D = N({ hidden: [] }), ee = P(null);
|
|
2536
|
+
function ne() {
|
|
2534
2537
|
return a.persistState ? `wcrud:cols:${a.persistState}` : null;
|
|
2535
2538
|
}
|
|
2536
|
-
function
|
|
2537
|
-
let e =
|
|
2539
|
+
function M() {
|
|
2540
|
+
let e = ne();
|
|
2538
2541
|
if (e) try {
|
|
2539
2542
|
let t = JSON.parse(localStorage.getItem(e) || "{}");
|
|
2540
2543
|
Array.isArray(t.hidden) && (D.hidden = t.hidden);
|
|
2541
2544
|
} catch {}
|
|
2542
2545
|
}
|
|
2543
|
-
function
|
|
2544
|
-
let e =
|
|
2546
|
+
function re() {
|
|
2547
|
+
let e = ne();
|
|
2545
2548
|
e && localStorage.setItem(e, JSON.stringify({ hidden: D.hidden }));
|
|
2546
2549
|
}
|
|
2547
|
-
function
|
|
2550
|
+
function ae() {
|
|
2548
2551
|
return a.persistState ? `wcrud:filters:${a.persistState}` : null;
|
|
2549
2552
|
}
|
|
2550
|
-
function
|
|
2551
|
-
let e =
|
|
2553
|
+
function oe() {
|
|
2554
|
+
let e = ae();
|
|
2552
2555
|
if (e) try {
|
|
2553
2556
|
let t = JSON.parse(localStorage.getItem(e) || "{}");
|
|
2554
2557
|
if (t && typeof t.columnFilters == "object" && t.columnFilters) for (let [e, n] of Object.entries(t.columnFilters)) n != null && n !== "" && (a.crud.columnFilters[e] = n);
|
|
2555
2558
|
typeof t.search == "string" && t.search && (a.crud.search.value = t.search);
|
|
2556
2559
|
} catch {}
|
|
2557
2560
|
}
|
|
2558
|
-
function
|
|
2559
|
-
let e =
|
|
2561
|
+
function le() {
|
|
2562
|
+
let e = ae();
|
|
2560
2563
|
e && localStorage.setItem(e, JSON.stringify({
|
|
2561
2564
|
columnFilters: { ...a.crud.columnFilters },
|
|
2562
2565
|
search: a.crud.search.value
|
|
2563
2566
|
}));
|
|
2564
2567
|
}
|
|
2565
|
-
|
|
2566
|
-
let
|
|
2567
|
-
function
|
|
2568
|
-
D.hidden = t ? D.hidden.filter((t) => t !== e) : [.../* @__PURE__ */ new Set([...D.hidden, e])],
|
|
2568
|
+
z(a.crud.columnFilters, le, { deep: !0 }), z(a.crud.search, le);
|
|
2569
|
+
let ue = d(() => a.crud.config.columns.filter((e) => e.visible !== !1));
|
|
2570
|
+
function H(e, t) {
|
|
2571
|
+
D.hidden = t ? D.hidden.filter((t) => t !== e) : [.../* @__PURE__ */ new Set([...D.hidden, e])], re();
|
|
2569
2572
|
}
|
|
2570
|
-
let
|
|
2573
|
+
let U = d(() => a.crud.config.columns.filter((e) => e.visible !== !1 && !D.hidden.includes(e.field)).map((e) => e.type === "number" && !e.align || e.type === "currency" && !e.align ? {
|
|
2571
2574
|
...e,
|
|
2572
2575
|
align: "right"
|
|
2573
2576
|
} : e));
|
|
2574
|
-
function
|
|
2577
|
+
function be(e) {
|
|
2575
2578
|
if (e.align === "right") return "text-right";
|
|
2576
2579
|
if (e.align === "center") return "text-center";
|
|
2577
2580
|
}
|
|
2578
|
-
let
|
|
2581
|
+
let xe = d(() => U.value.slice(0, a.cardFields)), J = d(() => {
|
|
2579
2582
|
let e = [];
|
|
2580
2583
|
return a.crud.config.canEdit !== !1 && e.push({
|
|
2581
2584
|
action: "edit",
|
|
@@ -2592,101 +2595,101 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2592
2595
|
tooltip: "Excluir",
|
|
2593
2596
|
severity: "danger"
|
|
2594
2597
|
}), e;
|
|
2595
|
-
}),
|
|
2596
|
-
function
|
|
2598
|
+
}), Se = d(() => a.crud.config.rowActions ?? J.value), Ce = d(() => Se.value.length > 0 || !!s["row-actions"]);
|
|
2599
|
+
function we(e, t) {
|
|
2597
2600
|
if (e.handler) {
|
|
2598
2601
|
e.handler(t);
|
|
2599
2602
|
return;
|
|
2600
2603
|
}
|
|
2601
|
-
e.action === "edit" ? a.crud.openEditDialog(t) : e.action === "view" ? a.crud.openViewDialog(t) : e.action === "duplicate" ? a.crud.openDuplicateDialog(t) : e.action === "delete" && (s["delete-message"] ? (
|
|
2604
|
+
e.action === "edit" ? a.crud.openEditDialog(t) : e.action === "view" ? a.crud.openViewDialog(t) : e.action === "duplicate" ? a.crud.openDuplicateDialog(t) : e.action === "delete" && (s["delete-message"] ? (Te.value = t, Ee.value = !0) : a.crud.confirmDelete(t));
|
|
2602
2605
|
}
|
|
2603
|
-
let
|
|
2604
|
-
async function
|
|
2605
|
-
if (
|
|
2606
|
-
|
|
2606
|
+
let Te = P(null), Ee = P(!1), De = P(!1);
|
|
2607
|
+
async function Oe() {
|
|
2608
|
+
if (Te.value) {
|
|
2609
|
+
De.value = !0;
|
|
2607
2610
|
try {
|
|
2608
|
-
await a.crud.performDelete(
|
|
2611
|
+
await a.crud.performDelete(Te.value), Ee.value = !1, Te.value = null;
|
|
2609
2612
|
} finally {
|
|
2610
|
-
|
|
2613
|
+
De.value = !1;
|
|
2611
2614
|
}
|
|
2612
2615
|
}
|
|
2613
2616
|
}
|
|
2614
|
-
function
|
|
2617
|
+
function ke(e, t) {
|
|
2615
2618
|
return !e.visible || e.visible(t);
|
|
2616
2619
|
}
|
|
2617
|
-
function
|
|
2620
|
+
function Ae(e, t) {
|
|
2618
2621
|
return e.disabled ? e.disabled(t) : !1;
|
|
2619
2622
|
}
|
|
2620
|
-
let
|
|
2623
|
+
let je = d(() => {
|
|
2621
2624
|
let e = [];
|
|
2622
2625
|
return a.showKpi && e.push({
|
|
2623
2626
|
icon: a.kpiIcon,
|
|
2624
2627
|
label: a.kpiLabel,
|
|
2625
2628
|
value: l(a.crud.pagination.rows, 0)
|
|
2626
2629
|
}), e.push(...a.extraKpis), e;
|
|
2627
|
-
}),
|
|
2628
|
-
function
|
|
2630
|
+
}), Y = d(() => a.crud.config.canCreate !== !1), X = se(e, "selectedRow"), Z = d(() => a.crud.config.selectionMode === "multiple"), Me = P(null);
|
|
2631
|
+
function Ne(e) {
|
|
2629
2632
|
let t = a.crud.config.pk || "id", n = a.crud.items.value.findIndex((n) => n[t] === e);
|
|
2630
2633
|
if (n < 0) return;
|
|
2631
|
-
let r = (
|
|
2634
|
+
let r = (Me.value?.$el)?.querySelectorAll("tbody > tr");
|
|
2632
2635
|
!r || r.length !== a.crud.items.value.length || r[n]?.scrollIntoView({
|
|
2633
2636
|
block: "nearest",
|
|
2634
2637
|
behavior: "smooth"
|
|
2635
2638
|
});
|
|
2636
2639
|
}
|
|
2637
|
-
n({ scrollToRow:
|
|
2638
|
-
let
|
|
2640
|
+
n({ scrollToRow: Ne });
|
|
2641
|
+
let Pe = d(() => a.crud.config.editMode === "cell"), Fe = d(() => new Map(a.crud.config.form.map((e) => [e.field, e]))), Q = [
|
|
2639
2642
|
"text",
|
|
2640
2643
|
"email",
|
|
2641
2644
|
"number",
|
|
2642
2645
|
"currency"
|
|
2643
2646
|
];
|
|
2644
|
-
function Fe(e) {
|
|
2645
|
-
let t = Ne.value.get(e);
|
|
2646
|
-
return t && Pe.includes(t.type || "text") ? t : void 0;
|
|
2647
|
-
}
|
|
2648
2647
|
function Ie(e) {
|
|
2648
|
+
let t = Fe.value.get(e);
|
|
2649
|
+
return t && Q.includes(t.type || "text") ? t : void 0;
|
|
2650
|
+
}
|
|
2651
|
+
function Le(e) {
|
|
2649
2652
|
e.newValue !== (e.value ?? e.data[e.field]) && a.crud.updateField(e.data, e.field, e.newValue);
|
|
2650
2653
|
}
|
|
2651
|
-
let
|
|
2654
|
+
let Re = d(() => a.crud.config.columns.filter((e) => e.filter)), ze = [{
|
|
2652
2655
|
label: "Sim",
|
|
2653
2656
|
value: !0
|
|
2654
2657
|
}, {
|
|
2655
2658
|
label: "Não",
|
|
2656
2659
|
value: !1
|
|
2657
2660
|
}];
|
|
2658
|
-
function
|
|
2661
|
+
function $(e) {
|
|
2659
2662
|
return e.filter?.param || e.field;
|
|
2660
2663
|
}
|
|
2661
2664
|
let Be = {};
|
|
2662
2665
|
function Ve(e, t) {
|
|
2663
|
-
let n =
|
|
2666
|
+
let n = $(e);
|
|
2664
2667
|
Be[n] && clearTimeout(Be[n]), Be[n] = setTimeout(() => a.crud.setColumnFilter(n, t || null), 300);
|
|
2665
2668
|
}
|
|
2666
|
-
let He =
|
|
2669
|
+
let He = P(null);
|
|
2667
2670
|
function Ue(e) {
|
|
2668
|
-
|
|
2671
|
+
X.value = e;
|
|
2669
2672
|
}
|
|
2670
2673
|
function We(e) {
|
|
2671
|
-
a.contextMenu && (
|
|
2674
|
+
a.contextMenu && (X.value = e.data, He.value?.show(e.originalEvent));
|
|
2672
2675
|
}
|
|
2673
2676
|
function Ge(e, t) {
|
|
2674
|
-
a.contextMenu && (e.preventDefault(),
|
|
2677
|
+
a.contextMenu && (e.preventDefault(), X.value = t, He.value?.show(e));
|
|
2675
2678
|
}
|
|
2676
2679
|
let Ke = d(() => {
|
|
2677
|
-
let e =
|
|
2680
|
+
let e = X.value;
|
|
2678
2681
|
if (!e) return [];
|
|
2679
2682
|
let t = [{
|
|
2680
2683
|
label: "Ver detalhes",
|
|
2681
2684
|
icon: "pi pi-eye",
|
|
2682
2685
|
command: () => a.crud.openViewDialog(e)
|
|
2683
2686
|
}];
|
|
2684
|
-
for (let n of
|
|
2687
|
+
for (let n of Se.value) ke(n, e) && t.push({
|
|
2685
2688
|
label: n.tooltip ?? n.action,
|
|
2686
2689
|
icon: n.icon,
|
|
2687
2690
|
class: n.severity === "danger" ? "w-crud-ctx-danger" : void 0,
|
|
2688
|
-
disabled:
|
|
2689
|
-
command: () =>
|
|
2691
|
+
disabled: Ae(n, e),
|
|
2692
|
+
command: () => we(n, e)
|
|
2690
2693
|
});
|
|
2691
2694
|
return a.showPrint && t.push({
|
|
2692
2695
|
label: "Imprimir",
|
|
@@ -2699,40 +2702,40 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2699
2702
|
})), t;
|
|
2700
2703
|
});
|
|
2701
2704
|
function Je() {
|
|
2702
|
-
|
|
2705
|
+
X.value && o("print", X.value);
|
|
2703
2706
|
}
|
|
2704
|
-
let Ye =
|
|
2707
|
+
let Ye = P(!1);
|
|
2705
2708
|
async function Xe() {
|
|
2706
2709
|
if (!Ye.value) {
|
|
2707
2710
|
Ye.value = !0;
|
|
2708
2711
|
try {
|
|
2709
|
-
Rn(Ln(a.csvScope === "page" ? a.crud.items.value : await a.crud.fetchAll(a.csvPageSize),
|
|
2712
|
+
Rn(Ln(a.csvScope === "page" ? a.crud.items.value : await a.crud.fetchAll(a.csvPageSize), U.value), a.csvFilename);
|
|
2710
2713
|
} finally {
|
|
2711
2714
|
Ye.value = !1;
|
|
2712
2715
|
}
|
|
2713
2716
|
}
|
|
2714
2717
|
}
|
|
2715
2718
|
return te(() => {
|
|
2716
|
-
|
|
2719
|
+
M(), oe(), a.autoInit && a.crud.init();
|
|
2717
2720
|
}), (t, n) => {
|
|
2718
|
-
let r =
|
|
2719
|
-
return
|
|
2720
|
-
e.showHeader ? (
|
|
2721
|
+
let r = ie("tooltip");
|
|
2722
|
+
return j(), m("div", zn, [
|
|
2723
|
+
e.showHeader ? (j(), m("div", Bn, [h("div", Vn, [h("h1", Hn, L(e.title), 1), e.subtitle ? (j(), m("p", Un, L(e.subtitle), 1)) : p("", !0)]), h("div", Wn, [I(t.$slots, "header-actions"), Y.value && !e.actionRail ? (j(), f(R(G), {
|
|
2721
2724
|
key: 0,
|
|
2722
2725
|
label: "Novo",
|
|
2723
2726
|
icon: "pi pi-plus",
|
|
2724
2727
|
onClick: n[0] ||= (t) => e.crud.openCreateDialog()
|
|
2725
2728
|
})) : p("", !0)])])) : p("", !0),
|
|
2726
|
-
|
|
2729
|
+
I(t.$slots, "before-table", {}, () => [je.value.length ? (j(), m("div", Gn, [(j(!0), m(u, null, F(je.value, (e, t) => (j(), m("div", {
|
|
2727
2730
|
key: t,
|
|
2728
2731
|
class: "w-crud-kpi"
|
|
2729
2732
|
}, [h("div", { class: O(["w-crud-kpi-icon", e.severity ? `w-crud-kpi-icon--${e.severity}` : ""]) }, [h("i", {
|
|
2730
2733
|
class: O([e.icon]),
|
|
2731
2734
|
style: A(e.color ? `color: ${e.color}` : "")
|
|
2732
|
-
}, null, 6)], 2), h("div", Kn, [h("div", qn,
|
|
2733
|
-
h("div", { class: O(["w-crud-content", { "w-crud-content--rail": e.actionRail }]) }, [h("div", Yn, [
|
|
2735
|
+
}, null, 6)], 2), h("div", Kn, [h("div", qn, L(e.label), 1), h("div", Jn, L(e.value), 1)])]))), 128))])) : p("", !0)]),
|
|
2736
|
+
h("div", { class: O(["w-crud-content", { "w-crud-content--rail": e.actionRail }]) }, [h("div", Yn, [Re.value.length ? (j(), m("div", Xn, [(j(!0), m(u, null, F(Re.value, (t) => (j(), m(u, { key: t.field }, [(t.filter?.type || "text") === "text" ? (j(), f(R(K), {
|
|
2734
2737
|
key: 0,
|
|
2735
|
-
"model-value": e.crud.columnFilters[
|
|
2738
|
+
"model-value": e.crud.columnFilters[$(t)] ?? "",
|
|
2736
2739
|
placeholder: t.filter?.placeholder || t.header,
|
|
2737
2740
|
size: "small",
|
|
2738
2741
|
onInput: (e) => Ve(t, e.target.value)
|
|
@@ -2740,58 +2743,58 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2740
2743
|
"model-value",
|
|
2741
2744
|
"placeholder",
|
|
2742
2745
|
"onInput"
|
|
2743
|
-
])) : t.filter?.type === "select" ? (
|
|
2746
|
+
])) : t.filter?.type === "select" ? (j(), f(R(pe), {
|
|
2744
2747
|
key: 1,
|
|
2745
|
-
"model-value": e.crud.columnFilters[
|
|
2748
|
+
"model-value": e.crud.columnFilters[$(t)],
|
|
2746
2749
|
options: t.filter?.options,
|
|
2747
2750
|
"option-label": "label",
|
|
2748
2751
|
"option-value": "value",
|
|
2749
2752
|
placeholder: t.filter?.placeholder || t.header,
|
|
2750
2753
|
"show-clear": "",
|
|
2751
2754
|
size: "small",
|
|
2752
|
-
"onUpdate:modelValue": (n) => e.crud.setColumnFilter(
|
|
2755
|
+
"onUpdate:modelValue": (n) => e.crud.setColumnFilter($(t), n)
|
|
2753
2756
|
}, null, 8, [
|
|
2754
2757
|
"model-value",
|
|
2755
2758
|
"options",
|
|
2756
2759
|
"placeholder",
|
|
2757
2760
|
"onUpdate:modelValue"
|
|
2758
|
-
])) : t.filter?.type === "boolean" ? (
|
|
2761
|
+
])) : t.filter?.type === "boolean" ? (j(), f(R(pe), {
|
|
2759
2762
|
key: 2,
|
|
2760
|
-
"model-value": e.crud.columnFilters[
|
|
2761
|
-
options:
|
|
2763
|
+
"model-value": e.crud.columnFilters[$(t)],
|
|
2764
|
+
options: ze,
|
|
2762
2765
|
"option-label": "label",
|
|
2763
2766
|
"option-value": "value",
|
|
2764
2767
|
placeholder: t.filter?.placeholder || t.header,
|
|
2765
2768
|
"show-clear": "",
|
|
2766
2769
|
size: "small",
|
|
2767
|
-
"onUpdate:modelValue": (n) => e.crud.setColumnFilter(
|
|
2770
|
+
"onUpdate:modelValue": (n) => e.crud.setColumnFilter($(t), n)
|
|
2768
2771
|
}, null, 8, [
|
|
2769
2772
|
"model-value",
|
|
2770
2773
|
"placeholder",
|
|
2771
2774
|
"onUpdate:modelValue"
|
|
2772
|
-
])) : t.filter?.type === "numeric" ? (
|
|
2775
|
+
])) : t.filter?.type === "numeric" ? (j(), f(R(fe), {
|
|
2773
2776
|
key: 3,
|
|
2774
|
-
"model-value": e.crud.columnFilters[
|
|
2777
|
+
"model-value": e.crud.columnFilters[$(t)] ?? null,
|
|
2775
2778
|
placeholder: t.filter?.placeholder || t.header,
|
|
2776
2779
|
size: "small",
|
|
2777
|
-
"onUpdate:modelValue": (n) => e.crud.setColumnFilter(
|
|
2780
|
+
"onUpdate:modelValue": (n) => e.crud.setColumnFilter($(t), n)
|
|
2778
2781
|
}, null, 8, [
|
|
2779
2782
|
"model-value",
|
|
2780
2783
|
"placeholder",
|
|
2781
2784
|
"onUpdate:modelValue"
|
|
2782
|
-
])) : p("", !0)], 64))), 128)), Object.keys(e.crud.columnFilters).length ? (
|
|
2785
|
+
])) : p("", !0)], 64))), 128)), Object.keys(e.crud.columnFilters).length ? (j(), f(R(G), {
|
|
2783
2786
|
key: 0,
|
|
2784
2787
|
label: "Limpar filtros",
|
|
2785
2788
|
icon: "pi pi-filter-slash",
|
|
2786
2789
|
text: "",
|
|
2787
2790
|
size: "small",
|
|
2788
2791
|
onClick: n[1] ||= (t) => e.crud.clearColumnFilters()
|
|
2789
|
-
})) : p("", !0)])) : p("", !0), C.value === "table" ? (
|
|
2790
|
-
h("span", $n,
|
|
2791
|
-
|
|
2792
|
+
})) : p("", !0)])) : p("", !0), C.value === "table" ? (j(), m("div", Zn, [Z.value && e.crud.selectedItems.value.length ? (j(), m("div", Qn, [
|
|
2793
|
+
h("span", $n, L(e.crud.selectedItems.value.length) + " selecionado(s) ", 1),
|
|
2794
|
+
I(t.$slots, "bulk-actions", {
|
|
2792
2795
|
selected: e.crud.selectedItems.value,
|
|
2793
2796
|
crud: e.crud
|
|
2794
|
-
}, () => [(
|
|
2797
|
+
}, () => [(j(!0), m(u, null, F(e.crud.config.bulkActions || [], (t) => (j(), f(R(G), {
|
|
2795
2798
|
key: t.action,
|
|
2796
2799
|
label: t.label,
|
|
2797
2800
|
icon: t.icon,
|
|
@@ -2806,7 +2809,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2806
2809
|
"disabled",
|
|
2807
2810
|
"onClick"
|
|
2808
2811
|
]))), 128))]),
|
|
2809
|
-
|
|
2812
|
+
V(y(R(G), {
|
|
2810
2813
|
icon: "pi pi-times",
|
|
2811
2814
|
text: "",
|
|
2812
2815
|
rounded: "",
|
|
@@ -2818,9 +2821,9 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2818
2821
|
void 0,
|
|
2819
2822
|
{ top: !0 }
|
|
2820
2823
|
]])
|
|
2821
|
-
])) : p("", !0), y(R(
|
|
2824
|
+
])) : p("", !0), y(R(de), {
|
|
2822
2825
|
ref_key: "tableRef",
|
|
2823
|
-
ref:
|
|
2826
|
+
ref: Me,
|
|
2824
2827
|
"expanded-rows": v.value,
|
|
2825
2828
|
"onUpdate:expandedRows": n[7] ||= (e) => v.value = e,
|
|
2826
2829
|
value: e.crud.items.value,
|
|
@@ -2843,13 +2846,13 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2843
2846
|
"sort-field": e.crud.sort.field ?? void 0,
|
|
2844
2847
|
"sort-order": e.crud.sort.order,
|
|
2845
2848
|
"data-key": e.crud.config.pk || "id",
|
|
2846
|
-
"edit-mode":
|
|
2847
|
-
selection:
|
|
2848
|
-
"selection-mode":
|
|
2849
|
+
"edit-mode": Pe.value ? "cell" : void 0,
|
|
2850
|
+
selection: Z.value ? e.crud.selectedItems.value : e.actionRail || e.contextMenu ? X.value : void 0,
|
|
2851
|
+
"selection-mode": Z.value ? void 0 : e.actionRail || e.contextMenu ? "single" : void 0,
|
|
2849
2852
|
"context-menu": e.contextMenu,
|
|
2850
|
-
"context-menu-selection": e.contextMenu ?
|
|
2851
|
-
"onUpdate:selection": n[8] ||= (t) =>
|
|
2852
|
-
"onUpdate:contextMenuSelection": n[9] ||= (e) =>
|
|
2853
|
+
"context-menu-selection": e.contextMenu ? X.value : void 0,
|
|
2854
|
+
"onUpdate:selection": n[8] ||= (t) => Z.value ? e.crud.selectedItems.value = t : X.value = t,
|
|
2855
|
+
"onUpdate:contextMenuSelection": n[9] ||= (e) => X.value = e,
|
|
2853
2856
|
onRowContextmenu: We,
|
|
2854
2857
|
onPage: e.crud.onPage,
|
|
2855
2858
|
onSort: n[10] ||= (t) => e.crud.onSort({
|
|
@@ -2858,11 +2861,11 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2858
2861
|
}),
|
|
2859
2862
|
onRowExpand: n[11] ||= (e) => o("row-expand", e.data),
|
|
2860
2863
|
onRowCollapse: n[12] ||= (e) => o("row-collapse", e.data),
|
|
2861
|
-
onCellEditComplete:
|
|
2864
|
+
onCellEditComplete: Le
|
|
2862
2865
|
}, g({
|
|
2863
|
-
header:
|
|
2864
|
-
e.showSearch ? (
|
|
2865
|
-
default:
|
|
2866
|
+
header: B(() => [h("div", er, [h("div", tr, [
|
|
2867
|
+
e.showSearch ? (j(), f(R(he), { key: 0 }, {
|
|
2868
|
+
default: B(() => [y(R(ge), { class: "pi pi-search" }), y(R(K), {
|
|
2866
2869
|
"model-value": e.crud.search.value,
|
|
2867
2870
|
placeholder: "Buscar...",
|
|
2868
2871
|
class: "w-72",
|
|
@@ -2870,11 +2873,11 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2870
2873
|
}, null, 8, ["model-value", "onInput"])]),
|
|
2871
2874
|
_: 1
|
|
2872
2875
|
})) : p("", !0),
|
|
2873
|
-
|
|
2874
|
-
|
|
2876
|
+
I(t.$slots, "toolbar-start"),
|
|
2877
|
+
I(t.$slots, "toolbar-filters")
|
|
2875
2878
|
]), h("div", nr, [
|
|
2876
|
-
|
|
2877
|
-
e.persistState ? (
|
|
2879
|
+
I(t.$slots, "toolbar-actions"),
|
|
2880
|
+
e.persistState ? (j(), m(u, { key: 0 }, [V(y(R(G), {
|
|
2878
2881
|
icon: "pi pi-sliders-h",
|
|
2879
2882
|
text: "",
|
|
2880
2883
|
size: "small",
|
|
@@ -2884,22 +2887,22 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2884
2887
|
"Colunas",
|
|
2885
2888
|
void 0,
|
|
2886
2889
|
{ top: !0 }
|
|
2887
|
-
]]), y(R(
|
|
2890
|
+
]]), y(R(q), {
|
|
2888
2891
|
ref_key: "chooser",
|
|
2889
2892
|
ref: ee
|
|
2890
2893
|
}, {
|
|
2891
|
-
default:
|
|
2894
|
+
default: B(() => [h("div", rr, [(j(!0), m(u, null, F(ue.value, (e) => (j(), m("div", {
|
|
2892
2895
|
key: e.field,
|
|
2893
2896
|
style: {
|
|
2894
2897
|
display: "flex",
|
|
2895
2898
|
"align-items": "center",
|
|
2896
2899
|
gap: "0.5rem"
|
|
2897
2900
|
}
|
|
2898
|
-
}, [y(R(
|
|
2901
|
+
}, [y(R(me), {
|
|
2899
2902
|
"model-value": !D.hidden.includes(e.field),
|
|
2900
2903
|
"input-id": `wcrud-col-${e.field}`,
|
|
2901
2904
|
binary: "",
|
|
2902
|
-
"onUpdate:modelValue": (t) =>
|
|
2905
|
+
"onUpdate:modelValue": (t) => H(e.field, !!t)
|
|
2903
2906
|
}, null, 8, [
|
|
2904
2907
|
"model-value",
|
|
2905
2908
|
"input-id",
|
|
@@ -2910,10 +2913,10 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2910
2913
|
"font-size": "0.85rem",
|
|
2911
2914
|
cursor: "pointer"
|
|
2912
2915
|
}
|
|
2913
|
-
},
|
|
2916
|
+
}, L(e.header), 9, ir)]))), 128))])]),
|
|
2914
2917
|
_: 1
|
|
2915
2918
|
}, 512)], 64)) : p("", !0),
|
|
2916
|
-
e.exportCsv ?
|
|
2919
|
+
e.exportCsv ? V((j(), f(R(G), {
|
|
2917
2920
|
key: 1,
|
|
2918
2921
|
icon: "pi pi-download",
|
|
2919
2922
|
text: "",
|
|
@@ -2926,52 +2929,52 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2926
2929
|
void 0,
|
|
2927
2930
|
{ top: !0 }
|
|
2928
2931
|
]]) : p("", !0),
|
|
2929
|
-
e.viewToggle ? (
|
|
2932
|
+
e.viewToggle ? (j(), m("div", ar, [y(R(G), {
|
|
2930
2933
|
icon: "pi pi-table",
|
|
2931
2934
|
size: "small",
|
|
2932
2935
|
text: !w("table"),
|
|
2933
2936
|
outlined: w("table"),
|
|
2934
2937
|
onClick: n[4] ||= (e) => T("table")
|
|
2935
|
-
}, null, 8, ["text", "outlined"]), y(R(
|
|
2938
|
+
}, null, 8, ["text", "outlined"]), y(R(G), {
|
|
2936
2939
|
icon: "pi pi-th-large",
|
|
2937
2940
|
size: "small",
|
|
2938
2941
|
text: !w("cards"),
|
|
2939
2942
|
outlined: w("cards"),
|
|
2940
2943
|
onClick: n[5] ||= (e) => T("cards")
|
|
2941
2944
|
}, null, 8, ["text", "outlined"])])) : p("", !0),
|
|
2942
|
-
!e.showHeader &&
|
|
2945
|
+
!e.showHeader && Y.value && !e.actionRail ? (j(), f(R(G), {
|
|
2943
2946
|
key: 3,
|
|
2944
2947
|
label: "Novo",
|
|
2945
2948
|
icon: "pi pi-plus",
|
|
2946
2949
|
onClick: n[6] ||= (t) => e.crud.openCreateDialog()
|
|
2947
2950
|
})) : p("", !0)
|
|
2948
2951
|
])])]),
|
|
2949
|
-
empty:
|
|
2952
|
+
empty: B(() => [I(t.$slots, "empty", {}, () => [n[22] ||= h("div", { class: "w-crud-empty" }, [
|
|
2950
2953
|
h("div", { class: "w-crud-empty-icon" }, [h("i", { class: "pi pi-inbox" })]),
|
|
2951
2954
|
h("p", { class: "w-crud-empty-title" }, "Nenhum registro encontrado"),
|
|
2952
2955
|
h("p", { class: "w-crud-empty-text" }, "Tente ajustar sua busca ou crie um novo registro")
|
|
2953
2956
|
], -1)])]),
|
|
2954
|
-
default:
|
|
2955
|
-
|
|
2957
|
+
default: B(() => [
|
|
2958
|
+
Z.value ? (j(), f(R(W), {
|
|
2956
2959
|
key: 0,
|
|
2957
2960
|
"selection-mode": "multiple",
|
|
2958
2961
|
style: { width: "3rem" }
|
|
2959
2962
|
})) : p("", !0),
|
|
2960
|
-
e.expandable ? (
|
|
2963
|
+
e.expandable ? (j(), f(R(W), {
|
|
2961
2964
|
key: 1,
|
|
2962
2965
|
expander: "",
|
|
2963
2966
|
style: { width: "3rem" }
|
|
2964
2967
|
})) : p("", !0),
|
|
2965
|
-
(
|
|
2968
|
+
(j(!0), m(u, null, F(U.value, (e) => (j(), f(R(W), {
|
|
2966
2969
|
key: e.field,
|
|
2967
2970
|
field: e.field,
|
|
2968
2971
|
header: e.header,
|
|
2969
2972
|
sortable: e.sortable,
|
|
2970
2973
|
style: A(e.style),
|
|
2971
|
-
"header-class":
|
|
2972
|
-
"body-class":
|
|
2974
|
+
"header-class": be(e),
|
|
2975
|
+
"body-class": be(e)
|
|
2973
2976
|
}, g({
|
|
2974
|
-
body:
|
|
2977
|
+
body: B(({ data: n }) => [I(t.$slots, `column-${e.field}`, {
|
|
2975
2978
|
data: n,
|
|
2976
2979
|
value: n[e.field]
|
|
2977
2980
|
}, () => [y(qe, {
|
|
@@ -2984,16 +2987,16 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
2984
2987
|
"row-data"
|
|
2985
2988
|
])])]),
|
|
2986
2989
|
_: 2
|
|
2987
|
-
}, [
|
|
2990
|
+
}, [Pe.value && Ie(e.field) ? {
|
|
2988
2991
|
name: "editor",
|
|
2989
|
-
fn:
|
|
2992
|
+
fn: B(({ data: t }) => [["number", "currency"].includes(Ie(e.field)?.type || "") ? (j(), f(R(fe), {
|
|
2990
2993
|
key: 0,
|
|
2991
2994
|
"model-value": t[e.field] ?? null,
|
|
2992
2995
|
fluid: "",
|
|
2993
2996
|
"onUpdate:modelValue": (n) => {
|
|
2994
2997
|
t[e.field] = n;
|
|
2995
2998
|
}
|
|
2996
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"])) : (
|
|
2999
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])) : (j(), f(R(K), {
|
|
2997
3000
|
key: 1,
|
|
2998
3001
|
"model-value": t[e.field] ?? "",
|
|
2999
3002
|
fluid: "",
|
|
@@ -3010,20 +3013,20 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3010
3013
|
"header-class",
|
|
3011
3014
|
"body-class"
|
|
3012
3015
|
]))), 128)),
|
|
3013
|
-
|
|
3016
|
+
Ce.value && !e.actionRail ? (j(), f(R(W), {
|
|
3014
3017
|
key: 2,
|
|
3015
3018
|
"header-class": "w-crud-actions-header",
|
|
3016
|
-
style: A({ width: `${(
|
|
3019
|
+
style: A({ width: `${(Se.value.length + +!!R(s)["row-actions"]) * 2.5 + 1}rem` })
|
|
3017
3020
|
}, {
|
|
3018
|
-
body:
|
|
3021
|
+
body: B(({ data: n }) => [h("div", or, [(j(!0), m(u, null, F(Se.value, (e) => (j(), m(u, { key: e.action }, [ke(e, n) ? V((j(), f(R(G), {
|
|
3019
3022
|
key: 0,
|
|
3020
3023
|
icon: e.icon,
|
|
3021
3024
|
text: "",
|
|
3022
3025
|
rounded: "",
|
|
3023
3026
|
size: "small",
|
|
3024
3027
|
severity: e.severity,
|
|
3025
|
-
disabled:
|
|
3026
|
-
onClick: (t) =>
|
|
3028
|
+
disabled: Ae(e, n),
|
|
3029
|
+
onClick: (t) => we(e, n)
|
|
3027
3030
|
}, null, 8, [
|
|
3028
3031
|
"icon",
|
|
3029
3032
|
"severity",
|
|
@@ -3034,7 +3037,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3034
3037
|
e.tooltip,
|
|
3035
3038
|
void 0,
|
|
3036
3039
|
{ top: !0 }
|
|
3037
|
-
]]) : p("", !0)], 64))), 128)),
|
|
3040
|
+
]]) : p("", !0)], 64))), 128)), I(t.$slots, "row-actions", {
|
|
3038
3041
|
data: n,
|
|
3039
3042
|
crud: e.crud
|
|
3040
3043
|
})])]),
|
|
@@ -3044,7 +3047,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3044
3047
|
_: 2
|
|
3045
3048
|
}, [e.expandable ? {
|
|
3046
3049
|
name: "expansion",
|
|
3047
|
-
fn:
|
|
3050
|
+
fn: B((e) => [I(t.$slots, "expansion", { data: e.data })]),
|
|
3048
3051
|
key: "0"
|
|
3049
3052
|
} : void 0]), 1032, [
|
|
3050
3053
|
"expanded-rows",
|
|
@@ -3061,10 +3064,10 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3061
3064
|
"context-menu",
|
|
3062
3065
|
"context-menu-selection",
|
|
3063
3066
|
"onPage"
|
|
3064
|
-
])])) : (
|
|
3067
|
+
])])) : (j(), m("div", sr, [
|
|
3065
3068
|
h("div", cr, [h("div", lr, [
|
|
3066
|
-
e.showSearch ? (
|
|
3067
|
-
default:
|
|
3069
|
+
e.showSearch ? (j(), f(R(he), { key: 0 }, {
|
|
3070
|
+
default: B(() => [y(R(ge), { class: "pi pi-search" }), y(R(K), {
|
|
3068
3071
|
"model-value": e.crud.search.value,
|
|
3069
3072
|
placeholder: "Buscar...",
|
|
3070
3073
|
class: "w-72",
|
|
@@ -3072,11 +3075,11 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3072
3075
|
}, null, 8, ["model-value", "onInput"])]),
|
|
3073
3076
|
_: 1
|
|
3074
3077
|
})) : p("", !0),
|
|
3075
|
-
|
|
3076
|
-
|
|
3078
|
+
I(t.$slots, "toolbar-start"),
|
|
3079
|
+
I(t.$slots, "toolbar-filters")
|
|
3077
3080
|
]), h("div", ur, [
|
|
3078
|
-
|
|
3079
|
-
e.exportCsv ?
|
|
3081
|
+
I(t.$slots, "toolbar-actions"),
|
|
3082
|
+
e.exportCsv ? V((j(), f(R(G), {
|
|
3080
3083
|
key: 0,
|
|
3081
3084
|
icon: "pi pi-download",
|
|
3082
3085
|
text: "",
|
|
@@ -3089,44 +3092,44 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3089
3092
|
void 0,
|
|
3090
3093
|
{ top: !0 }
|
|
3091
3094
|
]]) : p("", !0),
|
|
3092
|
-
e.viewToggle ? (
|
|
3095
|
+
e.viewToggle ? (j(), m("div", dr, [y(R(G), {
|
|
3093
3096
|
icon: "pi pi-table",
|
|
3094
3097
|
size: "small",
|
|
3095
3098
|
text: !w("table"),
|
|
3096
3099
|
outlined: w("table"),
|
|
3097
3100
|
onClick: n[13] ||= (e) => T("table")
|
|
3098
|
-
}, null, 8, ["text", "outlined"]), y(R(
|
|
3101
|
+
}, null, 8, ["text", "outlined"]), y(R(G), {
|
|
3099
3102
|
icon: "pi pi-th-large",
|
|
3100
3103
|
size: "small",
|
|
3101
3104
|
text: !w("cards"),
|
|
3102
3105
|
outlined: w("cards"),
|
|
3103
3106
|
onClick: n[14] ||= (e) => T("cards")
|
|
3104
3107
|
}, null, 8, ["text", "outlined"])])) : p("", !0),
|
|
3105
|
-
!e.showHeader &&
|
|
3108
|
+
!e.showHeader && Y.value && !e.actionRail ? (j(), f(R(G), {
|
|
3106
3109
|
key: 2,
|
|
3107
3110
|
label: "Novo",
|
|
3108
3111
|
icon: "pi pi-plus",
|
|
3109
3112
|
onClick: n[15] ||= (t) => e.crud.openCreateDialog()
|
|
3110
3113
|
})) : p("", !0)
|
|
3111
3114
|
])]),
|
|
3112
|
-
e.crud.loading.value ? (
|
|
3115
|
+
e.crud.loading.value ? (j(), m("div", fr, [...n[23] ||= [h("i", { class: "pi pi-spin pi-spinner" }, null, -1)]])) : e.crud.items.value.length ? (j(), m("div", {
|
|
3113
3116
|
key: 2,
|
|
3114
3117
|
class: O(["w-crud-cards", { "w-crud-cards--bare": e.cardBare }])
|
|
3115
|
-
}, [(
|
|
3118
|
+
}, [(j(!0), m(u, null, F(e.crud.items.value, (n, i) => (j(), m("div", {
|
|
3116
3119
|
key: n[e.crud.config.pk || "id"] ?? i,
|
|
3117
|
-
class: O(e.cardBare ? "w-crud-card-bare" : ["w-crud-card", { "w-crud-card--selected":
|
|
3120
|
+
class: O(e.cardBare ? "w-crud-card-bare" : ["w-crud-card", { "w-crud-card--selected": X.value === n }]),
|
|
3118
3121
|
onClick: (t) => !e.cardBare && Ue(n),
|
|
3119
3122
|
onDblclick: (t) => !e.cardBare && e.crud.config.canEdit !== !1 && e.crud.openEditDialog(n),
|
|
3120
3123
|
onContextmenu: (t) => !e.cardBare && Ge(t, n)
|
|
3121
|
-
}, [
|
|
3124
|
+
}, [I(t.$slots, "card", {
|
|
3122
3125
|
data: n,
|
|
3123
3126
|
crud: e.crud,
|
|
3124
|
-
columns:
|
|
3127
|
+
columns: xe.value,
|
|
3125
3128
|
index: i
|
|
3126
|
-
}, () => [h("div", mr, [(
|
|
3129
|
+
}, () => [h("div", mr, [(j(!0), m(u, null, F(xe.value, (e, r) => (j(), m("div", {
|
|
3127
3130
|
key: e.field,
|
|
3128
3131
|
class: O(["w-crud-card-row", { "w-crud-card-row--title": r === 0 }])
|
|
3129
|
-
}, [r === 0 ? p("", !0) : (
|
|
3132
|
+
}, [r === 0 ? p("", !0) : (j(), m("span", hr, L(e.header), 1)), h("span", gr, [I(t.$slots, `column-${e.field}`, {
|
|
3130
3133
|
data: n,
|
|
3131
3134
|
value: n[e.field]
|
|
3132
3135
|
}, () => [y(qe, {
|
|
@@ -3137,15 +3140,15 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3137
3140
|
"column",
|
|
3138
3141
|
"value",
|
|
3139
3142
|
"row-data"
|
|
3140
|
-
])])])], 2))), 128))]),
|
|
3143
|
+
])])])], 2))), 128))]), Ce.value && !e.actionRail ? (j(), m("div", _r, [(j(!0), m(u, null, F(Se.value, (e) => (j(), m(u, { key: e.action }, [ke(e, n) ? V((j(), f(R(G), {
|
|
3141
3144
|
key: 0,
|
|
3142
3145
|
icon: e.icon,
|
|
3143
3146
|
text: "",
|
|
3144
3147
|
rounded: "",
|
|
3145
3148
|
size: "small",
|
|
3146
3149
|
severity: e.severity,
|
|
3147
|
-
disabled:
|
|
3148
|
-
onClick: (t) =>
|
|
3150
|
+
disabled: Ae(e, n),
|
|
3151
|
+
onClick: (t) => we(e, n)
|
|
3149
3152
|
}, null, 8, [
|
|
3150
3153
|
"icon",
|
|
3151
3154
|
"severity",
|
|
@@ -3156,11 +3159,11 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3156
3159
|
e.tooltip,
|
|
3157
3160
|
void 0,
|
|
3158
3161
|
{ top: !0 }
|
|
3159
|
-
]]) : p("", !0)], 64))), 128)),
|
|
3162
|
+
]]) : p("", !0)], 64))), 128)), I(t.$slots, "row-actions", {
|
|
3160
3163
|
data: n,
|
|
3161
3164
|
crud: e.crud
|
|
3162
|
-
})])) : p("", !0)])], 42, pr))), 128))], 2)) :
|
|
3163
|
-
e.crud.items.value.length ? (
|
|
3165
|
+
})])) : p("", !0)])], 42, pr))), 128))], 2)) : I(t.$slots, "empty", {}, () => [n[24] ||= _("<div class=\"w-crud-empty\"><div class=\"w-crud-empty-icon\"><i class=\"pi pi-inbox\"></i></div><p class=\"w-crud-empty-title\">Nenhum registro encontrado</p><p class=\"w-crud-empty-text\">Tente ajustar sua busca ou crie um novo registro</p></div>", 1)], void 0, 1),
|
|
3166
|
+
e.crud.items.value.length ? (j(), f(R(_e), {
|
|
3164
3167
|
key: 3,
|
|
3165
3168
|
rows: e.crud.pagination.pageSize,
|
|
3166
3169
|
"total-records": e.crud.pagination.rows,
|
|
@@ -3180,8 +3183,8 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3180
3183
|
"first",
|
|
3181
3184
|
"onPage"
|
|
3182
3185
|
])) : p("", !0)
|
|
3183
|
-
]))]), e.actionRail ? (
|
|
3184
|
-
|
|
3186
|
+
]))]), e.actionRail ? (j(), m("aside", vr, [
|
|
3187
|
+
Y.value ? V((j(), f(R(G), {
|
|
3185
3188
|
key: 0,
|
|
3186
3189
|
icon: "pi pi-plus",
|
|
3187
3190
|
rounded: "",
|
|
@@ -3192,15 +3195,15 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3192
3195
|
void 0,
|
|
3193
3196
|
{ left: !0 }
|
|
3194
3197
|
]]) : p("", !0),
|
|
3195
|
-
|
|
3196
|
-
(
|
|
3198
|
+
Y.value && Se.value.length ? (j(), m("div", yr)) : p("", !0),
|
|
3199
|
+
(j(!0), m(u, null, F(Se.value, (e) => (j(), m(u, { key: e.action }, [!X.value || ke(e, X.value) ? V((j(), f(R(G), {
|
|
3197
3200
|
key: 0,
|
|
3198
3201
|
icon: e.icon,
|
|
3199
3202
|
text: "",
|
|
3200
3203
|
rounded: "",
|
|
3201
3204
|
severity: e.severity,
|
|
3202
|
-
disabled: !
|
|
3203
|
-
onClick: (t) =>
|
|
3205
|
+
disabled: !X.value || Ae(e, X.value),
|
|
3206
|
+
onClick: (t) => X.value && we(e, X.value)
|
|
3204
3207
|
}, null, 8, [
|
|
3205
3208
|
"icon",
|
|
3206
3209
|
"severity",
|
|
@@ -3212,17 +3215,17 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3212
3215
|
void 0,
|
|
3213
3216
|
{ left: !0 }
|
|
3214
3217
|
]]) : p("", !0)], 64))), 128)),
|
|
3215
|
-
|
|
3216
|
-
selected:
|
|
3218
|
+
I(t.$slots, "rail-actions", {
|
|
3219
|
+
selected: X.value,
|
|
3217
3220
|
crud: e.crud
|
|
3218
3221
|
}),
|
|
3219
|
-
e.showPrint || e.exportCsv ? (
|
|
3220
|
-
e.showPrint ?
|
|
3222
|
+
e.showPrint || e.exportCsv ? (j(), m("div", br)) : p("", !0),
|
|
3223
|
+
e.showPrint ? V((j(), f(R(G), {
|
|
3221
3224
|
key: 3,
|
|
3222
3225
|
icon: "pi pi-print",
|
|
3223
3226
|
text: "",
|
|
3224
3227
|
rounded: "",
|
|
3225
|
-
disabled: !
|
|
3228
|
+
disabled: !X.value,
|
|
3226
3229
|
onClick: Je
|
|
3227
3230
|
}, null, 8, ["disabled"])), [[
|
|
3228
3231
|
r,
|
|
@@ -3230,7 +3233,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3230
3233
|
void 0,
|
|
3231
3234
|
{ left: !0 }
|
|
3232
3235
|
]]) : p("", !0),
|
|
3233
|
-
e.exportCsv ?
|
|
3236
|
+
e.exportCsv ? V((j(), f(R(G), {
|
|
3234
3237
|
key: 4,
|
|
3235
3238
|
icon: "pi pi-download",
|
|
3236
3239
|
text: "",
|
|
@@ -3244,13 +3247,13 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3244
3247
|
{ left: !0 }
|
|
3245
3248
|
]]) : p("", !0)
|
|
3246
3249
|
])) : p("", !0)], 2),
|
|
3247
|
-
e.contextMenu ? (
|
|
3250
|
+
e.contextMenu ? (j(), f(R(ve), {
|
|
3248
3251
|
key: 1,
|
|
3249
3252
|
ref_key: "cm",
|
|
3250
3253
|
ref: He,
|
|
3251
3254
|
model: Ke.value
|
|
3252
3255
|
}, null, 8, ["model"])) : p("", !0),
|
|
3253
|
-
|
|
3256
|
+
I(t.$slots, "form-dialog", {
|
|
3254
3257
|
crud: e.crud,
|
|
3255
3258
|
dialogWidth: e.dialogWidth
|
|
3256
3259
|
}, () => [y(Pn, {
|
|
@@ -3269,9 +3272,9 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3269
3272
|
},
|
|
3270
3273
|
"onUpdate:field": n[18] ||= (t, n) => e.crud.setFormField(t, n),
|
|
3271
3274
|
onSave: n[19] ||= (t) => e.crud.save()
|
|
3272
|
-
}, g({ _: 2 }, [
|
|
3275
|
+
}, g({ _: 2 }, [F(e.crud.config.form, (e) => ({
|
|
3273
3276
|
name: `field-${e.field}`,
|
|
3274
|
-
fn:
|
|
3277
|
+
fn: B((n) => [I(t.$slots, `field-${e.field}`, k(x(n)))])
|
|
3275
3278
|
}))]), 1032, [
|
|
3276
3279
|
"visible",
|
|
3277
3280
|
"title",
|
|
@@ -3284,10 +3287,10 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3284
3287
|
"form-columns",
|
|
3285
3288
|
"keyboard-nav"
|
|
3286
3289
|
])]),
|
|
3287
|
-
t.$slots["delete-message"] ? (
|
|
3290
|
+
t.$slots["delete-message"] ? (j(), f(R(ye), {
|
|
3288
3291
|
key: 2,
|
|
3289
|
-
visible:
|
|
3290
|
-
"onUpdate:visible": n[21] ||= (e) =>
|
|
3292
|
+
visible: Ee.value,
|
|
3293
|
+
"onUpdate:visible": n[21] ||= (e) => Ee.value = e,
|
|
3291
3294
|
"append-to": R(i)?.hostEl.value ?? "body",
|
|
3292
3295
|
header: "Confirmar Exclusão",
|
|
3293
3296
|
modal: "",
|
|
@@ -3295,22 +3298,22 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3295
3298
|
class: "w-crud-delete-dialog",
|
|
3296
3299
|
style: { width: "30rem" }
|
|
3297
3300
|
}, {
|
|
3298
|
-
footer:
|
|
3301
|
+
footer: B(() => [y(R(G), {
|
|
3299
3302
|
type: "button",
|
|
3300
3303
|
label: "Cancelar",
|
|
3301
3304
|
severity: "secondary",
|
|
3302
3305
|
text: "",
|
|
3303
|
-
disabled:
|
|
3304
|
-
onClick: n[20] ||= (e) =>
|
|
3305
|
-
}, null, 8, ["disabled"]), y(R(
|
|
3306
|
+
disabled: De.value,
|
|
3307
|
+
onClick: n[20] ||= (e) => Ee.value = !1
|
|
3308
|
+
}, null, 8, ["disabled"]), y(R(G), {
|
|
3306
3309
|
type: "button",
|
|
3307
3310
|
label: "Excluir",
|
|
3308
3311
|
icon: "pi pi-trash",
|
|
3309
3312
|
severity: "danger",
|
|
3310
|
-
loading:
|
|
3311
|
-
onClick:
|
|
3313
|
+
loading: De.value,
|
|
3314
|
+
onClick: Oe
|
|
3312
3315
|
}, null, 8, ["loading"])]),
|
|
3313
|
-
default:
|
|
3316
|
+
default: B(() => [I(t.$slots, "delete-message", { item: Te.value })]),
|
|
3314
3317
|
_: 3
|
|
3315
3318
|
}, 8, ["visible", "append-to"])) : p("", !0)
|
|
3316
3319
|
]);
|
|
@@ -3383,7 +3386,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3383
3386
|
"remove"
|
|
3384
3387
|
],
|
|
3385
3388
|
setup(e, { emit: n }) {
|
|
3386
|
-
let r = e, i = n, { formatNumber: a } = t(), o =
|
|
3389
|
+
let r = e, i = n, { formatNumber: a } = t(), o = P(/* @__PURE__ */ new Set());
|
|
3387
3390
|
function s(e) {
|
|
3388
3391
|
return o.value.has(e);
|
|
3389
3392
|
}
|
|
@@ -3446,7 +3449,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3446
3449
|
let t = r.modelValue.reduce((t, n) => t + S(n[e.field]), 0);
|
|
3447
3450
|
return `${a(t, e.decimals ?? 2)}${e.suffix ?? ""}`;
|
|
3448
3451
|
}
|
|
3449
|
-
let te = d(() => r.columns.find((e) => !e.footer || e.footer === "none")?.field ?? null),
|
|
3452
|
+
let te = d(() => r.columns.find((e) => !e.footer || e.footer === "none")?.field ?? null), ne = d(() => r.columns.length + +!!r.expandable + +!!r.removable), M = d(() => r.columns.some((e) => e.group)), N = d(() => {
|
|
3450
3453
|
let e = [];
|
|
3451
3454
|
for (let t of r.columns) {
|
|
3452
3455
|
let n = t.group ?? "", r = e[e.length - 1];
|
|
@@ -3458,51 +3461,52 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3458
3461
|
}
|
|
3459
3462
|
return e;
|
|
3460
3463
|
});
|
|
3461
|
-
return (t, n) => (
|
|
3464
|
+
return (t, n) => (j(), m("div", Sr, [t.$slots.toolbar || t.$slots["toolbar-extra"] || e.addLabel ? (j(), m("div", Cr, [I(t.$slots, "toolbar", {}, () => [e.addLabel ? (j(), m("button", {
|
|
3465
|
+
key: 0,
|
|
3462
3466
|
type: "button",
|
|
3463
3467
|
class: "w-editable-table__add",
|
|
3464
3468
|
disabled: e.disabled,
|
|
3465
3469
|
onClick: n[0] ||= (e) => i("add")
|
|
3466
|
-
}, [n[1] ||= h("i", { class: "pi pi-plus" }, null, -1), v(
|
|
3467
|
-
h("thead", null, [
|
|
3468
|
-
e.expandable ? (
|
|
3469
|
-
(
|
|
3470
|
+
}, [n[1] ||= h("i", { class: "pi pi-plus" }, null, -1), v(L(e.addLabel), 1)], 8, wr)) : p("", !0)]), I(t.$slots, "toolbar-extra")])) : p("", !0), h("table", Tr, [
|
|
3471
|
+
h("thead", null, [M.value ? (j(), m("tr", Er, [
|
|
3472
|
+
e.expandable ? (j(), m("th", Dr)) : p("", !0),
|
|
3473
|
+
(j(!0), m(u, null, F(N.value, (e) => (j(), m("th", {
|
|
3470
3474
|
key: e.key,
|
|
3471
3475
|
colspan: e.span,
|
|
3472
3476
|
class: O(["w-editable-table__group", { "w-editable-table__group--label": e.label }])
|
|
3473
|
-
},
|
|
3474
|
-
e.removable ? (
|
|
3477
|
+
}, L(e.label), 11, Or))), 128)),
|
|
3478
|
+
e.removable ? (j(), m("th", kr)) : p("", !0)
|
|
3475
3479
|
])) : p("", !0), h("tr", null, [
|
|
3476
|
-
e.expandable ? (
|
|
3477
|
-
(
|
|
3480
|
+
e.expandable ? (j(), m("th", Ar)) : p("", !0),
|
|
3481
|
+
(j(!0), m(u, null, F(e.columns, (e) => (j(), m("th", {
|
|
3478
3482
|
key: e.field,
|
|
3479
3483
|
class: O(y(e)),
|
|
3480
3484
|
style: A(b(e))
|
|
3481
|
-
},
|
|
3482
|
-
e.removable ? (
|
|
3485
|
+
}, L(e.header), 7))), 128)),
|
|
3486
|
+
e.removable ? (j(), m("th", jr)) : p("", !0)
|
|
3483
3487
|
])]),
|
|
3484
|
-
e.modelValue.length ? p("", !0) : (
|
|
3485
|
-
colspan:
|
|
3488
|
+
e.modelValue.length ? p("", !0) : (j(), m("tbody", Mr, [h("tr", null, [h("td", {
|
|
3489
|
+
colspan: ne.value,
|
|
3486
3490
|
class: "w-editable-table__empty"
|
|
3487
|
-
}, [
|
|
3488
|
-
(
|
|
3489
|
-
e.expandable ? (
|
|
3491
|
+
}, [I(t.$slots, "empty", {}, () => [v(L(e.emptyMessage), 1)])], 8, Nr)])])),
|
|
3492
|
+
(j(!0), m(u, null, F(e.modelValue, (r, i) => (j(), m("tbody", { key: D(r, i) }, [h("tr", { class: O(["w-editable-table__row", { "w-editable-table__row--alt": i % 2 == 1 }]) }, [
|
|
3493
|
+
e.expandable ? (j(), m("td", Pr, [h("button", {
|
|
3490
3494
|
type: "button",
|
|
3491
3495
|
class: "w-editable-table__toggle",
|
|
3492
3496
|
"aria-expanded": s(i),
|
|
3493
3497
|
"aria-label": "Detalhes da linha",
|
|
3494
3498
|
onClick: (e) => c(i)
|
|
3495
3499
|
}, [h("i", { class: O(s(i) ? "pi pi-chevron-down" : "pi pi-chevron-right") }, null, 2)], 8, Fr)])) : p("", !0),
|
|
3496
|
-
(
|
|
3500
|
+
(j(!0), m(u, null, F(e.columns, (e) => (j(), m("td", {
|
|
3497
3501
|
key: e.field,
|
|
3498
3502
|
class: O(y(e)),
|
|
3499
3503
|
style: A(b(e))
|
|
3500
|
-
}, [
|
|
3504
|
+
}, [I(t.$slots, `cell-${e.field}`, {
|
|
3501
3505
|
row: r,
|
|
3502
3506
|
index: i,
|
|
3503
3507
|
value: r[e.field],
|
|
3504
3508
|
column: e
|
|
3505
|
-
}, () => [e.editor === "number" ? (
|
|
3509
|
+
}, () => [e.editor === "number" ? (j(), f(R(fe), {
|
|
3506
3510
|
key: 0,
|
|
3507
3511
|
"model-value": r[e.field],
|
|
3508
3512
|
fluid: "",
|
|
@@ -3526,7 +3530,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3526
3530
|
"placeholder",
|
|
3527
3531
|
"disabled",
|
|
3528
3532
|
"onUpdate:modelValue"
|
|
3529
|
-
])) : e.editor === "text" ? (
|
|
3533
|
+
])) : e.editor === "text" ? (j(), f(R(K), {
|
|
3530
3534
|
key: 1,
|
|
3531
3535
|
"model-value": r[e.field],
|
|
3532
3536
|
fluid: "",
|
|
@@ -3538,7 +3542,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3538
3542
|
"placeholder",
|
|
3539
3543
|
"disabled",
|
|
3540
3544
|
"onUpdate:modelValue"
|
|
3541
|
-
])) : e.editor === "select" ? (
|
|
3545
|
+
])) : e.editor === "select" ? (j(), f(R(pe), {
|
|
3542
3546
|
key: 2,
|
|
3543
3547
|
"model-value": r[e.field],
|
|
3544
3548
|
fluid: "",
|
|
@@ -3556,28 +3560,28 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3556
3560
|
"placeholder",
|
|
3557
3561
|
"disabled",
|
|
3558
3562
|
"onUpdate:modelValue"
|
|
3559
|
-
])) : (
|
|
3560
|
-
e.removable ? (
|
|
3563
|
+
])) : (j(), m("span", Ir, L(C(e, r)), 1))])], 6))), 128)),
|
|
3564
|
+
e.removable ? (j(), m("td", Lr, [h("button", {
|
|
3561
3565
|
type: "button",
|
|
3562
3566
|
class: "w-editable-table__remove",
|
|
3563
3567
|
"aria-label": "Remover linha",
|
|
3564
3568
|
onClick: (e) => E(r, i)
|
|
3565
3569
|
}, [...n[2] ||= [h("i", { class: "pi pi-trash" }, null, -1)]], 8, Rr)])) : p("", !0)
|
|
3566
|
-
], 2), e.expandable && s(i) ? (
|
|
3570
|
+
], 2), e.expandable && s(i) ? (j(), m("tr", zr, [h("td", { colspan: ne.value }, [I(t.$slots, "expansion", {
|
|
3567
3571
|
row: r,
|
|
3568
3572
|
index: i
|
|
3569
3573
|
})], 8, Br)])) : p("", !0)]))), 128)),
|
|
3570
|
-
k.value ? (
|
|
3571
|
-
e.expandable ? (
|
|
3572
|
-
(
|
|
3574
|
+
k.value ? (j(), m("tfoot", Vr, [h("tr", Hr, [
|
|
3575
|
+
e.expandable ? (j(), m("td", Ur)) : p("", !0),
|
|
3576
|
+
(j(!0), m(u, null, F(e.columns, (n) => (j(), m("td", {
|
|
3573
3577
|
key: n.field,
|
|
3574
3578
|
class: O(y(n)),
|
|
3575
3579
|
style: A(b(n))
|
|
3576
|
-
}, [
|
|
3580
|
+
}, [I(t.$slots, `footer-${n.field}`, {
|
|
3577
3581
|
rows: e.modelValue,
|
|
3578
3582
|
column: n
|
|
3579
|
-
}, () => [n.field === te.value ? (
|
|
3580
|
-
e.removable ? (
|
|
3583
|
+
}, () => [n.field === te.value ? (j(), m("span", Wr, L(e.footerLabel), 1)) : (j(), m("span", Gr, L(ee(n)), 1))])], 6))), 128)),
|
|
3584
|
+
e.removable ? (j(), m("td", Kr)) : p("", !0)
|
|
3581
3585
|
])])) : p("", !0)
|
|
3582
3586
|
])]));
|
|
3583
3587
|
}
|
|
@@ -3619,7 +3623,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3619
3623
|
rowKey: {}
|
|
3620
3624
|
},
|
|
3621
3625
|
setup(e) {
|
|
3622
|
-
let t = e, n =
|
|
3626
|
+
let t = e, n = ce(), r = d(() => t.crud.items.value), i = d(() => t.crud.config.canCreate !== !1 && !t.disabled), a = d(() => t.crud.config.canEdit !== !1 && !t.disabled), o = d(() => t.crud.config.canDelete !== !1 && !t.disabled), s = d(() => a.value || o.value), c = d(() => s.value ? [...t.columns, {
|
|
3623
3627
|
field: ii,
|
|
3624
3628
|
header: "",
|
|
3625
3629
|
width: "5rem",
|
|
@@ -3628,8 +3632,8 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3628
3632
|
function f(e) {
|
|
3629
3633
|
t.crud.config.onChange(e);
|
|
3630
3634
|
}
|
|
3631
|
-
return (t, n) => (
|
|
3632
|
-
e.title || t.$slots["toolbar-actions"] ? (
|
|
3635
|
+
return (t, n) => (j(), m("div", Jr, [
|
|
3636
|
+
e.title || t.$slots["toolbar-actions"] ? (j(), m("div", Yr, [h("div", Xr, [e.title ? (j(), m("h3", Zr, [v(L(e.title) + " ", 1), r.value.length ? (j(), m("span", Qr, L(r.value.length), 1)) : p("", !0)])) : p("", !0), e.subtitle ? (j(), m("p", $r, L(e.subtitle), 1)) : p("", !0)]), t.$slots["toolbar-actions"] ? (j(), m("div", ei, [I(t.$slots, "toolbar-actions")])) : p("", !0)])) : p("", !0),
|
|
3633
3637
|
y(qr, {
|
|
3634
3638
|
"model-value": r.value,
|
|
3635
3639
|
columns: c.value,
|
|
@@ -3642,13 +3646,13 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3642
3646
|
"onUpdate:modelValue": f,
|
|
3643
3647
|
onAdd: n[0] ||= (t) => e.crud.openCreateDialog()
|
|
3644
3648
|
}, g({
|
|
3645
|
-
[`cell-${ii}`]:
|
|
3649
|
+
[`cell-${ii}`]: B(({ row: t, index: r }) => [h("div", ti, [a.value ? (j(), m("button", {
|
|
3646
3650
|
key: 0,
|
|
3647
3651
|
type: "button",
|
|
3648
3652
|
class: "w-crud-subview__action",
|
|
3649
3653
|
"aria-label": "Editar",
|
|
3650
3654
|
onClick: (n) => e.crud.openEditDialog(t, r)
|
|
3651
|
-
}, [...n[3] ||= [h("i", { class: "pi pi-pencil" }, null, -1)]], 8, ni)) : p("", !0), o.value ? (
|
|
3655
|
+
}, [...n[3] ||= [h("i", { class: "pi pi-pencil" }, null, -1)]], 8, ni)) : p("", !0), o.value ? (j(), m("button", {
|
|
3652
3656
|
key: 1,
|
|
3653
3657
|
type: "button",
|
|
3654
3658
|
class: "w-crud-subview__action w-crud-subview__action--danger",
|
|
@@ -3657,19 +3661,24 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3657
3661
|
}, [...n[4] ||= [h("i", { class: "pi pi-trash" }, null, -1)]], 8, ri)) : p("", !0)])]),
|
|
3658
3662
|
_: 2
|
|
3659
3663
|
}, [
|
|
3660
|
-
|
|
3664
|
+
t.$slots["toolbar-extra"] ? {
|
|
3665
|
+
name: "toolbar-extra",
|
|
3666
|
+
fn: B(() => [I(t.$slots, "toolbar-extra")]),
|
|
3667
|
+
key: "0"
|
|
3668
|
+
} : void 0,
|
|
3669
|
+
F(l.value, (e) => ({
|
|
3661
3670
|
name: e,
|
|
3662
|
-
fn:
|
|
3671
|
+
fn: B((n) => [I(t.$slots, e, k(x(n)))])
|
|
3663
3672
|
})),
|
|
3664
3673
|
t.$slots.expansion ? {
|
|
3665
3674
|
name: "expansion",
|
|
3666
|
-
fn:
|
|
3667
|
-
key: "
|
|
3675
|
+
fn: B((e) => [I(t.$slots, "expansion", k(x(e)))]),
|
|
3676
|
+
key: "1"
|
|
3668
3677
|
} : void 0,
|
|
3669
3678
|
t.$slots.empty ? {
|
|
3670
3679
|
name: "empty",
|
|
3671
|
-
fn:
|
|
3672
|
-
key: "
|
|
3680
|
+
fn: B(() => [I(t.$slots, "empty")]),
|
|
3681
|
+
key: "2"
|
|
3673
3682
|
} : void 0
|
|
3674
3683
|
]), 1032, [
|
|
3675
3684
|
"model-value",
|
|
@@ -3695,18 +3704,18 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3695
3704
|
"onUpdate:field": e.crud.setFormField,
|
|
3696
3705
|
onSave: n[2] ||= (t) => e.crud.save()
|
|
3697
3706
|
}, g({ _: 2 }, [
|
|
3698
|
-
|
|
3707
|
+
F(u.value, (e) => ({
|
|
3699
3708
|
name: e,
|
|
3700
|
-
fn:
|
|
3709
|
+
fn: B((n) => [I(t.$slots, e, k(x(n)))])
|
|
3701
3710
|
})),
|
|
3702
3711
|
t.$slots["after-fields"] ? {
|
|
3703
3712
|
name: "after-fields",
|
|
3704
|
-
fn:
|
|
3713
|
+
fn: B((e) => [I(t.$slots, "after-fields", k(x(e)))]),
|
|
3705
3714
|
key: "0"
|
|
3706
3715
|
} : void 0,
|
|
3707
3716
|
t.$slots["form-footer"] ? {
|
|
3708
3717
|
name: "footer",
|
|
3709
|
-
fn:
|
|
3718
|
+
fn: B((e) => [I(t.$slots, "form-footer", k(x(e)))]),
|
|
3710
3719
|
key: "1"
|
|
3711
3720
|
} : void 0
|
|
3712
3721
|
]), 1032, [
|
|
@@ -3745,7 +3754,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3745
3754
|
function r(e) {
|
|
3746
3755
|
n("update:modelValue", e ?? null);
|
|
3747
3756
|
}
|
|
3748
|
-
return (t, n) => (
|
|
3757
|
+
return (t, n) => (j(), f(R(Ee), {
|
|
3749
3758
|
"model-value": e.modelValue ?? void 0,
|
|
3750
3759
|
"selection-mode": "range",
|
|
3751
3760
|
placeholder: e.placeholder,
|
|
@@ -3805,7 +3814,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3805
3814
|
},
|
|
3806
3815
|
emits: ["update:modelValue", "error"],
|
|
3807
3816
|
setup(e, { emit: t }) {
|
|
3808
|
-
let n = e, r = t, i =
|
|
3817
|
+
let n = e, r = t, i = P(null), a = d(() => {
|
|
3809
3818
|
let e = n.modelValue;
|
|
3810
3819
|
return e ? Array.isArray(e) ? e : [e] : [];
|
|
3811
3820
|
});
|
|
@@ -3836,8 +3845,8 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3836
3845
|
function l(e) {
|
|
3837
3846
|
return e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(0)} KB` : `${(e / 1048576).toFixed(1)} MB`;
|
|
3838
3847
|
}
|
|
3839
|
-
return (t, n) => (
|
|
3840
|
-
h("div", null, [y(R(
|
|
3848
|
+
return (t, n) => (j(), m("div", si, [
|
|
3849
|
+
h("div", null, [y(R(G), {
|
|
3841
3850
|
type: "button",
|
|
3842
3851
|
label: e.chooseLabel,
|
|
3843
3852
|
icon: "pi pi-upload",
|
|
@@ -3855,7 +3864,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3855
3864
|
style: { display: "none" },
|
|
3856
3865
|
onChange: s
|
|
3857
3866
|
}, null, 40, ci),
|
|
3858
|
-
a.value.length ? (
|
|
3867
|
+
a.value.length ? (j(), m("ul", li, [(j(!0), m(u, null, F(a.value, (t, r) => (j(), m("li", {
|
|
3859
3868
|
key: `${t.name}-${r}`,
|
|
3860
3869
|
style: {
|
|
3861
3870
|
display: "flex",
|
|
@@ -3868,9 +3877,9 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3868
3877
|
class: "pi pi-file",
|
|
3869
3878
|
style: { opacity: "0.6" }
|
|
3870
3879
|
}, null, -1),
|
|
3871
|
-
h("span", ui,
|
|
3872
|
-
h("span", di,
|
|
3873
|
-
y(R(
|
|
3880
|
+
h("span", ui, L(t.name), 1),
|
|
3881
|
+
h("span", di, L(l(t.size)), 1),
|
|
3882
|
+
y(R(G), {
|
|
3874
3883
|
type: "button",
|
|
3875
3884
|
icon: "pi pi-times",
|
|
3876
3885
|
text: "",
|
|
@@ -3880,7 +3889,7 @@ var zn = { class: "w-crud" }, Bn = {
|
|
|
3880
3889
|
disabled: e.disabled,
|
|
3881
3890
|
onClick: (e) => c(r)
|
|
3882
3891
|
}, null, 8, ["disabled", "onClick"])
|
|
3883
|
-
]))), 128))])) :
|
|
3892
|
+
]))), 128))])) : I(t.$slots, "empty", {}, () => [n[1] ||= h("span", { style: {
|
|
3884
3893
|
"font-size": "0.8rem",
|
|
3885
3894
|
opacity: "0.6"
|
|
3886
3895
|
} }, "Nenhum arquivo selecionado", -1)], void 0, 1)
|
|
@@ -4041,7 +4050,7 @@ var xi = {
|
|
|
4041
4050
|
},
|
|
4042
4051
|
emits: ["update:modelValue"],
|
|
4043
4052
|
setup(e, { emit: t }) {
|
|
4044
|
-
let n = e, r = t, i =
|
|
4053
|
+
let n = e, r = t, i = P(""), a = P({}), o = d(() => mi(n.options, {
|
|
4045
4054
|
optionValue: n.optionValue,
|
|
4046
4055
|
optionLabel: n.optionLabel,
|
|
4047
4056
|
groupBy: n.groupBy,
|
|
@@ -4056,11 +4065,11 @@ var xi = {
|
|
|
4056
4065
|
a.value = t;
|
|
4057
4066
|
}
|
|
4058
4067
|
let C = /* @__PURE__ */ new Set();
|
|
4059
|
-
|
|
4068
|
+
z(o, (e) => {
|
|
4060
4069
|
if (!n.defaultExpanded) return;
|
|
4061
4070
|
let t = e.filter((e) => e.children?.length && !C.has(e.key));
|
|
4062
4071
|
t.length && (t.forEach((e) => C.add(e.key)), S(t));
|
|
4063
|
-
}, { immediate: !0 }),
|
|
4072
|
+
}, { immediate: !0 }), z(i, (e) => {
|
|
4064
4073
|
e.trim() && S(l.value);
|
|
4065
4074
|
});
|
|
4066
4075
|
function w(e, t) {
|
|
@@ -4074,11 +4083,11 @@ var xi = {
|
|
|
4074
4083
|
function E() {
|
|
4075
4084
|
n.disabled || r("update:modelValue", []);
|
|
4076
4085
|
}
|
|
4077
|
-
return (t, n) => (
|
|
4078
|
-
|
|
4086
|
+
return (t, n) => (j(), m("div", { class: O(["w-tree-select", { "w-tree-select--disabled": e.disabled }]) }, [
|
|
4087
|
+
I(t.$slots, "header", {
|
|
4079
4088
|
selectedCount: g.value,
|
|
4080
4089
|
total: h.value
|
|
4081
|
-
}, () => [_.value ? (
|
|
4090
|
+
}, () => [_.value ? (j(), m("div", xi, [e.showCount ? (j(), m("span", Si, L(g.value) + " de " + L(h.value) + " selecionados ", 1)) : (j(), m("span", Ci)), e.showToggleAll ? (j(), m("div", wi, [y(R(G), {
|
|
4082
4091
|
type: "button",
|
|
4083
4092
|
label: "Marcar todos",
|
|
4084
4093
|
text: "",
|
|
@@ -4086,7 +4095,7 @@ var xi = {
|
|
|
4086
4095
|
tabindex: "-1",
|
|
4087
4096
|
disabled: e.disabled || g.value === h.value || !h.value,
|
|
4088
4097
|
onClick: T
|
|
4089
|
-
}, null, 8, ["disabled"]), y(R(
|
|
4098
|
+
}, null, 8, ["disabled"]), y(R(G), {
|
|
4090
4099
|
type: "button",
|
|
4091
4100
|
label: "Limpar",
|
|
4092
4101
|
text: "",
|
|
@@ -4095,11 +4104,11 @@ var xi = {
|
|
|
4095
4104
|
disabled: e.disabled || !g.value,
|
|
4096
4105
|
onClick: E
|
|
4097
4106
|
}, null, 8, ["disabled"])])) : p("", !0)])) : p("", !0)]),
|
|
4098
|
-
e.filter ? (
|
|
4107
|
+
e.filter ? (j(), f(R(he), {
|
|
4099
4108
|
key: 0,
|
|
4100
4109
|
class: "w-tree-select__filter"
|
|
4101
4110
|
}, {
|
|
4102
|
-
default:
|
|
4111
|
+
default: B(() => [y(R(ge), { class: "pi pi-search" }), y(R(K), {
|
|
4103
4112
|
modelValue: i.value,
|
|
4104
4113
|
"onUpdate:modelValue": n[0] ||= (e) => i.value = e,
|
|
4105
4114
|
placeholder: e.filterPlaceholder,
|
|
@@ -4115,7 +4124,7 @@ var xi = {
|
|
|
4115
4124
|
])]),
|
|
4116
4125
|
_: 1
|
|
4117
4126
|
})) : p("", !0),
|
|
4118
|
-
b.value ? (
|
|
4127
|
+
b.value ? (j(), m("div", Ti, [I(t.$slots, "empty", { filtering: c.value }, () => [v(L(x.value), 1)])])) : (j(), f(R(Ae), {
|
|
4119
4128
|
key: 1,
|
|
4120
4129
|
value: l.value,
|
|
4121
4130
|
"selection-mode": "checkbox",
|
|
@@ -4128,7 +4137,7 @@ var xi = {
|
|
|
4128
4137
|
onNodeSelect: n[2] ||= (e) => w(e, !0),
|
|
4129
4138
|
onNodeUnselect: n[3] ||= (e) => w(e, !1)
|
|
4130
4139
|
}, {
|
|
4131
|
-
default:
|
|
4140
|
+
default: B((e) => [I(t.$slots, "node", { node: e.node }, () => [v(L(e.node.label), 1)])]),
|
|
4132
4141
|
_: 3
|
|
4133
4142
|
}, 8, [
|
|
4134
4143
|
"value",
|
|
@@ -4349,7 +4358,7 @@ var Pi = {
|
|
|
4349
4358
|
height: { default: "" }
|
|
4350
4359
|
},
|
|
4351
4360
|
setup(e) {
|
|
4352
|
-
let t = e, n =
|
|
4361
|
+
let t = e, n = P(null), r = ae(null), i = P(!1), a = null, o = null, s = () => {
|
|
4353
4362
|
r.value && r.value.setOption(t.option, !0);
|
|
4354
4363
|
}, c = () => {
|
|
4355
4364
|
r.value && (t.loading ? r.value.showLoading("default", Mi()) : r.value.hideLoading());
|
|
@@ -4363,18 +4372,18 @@ var Pi = {
|
|
|
4363
4372
|
i.value = !1, r.value?.dispose(), r.value = e.init(n.value, t.print ? ji() : Ai(), { renderer: t.print ? "svg" : t.renderer }), s(), c();
|
|
4364
4373
|
}
|
|
4365
4374
|
};
|
|
4366
|
-
return
|
|
4375
|
+
return z(() => t.option, s, { deep: !0 }), z(() => t.loading, c), z([() => t.print, () => t.renderer], () => void l()), te(() => {
|
|
4367
4376
|
l(), a = new ResizeObserver(() => r.value?.resize()), n.value && a.observe(n.value), o = new MutationObserver(() => void l()), o.observe(document.documentElement, { attributes: !0 });
|
|
4368
4377
|
}), ee(() => {
|
|
4369
4378
|
a?.disconnect(), o?.disconnect(), r.value?.dispose(), r.value = null;
|
|
4370
|
-
}), (t, r) => (
|
|
4379
|
+
}), (t, r) => (j(), m("div", {
|
|
4371
4380
|
class: "w-chart",
|
|
4372
4381
|
style: A(e.height ? { "--w-chart-h": e.height } : void 0)
|
|
4373
|
-
}, [e.empty && !e.loading ? (
|
|
4382
|
+
}, [e.empty && !e.loading ? (j(), m("div", Pi, [I(t.$slots, "empty", {}, () => [v(L(e.emptyMessage), 1)], !0)])) : i.value ? (j(), m("div", Fi, [I(t.$slots, "unavailable", {}, () => [r[0] ||= v("Gráfico indisponível.", -1)], !0)])) : p("", !0), V(h("div", {
|
|
4374
4383
|
ref_key: "container",
|
|
4375
4384
|
ref: n,
|
|
4376
4385
|
class: "w-chart__canvas"
|
|
4377
|
-
}, null, 512), [[
|
|
4386
|
+
}, null, 512), [[ue, !e.empty && !i.value]])], 4));
|
|
4378
4387
|
}
|
|
4379
4388
|
}), [["__scopeId", "data-v-fe796670"]]), Li = /* @__PURE__ */ b({
|
|
4380
4389
|
__name: "WStatusTag",
|
|
@@ -4492,7 +4501,7 @@ var Pi = {
|
|
|
4492
4501
|
label: t.value,
|
|
4493
4502
|
severity: "secondary"
|
|
4494
4503
|
});
|
|
4495
|
-
return (e, t) => (
|
|
4504
|
+
return (e, t) => (j(), f(R(be), {
|
|
4496
4505
|
value: r.value.label,
|
|
4497
4506
|
severity: r.value.severity
|
|
4498
4507
|
}, null, 8, ["value", "severity"]));
|
|
@@ -4511,7 +4520,7 @@ var Pi = {
|
|
|
4511
4520
|
emits: ["action"],
|
|
4512
4521
|
setup(e, { emit: t }) {
|
|
4513
4522
|
let n = t;
|
|
4514
|
-
return (t, r) => (
|
|
4523
|
+
return (t, r) => (j(), m("div", Ri, [h("div", zi, [h("h2", Bi, L(e.title), 1), e.subtitle ? (j(), m("p", Vi, L(e.subtitle), 1)) : p("", !0)]), h("div", Hi, [I(t.$slots, "actions"), e.actionLabel ? (j(), f(R(G), {
|
|
4515
4524
|
key: 0,
|
|
4516
4525
|
label: e.actionLabel,
|
|
4517
4526
|
icon: e.actionIcon,
|
|
@@ -4533,11 +4542,11 @@ var Pi = {
|
|
|
4533
4542
|
emits: ["action"],
|
|
4534
4543
|
setup(e, { emit: t }) {
|
|
4535
4544
|
let n = t;
|
|
4536
|
-
return (t, r) => (
|
|
4545
|
+
return (t, r) => (j(), m("div", Wi, [
|
|
4537
4546
|
h("div", Gi, [h("i", { class: O(e.icon) }, null, 2)]),
|
|
4538
|
-
h("p", Ki,
|
|
4539
|
-
e.description ? (
|
|
4540
|
-
e.actionLabel ? (
|
|
4547
|
+
h("p", Ki, L(e.title), 1),
|
|
4548
|
+
e.description ? (j(), m("p", qi, L(e.description), 1)) : p("", !0),
|
|
4549
|
+
e.actionLabel ? (j(), f(R(G), {
|
|
4541
4550
|
key: 1,
|
|
4542
4551
|
label: e.actionLabel,
|
|
4543
4552
|
icon: e.actionIcon,
|
|
@@ -4562,28 +4571,28 @@ var Pi = {
|
|
|
4562
4571
|
statusMap: {}
|
|
4563
4572
|
},
|
|
4564
4573
|
setup(e) {
|
|
4565
|
-
let t = e, n =
|
|
4574
|
+
let t = e, n = Y();
|
|
4566
4575
|
function r() {
|
|
4567
4576
|
t.backTo ? n.push(typeof t.backTo == "string" ? { name: t.backTo } : t.backTo) : t.backRoute ? n.push({ name: t.backRoute }) : n.back();
|
|
4568
4577
|
}
|
|
4569
|
-
return (t, n) => (
|
|
4570
|
-
y(R(
|
|
4578
|
+
return (t, n) => (j(), m("div", Yi, [h("div", Xi, [
|
|
4579
|
+
y(R(G), {
|
|
4571
4580
|
icon: "pi pi-arrow-left",
|
|
4572
4581
|
text: "",
|
|
4573
4582
|
rounded: "",
|
|
4574
4583
|
onClick: r
|
|
4575
4584
|
}),
|
|
4576
|
-
e.icon ? (
|
|
4585
|
+
e.icon ? (j(), m("i", {
|
|
4577
4586
|
key: 0,
|
|
4578
4587
|
class: O([e.icon, "w-detail-header-icon"])
|
|
4579
4588
|
}, null, 2)) : p("", !0),
|
|
4580
|
-
h("div", Zi, [h("h2", Qi,
|
|
4581
|
-
e.status ? (
|
|
4589
|
+
h("div", Zi, [h("h2", Qi, L(e.title), 1), e.subtitle ? (j(), m("p", $i, L(e.subtitle), 1)) : p("", !0)]),
|
|
4590
|
+
e.status ? (j(), f(Li, {
|
|
4582
4591
|
key: 1,
|
|
4583
4592
|
value: e.status,
|
|
4584
4593
|
map: e.statusMap
|
|
4585
4594
|
}, null, 8, ["value", "map"])) : p("", !0)
|
|
4586
|
-
]), h("div", ea, [
|
|
4595
|
+
]), h("div", ea, [I(t.$slots, "actions")])]));
|
|
4587
4596
|
}
|
|
4588
4597
|
}), na = {
|
|
4589
4598
|
key: 0,
|
|
@@ -4610,17 +4619,17 @@ var Pi = {
|
|
|
4610
4619
|
let t = e.value;
|
|
4611
4620
|
return t == null || t === "" ? "-" : e.format === "currency" ? n(Number(t)) : e.format === "date" ? r(String(t)) : e.format === "datetime" ? r(String(t), "DD/MM/YYYY HH:mm") : e.format === "number" ? i(Number(t), e.decimals ?? 2) : String(t);
|
|
4612
4621
|
}
|
|
4613
|
-
return (t, n) => (
|
|
4622
|
+
return (t, n) => (j(), m("div", { class: O(["w-info-card", `w-info-card--${e.variant}`]) }, [e.title ? (j(), m("h3", na, L(e.title), 1)) : p("", !0), e.variant === "metric" ? (j(), m("div", ra, [(j(!0), m(u, null, F(e.fields, (e) => (j(), m("div", {
|
|
4614
4623
|
key: e.label,
|
|
4615
4624
|
class: "w-info-card-metric"
|
|
4616
4625
|
}, [
|
|
4617
|
-
h("span", ia,
|
|
4618
|
-
h("span", aa,
|
|
4619
|
-
e.suffix ? (
|
|
4620
|
-
]))), 128))])) : (
|
|
4626
|
+
h("span", ia, L(e.label), 1),
|
|
4627
|
+
h("span", aa, L(a(e)), 1),
|
|
4628
|
+
e.suffix ? (j(), m("span", oa, L(e.suffix), 1)) : p("", !0)
|
|
4629
|
+
]))), 128))])) : (j(), m("div", sa, [(j(!0), m(u, null, F(e.fields, (e) => (j(), m("div", {
|
|
4621
4630
|
key: e.label,
|
|
4622
4631
|
class: "w-info-card-field"
|
|
4623
|
-
}, [h("span", ca,
|
|
4632
|
+
}, [h("span", ca, L(e.label), 1), h("span", la, L(a(e)), 1)]))), 128))]))], 2));
|
|
4624
4633
|
}
|
|
4625
4634
|
}), da = {
|
|
4626
4635
|
key: 0,
|
|
@@ -4649,36 +4658,36 @@ var Pi = {
|
|
|
4649
4658
|
loading: { type: Boolean }
|
|
4650
4659
|
},
|
|
4651
4660
|
setup(e) {
|
|
4652
|
-
return (t, n) => (
|
|
4661
|
+
return (t, n) => (j(), m("article", { class: O(["w-kpi-card", e.severity ? `w-kpi-card--${e.severity}` : ""]) }, [e.loading ? (j(), m("div", da, [y(R(X), {
|
|
4653
4662
|
shape: "circle",
|
|
4654
4663
|
size: "2.75rem"
|
|
4655
4664
|
}), h("div", fa, [
|
|
4656
|
-
y(R(
|
|
4665
|
+
y(R(X), {
|
|
4657
4666
|
width: "6rem",
|
|
4658
4667
|
height: "0.75rem"
|
|
4659
4668
|
}),
|
|
4660
|
-
y(R(
|
|
4669
|
+
y(R(X), {
|
|
4661
4670
|
width: "7.5rem",
|
|
4662
4671
|
height: "1.5rem"
|
|
4663
4672
|
}),
|
|
4664
|
-
y(R(
|
|
4673
|
+
y(R(X), {
|
|
4665
4674
|
width: "5rem",
|
|
4666
4675
|
height: "0.75rem"
|
|
4667
4676
|
})
|
|
4668
|
-
])])) : (
|
|
4669
|
-
h("div", pa, [e.icon || t.$slots.icon ? (
|
|
4677
|
+
])])) : (j(), m(u, { key: 1 }, [
|
|
4678
|
+
h("div", pa, [e.icon || t.$slots.icon ? (j(), m("div", ma, [I(t.$slots, "icon", {}, () => [e.icon ? (j(), m("i", {
|
|
4670
4679
|
key: 0,
|
|
4671
4680
|
class: O(e.icon)
|
|
4672
|
-
}, null, 2)) : p("", !0)])])) : p("", !0), e.trend || t.$slots.trend ? (
|
|
4681
|
+
}, null, 2)) : p("", !0)])])) : p("", !0), e.trend || t.$slots.trend ? (j(), m("div", ha, [I(t.$slots, "trend", {}, () => [e.trend ? (j(), m("span", {
|
|
4673
4682
|
key: 0,
|
|
4674
4683
|
class: O(["w-kpi-card__trend-badge", e.trend.direction ? `w-kpi-card__trend-badge--${e.trend.direction}` : ""])
|
|
4675
|
-
},
|
|
4684
|
+
}, L(e.trend.value), 3)) : p("", !0)])])) : p("", !0)]),
|
|
4676
4685
|
h("div", ga, [
|
|
4677
|
-
h("p", _a,
|
|
4678
|
-
h("div", va, [
|
|
4679
|
-
e.hint || t.$slots.hint ? (
|
|
4686
|
+
h("p", _a, L(e.label), 1),
|
|
4687
|
+
h("div", va, [I(t.$slots, "value", {}, () => [v(L(e.value), 1)])]),
|
|
4688
|
+
e.hint || t.$slots.hint ? (j(), m("p", ya, [I(t.$slots, "hint", {}, () => [v(L(e.hint), 1)])])) : p("", !0)
|
|
4680
4689
|
]),
|
|
4681
|
-
t.$slots.footer ? (
|
|
4690
|
+
t.$slots.footer ? (j(), m("footer", ba, [I(t.$slots, "footer")])) : p("", !0)
|
|
4682
4691
|
], 64))], 2));
|
|
4683
4692
|
}
|
|
4684
4693
|
}), Sa = /* @__PURE__ */ b({
|
|
@@ -4693,11 +4702,11 @@ var Pi = {
|
|
|
4693
4702
|
},
|
|
4694
4703
|
setup(e) {
|
|
4695
4704
|
let t = e, n = d(() => [t.columns === "auto" ? "w-kpi-grid--auto" : `w-kpi-grid--cols-${t.columns}`, { "w-kpi-grid--dense": t.dense }]);
|
|
4696
|
-
return (t, r) => (
|
|
4705
|
+
return (t, r) => (j(), m("div", { class: O(["w-kpi-grid", n.value]) }, [t.$slots.item ? (j(!0), m(u, { key: 0 }, F(e.items, (e, n) => I(t.$slots, "item", {
|
|
4697
4706
|
key: n,
|
|
4698
4707
|
item: e,
|
|
4699
4708
|
index: n
|
|
4700
|
-
})), 128)) : (
|
|
4709
|
+
})), 128)) : (j(!0), m(u, { key: 1 }, F(e.items, (e, t) => (j(), f(xa, {
|
|
4701
4710
|
key: t,
|
|
4702
4711
|
label: e.label,
|
|
4703
4712
|
value: e.value,
|
|
@@ -4734,10 +4743,10 @@ var Pi = {
|
|
|
4734
4743
|
compact: { type: Boolean }
|
|
4735
4744
|
},
|
|
4736
4745
|
setup(e) {
|
|
4737
|
-
return (t, n) => (
|
|
4746
|
+
return (t, n) => (j(), m("div", { class: O(["w-section-header", { "w-section-header--compact": e.compact }]) }, [h("div", Ca, [e.icon || t.$slots.icon ? (j(), m("div", wa, [I(t.$slots, "icon", {}, () => [e.icon ? (j(), m("i", {
|
|
4738
4747
|
key: 0,
|
|
4739
4748
|
class: O(e.icon)
|
|
4740
|
-
}, null, 2)) : p("", !0)])])) : p("", !0), h("div", Ta, [h("div", Ea, [h("h3", Da,
|
|
4749
|
+
}, null, 2)) : p("", !0)])])) : p("", !0), h("div", Ta, [h("div", Ea, [h("h3", Da, L(e.title), 1), I(t.$slots, "meta")]), e.subtitle ? (j(), m("p", Oa, L(e.subtitle), 1)) : p("", !0)])]), t.$slots.actions ? (j(), m("div", ka, [I(t.$slots, "actions")])) : p("", !0)], 2));
|
|
4741
4750
|
}
|
|
4742
4751
|
}), ja = {
|
|
4743
4752
|
key: 0,
|
|
@@ -4756,7 +4765,7 @@ var Pi = {
|
|
|
4756
4765
|
variant: {}
|
|
4757
4766
|
},
|
|
4758
4767
|
setup(e) {
|
|
4759
|
-
return (t, n) => (
|
|
4768
|
+
return (t, n) => (j(), m("section", { class: O(["w-form-section", e.variant ? `w-form-section--${e.variant}` : ""]) }, [e.title || e.description || t.$slots.actions ? (j(), m("div", ja, [h("div", Ma, [h("h3", Na, L(e.title), 1), e.description ? (j(), m("p", Pa, L(e.description), 1)) : p("", !0)]), t.$slots.actions ? (j(), m("div", Fa, [I(t.$slots, "actions")])) : p("", !0)])) : p("", !0), h("div", Ia, [I(t.$slots, "default")])], 2));
|
|
4760
4769
|
}
|
|
4761
4770
|
}), Ra = {
|
|
4762
4771
|
key: 0,
|
|
@@ -4777,10 +4786,10 @@ var Pi = {
|
|
|
4777
4786
|
}
|
|
4778
4787
|
},
|
|
4779
4788
|
setup(e) {
|
|
4780
|
-
return (t, n) => (
|
|
4781
|
-
t.$slots.primary || t.$slots.default ? (
|
|
4782
|
-
t.$slots.filters ? (
|
|
4783
|
-
t.$slots.secondary ? (
|
|
4789
|
+
return (t, n) => (j(), m("div", { class: O(["w-action-bar", [`w-action-bar--${e.align}`, { "w-action-bar--stack": e.stackOnMobile }]]) }, [
|
|
4790
|
+
t.$slots.primary || t.$slots.default ? (j(), m("div", Ra, [I(t.$slots, "primary", {}, () => [I(t.$slots, "default")])])) : p("", !0),
|
|
4791
|
+
t.$slots.filters ? (j(), m("div", za, [I(t.$slots, "filters")])) : p("", !0),
|
|
4792
|
+
t.$slots.secondary ? (j(), m("div", Ba, [I(t.$slots, "secondary")])) : p("", !0)
|
|
4784
4793
|
], 2));
|
|
4785
4794
|
}
|
|
4786
4795
|
}), Ha = { class: "w-progress-flow__marker" }, Ua = { class: "w-progress-flow__content" }, Wa = { class: "w-progress-flow__label" }, Ga = {
|
|
@@ -4798,14 +4807,14 @@ var Pi = {
|
|
|
4798
4807
|
function r(e) {
|
|
4799
4808
|
return e < n.value ? "done" : e === n.value ? "current" : "pending";
|
|
4800
4809
|
}
|
|
4801
|
-
return (t, n) => (
|
|
4810
|
+
return (t, n) => (j(), m("div", { class: O(["w-progress-flow", `w-progress-flow--${e.orientation}`]) }, [(j(!0), m(u, null, F(e.steps, (e, n) => (j(), m("div", {
|
|
4802
4811
|
key: e.key,
|
|
4803
4812
|
class: O(["w-progress-flow__step", `w-progress-flow__step--${r(n)}`])
|
|
4804
|
-
}, [
|
|
4813
|
+
}, [I(t.$slots, "step", {
|
|
4805
4814
|
step: e,
|
|
4806
4815
|
index: n,
|
|
4807
4816
|
state: r(n)
|
|
4808
|
-
}, () => [h("div", Ha, [h("span", null,
|
|
4817
|
+
}, () => [h("div", Ha, [h("span", null, L(n + 1), 1)]), h("div", Ua, [h("p", Wa, L(e.label), 1), e.description ? (j(), m("p", Ga, L(e.description), 1)) : p("", !0)])])], 2))), 128))], 2));
|
|
4809
4818
|
}
|
|
4810
4819
|
}), qa = Symbol("w-step-flow"), Ja = /* @__PURE__ */ b({
|
|
4811
4820
|
__name: "WStepFlow",
|
|
@@ -4823,13 +4832,13 @@ var Pi = {
|
|
|
4823
4832
|
function s(e) {
|
|
4824
4833
|
n.disabled || r("update:modelValue", n.modelValue === e ? 0 : e);
|
|
4825
4834
|
}
|
|
4826
|
-
|
|
4835
|
+
M(qa, {
|
|
4827
4836
|
active: i,
|
|
4828
4837
|
toggle: s,
|
|
4829
4838
|
disabled: a,
|
|
4830
4839
|
orientation: o
|
|
4831
4840
|
});
|
|
4832
|
-
let c =
|
|
4841
|
+
let c = P(null);
|
|
4833
4842
|
function l(e) {
|
|
4834
4843
|
if (n.orientation !== "horizontal") return;
|
|
4835
4844
|
let t = {
|
|
@@ -4844,12 +4853,12 @@ var Pi = {
|
|
|
4844
4853
|
let a = e.key === "Home" ? 0 : e.key === "End" ? r.length - 1 : (i + t + r.length) % r.length;
|
|
4845
4854
|
e.preventDefault(), r[a].focus();
|
|
4846
4855
|
}
|
|
4847
|
-
return (e, t) => (
|
|
4856
|
+
return (e, t) => (j(), m("div", {
|
|
4848
4857
|
ref_key: "root",
|
|
4849
4858
|
ref: c,
|
|
4850
4859
|
class: O(["w-step-flow", `w-step-flow--${o.value}`]),
|
|
4851
4860
|
onKeydown: l
|
|
4852
|
-
}, [
|
|
4861
|
+
}, [I(e.$slots, "default")], 34));
|
|
4853
4862
|
}
|
|
4854
4863
|
}), Ya = { class: "w-step-section__rail" }, Xa = {
|
|
4855
4864
|
key: 0,
|
|
@@ -4905,18 +4914,18 @@ var Pi = {
|
|
|
4905
4914
|
}
|
|
4906
4915
|
},
|
|
4907
4916
|
setup(e) {
|
|
4908
|
-
let t = e, n = C(qa, null), r =
|
|
4917
|
+
let t = e, n = C(qa, null), r = P(!0), i = d(() => n ? n.active.value === t.step : r.value), a = d(() => t.disabled || (n?.disabled.value ?? !1)), o = d(() => n?.orientation.value === "horizontal"), s = d(() => n !== null), c = d(() => o.value && n != null && t.step < n.active.value);
|
|
4909
4918
|
function l() {
|
|
4910
4919
|
a.value || (n ? n.toggle(t.step) : r.value = !r.value);
|
|
4911
4920
|
}
|
|
4912
|
-
return (t, n) => o.value ? (
|
|
4921
|
+
return (t, n) => o.value ? (j(), m("div", {
|
|
4913
4922
|
key: 1,
|
|
4914
4923
|
class: O(["w-step-section w-step-section--horizontal", {
|
|
4915
4924
|
"w-step-section--open": i.value,
|
|
4916
4925
|
"w-step-section--done": c.value
|
|
4917
4926
|
}])
|
|
4918
4927
|
}, [h("div", so, [
|
|
4919
|
-
s.value ? (
|
|
4928
|
+
s.value ? (j(), m("span", {
|
|
4920
4929
|
key: 0,
|
|
4921
4930
|
class: O(["w-step-section__line", { "w-step-section__line--done": c.value || i.value }])
|
|
4922
4931
|
}, null, 2)) : p("", !0),
|
|
@@ -4934,19 +4943,19 @@ var Pi = {
|
|
|
4934
4943
|
"w-step-section__badge--done": c.value
|
|
4935
4944
|
}]),
|
|
4936
4945
|
"aria-hidden": "true"
|
|
4937
|
-
}, [c.value ? (
|
|
4938
|
-
h("h2", uo,
|
|
4939
|
-
e.count == null ? p("", !0) : (
|
|
4940
|
-
e.summary ? (
|
|
4946
|
+
}, [c.value ? (j(), m("i", lo)) : (j(), m(u, { key: 1 }, [v(L(e.step), 1)], 64))], 2),
|
|
4947
|
+
h("h2", uo, L(e.title), 1),
|
|
4948
|
+
e.count == null ? p("", !0) : (j(), m("span", fo, L(e.count), 1)),
|
|
4949
|
+
e.summary ? (j(), m("span", po, L(e.summary), 1)) : p("", !0)
|
|
4941
4950
|
], 8, co),
|
|
4942
|
-
t.$slots.actions ? (
|
|
4943
|
-
]), i.value ? (
|
|
4951
|
+
t.$slots.actions ? (j(), m("div", mo, [I(t.$slots, "actions", { open: i.value })])) : p("", !0)
|
|
4952
|
+
]), i.value ? (j(), m("div", ho, [h("div", go, [I(t.$slots, "default")]), t.$slots.footer ? (j(), m("div", _o, [I(t.$slots, "footer")])) : p("", !0)])) : p("", !0)], 2)) : (j(), m("div", {
|
|
4944
4953
|
key: 0,
|
|
4945
4954
|
class: O(["w-step-section", { "w-step-section--open": i.value }])
|
|
4946
4955
|
}, [h("div", Ya, [h("span", {
|
|
4947
4956
|
class: O(["w-step-section__badge", { "w-step-section__badge--on": i.value }]),
|
|
4948
4957
|
"aria-hidden": "true"
|
|
4949
|
-
},
|
|
4958
|
+
}, L(e.step), 3), s.value ? (j(), m("span", Xa)) : p("", !0)]), h("div", Za, [h("div", Qa, [h("div", $a, [h("button", {
|
|
4950
4959
|
type: "button",
|
|
4951
4960
|
class: "w-step-section__trigger",
|
|
4952
4961
|
"aria-expanded": i.value,
|
|
@@ -4955,10 +4964,10 @@ var Pi = {
|
|
|
4955
4964
|
onClick: l
|
|
4956
4965
|
}, [
|
|
4957
4966
|
h("i", { class: O(["w-step-section__chevron", i.value ? "pi pi-chevron-down" : "pi pi-chevron-right"]) }, null, 2),
|
|
4958
|
-
h("h2", to,
|
|
4959
|
-
e.count == null ? p("", !0) : (
|
|
4960
|
-
e.summary ? (
|
|
4961
|
-
], 8, eo), t.$slots.actions ? (
|
|
4967
|
+
h("h2", to, L(e.title), 1),
|
|
4968
|
+
e.count == null ? p("", !0) : (j(), m("span", no, L(e.count), 1)),
|
|
4969
|
+
e.summary ? (j(), m("span", ro, L(e.summary), 1)) : p("", !0)
|
|
4970
|
+
], 8, eo), t.$slots.actions ? (j(), m("div", io, [I(t.$slots, "actions", { open: i.value })])) : p("", !0)]), i.value ? (j(), m(u, { key: 0 }, [h("div", ao, [I(t.$slots, "default")]), t.$slots.footer ? (j(), m("div", oo, [I(t.$slots, "footer")])) : p("", !0)], 64)) : p("", !0)])])], 2));
|
|
4962
4971
|
}
|
|
4963
4972
|
}), yo = { class: "w-check-list" }, bo = {
|
|
4964
4973
|
key: 0,
|
|
@@ -4992,10 +5001,10 @@ var Pi = {
|
|
|
4992
5001
|
function a(e) {
|
|
4993
5002
|
return i[e] ?? i.warn;
|
|
4994
5003
|
}
|
|
4995
|
-
return (t, n) => (
|
|
5004
|
+
return (t, n) => (j(), m("div", yo, [e.title || e.showCount ? (j(), m("div", bo, [h("span", xo, L(e.title), 1), e.showCount ? (j(), m("span", So, L(r.value), 1)) : p("", !0)])) : p("", !0), e.items.length ? (j(), m("ul", Co, [(j(!0), m(u, null, F(e.items, (e, t) => (j(), m("li", {
|
|
4996
5005
|
key: `${e.label}-${t}`,
|
|
4997
5006
|
class: "w-check-list__item"
|
|
4998
|
-
}, [h("i", { class: O([a(e.nivel), `w-check-list__icon--${e.nivel}`]) }, null, 2), h("span", wo,
|
|
5007
|
+
}, [h("i", { class: O([a(e.nivel), `w-check-list__icon--${e.nivel}`]) }, null, 2), h("span", wo, L(e.label), 1)]))), 128))])) : (j(), m("div", To, [I(t.$slots, "empty", {}, () => [v(L(e.emptyMessage), 1)])]))]));
|
|
4999
5008
|
}
|
|
5000
5009
|
}), Do = .85;
|
|
5001
5010
|
function Oo(e, t, n) {
|
|
@@ -5069,6 +5078,10 @@ var Ao = { class: "w-map-select__body" }, jo = {
|
|
|
5069
5078
|
clearLabel: { default: "Limpar seleção" },
|
|
5070
5079
|
collapseLabel: { default: "Recolher painel de seleção" },
|
|
5071
5080
|
expandLabel: { default: "Mostrar painel de seleção" },
|
|
5081
|
+
collapsed: {
|
|
5082
|
+
type: Boolean,
|
|
5083
|
+
default: void 0
|
|
5084
|
+
},
|
|
5072
5085
|
badgeLabel: { default: "Satélite" },
|
|
5073
5086
|
emptyMessage: { default: "Nenhum talhão encontrado" },
|
|
5074
5087
|
mapErrorMessage: { default: es },
|
|
@@ -5118,50 +5131,51 @@ var Ao = { class: "w-map-select__body" }, jo = {
|
|
|
5118
5131
|
"update:modelValue",
|
|
5119
5132
|
"feature-click",
|
|
5120
5133
|
"feature-enter",
|
|
5121
|
-
"feature-leave"
|
|
5134
|
+
"feature-leave",
|
|
5135
|
+
"update:collapsed"
|
|
5122
5136
|
],
|
|
5123
5137
|
setup(e, { expose: n, emit: r }) {
|
|
5124
|
-
let i = e, a = r, { formatNumber:
|
|
5125
|
-
function
|
|
5126
|
-
|
|
5138
|
+
let i = e, a = r, o = ce(), { formatNumber: s } = t(), c = d(() => i.layout === "sobreposto"), l = d(() => !i.readonly && (!!o.footer || i.areaLabel !== "")), f = d(() => i.readonly && i.mapErrorMessage === es ? ts : i.mapErrorMessage), g = P(!1), _ = d(() => i.collapsed != null), b = d(() => _.value ? !!i.collapsed : g.value);
|
|
5139
|
+
function x(e) {
|
|
5140
|
+
b.value !== e && (_.value || (g.value = e), a("update:collapsed", e));
|
|
5127
5141
|
}
|
|
5128
|
-
function
|
|
5129
|
-
|
|
5142
|
+
function S() {
|
|
5143
|
+
x(!b.value);
|
|
5130
5144
|
}
|
|
5131
|
-
let
|
|
5132
|
-
function
|
|
5133
|
-
return
|
|
5145
|
+
let C = d(() => b.value ? i.expandLabel : i.collapseLabel), w = d(() => new Set(i.modelValue)), T = d(() => i.selectionMode ?? (i.readonly ? "none" : "multiple"));
|
|
5146
|
+
function E(e) {
|
|
5147
|
+
return w.value.has(e);
|
|
5134
5148
|
}
|
|
5135
|
-
function
|
|
5149
|
+
function k(e) {
|
|
5136
5150
|
if (i.disabled) return;
|
|
5137
|
-
let t =
|
|
5151
|
+
let t = T.value;
|
|
5138
5152
|
if (t === "none") return;
|
|
5139
|
-
let n = t === "single" ?
|
|
5153
|
+
let n = t === "single" ? E(e) ? [] : [e] : E(e) ? i.modelValue.filter((t) => t !== e) : [...i.modelValue, e];
|
|
5140
5154
|
a("update:modelValue", n);
|
|
5141
5155
|
}
|
|
5142
|
-
function
|
|
5143
|
-
i.disabled ||
|
|
5156
|
+
function ne() {
|
|
5157
|
+
i.disabled || T.value === "none" || !i.modelValue.length || a("update:modelValue", []);
|
|
5144
5158
|
}
|
|
5145
|
-
let
|
|
5146
|
-
function
|
|
5159
|
+
let M = d(() => i.features.filter((e) => E(e.id))), N = d(() => M.value.reduce((e, t) => e + (t.area ?? 0), 0)), ie = d(() => i.selectionLabel(M.value.length)), ae = P("");
|
|
5160
|
+
function oe(e) {
|
|
5147
5161
|
return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
5148
5162
|
}
|
|
5149
|
-
let
|
|
5150
|
-
let e =
|
|
5151
|
-
return e ? i.features.filter((t) =>
|
|
5163
|
+
let se = d(() => {
|
|
5164
|
+
let e = oe(ae.value.trim());
|
|
5165
|
+
return e ? i.features.filter((t) => oe(`${t.nome} ${t.subtitulo ?? ""}`).includes(e)) : i.features;
|
|
5152
5166
|
});
|
|
5153
|
-
function
|
|
5154
|
-
return e.area == null ? "" : `${
|
|
5167
|
+
function le(e) {
|
|
5168
|
+
return e.area == null ? "" : `${s(e.area, i.areaDecimals)} ${i.areaSuffix}`.trim();
|
|
5155
5169
|
}
|
|
5156
|
-
let
|
|
5170
|
+
let ue = d(() => s(N.value, i.areaDecimals)), V = P(null), H = P(null), U = P(null), de = P(!1), W = null, G = null, fe = null, pe = null, q = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map(), ve = !1, ye = !1, be = d(() => {
|
|
5157
5171
|
let e = /* @__PURE__ */ new Map();
|
|
5158
5172
|
for (let t of i.features) e.set(t.id, t);
|
|
5159
5173
|
return e;
|
|
5160
5174
|
});
|
|
5161
|
-
function
|
|
5162
|
-
let t =
|
|
5175
|
+
function xe(e) {
|
|
5176
|
+
let t = E(e), n = t ? i.polygonSelectedStyle : i.polygonStyle;
|
|
5163
5177
|
if (i.featureStyle) {
|
|
5164
|
-
let r =
|
|
5178
|
+
let r = be.value.get(e), a = r ? i.featureStyle(r, t) : null;
|
|
5165
5179
|
a && (n = {
|
|
5166
5180
|
...n,
|
|
5167
5181
|
...a
|
|
@@ -5172,56 +5186,56 @@ var Ao = { class: "w-map-select__body" }, jo = {
|
|
|
5172
5186
|
...i.polygonSelectedStyle
|
|
5173
5187
|
}), n;
|
|
5174
5188
|
}
|
|
5175
|
-
let
|
|
5189
|
+
let J = P(null), Se = P({
|
|
5176
5190
|
x: 0,
|
|
5177
5191
|
y: 0
|
|
5178
5192
|
});
|
|
5179
|
-
function
|
|
5193
|
+
function Ce(e) {
|
|
5180
5194
|
return e ?? void 0;
|
|
5181
5195
|
}
|
|
5182
|
-
function
|
|
5196
|
+
function we(e) {
|
|
5183
5197
|
let t = e?.containerPoint;
|
|
5184
5198
|
if (!t) return;
|
|
5185
|
-
let n =
|
|
5186
|
-
|
|
5199
|
+
let n = V.value?.clientWidth ?? 0, r = V.value?.clientHeight ?? 0;
|
|
5200
|
+
Se.value = {
|
|
5187
5201
|
x: n ? Math.min(Math.max(t.x, 12), n - 12) : t.x,
|
|
5188
5202
|
y: r ? Math.min(Math.max(t.y, 12), r - 12) : t.y
|
|
5189
5203
|
};
|
|
5190
5204
|
}
|
|
5191
|
-
function
|
|
5192
|
-
|
|
5205
|
+
function Te(e, t) {
|
|
5206
|
+
we(t), J.value?.id !== e.id && (J.value = e, a("feature-enter", e));
|
|
5193
5207
|
}
|
|
5194
|
-
function
|
|
5195
|
-
|
|
5208
|
+
function Ee(e) {
|
|
5209
|
+
J.value && we(e);
|
|
5196
5210
|
}
|
|
5197
|
-
function
|
|
5198
|
-
|
|
5211
|
+
function De() {
|
|
5212
|
+
J.value && (J.value = null, a("feature-leave"));
|
|
5199
5213
|
}
|
|
5200
|
-
function
|
|
5201
|
-
if (
|
|
5202
|
-
|
|
5214
|
+
function Oe(e, t) {
|
|
5215
|
+
if (J.value?.id === e.id) {
|
|
5216
|
+
De();
|
|
5203
5217
|
return;
|
|
5204
5218
|
}
|
|
5205
|
-
|
|
5219
|
+
J.value = null, Te(e, t);
|
|
5206
5220
|
}
|
|
5207
|
-
let
|
|
5208
|
-
left: `${
|
|
5209
|
-
top: `${
|
|
5221
|
+
let ke = d(() => Se.value.y < 150), Ae = d(() => i.detailPlacement === "canto" ? void 0 : {
|
|
5222
|
+
left: `${Se.value.x}px`,
|
|
5223
|
+
top: `${Se.value.y}px`
|
|
5210
5224
|
});
|
|
5211
|
-
function
|
|
5212
|
-
e.key === "Escape" &&
|
|
5225
|
+
function je(e) {
|
|
5226
|
+
e.key === "Escape" && De();
|
|
5213
5227
|
}
|
|
5214
|
-
function
|
|
5228
|
+
function Y(e) {
|
|
5215
5229
|
if (i.featureLabel) return i.featureLabel(e);
|
|
5216
|
-
let t =
|
|
5230
|
+
let t = le(e);
|
|
5217
5231
|
return t ? `${e.nome} · ${t}` : e.nome;
|
|
5218
5232
|
}
|
|
5219
|
-
function
|
|
5233
|
+
function X(e) {
|
|
5220
5234
|
return i.featureLabelShort ? i.featureLabelShort(e) : e.nome;
|
|
5221
5235
|
}
|
|
5222
|
-
let
|
|
5223
|
-
function
|
|
5224
|
-
let n =
|
|
5236
|
+
let Z = d(() => i.tooltips === "auto");
|
|
5237
|
+
function Me(e, t) {
|
|
5238
|
+
let n = Y(t);
|
|
5225
5239
|
n && e.bindTooltip(n, i.tooltips === "hover" ? {
|
|
5226
5240
|
permanent: !1,
|
|
5227
5241
|
sticky: !0,
|
|
@@ -5235,107 +5249,107 @@ var Ao = { class: "w-map-select__body" }, jo = {
|
|
|
5235
5249
|
opacity: 1
|
|
5236
5250
|
});
|
|
5237
5251
|
}
|
|
5238
|
-
let
|
|
5239
|
-
function
|
|
5240
|
-
if (!
|
|
5241
|
-
let t =
|
|
5242
|
-
style: () =>
|
|
5243
|
-
interactive:
|
|
5252
|
+
let Ne = d(() => T.value !== "none" || i.tooltips === "hover" || i.featureDetail !== "none");
|
|
5253
|
+
function Pe(e) {
|
|
5254
|
+
if (!W || !G || !e.geometria) return;
|
|
5255
|
+
let t = W.geoJSON(e.geometria, {
|
|
5256
|
+
style: () => xe(e.id),
|
|
5257
|
+
interactive: Ne.value
|
|
5244
5258
|
});
|
|
5245
5259
|
t.on("click", (t) => {
|
|
5246
|
-
|
|
5247
|
-
}), i.featureDetail === "hover" && (t.on("mouseover", (t) =>
|
|
5260
|
+
k(e.id), a("feature-click", e), i.featureDetail === "click" && Oe(e, Ce(t));
|
|
5261
|
+
}), i.featureDetail === "hover" && (t.on("mouseover", (t) => Te(e, Ce(t))), t.on("mousemove", (e) => Ee(Ce(e))), t.on("mouseout", () => De())), Me(t, e), t.addTo(G), q.set(e.id, t), me.set(e.id, e.geometria), _e.set(e.id, t.getBounds());
|
|
5248
5262
|
}
|
|
5249
|
-
function
|
|
5250
|
-
if (!
|
|
5263
|
+
function Fe() {
|
|
5264
|
+
if (!W || !G) return;
|
|
5251
5265
|
let e = /* @__PURE__ */ new Map();
|
|
5252
5266
|
for (let t of i.features) t.geometria && e.set(t.id, t);
|
|
5253
|
-
|
|
5254
|
-
e.has(n) || (t.remove(),
|
|
5267
|
+
q.forEach((t, n) => {
|
|
5268
|
+
e.has(n) || (t.remove(), q.delete(n), me.delete(n), _e.delete(n));
|
|
5255
5269
|
}), e.forEach((e, t) => {
|
|
5256
|
-
let n =
|
|
5257
|
-
if (n &&
|
|
5258
|
-
let t =
|
|
5259
|
-
t ? r ? r.setContent(t) :
|
|
5270
|
+
let n = q.get(t);
|
|
5271
|
+
if (n && me.get(t) === e.geometria) {
|
|
5272
|
+
let t = Y(e), r = n.getTooltip();
|
|
5273
|
+
t ? r ? r.setContent(t) : Me(n, e) : n.unbindTooltip();
|
|
5260
5274
|
return;
|
|
5261
5275
|
}
|
|
5262
|
-
n && (n.remove(),
|
|
5263
|
-
}),
|
|
5276
|
+
n && (n.remove(), q.delete(t), me.delete(t), _e.delete(t)), Pe(e);
|
|
5277
|
+
}), Be(), !ve && (q.size || i.scopeGeometry) && (Ve(), ve = !0, ye = !!i.scopeGeometry), $();
|
|
5264
5278
|
}
|
|
5265
|
-
let
|
|
5266
|
-
function
|
|
5279
|
+
let Q = null, Ie = /* @__PURE__ */ new Map();
|
|
5280
|
+
function Le(e) {
|
|
5267
5281
|
if (!e) return null;
|
|
5268
|
-
let t =
|
|
5282
|
+
let t = Ie.get(e);
|
|
5269
5283
|
if (t) return t;
|
|
5270
|
-
if (typeof document > "u" || !
|
|
5271
|
-
|
|
5284
|
+
if (typeof document > "u" || !H.value) return null;
|
|
5285
|
+
Q || (Q = document.createElement("div"), Q.className = "leaflet-tooltip w-map-select__tip w-map-select__tip--medida", Q.setAttribute("aria-hidden", "true"), H.value.appendChild(Q)), Q.textContent = e;
|
|
5272
5286
|
let n = {
|
|
5273
|
-
largura:
|
|
5274
|
-
altura:
|
|
5287
|
+
largura: Q.offsetWidth,
|
|
5288
|
+
altura: Q.offsetHeight
|
|
5275
5289
|
};
|
|
5276
|
-
return n.largura > 0 && n.altura > 0 &&
|
|
5290
|
+
return n.largura > 0 && n.altura > 0 && Ie.set(e, n), n;
|
|
5277
5291
|
}
|
|
5278
|
-
function
|
|
5279
|
-
let t =
|
|
5280
|
-
if (!
|
|
5292
|
+
function Re(e) {
|
|
5293
|
+
let t = _e.get(e);
|
|
5294
|
+
if (!G || !t?.isValid()) return {
|
|
5281
5295
|
largura: 0,
|
|
5282
5296
|
altura: 0
|
|
5283
5297
|
};
|
|
5284
|
-
let n =
|
|
5298
|
+
let n = G.latLngToContainerPoint(t.getSouthWest()), r = G.latLngToContainerPoint(t.getNorthEast());
|
|
5285
5299
|
return {
|
|
5286
5300
|
largura: Math.abs(r.x - n.x),
|
|
5287
5301
|
altura: Math.abs(n.y - r.y)
|
|
5288
5302
|
};
|
|
5289
5303
|
}
|
|
5290
|
-
function
|
|
5291
|
-
if (!
|
|
5304
|
+
function ze() {
|
|
5305
|
+
if (!G) return !1;
|
|
5292
5306
|
try {
|
|
5293
|
-
return
|
|
5307
|
+
return G.getCenter(), !0;
|
|
5294
5308
|
} catch {
|
|
5295
5309
|
return !1;
|
|
5296
5310
|
}
|
|
5297
5311
|
}
|
|
5298
|
-
function
|
|
5299
|
-
if (!
|
|
5300
|
-
let e = i.labelFullFromZoom, t = e != null && (
|
|
5301
|
-
|
|
5302
|
-
let r = e.getTooltip(), a =
|
|
5312
|
+
function $() {
|
|
5313
|
+
if (!Z.value || !ze()) return;
|
|
5314
|
+
let e = i.labelFullFromZoom, t = e != null && (G?.getZoom() ?? 0) >= e;
|
|
5315
|
+
q.forEach((e, n) => {
|
|
5316
|
+
let r = e.getTooltip(), a = be.value.get(n);
|
|
5303
5317
|
if (!r || !a) return;
|
|
5304
|
-
let o =
|
|
5318
|
+
let o = Y(a);
|
|
5305
5319
|
if (!o) return;
|
|
5306
|
-
let s =
|
|
5320
|
+
let s = X(a), c = t ? "completo" : ko(Re(n), Le(o), s && s !== o ? Le(s) : null, i.labelFitScale);
|
|
5307
5321
|
c !== "oculto" && r.setContent(c === "curto" ? s : o), r.getElement()?.classList.toggle("w-map-select__tip--fora", c === "oculto");
|
|
5308
5322
|
});
|
|
5309
5323
|
}
|
|
5310
|
-
function
|
|
5311
|
-
|
|
5312
|
-
let n =
|
|
5313
|
-
e.setStyle(
|
|
5324
|
+
function Be() {
|
|
5325
|
+
q.forEach((e, t) => {
|
|
5326
|
+
let n = E(t);
|
|
5327
|
+
e.setStyle(xe(t)), (e.getTooltip()?.getElement())?.classList.toggle("w-map-select__tip--on", n);
|
|
5314
5328
|
});
|
|
5315
5329
|
}
|
|
5316
|
-
function
|
|
5317
|
-
if (!
|
|
5330
|
+
function Ve() {
|
|
5331
|
+
if (!W || !G) return;
|
|
5318
5332
|
let e = [];
|
|
5319
5333
|
if (i.scopeGeometry) {
|
|
5320
|
-
let t =
|
|
5334
|
+
let t = W.geoJSON(i.scopeGeometry).getBounds();
|
|
5321
5335
|
t.isValid() && e.push(t.getSouthWest(), t.getNorthEast());
|
|
5322
5336
|
}
|
|
5323
|
-
e.length ||
|
|
5337
|
+
e.length || q.forEach((t) => {
|
|
5324
5338
|
let n = t.getBounds();
|
|
5325
5339
|
n.isValid() && e.push(n.getSouthWest(), n.getNorthEast());
|
|
5326
|
-
}), e.length ?
|
|
5340
|
+
}), e.length ? G.fitBounds(W.latLngBounds(e), { padding: [20, 20] }) : G.setView([0, 0], 2);
|
|
5327
5341
|
}
|
|
5328
|
-
function
|
|
5329
|
-
if (!
|
|
5330
|
-
let n =
|
|
5342
|
+
function He(e, t) {
|
|
5343
|
+
if (!G) return;
|
|
5344
|
+
let n = q.get(e);
|
|
5331
5345
|
if (!n) return;
|
|
5332
5346
|
let r = n.getBounds();
|
|
5333
|
-
r.isValid() &&
|
|
5347
|
+
r.isValid() && G.fitBounds(r, {
|
|
5334
5348
|
padding: [20, 20],
|
|
5335
5349
|
...t
|
|
5336
5350
|
});
|
|
5337
5351
|
}
|
|
5338
|
-
function
|
|
5352
|
+
function Ue(e, t, n) {
|
|
5339
5353
|
let r = !1;
|
|
5340
5354
|
for (let i = 0, a = n.length - 1; i < n.length; a = i++) {
|
|
5341
5355
|
let [o, s] = n[i], [c, l] = n[a];
|
|
@@ -5343,91 +5357,95 @@ var Ao = { class: "w-map-select__body" }, jo = {
|
|
|
5343
5357
|
}
|
|
5344
5358
|
return r;
|
|
5345
5359
|
}
|
|
5346
|
-
function
|
|
5360
|
+
function We(e, t, n) {
|
|
5347
5361
|
let r = n.type === "Polygon" ? [n.coordinates] : n.coordinates;
|
|
5348
|
-
for (let n of r) if (!(!n.length || !
|
|
5362
|
+
for (let n of r) if (!(!n.length || !Ue(e, t, n[0])) && !n.slice(1).some((n) => Ue(e, t, n))) return !0;
|
|
5349
5363
|
return !1;
|
|
5350
5364
|
}
|
|
5351
|
-
function
|
|
5352
|
-
if (!
|
|
5353
|
-
let n =
|
|
5365
|
+
function Ge(e, t) {
|
|
5366
|
+
if (!G || !V.value) return null;
|
|
5367
|
+
let n = V.value.getBoundingClientRect(), r = e - n.left, a = t - n.top;
|
|
5354
5368
|
if (n.width > 0 && n.height > 0 && (r < 0 || a < 0 || r > n.width || a > n.height)) return null;
|
|
5355
|
-
let o =
|
|
5356
|
-
for (let e of i.features) if (e.geometria &&
|
|
5369
|
+
let o = G.containerPointToLatLng([r, a]);
|
|
5370
|
+
for (let e of i.features) if (e.geometria && We(o.lng, o.lat, e.geometria)) return e.id;
|
|
5357
5371
|
return null;
|
|
5358
5372
|
}
|
|
5359
|
-
function
|
|
5360
|
-
!
|
|
5373
|
+
function Ke() {
|
|
5374
|
+
!W || !G || (q.forEach((e) => e.remove()), q.clear(), me.clear(), _e.clear(), Fe());
|
|
5361
5375
|
}
|
|
5362
|
-
function
|
|
5363
|
-
!
|
|
5376
|
+
function qe() {
|
|
5377
|
+
!G || !V.value || V.value.clientWidth > 0 && V.value.clientHeight > 0 && G.invalidateSize();
|
|
5364
5378
|
}
|
|
5365
|
-
function
|
|
5366
|
-
if (!
|
|
5367
|
-
if (!
|
|
5368
|
-
|
|
5379
|
+
function Je() {
|
|
5380
|
+
if (!H.value) return;
|
|
5381
|
+
if (!U.value) {
|
|
5382
|
+
H.value.style.setProperty("--w-map-foot-h", "0px");
|
|
5369
5383
|
return;
|
|
5370
5384
|
}
|
|
5371
|
-
|
|
5372
|
-
|
|
5385
|
+
if (!c.value) {
|
|
5386
|
+
H.value.style.removeProperty("--w-map-foot-h");
|
|
5387
|
+
return;
|
|
5388
|
+
}
|
|
5389
|
+
let e = U.value.offsetHeight;
|
|
5390
|
+
e > 0 && H.value.style.setProperty("--w-map-foot-h", `${e}px`);
|
|
5373
5391
|
}
|
|
5374
|
-
async function
|
|
5375
|
-
if (
|
|
5392
|
+
async function Ye() {
|
|
5393
|
+
if (V.value) {
|
|
5376
5394
|
try {
|
|
5377
5395
|
let e = await import("leaflet");
|
|
5378
|
-
|
|
5396
|
+
W = e.default ?? e;
|
|
5379
5397
|
} catch {
|
|
5380
|
-
|
|
5398
|
+
de.value = !0;
|
|
5381
5399
|
return;
|
|
5382
5400
|
}
|
|
5383
|
-
if (
|
|
5384
|
-
|
|
5401
|
+
if (V.value) try {
|
|
5402
|
+
G = W.map(V.value, {
|
|
5385
5403
|
zoomControl: !0,
|
|
5386
5404
|
attributionControl: !!i.tileAttribution,
|
|
5387
5405
|
preferCanvas: !0
|
|
5388
|
-
}),
|
|
5406
|
+
}), G.attributionControl?.setPrefix(!1), W.tileLayer(i.tileUrl, {
|
|
5389
5407
|
maxZoom: i.maxZoom,
|
|
5390
5408
|
attribution: i.tileAttribution
|
|
5391
|
-
}).addTo(
|
|
5409
|
+
}).addTo(G), G.on("zoomend", $), Fe(), ve || G.setView([0, 0], 2), qe(), typeof ResizeObserver < "u" && (fe = new ResizeObserver(() => qe()), fe.observe(V.value));
|
|
5392
5410
|
} catch {
|
|
5393
|
-
|
|
5411
|
+
de.value = !0;
|
|
5394
5412
|
}
|
|
5395
5413
|
}
|
|
5396
5414
|
}
|
|
5397
5415
|
return te(() => {
|
|
5398
|
-
typeof window < "u" && window.addEventListener("keydown",
|
|
5416
|
+
typeof window < "u" && window.addEventListener("keydown", je), Ye(), Je(), typeof ResizeObserver < "u" && U.value && (pe = new ResizeObserver(() => Je()), pe.observe(U.value));
|
|
5399
5417
|
}), ee(() => {
|
|
5400
|
-
typeof window < "u" && window.removeEventListener("keydown",
|
|
5401
|
-
}),
|
|
5402
|
-
|
|
5403
|
-
}),
|
|
5404
|
-
!
|
|
5405
|
-
}),
|
|
5418
|
+
typeof window < "u" && window.removeEventListener("keydown", je), fe?.disconnect(), fe = null, pe?.disconnect(), pe = null, q.clear(), me.clear(), _e.clear(), Ie.clear(), Q?.remove(), Q = null, G?.remove(), G = null;
|
|
5419
|
+
}), z(() => i.features, Fe), z([() => i.featureDetail, () => i.detailPlacement], () => {
|
|
5420
|
+
De(), Ke();
|
|
5421
|
+
}), z(() => i.modelValue, Be, { deep: !0 }), z(() => i.featureStyle, Be), z(() => i.highlightFeature, Be), z(() => i.scopeGeometry, (e) => {
|
|
5422
|
+
!G || !e || ye || (Ve(), ve = !0, ye = !0);
|
|
5423
|
+
}), z([() => i.tooltips, Ne], () => Ke()), z([
|
|
5406
5424
|
() => i.featureLabel,
|
|
5407
5425
|
() => i.featureLabelShort,
|
|
5408
5426
|
() => i.labelFitScale
|
|
5409
|
-
], () =>
|
|
5427
|
+
], () => $()), z([b, c], () => {
|
|
5410
5428
|
D(() => {
|
|
5411
|
-
|
|
5429
|
+
Je(), qe();
|
|
5412
5430
|
});
|
|
5413
5431
|
}), n({
|
|
5414
|
-
refreshSize:
|
|
5415
|
-
collapsed:
|
|
5416
|
-
setCollapsed:
|
|
5417
|
-
fitToScope:
|
|
5418
|
-
fitToFeature:
|
|
5419
|
-
hitTest:
|
|
5420
|
-
detalhe:
|
|
5421
|
-
fecharDetalhe:
|
|
5422
|
-
}), (t, n) => (
|
|
5432
|
+
refreshSize: qe,
|
|
5433
|
+
collapsed: re(b),
|
|
5434
|
+
setCollapsed: x,
|
|
5435
|
+
fitToScope: Ve,
|
|
5436
|
+
fitToFeature: He,
|
|
5437
|
+
hitTest: Ge,
|
|
5438
|
+
detalhe: re(J),
|
|
5439
|
+
fecharDetalhe: De
|
|
5440
|
+
}), (t, n) => (j(), m("div", {
|
|
5423
5441
|
ref_key: "root",
|
|
5424
|
-
ref:
|
|
5442
|
+
ref: H,
|
|
5425
5443
|
class: O(["w-map-select", {
|
|
5426
5444
|
"w-map-select--disabled": e.disabled,
|
|
5427
5445
|
"w-map-select--readonly": e.readonly,
|
|
5428
|
-
"w-map-select--unselectable":
|
|
5429
|
-
"w-map-select--overlay":
|
|
5430
|
-
"w-map-select--collapsed":
|
|
5446
|
+
"w-map-select--unselectable": T.value === "none",
|
|
5447
|
+
"w-map-select--overlay": c.value,
|
|
5448
|
+
"w-map-select--collapsed": c.value && b.value && !e.readonly
|
|
5431
5449
|
}])
|
|
5432
5450
|
}, [h("div", Ao, [h("div", {
|
|
5433
5451
|
class: "w-map-select__map",
|
|
@@ -5435,38 +5453,38 @@ var Ao = { class: "w-map-select__body" }, jo = {
|
|
|
5435
5453
|
}, [
|
|
5436
5454
|
h("div", {
|
|
5437
5455
|
ref_key: "container",
|
|
5438
|
-
ref:
|
|
5456
|
+
ref: V,
|
|
5439
5457
|
class: "w-map-select__canvas"
|
|
5440
5458
|
}, null, 512),
|
|
5441
|
-
|
|
5442
|
-
|
|
5459
|
+
de.value ? (j(), m("div", jo, [n[1] ||= h("i", { class: "pi pi-map" }, null, -1), h("span", null, L(f.value), 1)])) : e.badgeLabel ? (j(), m("span", Mo, [n[2] ||= h("i", { class: "pi pi-globe" }, null, -1), v(L(e.badgeLabel), 1)])) : p("", !0),
|
|
5460
|
+
J.value && e.featureDetail !== "none" ? (j(), m("div", {
|
|
5443
5461
|
key: 2,
|
|
5444
5462
|
class: O(["w-map-select__detail", {
|
|
5445
5463
|
"w-map-select__detail--canto": e.detailPlacement === "canto",
|
|
5446
|
-
"w-map-select__detail--abaixo": e.detailPlacement !== "canto" &&
|
|
5464
|
+
"w-map-select__detail--abaixo": e.detailPlacement !== "canto" && ke.value,
|
|
5447
5465
|
"w-map-select__detail--hover": e.featureDetail === "hover"
|
|
5448
5466
|
}]),
|
|
5449
|
-
style: A(
|
|
5467
|
+
style: A(Ae.value),
|
|
5450
5468
|
role: "tooltip"
|
|
5451
|
-
}, [
|
|
5452
|
-
feature:
|
|
5453
|
-
selected:
|
|
5454
|
-
close:
|
|
5455
|
-
}, () => [h("span", No,
|
|
5456
|
-
], 4), e.readonly ? p("", !0) : (
|
|
5457
|
-
|
|
5469
|
+
}, [I(t.$slots, "feature-detail", {
|
|
5470
|
+
feature: J.value,
|
|
5471
|
+
selected: E(J.value.id),
|
|
5472
|
+
close: De
|
|
5473
|
+
}, () => [h("span", No, L(J.value.nome), 1), J.value.subtitulo ? (j(), m("span", Po, L(J.value.subtitulo), 1)) : p("", !0)])], 6)) : p("", !0)
|
|
5474
|
+
], 4), e.readonly ? p("", !0) : (j(), m("div", Fo, [
|
|
5475
|
+
c.value ? (j(), m("button", {
|
|
5458
5476
|
key: 0,
|
|
5459
5477
|
type: "button",
|
|
5460
5478
|
class: "w-map-select__collapse",
|
|
5461
|
-
"aria-expanded": !
|
|
5462
|
-
"aria-label":
|
|
5463
|
-
title:
|
|
5464
|
-
onClick:
|
|
5465
|
-
}, [h("i", { class: O(["pi",
|
|
5466
|
-
h("div", Ro, [y(R(
|
|
5467
|
-
default:
|
|
5468
|
-
modelValue:
|
|
5469
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
5479
|
+
"aria-expanded": !b.value,
|
|
5480
|
+
"aria-label": C.value,
|
|
5481
|
+
title: C.value,
|
|
5482
|
+
onClick: S
|
|
5483
|
+
}, [h("i", { class: O(["pi", b.value ? "pi-list" : "pi-chevron-right"]) }, null, 2), e.modelValue.length ? (j(), m("span", Lo, L(e.modelValue.length), 1)) : p("", !0)], 8, Io)) : p("", !0),
|
|
5484
|
+
h("div", Ro, [y(R(he), null, {
|
|
5485
|
+
default: B(() => [y(R(ge), { class: "pi pi-search" }), y(R(K), {
|
|
5486
|
+
modelValue: ae.value,
|
|
5487
|
+
"onUpdate:modelValue": n[0] ||= (e) => ae.value = e,
|
|
5470
5488
|
fluid: "",
|
|
5471
5489
|
"data-kbd-skip": "",
|
|
5472
5490
|
placeholder: e.searchPlaceholder,
|
|
@@ -5477,40 +5495,40 @@ var Ao = { class: "w-map-select__body" }, jo = {
|
|
|
5477
5495
|
"aria-label"
|
|
5478
5496
|
])]),
|
|
5479
5497
|
_: 1
|
|
5480
|
-
}), h("div", zo, [h("span", Bo,
|
|
5498
|
+
}), h("div", zo, [h("span", Bo, L(ie.value), 1), h("button", {
|
|
5481
5499
|
type: "button",
|
|
5482
5500
|
class: "w-map-select__clear",
|
|
5483
5501
|
disabled: e.disabled || !e.modelValue.length,
|
|
5484
|
-
onClick:
|
|
5485
|
-
},
|
|
5486
|
-
h("ul", Ho, [(
|
|
5502
|
+
onClick: ne
|
|
5503
|
+
}, L(e.clearLabel), 9, Vo)])]),
|
|
5504
|
+
h("ul", Ho, [(j(!0), m(u, null, F(se.value, (n) => (j(), m("li", { key: n.id }, [I(t.$slots, "item", {
|
|
5487
5505
|
feature: n,
|
|
5488
|
-
selected:
|
|
5506
|
+
selected: E(n.id)
|
|
5489
5507
|
}, () => [h("button", {
|
|
5490
5508
|
type: "button",
|
|
5491
|
-
class: O(["w-map-select__item", { "w-map-select__item--on":
|
|
5492
|
-
"aria-pressed":
|
|
5509
|
+
class: O(["w-map-select__item", { "w-map-select__item--on": E(n.id) }]),
|
|
5510
|
+
"aria-pressed": E(n.id),
|
|
5493
5511
|
disabled: e.disabled,
|
|
5494
|
-
onClick: (e) =>
|
|
5512
|
+
onClick: (e) => k(n.id)
|
|
5495
5513
|
}, [
|
|
5496
|
-
h("span", Wo, [
|
|
5497
|
-
h("span", Ko, [h("span", qo,
|
|
5498
|
-
n.geometria ? p("", !0) : (
|
|
5499
|
-
n.area == null ? p("", !0) : (
|
|
5500
|
-
], 10, Uo)])]))), 128)),
|
|
5501
|
-
]))]),
|
|
5514
|
+
h("span", Wo, [E(n.id) ? (j(), m("i", Go)) : p("", !0)]),
|
|
5515
|
+
h("span", Ko, [h("span", qo, L(n.nome), 1), n.subtitulo ? (j(), m("span", Jo, L(n.subtitulo), 1)) : p("", !0)]),
|
|
5516
|
+
n.geometria ? p("", !0) : (j(), m("i", Yo)),
|
|
5517
|
+
n.area == null ? p("", !0) : (j(), m("span", Xo, L(le(n)), 1))
|
|
5518
|
+
], 10, Uo)])]))), 128)), se.value.length ? p("", !0) : (j(), m("li", Zo, [I(t.$slots, "empty", {}, () => [v(L(e.emptyMessage), 1)])]))])
|
|
5519
|
+
]))]), l.value ? (j(), m("div", {
|
|
5502
5520
|
key: 0,
|
|
5503
5521
|
ref_key: "footer",
|
|
5504
|
-
ref:
|
|
5522
|
+
ref: U,
|
|
5505
5523
|
class: "w-map-select__footer"
|
|
5506
|
-
}, [
|
|
5507
|
-
area:
|
|
5508
|
-
features:
|
|
5524
|
+
}, [I(t.$slots, "footer", {
|
|
5525
|
+
area: N.value,
|
|
5526
|
+
features: M.value
|
|
5509
5527
|
}, () => [h("span", Qo, [
|
|
5510
|
-
v(
|
|
5511
|
-
h("strong", null,
|
|
5512
|
-
h("span", $o,
|
|
5513
|
-
])])], 512))], 2));
|
|
5528
|
+
v(L(e.areaLabel) + " ", 1),
|
|
5529
|
+
h("strong", null, L(ue.value), 1),
|
|
5530
|
+
h("span", $o, L(e.areaSuffix), 1)
|
|
5531
|
+
])])], 512)) : p("", !0)], 2));
|
|
5514
5532
|
}
|
|
5515
5533
|
}), rs = {
|
|
5516
5534
|
nota: {
|
|
@@ -5592,7 +5610,7 @@ function os(e) {
|
|
|
5592
5610
|
let t = as(e);
|
|
5593
5611
|
return rs[t] ?? rs[is[t]] ?? null;
|
|
5594
5612
|
}
|
|
5595
|
-
var ss = new
|
|
5613
|
+
var ss = new Z().utils.escapeHtml;
|
|
5596
5614
|
function cs(e, t) {
|
|
5597
5615
|
let n = t?.trim() || e.label;
|
|
5598
5616
|
return `<div class="md-alert md-alert--${e.tone}"><p class="md-alert__head"><i class="${e.icon}" aria-hidden="true"></i>${ss(n)}</p><div class="md-alert__body">`;
|
|
@@ -5673,19 +5691,19 @@ var vs = /* @__PURE__ */ new Set([
|
|
|
5673
5691
|
"tab"
|
|
5674
5692
|
]), ys = /^\s*([^\s]+)\s*(.*)$/;
|
|
5675
5693
|
function bs() {
|
|
5676
|
-
let e = new
|
|
5694
|
+
let e = new Z({
|
|
5677
5695
|
html: !1,
|
|
5678
5696
|
linkify: !0,
|
|
5679
5697
|
typographer: !1
|
|
5680
5698
|
});
|
|
5681
|
-
return e.use(
|
|
5699
|
+
return e.use(Fe).use(Q).use(Ie).use(Le).use(Re).use(ze).use($), e.use(Ne, {
|
|
5682
5700
|
level: [
|
|
5683
5701
|
2,
|
|
5684
5702
|
3,
|
|
5685
5703
|
4
|
|
5686
5704
|
],
|
|
5687
5705
|
slugify: _s,
|
|
5688
|
-
permalink:
|
|
5706
|
+
permalink: Ne.permalink.linkInsideHeader({
|
|
5689
5707
|
symbol: "",
|
|
5690
5708
|
class: "md-anchor",
|
|
5691
5709
|
placement: "after",
|
|
@@ -5728,7 +5746,7 @@ function Ss(e, t) {
|
|
|
5728
5746
|
}
|
|
5729
5747
|
function Cs(e) {
|
|
5730
5748
|
let t = [];
|
|
5731
|
-
e.use(
|
|
5749
|
+
e.use(Pe, "lz", {
|
|
5732
5750
|
validate: (e) => {
|
|
5733
5751
|
let t = ys.exec(e);
|
|
5734
5752
|
if (!t) return !1;
|
|
@@ -5835,7 +5853,7 @@ function Ms(e) {
|
|
|
5835
5853
|
return t;
|
|
5836
5854
|
}
|
|
5837
5855
|
function Ns(e) {
|
|
5838
|
-
return
|
|
5856
|
+
return Me.sanitize(e, { ADD_ATTR: [
|
|
5839
5857
|
"target",
|
|
5840
5858
|
"open",
|
|
5841
5859
|
"checked",
|
|
@@ -6001,8 +6019,8 @@ var Js = {
|
|
|
6001
6019
|
},
|
|
6002
6020
|
emits: ["headings"],
|
|
6003
6021
|
setup(e, { emit: t }) {
|
|
6004
|
-
let n = e, r = t, i =
|
|
6005
|
-
|
|
6022
|
+
let n = e, r = t, i = P(null), a = P(ms()), o = d(() => (a.value, Ps(n.source ?? ""))), s = d(() => o.value.html), c = d(() => !n.source || !n.source.trim());
|
|
6023
|
+
z(o, (e) => r("headings", e.headings), { immediate: !0 }), z(s, () => void D(() => qs(i.value)));
|
|
6006
6024
|
let l = null;
|
|
6007
6025
|
function u() {
|
|
6008
6026
|
typeof MutationObserver > "u" || (l = new MutationObserver(() => void Ks(i.value, !0)), l.observe(document.documentElement, {
|
|
@@ -6012,7 +6030,7 @@ var Js = {
|
|
|
6012
6030
|
}
|
|
6013
6031
|
return te(async () => {
|
|
6014
6032
|
await D(), await qs(i.value), u(), a.value ||= (await hs(), !0);
|
|
6015
|
-
}), ee(() => l?.disconnect()), (t, n) => c.value ? (
|
|
6033
|
+
}), ee(() => l?.disconnect()), (t, n) => c.value ? (j(), m("div", Js, L(e.emptyText), 1)) : (j(), m("div", {
|
|
6016
6034
|
key: 1,
|
|
6017
6035
|
ref_key: "raiz",
|
|
6018
6036
|
ref: i,
|
|
@@ -6051,7 +6069,7 @@ var Js = {
|
|
|
6051
6069
|
},
|
|
6052
6070
|
emits: ["update:modelValue"],
|
|
6053
6071
|
setup(e, { emit: t }) {
|
|
6054
|
-
let n = e, r = t, i =
|
|
6072
|
+
let n = e, r = t, i = P(null), a = P(!1), o = d(() => n.previewMode === "split"), s = d(() => o.value || !a.value), c = d(() => o.value || a.value);
|
|
6055
6073
|
function l(e) {
|
|
6056
6074
|
r("update:modelValue", e.target.value);
|
|
6057
6075
|
}
|
|
@@ -6113,13 +6131,13 @@ var Js = {
|
|
|
6113
6131
|
function te() {
|
|
6114
6132
|
E("| Coluna | Coluna |\n| --- | --- |\n| $ | valor |", "valor");
|
|
6115
6133
|
}
|
|
6116
|
-
function
|
|
6134
|
+
function ne() {
|
|
6117
6135
|
_("==", "==", "destaque");
|
|
6118
6136
|
}
|
|
6119
|
-
function
|
|
6137
|
+
function M() {
|
|
6120
6138
|
a.value = !a.value;
|
|
6121
6139
|
}
|
|
6122
|
-
let
|
|
6140
|
+
let N = P(!1), re = [
|
|
6123
6141
|
{
|
|
6124
6142
|
sintaxe: "## Título",
|
|
6125
6143
|
efeito: "Seção (entra no índice lateral)"
|
|
@@ -6160,7 +6178,7 @@ var Js = {
|
|
|
6160
6178
|
sintaxe: "```mermaid",
|
|
6161
6179
|
efeito: "Diagrama de fluxo"
|
|
6162
6180
|
}
|
|
6163
|
-
],
|
|
6181
|
+
], I = [
|
|
6164
6182
|
{
|
|
6165
6183
|
glyph: "B",
|
|
6166
6184
|
label: "Negrito",
|
|
@@ -6214,12 +6232,12 @@ var Js = {
|
|
|
6214
6232
|
{
|
|
6215
6233
|
icon: "pi pi-pencil",
|
|
6216
6234
|
label: "Marcar texto",
|
|
6217
|
-
run:
|
|
6235
|
+
run: ne
|
|
6218
6236
|
}
|
|
6219
6237
|
];
|
|
6220
|
-
return (t, n) => (
|
|
6238
|
+
return (t, n) => (j(), m("div", { class: O(["w-markdown-editor", { "w-markdown-editor--split": o.value }]) }, [
|
|
6221
6239
|
h("div", Zs, [
|
|
6222
|
-
(
|
|
6240
|
+
(j(), m(u, null, F(I, (t) => h("button", {
|
|
6223
6241
|
key: t.label,
|
|
6224
6242
|
type: "button",
|
|
6225
6243
|
class: "w-markdown-editor__tool",
|
|
@@ -6227,50 +6245,50 @@ var Js = {
|
|
|
6227
6245
|
title: t.label,
|
|
6228
6246
|
disabled: e.disabled || !o.value && a.value,
|
|
6229
6247
|
onClick: (e) => t.run()
|
|
6230
|
-
}, [t.icon ? (
|
|
6248
|
+
}, [t.icon ? (j(), m("i", {
|
|
6231
6249
|
key: 0,
|
|
6232
6250
|
class: O(t.icon),
|
|
6233
6251
|
"aria-hidden": "true"
|
|
6234
|
-
}, null, 2)) : (
|
|
6252
|
+
}, null, 2)) : (j(), m("span", {
|
|
6235
6253
|
key: 1,
|
|
6236
6254
|
class: O(["w-markdown-editor__glyph", {
|
|
6237
6255
|
"w-markdown-editor__glyph--bold": t.glyph === "B",
|
|
6238
6256
|
"w-markdown-editor__glyph--italic": t.glyph === "I"
|
|
6239
6257
|
}]),
|
|
6240
6258
|
"aria-hidden": "true"
|
|
6241
|
-
},
|
|
6259
|
+
}, L(t.glyph), 3))], 8, Qs)), 64)),
|
|
6242
6260
|
h("button", {
|
|
6243
6261
|
type: "button",
|
|
6244
|
-
class: O(["w-markdown-editor__tool w-markdown-editor__tool--ajuda", { "w-markdown-editor__tool--active":
|
|
6262
|
+
class: O(["w-markdown-editor__tool w-markdown-editor__tool--ajuda", { "w-markdown-editor__tool--active": N.value }]),
|
|
6245
6263
|
"aria-label": "Sintaxe disponível",
|
|
6246
6264
|
title: "Sintaxe disponível",
|
|
6247
|
-
"aria-pressed":
|
|
6248
|
-
onClick: n[0] ||= (e) =>
|
|
6265
|
+
"aria-pressed": N.value,
|
|
6266
|
+
onClick: n[0] ||= (e) => N.value = !N.value
|
|
6249
6267
|
}, [...n[1] ||= [h("i", {
|
|
6250
6268
|
class: "pi pi-question-circle",
|
|
6251
6269
|
"aria-hidden": "true"
|
|
6252
6270
|
}, null, -1)]], 10, $s),
|
|
6253
|
-
o.value ? p("", !0) : (
|
|
6271
|
+
o.value ? p("", !0) : (j(), m("button", {
|
|
6254
6272
|
key: 0,
|
|
6255
6273
|
type: "button",
|
|
6256
6274
|
class: O(["w-markdown-editor__tool w-markdown-editor__tool--preview", { "w-markdown-editor__tool--active": a.value }]),
|
|
6257
6275
|
"aria-label": "Visualizar",
|
|
6258
6276
|
title: "Visualizar",
|
|
6259
6277
|
"aria-pressed": a.value,
|
|
6260
|
-
onClick:
|
|
6278
|
+
onClick: M
|
|
6261
6279
|
}, [h("i", {
|
|
6262
6280
|
class: O(a.value ? "pi pi-pencil" : "pi pi-eye"),
|
|
6263
6281
|
"aria-hidden": "true"
|
|
6264
6282
|
}, null, 2)], 10, ec))
|
|
6265
6283
|
]),
|
|
6266
|
-
|
|
6284
|
+
N.value ? (j(), m("dl", tc, [(j(), m(u, null, F(re, (e) => (j(), m(u, { key: e.sintaxe }, [h("dt", null, L(e.sintaxe), 1), h("dd", null, L(e.efeito), 1)], 64))), 64))])) : p("", !0),
|
|
6267
6285
|
h("div", {
|
|
6268
6286
|
class: "w-markdown-editor__body",
|
|
6269
6287
|
style: A({
|
|
6270
6288
|
minHeight: e.minHeight,
|
|
6271
6289
|
maxHeight: e.maxHeight
|
|
6272
6290
|
})
|
|
6273
|
-
}, [s.value ? (
|
|
6291
|
+
}, [s.value ? (j(), m("textarea", {
|
|
6274
6292
|
key: 0,
|
|
6275
6293
|
ref_key: "textareaRef",
|
|
6276
6294
|
ref: i,
|
|
@@ -6280,7 +6298,7 @@ var Js = {
|
|
|
6280
6298
|
placeholder: e.placeholder,
|
|
6281
6299
|
spellcheck: "false",
|
|
6282
6300
|
onInput: l
|
|
6283
|
-
}, null, 40, nc)) : p("", !0), c.value ? (
|
|
6301
|
+
}, null, 40, nc)) : p("", !0), c.value ? (j(), f(Xs, {
|
|
6284
6302
|
key: 1,
|
|
6285
6303
|
class: "w-markdown-editor__preview",
|
|
6286
6304
|
source: e.modelValue,
|
|
@@ -6322,7 +6340,7 @@ var Js = {
|
|
|
6322
6340
|
maxHeight: { default: "calc(100vh - 14rem)" }
|
|
6323
6341
|
},
|
|
6324
6342
|
setup(e) {
|
|
6325
|
-
let t = e, n =
|
|
6343
|
+
let t = e, n = P(""), r = P(""), i = P(null), a = null, o = d(() => {
|
|
6326
6344
|
let e = [];
|
|
6327
6345
|
for (let n of t.headings) n.level <= 2 || !e.length ? e.push({
|
|
6328
6346
|
titulo: n,
|
|
@@ -6365,24 +6383,24 @@ var Js = {
|
|
|
6365
6383
|
block: "start"
|
|
6366
6384
|
}));
|
|
6367
6385
|
}
|
|
6368
|
-
return
|
|
6369
|
-
h("p", ac,
|
|
6370
|
-
e.searchable ? (
|
|
6386
|
+
return z(() => t.headings, () => void D(_), { immediate: !0 }), ee(() => a?.disconnect()), (t, i) => e.headings.length >= e.minHeadings ? (j(), m("nav", ic, [
|
|
6387
|
+
h("p", ac, L(e.title), 1),
|
|
6388
|
+
e.searchable ? (j(), m("div", oc, [i[1] ||= h("i", {
|
|
6371
6389
|
class: "pi pi-search",
|
|
6372
6390
|
"aria-hidden": "true"
|
|
6373
|
-
}, null, -1),
|
|
6391
|
+
}, null, -1), V(h("input", {
|
|
6374
6392
|
"onUpdate:modelValue": i[0] ||= (e) => r.value = e,
|
|
6375
6393
|
type: "search",
|
|
6376
6394
|
placeholder: "Filtrar seções",
|
|
6377
6395
|
"aria-label": "Filtrar seções"
|
|
6378
|
-
}, null, 512), [[
|
|
6396
|
+
}, null, 512), [[le, r.value]])])) : p("", !0),
|
|
6379
6397
|
h("div", {
|
|
6380
6398
|
class: "w-md-toc__corpo",
|
|
6381
6399
|
style: A({ maxHeight: e.maxHeight })
|
|
6382
|
-
}, [h("ul", sc, [(
|
|
6400
|
+
}, [h("ul", sc, [(j(!0), m(u, null, F(c.value, (e) => (j(), m("li", {
|
|
6383
6401
|
key: e.titulo.id,
|
|
6384
6402
|
class: "w-md-toc__grupo"
|
|
6385
|
-
}, [h("div", { class: O(["w-md-toc__item w-md-toc__item--n2", { "w-md-toc__item--ativo": n.value === e.titulo.id }]) }, [e.filhos.length ? (
|
|
6403
|
+
}, [h("div", { class: O(["w-md-toc__item w-md-toc__item--n2", { "w-md-toc__item--ativo": n.value === e.titulo.id }]) }, [e.filhos.length ? (j(), m("button", {
|
|
6386
6404
|
key: 0,
|
|
6387
6405
|
type: "button",
|
|
6388
6406
|
class: "w-md-toc__chevron",
|
|
@@ -6392,16 +6410,16 @@ var Js = {
|
|
|
6392
6410
|
}, [h("i", {
|
|
6393
6411
|
class: O(f(e) ? "pi pi-chevron-down" : "pi pi-chevron-right"),
|
|
6394
6412
|
"aria-hidden": "true"
|
|
6395
|
-
}, null, 2)], 8, cc)) : (
|
|
6413
|
+
}, null, 2)], 8, cc)) : (j(), m("span", lc)), h("a", {
|
|
6396
6414
|
href: `#${e.titulo.id}`,
|
|
6397
|
-
onClick:
|
|
6398
|
-
},
|
|
6415
|
+
onClick: U((t) => v(e.titulo.id), ["prevent"])
|
|
6416
|
+
}, L(e.titulo.text), 9, uc)], 2), f(e) ? (j(), m("ul", dc, [(j(!0), m(u, null, F(e.filhos, (e) => (j(), m("li", {
|
|
6399
6417
|
key: e.id,
|
|
6400
6418
|
class: O(["w-md-toc__item w-md-toc__item--n3", { "w-md-toc__item--ativo": n.value === e.id }])
|
|
6401
6419
|
}, [h("a", {
|
|
6402
6420
|
href: `#${e.id}`,
|
|
6403
|
-
onClick:
|
|
6404
|
-
},
|
|
6421
|
+
onClick: U((t) => v(e.id), ["prevent"])
|
|
6422
|
+
}, L(e.text), 9, fc)], 2))), 128))])) : p("", !0)]))), 128))]), l.value && !c.value.length ? (j(), m("p", pc, "Nenhuma seção encontrada")) : p("", !0)], 4)
|
|
6405
6423
|
])) : p("", !0);
|
|
6406
6424
|
}
|
|
6407
6425
|
}), hc = /* @__PURE__ */ b({
|
|
@@ -6410,9 +6428,9 @@ var Js = {
|
|
|
6410
6428
|
__name: "WDialog",
|
|
6411
6429
|
setup(e) {
|
|
6412
6430
|
let t = c();
|
|
6413
|
-
return (e, n) => (
|
|
6431
|
+
return (e, n) => (j(), f(R(ye), E({ "append-to": R(t)?.hostEl.value ?? "body" }, e.$attrs), g({ _: 2 }, [F(e.$slots, (t, n) => ({
|
|
6414
6432
|
name: n,
|
|
6415
|
-
fn:
|
|
6433
|
+
fn: B((t) => [I(e.$slots, n, k(x(t ?? {})))])
|
|
6416
6434
|
}))]), 1040, ["append-to"]));
|
|
6417
6435
|
}
|
|
6418
6436
|
}), gc = ["aria-label"], _c = [
|
|
@@ -6433,7 +6451,7 @@ var Js = {
|
|
|
6433
6451
|
},
|
|
6434
6452
|
emits: ["update:modelValue"],
|
|
6435
6453
|
setup(e, { emit: t }) {
|
|
6436
|
-
let n = t, r =
|
|
6454
|
+
let n = t, r = P([]);
|
|
6437
6455
|
function i(e, t) {
|
|
6438
6456
|
e instanceof HTMLButtonElement && (r.value[t] = e);
|
|
6439
6457
|
}
|
|
@@ -6450,11 +6468,11 @@ var Js = {
|
|
|
6450
6468
|
}
|
|
6451
6469
|
}
|
|
6452
6470
|
}
|
|
6453
|
-
return (t, n) => (
|
|
6471
|
+
return (t, n) => (j(), m("div", {
|
|
6454
6472
|
class: "w-tab-bar",
|
|
6455
6473
|
role: "tablist",
|
|
6456
6474
|
"aria-label": e.ariaLabel
|
|
6457
|
-
}, [(
|
|
6475
|
+
}, [(j(!0), m(u, null, F(e.items, (t, n) => (j(), m("button", {
|
|
6458
6476
|
key: t.value,
|
|
6459
6477
|
ref_for: !0,
|
|
6460
6478
|
ref: (e) => i(e, n),
|
|
@@ -6465,15 +6483,15 @@ var Js = {
|
|
|
6465
6483
|
tabindex: t.value === e.modelValue ? 0 : -1,
|
|
6466
6484
|
disabled: t.disabled,
|
|
6467
6485
|
onClick: (e) => a(t),
|
|
6468
|
-
onKeydown: [
|
|
6486
|
+
onKeydown: [H(U((t) => o(e.items, n, 1), ["prevent"]), ["right"]), H(U((t) => o(e.items, n, -1), ["prevent"]), ["left"])]
|
|
6469
6487
|
}, [
|
|
6470
|
-
t.icon ? (
|
|
6488
|
+
t.icon ? (j(), m("i", {
|
|
6471
6489
|
key: 0,
|
|
6472
6490
|
class: O(t.icon),
|
|
6473
6491
|
"aria-hidden": "true"
|
|
6474
6492
|
}, null, 2)) : p("", !0),
|
|
6475
|
-
h("span", null,
|
|
6476
|
-
t.badge !== void 0 && t.badge !== null ? (
|
|
6493
|
+
h("span", null, L(t.label), 1),
|
|
6494
|
+
t.badge !== void 0 && t.badge !== null ? (j(), m("span", vc, L(t.badge), 1)) : p("", !0)
|
|
6477
6495
|
], 42, _c))), 128))], 8, gc));
|
|
6478
6496
|
}
|
|
6479
6497
|
}), bc = { class: "w-tab-nav" }, xc = ["aria-label"], Sc = [
|
|
@@ -6498,11 +6516,11 @@ var Js = {
|
|
|
6498
6516
|
"reload"
|
|
6499
6517
|
],
|
|
6500
6518
|
setup(e, { emit: t }) {
|
|
6501
|
-
let n = e, r = t, i = d(() => n.tabs.tabs.value), a = d(() => n.tabs.activeKey.value), o =
|
|
6519
|
+
let n = e, r = t, i = d(() => n.tabs.tabs.value), a = d(() => n.tabs.activeKey.value), o = P([]), s = P(null);
|
|
6502
6520
|
function c(e, t) {
|
|
6503
6521
|
e instanceof HTMLElement && (o.value[t] = e);
|
|
6504
6522
|
}
|
|
6505
|
-
|
|
6523
|
+
z(a, async () => {
|
|
6506
6524
|
await D();
|
|
6507
6525
|
let e = i.value.findIndex((e) => e.key === a.value);
|
|
6508
6526
|
o.value[e]?.scrollIntoView?.({
|
|
@@ -6522,7 +6540,7 @@ var Js = {
|
|
|
6522
6540
|
let r = (e + t + n) % n;
|
|
6523
6541
|
l(i.value[r]), o.value[r]?.focus();
|
|
6524
6542
|
}
|
|
6525
|
-
let _ =
|
|
6543
|
+
let _ = P(null), v = P(null), b = d(() => {
|
|
6526
6544
|
let e = v.value;
|
|
6527
6545
|
return e ? [
|
|
6528
6546
|
{
|
|
@@ -6583,19 +6601,19 @@ var Js = {
|
|
|
6583
6601
|
let t = i.value[e]?.group;
|
|
6584
6602
|
return !!t && t !== i.value[e - 1]?.group;
|
|
6585
6603
|
}
|
|
6586
|
-
return (t, n) => (
|
|
6604
|
+
return (t, n) => (j(), m("div", bc, [
|
|
6587
6605
|
h("div", {
|
|
6588
6606
|
ref_key: "trilho",
|
|
6589
6607
|
ref: s,
|
|
6590
6608
|
class: "w-tab-nav__list",
|
|
6591
6609
|
role: "tablist",
|
|
6592
6610
|
"aria-label": e.ariaLabel ?? "Abas abertas"
|
|
6593
|
-
}, [(
|
|
6611
|
+
}, [(j(!0), m(u, null, F(i.value, (e, r) => (j(), m(u, { key: e.key }, [E(r) ? (j(), m("span", {
|
|
6594
6612
|
key: 0,
|
|
6595
6613
|
class: "w-tab-nav__group",
|
|
6596
6614
|
style: A(T(e)),
|
|
6597
6615
|
"aria-hidden": "true"
|
|
6598
|
-
},
|
|
6616
|
+
}, L(e.group), 5)) : p("", !0), h("div", {
|
|
6599
6617
|
ref_for: !0,
|
|
6600
6618
|
ref: (e) => c(e, r),
|
|
6601
6619
|
role: "tab",
|
|
@@ -6607,49 +6625,49 @@ var Js = {
|
|
|
6607
6625
|
style: A(T(e)),
|
|
6608
6626
|
"aria-selected": e.key === a.value,
|
|
6609
6627
|
onClick: (t) => l(e),
|
|
6610
|
-
onAuxclick:
|
|
6611
|
-
onContextmenu:
|
|
6628
|
+
onAuxclick: U((t) => f(e), ["middle", "prevent"]),
|
|
6629
|
+
onContextmenu: U((t) => x(t, e), ["prevent"]),
|
|
6612
6630
|
onKeydown: [
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6631
|
+
H(U((e) => g(r, 1), ["prevent"]), ["right"]),
|
|
6632
|
+
H(U((e) => g(r, -1), ["prevent"]), ["left"]),
|
|
6633
|
+
H(U((t) => l(e), ["prevent"]), ["enter"])
|
|
6616
6634
|
]
|
|
6617
6635
|
}, [
|
|
6618
|
-
|
|
6636
|
+
I(t.$slots, "tab", {
|
|
6619
6637
|
tab: e,
|
|
6620
6638
|
active: e.key === a.value
|
|
6621
|
-
}, () => [e.icon ? (
|
|
6639
|
+
}, () => [e.icon ? (j(), m("i", {
|
|
6622
6640
|
key: 0,
|
|
6623
6641
|
class: O(e.icon),
|
|
6624
6642
|
"aria-hidden": "true"
|
|
6625
6643
|
}, null, 2)) : p("", !0), h("span", {
|
|
6626
6644
|
class: "w-tab-nav__title",
|
|
6627
6645
|
title: e.title
|
|
6628
|
-
},
|
|
6646
|
+
}, L(e.title), 9, Cc)]),
|
|
6629
6647
|
h("button", {
|
|
6630
6648
|
type: "button",
|
|
6631
6649
|
class: "w-tab-nav__menu",
|
|
6632
6650
|
"aria-label": `Opções de ${e.title}`,
|
|
6633
6651
|
tabindex: "-1",
|
|
6634
|
-
onClick:
|
|
6652
|
+
onClick: U((t) => x(t, e), ["stop"])
|
|
6635
6653
|
}, [...n[0] ||= [h("i", {
|
|
6636
6654
|
class: "pi pi-ellipsis-v",
|
|
6637
6655
|
"aria-hidden": "true"
|
|
6638
6656
|
}, null, -1)]], 8, wc),
|
|
6639
|
-
e.closable ? (
|
|
6657
|
+
e.closable ? (j(), m("button", {
|
|
6640
6658
|
key: 0,
|
|
6641
6659
|
type: "button",
|
|
6642
6660
|
class: "w-tab-nav__close",
|
|
6643
6661
|
"aria-label": `Fechar ${e.title}`,
|
|
6644
6662
|
tabindex: "-1",
|
|
6645
|
-
onClick:
|
|
6663
|
+
onClick: U((t) => f(e), ["stop"])
|
|
6646
6664
|
}, [...n[1] ||= [h("i", {
|
|
6647
6665
|
class: "pi pi-times",
|
|
6648
6666
|
"aria-hidden": "true"
|
|
6649
6667
|
}, null, -1)]], 8, Tc)) : p("", !0)
|
|
6650
6668
|
], 46, Sc)], 64))), 128))], 8, xc),
|
|
6651
|
-
t.$slots.actions ? (
|
|
6652
|
-
y(R(
|
|
6669
|
+
t.$slots.actions ? (j(), m("div", Ec, [I(t.$slots, "actions")])) : p("", !0),
|
|
6670
|
+
y(R(ve), {
|
|
6653
6671
|
ref_key: "menu",
|
|
6654
6672
|
ref: _,
|
|
6655
6673
|
model: b.value
|
|
@@ -6679,22 +6697,22 @@ var Js = {
|
|
|
6679
6697
|
setup(e) {
|
|
6680
6698
|
let t = e.api.runtime(e.tab.key);
|
|
6681
6699
|
if (!t) return () => null;
|
|
6682
|
-
|
|
6700
|
+
M(je, t.route);
|
|
6683
6701
|
function n(e, t) {
|
|
6684
|
-
e.push(t),
|
|
6702
|
+
e.push(t), ne(() => {
|
|
6685
6703
|
let n = e.indexOf(t);
|
|
6686
6704
|
n !== -1 && e.splice(n, 1);
|
|
6687
6705
|
});
|
|
6688
6706
|
}
|
|
6689
6707
|
let r = {
|
|
6690
6708
|
hostEl: e.hostEl,
|
|
6691
|
-
active:
|
|
6709
|
+
active: oe(e, "active"),
|
|
6692
6710
|
setTitle: (t) => e.api.setTitle(e.tab.key, t),
|
|
6693
6711
|
onTabActivated: (e) => n(t.activatedHooks, e),
|
|
6694
6712
|
onTabDeactivated: (e) => n(t.deactivatedHooks, e),
|
|
6695
6713
|
registerCloseGuard: (e) => n(t.closeGuards, e)
|
|
6696
6714
|
};
|
|
6697
|
-
return
|
|
6715
|
+
return M(l, r), z(() => e.active, (e) => {
|
|
6698
6716
|
let n = e ? t.activatedHooks : t.deactivatedHooks;
|
|
6699
6717
|
for (let e of [...n]) e();
|
|
6700
6718
|
}), () => t.component ? S(t.component, {
|
|
@@ -6709,7 +6727,7 @@ var Js = {
|
|
|
6709
6727
|
let t = e, n = d(() => t.tabs.activeKey.value), r = d(() => t.tabs.tabs.value.filter((e) => e.hydrated)), i = /* @__PURE__ */ new Map();
|
|
6710
6728
|
function a(e) {
|
|
6711
6729
|
let t = i.get(e);
|
|
6712
|
-
return t || (t =
|
|
6730
|
+
return t || (t = ae(null), i.set(e, t)), t;
|
|
6713
6731
|
}
|
|
6714
6732
|
function o(e, t) {
|
|
6715
6733
|
let n = a(e);
|
|
@@ -6719,10 +6737,10 @@ var Js = {
|
|
|
6719
6737
|
}
|
|
6720
6738
|
n.value && !n.value.isConnected && (n.value = null);
|
|
6721
6739
|
}
|
|
6722
|
-
return
|
|
6740
|
+
return z(r, (e) => {
|
|
6723
6741
|
let t = new Set(e.map((e) => e.key));
|
|
6724
6742
|
for (let e of i.keys()) t.has(e) || i.delete(e);
|
|
6725
|
-
}), (t, i) => (
|
|
6743
|
+
}), (t, i) => (j(), m("div", kc, [(j(!0), m(u, null, F(r.value, (t) => V((j(), m("div", {
|
|
6726
6744
|
key: `${t.key}#${t.remount}`,
|
|
6727
6745
|
ref_for: !0,
|
|
6728
6746
|
ref: (e) => o(t.key, e),
|
|
@@ -6737,7 +6755,7 @@ var Js = {
|
|
|
6737
6755
|
"api",
|
|
6738
6756
|
"active",
|
|
6739
6757
|
"host-el"
|
|
6740
|
-
])])])), [[
|
|
6758
|
+
])])])), [[ue, t.key === n.value]])), 128))]));
|
|
6741
6759
|
}
|
|
6742
6760
|
}), Mc = ["aria-busy"], Nc = { class: "w-kanban-board__header" }, Pc = { class: "w-kanban-board__title" }, Fc = { class: "w-kanban-board__count" }, Ic = [
|
|
6743
6761
|
"aria-label",
|
|
@@ -6773,7 +6791,7 @@ var Js = {
|
|
|
6773
6791
|
},
|
|
6774
6792
|
emits: ["move", "item-click"],
|
|
6775
6793
|
setup(e, { emit: t }) {
|
|
6776
|
-
let n = e, r = t, i =
|
|
6794
|
+
let n = e, r = t, i = P(null), a = P(null), o = /* @__PURE__ */ new Map();
|
|
6777
6795
|
function s(e, t) {
|
|
6778
6796
|
t instanceof HTMLElement ? o.set(e, t) : o.delete(e);
|
|
6779
6797
|
}
|
|
@@ -6851,17 +6869,17 @@ var Js = {
|
|
|
6851
6869
|
function T(e, t) {
|
|
6852
6870
|
return !!i.value && a.value?.column === e.value && a.value.index === t;
|
|
6853
6871
|
}
|
|
6854
|
-
return (t, n) => (
|
|
6872
|
+
return (t, n) => (j(), m("div", {
|
|
6855
6873
|
class: O(["w-kanban-board", {
|
|
6856
6874
|
"w-kanban-board--loading": e.loading,
|
|
6857
6875
|
"w-kanban-board--dragging": !!i.value
|
|
6858
6876
|
}]),
|
|
6859
6877
|
"aria-busy": e.loading || void 0
|
|
6860
|
-
}, [(
|
|
6878
|
+
}, [(j(!0), m(u, null, F(e.columns, (r) => (j(), m("section", {
|
|
6861
6879
|
key: r.value,
|
|
6862
6880
|
class: O(["w-kanban-board__column", { "w-kanban-board__column--over": !!i.value && a.value?.column === r.value }]),
|
|
6863
6881
|
style: A(r.accent ? { "--w-kanban-accent": r.accent } : void 0)
|
|
6864
|
-
}, [h("header", Nc, [
|
|
6882
|
+
}, [h("header", Nc, [I(t.$slots, "column-header", { column: r }, () => [h("span", Pc, L(r.label), 1), h("span", Fc, L(r.items.length), 1)]), I(t.$slots, "column-action", { column: r })]), h("div", {
|
|
6865
6883
|
ref_for: !0,
|
|
6866
6884
|
ref: (e) => s(r.value, e),
|
|
6867
6885
|
class: "w-kanban-board__list",
|
|
@@ -6875,7 +6893,7 @@ var Js = {
|
|
|
6875
6893
|
onDragleave: (e) => b(r, e),
|
|
6876
6894
|
onDrop: (e) => x(r, e)
|
|
6877
6895
|
}, [
|
|
6878
|
-
(
|
|
6896
|
+
(j(!0), m(u, null, F(r.items, (e, n) => (j(), m(u, { key: String(c(e)) }, [T(r, n) ? (j(), m("div", Lc)) : p("", !0), h("div", {
|
|
6879
6897
|
class: O(["w-kanban-board__card", {
|
|
6880
6898
|
"w-kanban-board__card--dragging": f(e),
|
|
6881
6899
|
"w-kanban-board__card--static": !d(e)
|
|
@@ -6886,17 +6904,17 @@ var Js = {
|
|
|
6886
6904
|
onDragstart: (t) => _(e, r, t),
|
|
6887
6905
|
onDragend: S,
|
|
6888
6906
|
onClick: (t) => w(e),
|
|
6889
|
-
onKeydown: [
|
|
6890
|
-
}, [
|
|
6907
|
+
onKeydown: [H(U((t) => w(e), ["prevent"]), ["enter"]), H(U((t) => w(e), ["prevent"]), ["space"])]
|
|
6908
|
+
}, [I(t.$slots, "card", {
|
|
6891
6909
|
item: e,
|
|
6892
6910
|
column: r
|
|
6893
|
-
}, () => [h("span", zc,
|
|
6894
|
-
T(r, r.items.length) ? (
|
|
6895
|
-
r.items.length ? p("", !0) : (
|
|
6911
|
+
}, () => [h("span", zc, L(l(e)), 1)])], 42, Rc)], 64))), 128)),
|
|
6912
|
+
T(r, r.items.length) ? (j(), m("div", Bc)) : p("", !0),
|
|
6913
|
+
r.items.length ? p("", !0) : (j(), m("div", Vc, [I(t.$slots, "empty-column", { column: r }, () => [n[0] ||= v("Nenhum item", -1)])]))
|
|
6896
6914
|
], 44, Ic)], 6))), 128))], 10, Mc));
|
|
6897
6915
|
}
|
|
6898
6916
|
});
|
|
6899
6917
|
//#endregion
|
|
6900
6918
|
export { fi as A, Wt as B, Ui as C, ji as D, Ai as E, Rn as F, pt as G, Mt as H, Ln as I, qe as J, _t as K, Pn as L, ai as M, qr as N, Ni as O, xr as P, Mn as R, Ji as S, Ii as T, Ot as U, Nt as V, gt as W, Aa as _, hc as a, ua as b, Xs as c, vo as d, Ja as f, La as g, Va as h, yc as i, oi as j, Ei as k, ns as l, Ka as m, jc as n, mc as o, qa as p, mt as q, Dc as r, rc as s, Hc as t, Eo as u, Sa as v, Li as w, ta as x, xa as y, an as z };
|
|
6901
6919
|
|
|
6902
|
-
//# sourceMappingURL=components-
|
|
6920
|
+
//# sourceMappingURL=components-B2qPV7fZ.js.map
|